The highest-leverage answer is tooling, not discipline. Roughly 80/20. The team’s actual failure mode is not “forgot checklist item”; it is “one surface can deploy alone and still look healthy locally.” A checklist will be skipped exactly when it matters: feature pressure, branch sprawl, and agent-written changes.
I would not try to prevent every asymmetric ship in two weeks. I’d make asymmetric ships loud within minutes and expensive work impossible to keep running.
Center Of Gravity
Build a production contract sentinel around claimability and worker readiness.
The invariant is simple:
If there are queued cloud tasks and live workers, at least one task must be claimable by a production-shaped worker within a short window. If a worker cannot pass preflight, it must die. If the queue is nonempty but claimability is zero, page and stop scaling.
That bends the whole class because all three incidents collapse to the same operational symptom: the system has work, but the deployed producer/consumer contract makes the work unreachable.
This repo already has local chokepoints. Task creation now has stampTaskRouteContract in routeContract.ts. Route derivation still has the dangerous params.model_family override in selectedRoute.ts. Claim currently returns 204 and only explains rejection under debug=true in claim-next-task. That is the exact anti-pattern: the system knows enough to diagnose itself, but only when a human asks.
Detection vs Prevention
Pick detect-and-loud after deploy, with one automatic mitigation: stop wasting GPU money.
Blocking PRs sounds attractive but will fail here. You have three repos, feature branches, DB migrations, Supabase edge functions, Railway deploys, and pods resetting to origin/main. A PR gate can prove one repo is internally consistent. It cannot prove the production composition is consistent unless it becomes the big contract platform you explicitly do not want right now.
So the first two-week move is:
- Every minute, run an availability probe using production-shaped inputs, not the live-test shortcut.
- Query queued tasks by route/backend/profile/contract version.
- Ask the same claim path production workers use whether anything is claimable.
- If queued-but-unclaimable persists for 3-5 minutes, escalate to Slack/PagerDuty/whatever actually interrupts work.
- If pods are initializing or preflight-failed past threshold, terminate or set desired worker count to zero for that pool until someone acknowledges.
This is not “monitoring.” This is an operational gate after deployment. The mistake can ship, but it cannot hide for a week or burn pods for 18 hours.
What Is Actually Causing Recurrence
The same engineer repeats the bug because the system rewards making a local conceptual change and gives no immediate penalty for failing to deploy the matching half.
The structural problem is contract ownership without deployment ownership. A person changes the rule in one repo while believing, often correctly in their branch, that the other-side change exists somewhere. But production is not “their branch”; production is a weird composition: orchestrator auto-deployed from a feature branch, workers hard-resetting to origin/main, DB migrations already live, edge functions using a different task creation path than tests.
That means the engineer’s mental model is branch-coherent, while production is surface-coherent. Those are different systems.
The live-test masking is especially corrosive. Once tests pass through a non-production path, they train the team to distrust failures and trust green runs. After that, logs like “initializing for 66087s” become background noise. People ignore telemetry because historically telemetry is commentary, not a decision-maker.
LLM agents likely amplify this. They are good at making the matching edit in the files they can see. They are bad at knowing whether Railway deployed branch X while RunPod pulls branch Y. So the human sees a plausible complete change set, but the runtime never receives it.
The Single Biggest Thing This Week
Implement one contract sentinel plus fail-closed worker readiness.
Not a package. Not codegen. Not a migration philosophy. One shipped guardrail:
- Add an edge/Railway cron job named something like
contract-sentinel.
- It runs the real production task creation resolver for one or two cheap synthetic tasks per critical route, or inspects recent real queued tasks if creating synthetic tasks is too invasive.
- It validates that every queued production task has
route_contract, top-level mirrored route fields, known route_key, known backend/profile, and compatible worker contract version.
- It calls or dry-runs the same DB claim analysis as
claim-next-task, always with debug-level rejection reasons.
- It emits one clear state:
OK, NO_WORK, UNCLAIMABLE_WORK, NO_READY_WORKERS, WORKERS_STUCK_INITIALIZING.
UNCLAIMABLE_WORK and WORKERS_STUCK_INITIALIZING escalate after a short grace period.
- The orchestrator consumes that state and refuses to keep launching paid pods when the reason is contract/readiness failure.
Why this first? Because it covers today’s three failures without needing to understand every future contract. Missing route_contract, invalid route_key, stale worker metadata, bad model_family, and readiness skew all produce the same sentinel outcome: queued work cannot be claimed by the deployed worker shape.
Also change the worker launcher behavior: Timed out waiting for worker preflight after 900s must be followed by process exit. Continuing after failed preflight is indefensible. That one line turns a detector into a gate.
What I Would Not Do
I would not start with PR checklists. They will create guilt, not safety.
I would not build the shared contracts package right now. It may be correct eventually, but it is too much surface area before the team has stopped the bleeding.
I would not add more dashboards. Dashboards are where incidents go to be noticed later.
I would not start with DB constraints rejecting all invalid writes. Good end state, bad first move. In this system, a hard DB reject can become another production outage unless producers are already routed through one creation chokepoint and the sentinel tells you what would break.
I would not try to make every repo deploy in lockstep this month. Instead, assume skew will happen and make skew non-silent.
The practical thesis: stop trusting humans to remember cross-repo contracts; also stop trying to perfectly prevent skew. Make production prove claimability continuously, and make failed readiness kill money-burning workers. That is small enough for one person in two weeks and directly attacks the recurrence pattern.