0%

Section 07: Drift-Cure / Materiality Fix (emergency)

Status: Not Started Goal: Close the amplification hole. The §08 fabrication was masked when a /continue-roadmap --autopilot drift-cure judged the content_hash mismatch “non-material” and refreshed the hash. A completion-transition drift is NEVER a stamp artifact — force MATERIAL.

Success Criteria:

  • Preclassifier returns MATERIAL unconditionally for drift whose structural diff includes a status:→complete or reviewed:-positive/negative transition.
  • Auto-cure loop does NOT hash-refresh such drift; routes to surface/halt/reversal.
  • Regression test reproduces the §08 shape and asserts MATERIAL + no-refresh.

Context: This session’s own failure: the drift-cure sub-agent rationalized “within-session stamp artifact” and refreshed content_hash ce464bd4…→123041a1…, erasing the signal. The classifier must remove that discretion for completion transitions.

Depends on: None. Emergency — land alongside §01.


Intelligence Reconnaissance

Queries run 2026-05-26:

  • scripts/intel-query.sh search "materiality preclassifier content_hash drift" — N/A on the Rust-only code-symbol graph; this section edits Python. Recorded per plan-schema non-Rust allowance.
  • Direct grounding (this session): scripts/plan_orchestrator/materiality_preclassifier.py (PreclassifierClass, classify_body_delta); scripts/plan_orchestrator/materiality_gate.py (MATERIAL → reverse_via_record_review_reversal | halt); scripts/plan_orchestrator/drift_classes.py; scripts/plan_corpus/stale_state.py (content_hash_mismatch finding, suggested cure = materiality_gate); scripts/plan_corpus/__main__.py resolve-content-hash-drift-detected; scripts/plan_orchestrator/auto_cure_loop.py.

Results summary [ori]: classifier SSOT = materiality_preclassifier.classify_body_deltaPreclassifierClass. Fix: a structural-diff predicate (status→complete OR reviewed-flip) forces MATERIAL BEFORE any NON_MATERIAL path or LLM verdict. auto_cure_loop + resolve-content-hash-drift-detected must honor the forced verdict (no refresh). UNVERIFIED: exact PreclassifierClass enum members + where the structural-diff is computed — confirm at execution.


07.1 Force MATERIAL on completion-transition drift

File(s): scripts/plan_orchestrator/materiality_preclassifier.py; scripts/plan_orchestrator/drift_classes.py

  • Add a structural-diff predicate: if the baseline→current frontmatter diff includes status: → complete OR a reviewed: flip (either direction), classify_body_delta returns MATERIAL unconditionally — evaluated BEFORE any NON_MATERIAL classification and not overridable by an LLM materiality verdict.
  • Ensure materiality_gate.py routes this MATERIAL verdict to surface/halt (or reversal via /independent-review per §06), never to hash-refresh.
  • Subsection close-out (07.1) — MANDATORY before 07.2:
    • Tasks [x]; predicate unit-tested; update subsection statuscomplete.
    • Repo hygiene checkcompiler_repo/diagnostics/repo-hygiene.sh --check.

07.2 Block auto-refresh on material completion drift + regression test

File(s): scripts/plan_orchestrator/auto_cure_loop.py; scripts/plan_corpus/__main__.py (resolve-content-hash-drift-detected); scripts/plan_orchestrator/tests/

  • The auto-cure loop MUST NOT classify a completion-transition content_hash drift as script_auto/llm_required-curable-by-refresh; resolve-content-hash-drift-detected refuses to refresh when the forced-MATERIAL predicate fires.
  • Regression test: fixture reproducing the §08 shape (status: not-started→complete, reviewed: false→true, stale content_hash) → assert classifier MATERIAL AND the loop does not refresh the hash AND it surfaces/halts.
  • Subsection close-out (07.2) — MANDATORY before 07.N:
    • Tasks [x]; regression test green; update subsection statuscomplete.
    • Repo hygiene checkcompiler_repo/diagnostics/repo-hygiene.sh --check.

07.N Completion Checklist

  • 07.1–07.2 [x] and status complete.
  • python3 -m pytest scripts/plan_orchestrator/tests/ -q green incl. the §08-shape regression.
  • Manual proof: the §08 content_hash drift now classifies MATERIAL; no refresh occurs.
  • Plan sync — close via §06 /independent-review (bootstrap caveat); update 00-overview.md + index.md.
  • Repo hygiene checkcompiler_repo/diagnostics/repo-hygiene.sh --check.

Exit Criteria: A content_hash drift including a status:→complete or reviewed: transition classifies MATERIAL unconditionally; the auto-cure loop surfaces/halts rather than refreshing the hash; the §08-shape regression test is green.