02 — scope-assembly
Goal
Assemble the bounded candidate surface from the completed plan: the plan’s touched symbols (seed set) plus a one-hop graph expansion. Pull collapse signals — clone_fingerprint clusters (filtered to real-bodied production functions), the now-populated MISSING_ABSTRACTION pairs, similar (softest), and blast_radius for collapse cost. Whole-system scope, but bounded by the plan surface + one hop, so it terminates.
Implementation Sketch
scope.py: extract the plan’s cited symbols/files (from content bodies); for that seed set + one callees/similar hop, query clone_fingerprint clusters (kind=function, real body, exclude tests + the degenerate bodyless bucket), MISSING_ABSTRACTION pairs, and blast_radius. Freshness is guaranteed by the query-intel up-front gate (plans/completed/query-intel-always-fresh). Key clone detection on clone_fingerprint (body), corroborate with signature_hash; NEVER signature_hash alone (trait-method noise).
Spec References
scripts/intel-query.sh (clone_fingerprint, MISSING_ABSTRACTION, blast_radius, similar, callees); plans/completed/query-intel-always-fresh (freshness gate); intel_repo/CLAUDE.md §GDS Graph Insights + §Code Property Graph
Work Items
-
scope.py: completed-plan seed symbols + one-hop expansion (bounded surface) - Pull clone_fingerprint clusters (real-bodied prod fns; exclude tests + degenerate bucket)
- Pull MISSING_ABSTRACTION pairs + blast_radius;
similaras softest signal - Key on clone_fingerprint (body), corroborate signature_hash; never signature_hash alone