Skip to content

Remove the deep-scan drift step; salvage health + baseline into Step 9 Finalize#98

Merged
gbrbks merged 3 commits into
mainfrom
feature/remove-drift-step
Jun 17, 2026
Merged

Remove the deep-scan drift step; salvage health + baseline into Step 9 Finalize#98
gbrbks merged 3 commits into
mainfrom
feature/remove-drift-step

Conversation

@gbrbks

@gbrbks gbrbks commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

What

Deletes the drift step (old Step 9) from the deep-scan pipeline - the slowest post-intent-layer phase - and re-homes everything worth keeping. Net: -2,126 lines.

Why

  • Its findings were the only user-facing AI output that bypassed the verified channel: no triggering_call_site requirement, no backward verification, no hysteresis, regenerated from scratch each run. The 'compare to previous run' story was an LLM prose-diffing the prior scan_report.md - unreliable by construction.
  • Every problem class it covered is owned by machinery that does it better: the Wave 2 Risk agent's invariant walk + the edit-time hooks (decision violations, pitfall triggers, trade-off undermining, schema drift), and findings.json (recurrence with stable ids + confirmed_in_scan + hysteresis).

Changes

  • New Step 9: Finalize (plain bash, no subagent) - health measurement (health.json + history), complete-step 9 + save-baseline (the --incremental dependency), telemetry flush, closing summary. Absorbs old Step 10.
  • Recency sweep salvage: in incremental runs the Risk agent (Step 5b) now reads the injected changed_files list file-by-file against documented invariants and per-folder CLAUDE.md patterns; findings flow through the standard verifier. Wiring test added (test_incremental_recency_sweep_is_wired).
  • Removed: drift.py, step-9-drift.md, step-10-telemetry.md, templates/scan-report.md, extract_output.py deep-drift/recent-files subcommands, dead filter-ignored subcommand, scan_report/drift_report share-bundle sources.
  • Upgrade hygiene: Step 8 cleanup and the pip install path delete stale drift_report.json / scan_report.md / drift.py on upgrade.
  • Telemetry step key renamed drift -> finalize (accepted trend-continuity break).

Accepted losses (decided in session)

  • Semantic near-twin duplication detection has no successor (the mechanical verbosity metric catches exact clones only). Cheap to re-add later as a Risk-agent finding class if missed.
  • Share viewer loses the prose report page; findings/health still ship structured from findings.json/health.json.

Verification

  • scripts/verify_sync.py passes (34 scripts, workflow + assets in sync)
  • Full pytest: 897 passed
  • Inline-python / bash allowlist audit on all changed step files: only pre-existing allowlisted command shapes
  • Outstanding (manual): one behavioral deep-scan run in Claude Code and one in Codex on a test project to confirm parity end-to-end

Generated with Claude Code

… into Step 9 Finalize

The drift step (old Step 9) was the slowest post-intent-layer phase and its
findings bypassed the verified channel: no triggering_call_site requirement,
no backward verification, no hysteresis, regenerated from scratch each run.
Everything it claimed to cover is owned by machinery that does it better:

- Decision violations / pitfall triggers / trade-off undermining / schema
  drift: the Wave 2 Risk agent's invariant walk (Step 5b) + edit-time hooks.
- Recency coverage: new recency sweep in the Risk agent - in incremental
  runs the changed_files list (already injected into the Wave 2 preamble)
  is read file-by-file against documented invariants and per-folder
  CLAUDE.md patterns, and the resulting findings flow through the verifier.
- Recurrence tracking: findings.json (stable ids, confirmed_in_scan,
  hysteresis) replaces the LLM prose-diff of scan_report.md.

Salvaged into the new Step 9 (Finalize, plain bash, no subagent): health
measurement (health.json + history), complete-step 9 + save-baseline (the
--incremental dependency), telemetry flush, and the closing summary.

Removed: drift.py (722 lines), step-9-drift.md, step-10-telemetry.md
(absorbed into step-9-finalize.md), templates/scan-report.md, the
extract_output deep-drift/recent-files subcommands, the dead filter-ignored
subcommand, and the scan_report/drift_report share-bundle sources. Step 8
cleanup and the pip install path now delete stale drift artifacts on upgrade.

Accepted losses (signed off): semantic near-twin duplication detection has
no successor (health.json verbosity = exact clones only); the share viewer
loses the prose report page; telemetry trend continuity breaks on the drift
step key.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
archie Ready Ready Preview, Comment Jun 12, 2026 10:14am
archie-viewer Ready Ready Preview, Comment Jun 12, 2026 10:14am

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Review (Claude adversarial + testing/maintainability/security specialists +
Codex cross-model) confirmed two regressions and a set of stragglers:

- Step 8's new `rm -f .archie/drift_report.json .archie/scan_report.md` was
  not in the Claude permission allowlist (only the tmp/ and health.json rm
  globs are) and would prompt mid-pipeline on every upgraded project; it was
  also cwd-relative and skipped per-package workspaces. Moved the retirement
  sweep to install.py::_clean_legacy_layout (allowlisted, PROJECT_ROOT-anchored,
  per-workspace) and expanded it: drift_report.json, drift_diff.json,
  scan_report.md, semantic_duplications.json, drift_history/.
- The recency sweep died on any resumed incremental run: changed_files lives
  only in conversation memory and neither save-run-context nor the Resume
  Prelude restores it. Both the Wave 2 dispatch and the Resume Prelude now
  regenerate it via detect-changes (safe: save-baseline only moves at Step 9).
  Wiring test added.
- detect-changes now filters the changed list through IgnoreMatcher - git
  lists tracked-but-.archieignore'd files, which inflated the incremental
  threshold and would have fed vendored files to the recency sweep (the
  deleted filter-ignored subcommand used to provide exactly this). Test added.
- step-9-finalize: telemetry flush now runs BEFORE complete-step 9 so an
  interruption leaves status=in_progress and --continue re-runs the idempotent
  step instead of stranding the telemetry; the receipt reads the per-folder
  count from enrich_state.json (not from pre-compact memory) and includes a
  health line.
- --from N is now bounded to 1-9 (a stale --from 10 validated clean and
  no-opped every step).
- Dead code: upload.py _read_text removed (last caller was the scan_report
  read). Stale references fixed: 'Steps 1-10' in SKILL.md and
  scope_resolution.md, drift.py/deep-drift/recent-files/templates mentions in
  ARCHITECTURE.md, drift in CLAUDE.md repo layout, scan_report.md in
  gitignore.default, 'Top risks' block in the README sample output.
- New tests: semantic_duplications bundle behavior (legacy file, structured
  zero, stale drift_report ignored), installer retirement sweep, a pytest
  gate running scripts/verify_sync.py, resume-regeneration wiring, and the
  detect-changes ignore filter. Suite: 985 passed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@gbrbks gbrbks merged commit e1f6407 into main Jun 17, 2026
4 checks passed
@gbrbks gbrbks deleted the feature/remove-drift-step branch June 17, 2026 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant