check — drift report
Pure diagnostic. Reports violations grouped by severity. Writes nothing. The user decides the remedy.
Plan artifacts drifting silently from code is the #1 failure mode. check is the
detector. Run it after each build and before each ship — drift caught here is a
diff; drift caught in prod is a LESSONS.md bug row.
OWNERSHIP
Owns: the drift report (delivered inline — does NOT write a file).
Reads: PLAN.md, SPEC.md, ARD.md (whatever exists), CONTEXT.md, the codebase.
MUST NOT write anything. NEVER invokes fix skills — only suggests them.
WHEN (user-invoked)
- After a
buildcompletes a task or a plan. - Before a ship / merge / PR.
- User asks "check drift", "audit the spec", "does the code still match", "is the plan still accurate".
- Invoked by the
verifydiscipline as the final plan-level drift check.
STEP 0 — LOAD
- Resolve the active plan per §6. If none, "no plan, nothing to check." Stop.
- Read whatever exists:
PRD.md,ARD.md,SPEC.md,PLAN.md,CONTEXT.md. - Parse invocation args:
§V-> check invariants only (default)§I-> check interfaces§T-> audit task status vs code--all-> all three
CHECK §V — invariants
For each V<n> in SPEC.md/ARD.md:
- Translate the invariant into a verifiable claim about the code.
- Grep / read the relevant files.
- Classify:
- HOLD — the code satisfies the invariant.
- VIOLATE — the code breaks the invariant (cite file:line).
- UNVERIFIABLE — no test covers the invariant's path.
- Record the address + file:line evidence.
CHECK §I — interfaces
For each §I item:
- Locate the implementation.
- Classify:
- MATCH — shape in code = shape in spec.
- DRIFT — impl exists, shape differs (cite file:line).
- MISSING — impl absent.
- EXTRA — code exposes a surface not in
§I.
CHECK §T — tasks
For each T<n> in PLAN.md:
- If
[x]: verify the claimed work is present in the code. If not -> STALE. - If
~: note as in-progress. - If
[ ]: note as pending.
REPORT
Caveman. Grouped by severity. Example:
## §V drift
V2 VIOLATE: auth/mw.go:47 uses `<` not `<=`. see LESSONS.md B.1.
V5 UNVERIFIABLE: no test covers every req path.
## §I drift
I.api DRIFT: POST /x returns `{result}` not `{id}`. route.go:112.
I.cmd MISSING: `foo bar` absent from cli/*.go.
## §T drift
T3 STALE: status [x], no middleware file exists.
## summary
2 violate. 1 missing. 1 stale. 1 unverifiable.
next: spec skill with `bug:` or fix code at cited lines.
REMEDY HINTS (not actions)
End the report with a one-line hint per class. NEVER invoke the fixes.
- VIOLATE / DRIFT -> invoke the
specskill withbug: <V.n>or fix the code. - MISSING -> invoke the
buildskill on§T.nif a task exists; else thespecskill withamend §T. - STALE -> the
specskill withamend §Tto uncheck. - EXTRA -> the
specskill withamend §Ito document, or delete the code. - UNVERIFIABLE -> the
tdddiscipline to write the missing test.
BOUNDARIES
- MUST write nothing. No artifact edits. No code edits.
- MUST NOT invoke fix skills. Report only.
- MUST cite file:line for every VIOLATE / DRIFT / STALE finding.
- MUST run on the main thread — no subagents.
- MUST give a binary verdict per item: holds or drifts. No scores, no grades.
- MUST use
cavemanfor the report.