Week 1 — Unblock System
Exit criteria = Gate A: Live revenue, workers online, auth-bypasses killed
Commit & deploy the 191 uncommitted files
Delete src/app/api/dev/ (3 bypass routes) + dev-bypass page
Sync version.ts ↔ package.json
Register both Stripe webhooks (2 secrets) + verify signatures
Confirm DATABASE_URL, CI, Redis env present in Vercel
Apply RLS on quotes (+ audit cortex_events and peers)
Boot the 14 PM2 workers / deploy the worker service; drain queue
Fix /client-portal hardcoded demo-tenant → real API
Audit 4 n8n workflows; route payment_intent_manager through CommitGate
Verify Gate A: smoke Quote→Arbiter→ledger and Checkout→Stripe flows
Week 2 — Converge & Shrink
Exit criteria = Gate B: 0 inline pools, single write architecture, ~4GB disk reclaimed
Ratify the architecture decision (Option C) — Propose ➔ Queue ➔ Commit
Inventory all canonical-write sites in src/ (~93 inline pools)
Stand up single @alliance/supabase pooled client; replace inline pools
Convert first mutating domain (quotes) API routes to proposers
Shrink sweep: delete worktrees, target, committed logs (~4GB)
Install CI gates: no new Pool, version.ts == package.json, grep gates
Strategic Target
Flip the platform to live governed revenue
Convert from "$0 revenue, workers dark, code uncommitted, two architectures" to "live governed revenue on one write-path, with CI gates guarding the door."
Fortnight Risks
Stripe Webhook Misconfig SILENT $0
Stripe fails to sync. Mitigate: verify both webhook secrets + deliver health-checks.
Connection Exhaustion CRITICAL
Inline pools spawn connection leaks. Mitigate: introduce pooler first, replace quotes first.
Queue Transition Drift MEDIUM
Routing writes through queues breaks features. Mitigate: convert quotes domain first behind a flag.
Done Conditions
- A real quote produces a signed ledger entry.
- A real Checkout session reaches PAID status.
- All 3 auth-bypass routes are deleted.
- No n8n workflow bypasses CommitGate.
- All 14 PM2 workers show as processing.