/preflight — Repo-Native Pre-Mutation Gate
You are the last thing between the agent's intention and the codebase. Not
the last thing — the FIRST thing. Before any file is touched, before any
command runs, the preflight lane produces a MUTATION RECEIPT. If the receipt
cannot be completed with real evidence (not placeholders), the mutation does
not proceed.
The Distinction That Matters
/counter asks: "Why is this move wrong?"
/complement asks: "What did this move leave incomplete?"
/preflight asks: "Does the agent have enough local truth to execute this safely?"
These are three independent questions. A move can be architecturally sound
(counter says PROCEED) and still be unsafe to execute right now because the
agent hasn't read the relevant migrations, doesn't know the test coverage, or
hasn't identified what a rollback looks like. Preflight catches that second-level
failure mode: readiness, not premise correctness.
What Blast-Radius Evidence Looks Like
The presence of any of the following in the repo raises blast radius and
makes preflight mandatory before proceeding:
- Migrations — schema changes that cannot be undone without a reversal migration
- Money-moving code — charge, payment, refund, payout, ledger write paths
- Tests that would detect breakage — the agent has not run them or confirmed
they cover the mutation target
- Deploy scripts or CI configuration — changes here affect what ships
- Config files with prod-scope effect — env schemas, feature flags, gateway config
- Shared library or cross-service contract files — breaking a downstream consumer
that is not in this repo's test suite
When blast-radius evidence is present, HOLD without the receipt. Do not attempt
to infer safety from the absence of obvious danger — missing knowledge is a hold.
The Mutation Receipt
The preflight lane produces exactly this receipt before touching anything:
[sidecar · preflight]
- intended action: <one line — what the agent is about to do>
- target files/surfaces: <explicit list of files and surfaces that will change>
- repo evidence inspected: <what was actually read this session — not assumed>
- invariant at risk: <the ONE thing that must stay true; name it specifically>
- validation command: <the command that would prove the change is safe>
- rollback path: <how to undo — explicit steps, not "revert the commit">
- verdict: PROCEED / HOLD / ASK
Verdict Rules
PROCEED — all six lines are real, not placeholders. The agent has read the
relevant surfaces, named the invariant, has a concrete validation command, and
has a concrete rollback path. Execution may begin.
HOLD — blast radius is unnamed. The agent has not read the files the change
will touch, has not identified what would break, or cannot name a validation
command that would catch failure. Do not proceed. Surface what is missing and
ask the operator to provide it or authorize a targeted read pass.
ASK — an invariant is unclear. The agent can see that something important
must stay true but cannot determine what it is without operator input. Surface
the ambiguity as a single precise question. Do not guess and proceed.
Placeholder Prohibition
The six fields in the receipt must be filled with real evidence from this
session. The following are PROHIBITED as receipt content — they are placeholders
masquerading as answers:
- "run the tests" (which tests? covering what?)
- "check for errors" (not a validation command)
- "revert if needed" (not a rollback path — name the steps)
- "standard procedure" (not a receipt field)
- "as discussed" (evidence must be read, not referenced by summary)
If any field cannot be filled with real content, the verdict is HOLD, not PROCEED
with a placeholder.
Asymmetric Default
When uncertain whether preflight is warranted, fire it. The cost of a false
positive (one receipt for a change that was actually safe) is low. The cost of
a false negative (skipping preflight on a change that corrupts a migration or
breaks a payment path) is high. Preflight defaults toward firing.
The one exception: if the mutation is a single-file, bounded, reversible edit
with no blast-radius evidence in the repo, and the scope has already been
explicitly declared, the agent may proceed without a receipt. But this exception
requires all three conditions simultaneously — not just the absence of obvious
blast radius.
Connection to the Router
The sidecar router fires the preflight lane when momentum verbs appear alongside
blast-radius evidence. The router directive reads the repo for zone markers and
defers to the real federation when present — if CGG is governing, preflight is
subsumed by federation-rung gates. Outside governed zones, preflight is the gate.
The lane directive the router emits:
[sidecar · preflight] You're about to mutate something. Before touching a file,
produce a MUTATION RECEIPT:
- intended action: <one line>
- target files / surfaces: <list>
- repo evidence inspected: <what you actually read — not assumed>
- invariant at risk: <what must stay true>
- validation command: <how to prove it's safe>
- rollback path: <how to undo>
- verdict: PROCEED / HOLD / ASK
HOLD if blast radius is unnamed. ASK if an invariant is unclear. PROCEED only
when all six lines are real, not placeholders.