Critical-Path Definition & Gate
What is a critical path?
A critical path is a code flow where breakage immediately harms customers or costs the company real money:
- Live Stripe checkout (customer pays, nothing provisions)
- Inbound voice call (phone rings, agent doesn't answer)
- User login (pastors locked out of their admin)
- Live chatbot response (visitor asks, nothing answers)
Critical paths are declared in knowledge/tests/registry.yaml with
critical_path: true. Each declaration lists:
code_files— the directories + files whose modification puts the path at riskplaywright_spec— the name of the live-flow E2E test that must passoverride_label— the PR label that explicitly overrides the gatelast_break(if applicable) — the date the path most recently broke in production
What the gate does
On every PR to a repo with the critical-path-gate workflow installed, the gate:
- Reads
knowledge/tests/registry.yamlfrom theChurchWiseAI/knowledgerepo - Filters to entries with
critical_path: truefor this repo - Compares the PR's changed files against each entry's
code_fileslist - If the PR touches any critical-path file, requires one of:
- A CI artifact named
<spec_name>-playwright-run.zipshowing a green run - The PR label
critical-path-override+ a comment explaining why
- A CI artifact named
- Blocks merge if neither is present
Why this exists (the 2026-04-14 incident)
On April 14, 2026, an agent shipped a Stripe harness refactor that passed build, passed type checks, and merged cleanly. The webhook started returning HTTP 200 on silent provisioning failures — Stripe thought everything was fine, customers paid real money, nothing got provisioned. The founder lost a live payment and spent the evening diagnosing instead of onboarding customers.
Agent feedback memory already said "NEVER claim done without Playwright-verified interaction on the deployed URL." It had no enforcement mechanism. This gate is the enforcement mechanism. Agents can no longer ship critical-path code and say "done" — the PR literally cannot merge without either verified evidence or a logged override.
How to add a new critical path
- Edit
knowledge/tests/registry.yaml - Add an entry with
critical_path: true, list thecode_files, name theplaywright_spec - Ensure the Playwright spec exists and runs against the deployed URL
- Wire the spec to upload its output as an artifact named
<spec_name>-playwright-run.zipin the CI workflow that runs it - Merge the registry change. From then on, every PR touching those files is gated.
How to override (for genuinely non-customer-facing changes)
If you're editing a critical-path file in a way that cannot touch the customer flow (e.g., updating a code comment, renaming an unused variable):
- Add label
critical-path-overrideto the PR - Add a comment explaining why the change is safe without a live-flow run
- Gate allows merge
Overrides are logged and auditable. The expected use is rare — the default path should always be "attach a verified Playwright run."
Current critical paths (MVP)
As of 2026-04-14, one path is gated:
- stripe-live-checkout — live Stripe checkout + webhook provisioning in churchwiseai-web
Paths declared but not yet gated (waiting for their Playwright specs to exist and go green at least once):
- voice-live-call
- user-login-cwa
When their specs exist and pass, flip critical_path: true in the registry and
they're live.