Skip to main content
Phase 6.6 closes the operational gaps identified across Phases 6.0–6.5. Each item is a real correctness or observability fix, not a stylistic sweep.

1. Advisory PG lock on scheduler tick

Problem: /api/v1/cron/flow-scheduler-tick was lock-free. An external orchestrator that double-fires the endpoint (e.g. a Vercel Cron retry on a transient timeout) would dispatch every due pipeline twice. Fix: Wrap the tick in pg_try_advisory_lock(0x666c6f77). When the lock is already held, the route returns 200 with skipped: true so the orchestrator doesn’t treat it as an error.
The advisory lock is process-wide on the PG instance, so even multi-replica deployments are safe.

2. Per-tenant scheduler dashboard at /data/scheduler

A read-only page (no write controls) showing every IR-native pipeline with ir.schedule: API surface: GET /api/v1/scheduler-status. Tenant-scoped via requireTenant.

3. k6 baseline perf script at k6/flow/baseline.js

Run with:
SLO thresholds enforced in the script: Global threshold: http_req_failed: rate<0.01 (under 1% errors).

4. Runtime correctness & recovery guardrails

These pipeline-runtime guardrails underlie the scheduler hardening above. Each is opt-in on the IR (or on the target/validate node) and each is best-effort where noted, so enabling one never turns a healthy run into a failure.

File-arrival deadline enforcement (shipped)

trigger.file_arrival.deadline is enforced — maybeFireDeadlineMiss in lib/flow/scheduler/run-tick.ts compares now against anchor + windowMinutes (anchor = lastRunAt, or the pipeline’s createdAt when it has never run) and, once the window has elapsed, takes the onMiss action: alert (warning system-health alert), fail (a synthetic failed PipelineRun so health dashboards count the missed SLA), or skip (log + continue). It is idempotent per (pipeline, anchor) so a stuck pipeline alerts once, not every tick.

Honest limits deferred beyond Phase 6.6