State Audit
Compare an expected condition inventory with observed product handling. Separate intended behavior evidence from implementation evidence.
Procedure
- Determine the feature or surface. If the user named a directory or scope, proceed. Otherwise show the detected root and ask for a narrower path or confirmation.
- Read
STATEFUL.mdand existing maps without overwriting confirmed decisions. - Inventory available evidence:
- requirements, policies, research, domain rules;
- analytics, incidents, support history;
- designs and prototypes;
- code, tests, schedulers, enums, data models, dependencies.
- Derive the expected inventory first from non-implementation evidence. Use code for structural clues only when necessary and mark those records as hypotheses; code cannot prove what ought to exist.
- Build the four lenses: lifecycle states, failures with cause, interruption contexts, and surfaces. Record evidence and confidence per condition.
- Inspect actual handling in routes, components, reducers, controllers, jobs, validation, errors, loading/empty branches, tests, stories, templates, notifications, data models, and infrastructure. Cite
file:line. - Compare expected and observed behavior. Distinguish:
- undesigned;
- designed but unimplemented;
- implemented without deliberate design;
- implemented but unverified;
- evidence conflict requiring a decision.
- Score likelihood, impact, and confidence. Rank by risk, not likelihood alone.
- For the top 3–5 gaps, state current behavior, evidence, design/engineering implication, layers, owner needed, and the next acceptance criterion—not a prescriptive fix unless the user asks.
- Update the
## Auditsection ofSTATEFUL.md. Preserve evidence sources and known unknowns. - Ask whether to produce or update a v0.1 JSON mirror. New gap records begin at
status: discovered; do not invent scope. Preservescenariosand typedrelationships, and keepmetadata.maturity: workinguntil the handoff gate passes.
Output
## Evidence consulted
| Type | Reference | What it establishes |
## Expected condition inventory
<four lenses with evidence and confidence>
## Observed handling
| Condition | Status | Evidence | Current behavior |
## Gaps
| Condition | Gap type | Likelihood | Impact | Confidence | Evidence | Implication |
## Top gaps
1. <risk-aware narrative with file:line evidence>
## Known unknowns
- <unconsulted evidence or unresolved domain question>
Failure modes
- Claiming independent derivation while using the implementation as the only source.
- Treating absence from code as proof that a condition should exist.
- Reporting a missing condition without observed current behavior.
- Ranking only by traffic.
- Conflating design gaps, implementation gaps, and verification gaps.
- Auditing an entire product at once.