100%

00 — walking-skeleton

Goal

Prove the end-to-end wire on ONE candidate: /consolidate <completed-plan> REFUSES a non-completed plan (exit with a clear gate message), and on a completed plan carrying one obvious accidental clone pair, surfaces it from the graph, RE-READS live source to confirm, classifies it (4-class), and — if collapse — applies it via the thin executor loop (one collapse -> /commit-push -> refactor commit). Thin vertical slice across gate -> scope -> freeze -> judge -> execute, one candidate deep.

Implementation Sketch

Stand up scripts/consolidate_runtime/__main__.py with a single end-to-end path on one candidate. Gate: refuse unless the target plan is complete (plan-status / read.py). Find: one clone_fingerprint cluster within the plan’s symbol surface. Confirm: rg the two bodies live. Judge: classify accidental-copy-paste vs leave. Execute (if collapse): apply + /commit-push (test-all+hygiene) as a refactor: commit. No ranking, no batching yet.

Spec References

scripts/intel-query.sh (clone_fingerprint, query-intel surface); scripts/plan_corpus/read.py (plan completion); .claude/rules/script-first.md §4 (consolidate_runtime layout); .claude/rules/impl-hygiene.md (LEAK:algorithmic-duplication)

Work Items

  • consolidate_runtime/__main__.py thin end-to-end path on ONE candidate
  • Completion gate refuses non-completed target plan with a named message
  • Find one clone pair -> rg live-source confirm -> 4-class classify -> collapse-or-leave
  • Skeleton test: refusal on incomplete plan; one accidental clone collapses via /commit-push