Section 02: /create-plan Phase 0 Subsumption Classification Step
Goal: Wire §01’s routing rule into /create-plan so plan creation captures subsumption claims at the moment the plan is being designed, not as an afterthought.
Success Criteria: see frontmatter.
Implementation Sketch
/create-plan Phase 0 already does scope analysis + fork-decision. The natural insertion point for subsumption classification is between Phase 0’s fork-decision and Phase 1’s prerequisites — once the plan’s touches: is known (which subsystems are affected), candidate bugs can be enumerated.
Workflow:
- Enumerate candidates. For each
touches:path, queryscripts/intel-query.sh bugs-for <subsystem>(subsystem mapping viaintelligence.md §Subsystem Mapping). Fall back togit grep -l 'subsystem: <name>' bug-tracker/plans/*/00-overview.mdif intel graph unavailable. - Filter candidates. Filter out
status: closedandstatus: completebugs (no value in claiming fixed bugs). Filter rule forstatus: in-progressbugs (per Step 4 blind-spot 6): they ARE candidates — the in-progress filter from prior plan revisions applied to active /fix-bug routing, not /create-plan rebuild routing. When a candidate is in-progress, append aMIGRATION_RACE_GUARDwarning to its surfaced row. - Apply 3-signal test (author-confirmed) + author
subsumption_evidence. For each candidate, present: bug title + symptom + filed-in subsystem + Claude’s signal-fire inference + (if in-progress) MIGRATION_RACE_GUARD warning. Author confirms via batchedAskUserQuestionper subsystem (NOT per bug). Recommended option perask-user-question.md= Claude’s best-grounded inference with rationale. - Capture verification_test. Per confirmed claim, locate the failing test reference: try (priority) bug-frontmatter
verification_test:→ bug Mission Success Criteria checklists → bug §03 TDD matrix → author-supplied. If none found, surfaceSUBSUMES_TEST_REF_REQUIREDAskUserQuestion. - Write classifications. For
subsumeschoices: appendsubsumes: [{bug, verification_test, subsumption_evidence}, ...]to plan’s00-overview.mdfrontmatter; cross-writesubsumed_by: plans/<name>/on each bug; flip bugstatus: open|in-progress→subsumed; HISTORY entries on both sides citing the classification turn (timestamp, plan name, signals confirmed, verification_test, payload summary).
Implementation Items
- §02.1 Add Phase 0.6 (or equivalent — between fork-decision and Phase 1)
Subsumption Classificationstep to.claude/skills/create-plan/SKILL.md. Citerouting.md §2.X(authored by §01 of this plan) as the routing SSOT. Document the step’s I/O: input = plan’stouches:; output =subsumes:frontmatter on plan +subsumed_by:cross-writes on bugs. - §02.2 Implement subsystem-to-bug enumeration helper. Reuse
intelligence.md §Subsystem Mappingtable for path → subsystem mapping. Primary path:scripts/intel-query.sh bugs-for <subsystem>; graceful-degradation fallback:git grep -l 'subsystem: <name>' bug-tracker/plans/*/00-overview.md. Filter by status: includeopenANDin-progress; excludeclosed,complete,subsumed(already claimed). - §02.2 Implement MIGRATION_RACE_GUARD detection. For each
in-progresscandidate, querygit log -1 --format=%H bug-tracker/plans/BUG-XX-NNN/to detect recent activity (commit within last 7 days). Mark such candidates with the warning flag in the candidate-row payload. - §02.3 Implement author-confirmation prompt. Batched
AskUserQuestionper subsystem (NOT per bug — fan-out is aSTRUCTURE:autopilot-pause-leakfailure mode). Each option presents one candidate bug with classification choices: subsumes / blocker / unrelated / defer. Recommended option perask-user-question.mdrule = Claude’s best-grounded inference with one-line rationale citing which of the 3 signals fire. Forin-progress + MIGRATION_RACE_GUARDcandidates, the option list adds a(in-progress — race guard)annotation; recommendation accounts for the race. - §02.3 Implement
subsumption_evidencepayload authoring sub-prompt. After signal confirmation, prompt for (or auto-extract from bug overview):replaced_subsystem(str),root_cause_pointer(file:line or commit SHA),verification_test_pointer(test path or test-id). Auto-extraction tries: (1) bugsubsystem:field for replaced_subsystem; (2) bug §02 root cause pointer for root_cause_pointer; (3) bug Mission Success Criteria test list for verification_test_pointer. Author confirms or overrides. - §02.3 Implement
verification_testcapture. Per claim, attempt to locate failing test reference: priority order = bug-frontmatterverification_test:(future field) > bug Mission Success Criteria block (e.g., BUG-04-118 lists 16 tests atbug-tracker/plans/BUG-04-118/00-overview.md:40-42) > bug §03 TDD matrix in bug-plan body > author-supplied. If none locatable, emitSUBSUMES_TEST_REF_REQUIREDAskUserQuestion with options: (a) author-supplied path (Recommended), (b) defer classification, (c) skip subsumption. - §02.4 Implement bidirectional frontmatter writes. Plan side:
subsumes: list[SubsumptionClaim]on plan’s00-overview.md(schema field added by §05). Bug side:subsumed_by: str | nullon bug’s00-overview.md(schema field added by §05). Atomic write pair — both succeed or both rollback. Use Pythontempfile+os.renamefor atomic single-file writes; cross-file atomicity is best-effort via write-both-then-verify (no two-phase commit needed for filesystem writes at this granularity). - §02.5 Implement bug
statusflip + HISTORY entries. Bug status:open|in-progress→subsumed(requires §05 schema enum extension to permitsubsumedin OVERVIEW_STATUSES + FIX_STATUSES). HISTORY entry on both sides: “YYYY-MM-DD — Subsumed byplans/<name>/. Signals confirmed: surface=Y, non-reproduction=Y, symptom=Y. verification_test=<path>. subsumption_evidence: replaced_subsystem=<subsystem>, root_cause=<pointer>. Verification at plan-completion gate per §07.” - §02.5 Cross-bug-blocker check. If the candidate is target of any other bug’s
blocked_by:chain (grep -l "BUG-XX-NNN" bug-tracker/plans/*/00-overview.md), surfaceSUBSUMED_BLOCKER_DEPENDENCYwarning AskUserQuestion with options: (a) co-subsume the dependent bug under same plan (Recommended when 3-signal also fires for the dependent), (b) rehome the blocker — re-point dependent’sblocked_by:to this plan, (c) skip subsumption — leave the chain intact. - §02.6 Idempotency: re-running classification on an already-classified plan reads existing
subsumes:+ skips classified bugs (no double-prompt, no duplicate HISTORY entries).--called-by-orchestratorbehavior: when set, skip theAskUserQuestionand return structured exit-statesubsumption_classification_pendingwith payload{candidates: [{bug, signal_inference, race_guard, suggested_test}], subsystems: [...]}for the orchestrator to resolve. - §02.6 Test cases: (a) plan with no candidate bugs (empty
subsumes:, no prompts), (b) plan with 1 candidate (single-question prompt), (c) plan with N candidates across M subsystems (M batched prompts), (d) re-run idempotency, (e)--called-by-orchestratordeferred behavior, (f) in-progress candidate with race guard, (g) candidate target ofblocked_by:chain (blocker dependency check), (h) candidate with no locatable verification_test.
Test Strategy
This section modifies /create-plan skill behavior. Test matrix:
| Dimension | Cases |
|---|---|
| Plan-touches scope | empty touches:, single-subsystem, multi-subsystem |
| Candidate count per subsystem | 0, 1, N |
| Bug status mix | all-open candidates, some-in-progress (filtered), all-closed (none surface) |
| Invocation mode | direct user-invoke, --called-by-orchestrator, /review-draft-proposal Step 12 feature-plan |
| Idempotency | first run, re-run with same scope, re-run after subsumes: manually edited |
Semantic pins:
- Positive: re-arch + non-reproduction + symptom all-confirmed → bug lands in
subsumes:ANDsubsumed_by:cross-writes AND status flips. Reverting any one of the three writes the test fails. - Negative: 2-of-3 signals confirmed (e.g., re-arch + non-reproduction but NOT symptom) → bug routes per
/add-bug --inline5-case dispatcher OR stays as separate tracker entry;subsumes:is NOT written. Test that the wrong-classification case is rejected, not silently absorbed.
Intelligence Reconnaissance
(2026-05-09) Section modifies .claude/skills/create-plan/SKILL.md + references files (Markdown skill body) and reads scripts/intel-query.sh (Bash) for the bug-enumeration helper. Skill bodies are not symbol-graph-indexed; intel-query.sh bugs-for <subsystem> is the Python-shipped subcommand the new step invokes (verified present per intelligence.md §How to Query table). Per compose-intel-summary.md graceful-degradation, recording graph unavailability for the skill-body edit as freeform prose; the inner subcommand call IS graph-mediated at runtime. Cross-references resolved by direct Read: /create-plan/SKILL.md (Phase 0 + Phase 0.5 feature-mode pattern verified), intelligence.md §Subsystem Mapping (path → subsystem mapping table verified), ask-user-question.md (recommended-option rule verified). Symbol-graph queries reserved for sections that touch compiler-indexed Python (§05, §06).
Cross-References
- §01 — routing rule SSOT this section consumes.
- §05 — schema fields (
subsumes:,subsumed_by:) this section writes. /create-planSKILL.md — host file for the new step (@-included rules + body modifications)..claude/rules/ask-user-question.md— recommended-option rule for the classification prompt..claude/rules/skill-control-contract.md §Hybrid Contract—--called-by-orchestratordeferred-behavior protocol.
02.1 Add Subsumption Classification step to /create-plan SKILL.md
Insertion point: .claude/skills/create-plan/SKILL.md Phase 0.6 (between Phase 0.5 Feature-mode fork-decision and Phase 1 Prerequisites).
- Add a new
## Phase 0.6 — Subsumption Classificationsection to.claude/skills/create-plan/SKILL.mdbody. Reference:routing.md §2.X(authored by §01 of THIS plan). - Document the step’s inputs: plan’s proposed
touches:array; plan’smissiontext (for 3-signal heuristic). - Document the step’s outputs:
subsumes: list[SubsumptionClaim]on plan’s00-overview.md; bidirectionalsubsumed_by:cross-writes; bugstatus:flips per §02.5. - Document
--called-by-orchestratorexit-state schema:{status: "subsumption_classification_pending", candidates: [...], subsystems: [...]}. - Add
@-include reference to.claude/rules/routing.mdand.claude/rules/ask-user-question.mdat top of the new phase perskill-template.md §2 SSOT consumption discipline.
02.2 Implement subsystem→bug enumeration + race-guard detection
- Author
.claude/skills/create-plan/references/subsumption-enumerate.md(or inline in SKILL.md if total body stays under 500 lines) — references file holds the algorithm; SKILL.md cites it. - Implement primary enumeration: for each path in plan’s
touches:, callscripts/intel-query.sh bugs-for $(map_path_to_subsystem <path>)perintelligence.md §Subsystem Mapping. Aggregate bug list across paths; dedup by bug-id. - Implement graceful-degradation fallback: when
scripts/intel-query.sh statusreports unavailable, fall back togit grep -l 'subsystem: \"<name>\"' bug-tracker/plans/*/00-overview.md. Document the fallback as the canonical secondary path. - Implement candidate filter rule: include
status: openANDstatus: in-progress; excludestatus: closed | complete | subsumed. (subsumedexcluded because already-claimed bugs are not re-candidates.) - Implement MIGRATION_RACE_GUARD: for each in-progress candidate, run
git log -1 --since="7 days ago" --format=%H -- bug-tracker/plans/BUG-XX-NNN/. Non-empty result → tag candidate withrace_guard: truefor §02.3 prompt-rendering.
02.3 Implement 3-signal-test author-confirmation prompt + subsumption_evidence + verification_test capture
- Implement batched
AskUserQuestionper subsystem. Question template: “Plan touches<subsystem>. The following bugs are candidates for subsumption: [bug list with signal-fire inference]. Classify each:” Options per bug:subsumes (Recommended when 3-of-3 fire),blocker,unrelated,defer. Maximum 4 options perAskUserQuestionschema constraint; if subsystem has >4 candidates, batch into multiple sequential questions (max 4 candidates per question, all questions emitted before any execution perskill-control-contract.md §Front-Loading Pattern). - Implement signal-fire inference helper (Claude’s best-grounded suggestion only; mechanical inference BANNED per §01 banned pattern (c) — author confirms): heuristic checks (a) plan’s
touches:⊇ bug’ssubsystem:(signal #1), (b) plan’smissiontext matches bug’s reproducer description (signal #2), (c) bug’s root-cause pointer cites a path in plan’stouches:(signal #3). Render as “SUGGESTED: subsumes (signals 1+2+3 fire — verify)” or “SUGGESTED: not subsumed (only signal N fires)”. - Implement
subsumption_evidencepayload authoring per confirmed claim. Auto-extract: (1)replaced_subsystemfrom bug’ssubsystem:field; (2)root_cause_pointerfrom bug §02 root-cause first cite; (3)verification_test_pointerfrom bug Mission Success Criteria block (look fortests pass/failing testchecklist items). Surface auto-extracted values in a confirmationAskUserQuestion: option (a) Accept auto-extracted (Recommended), (b) Override values (free-text per field), (c) Skip subsumption — payload incomplete. - Implement
verification_testcapture. Priority chain: (1) bugverification_test:frontmatter field (future addition); (2) bug00-overview.mdMission Success Criteria — first checklist item containing the substringtest_ortests pass(e.g., BUG-04-118’sbug-tracker/plans/BUG-04-118/00-overview.md:40-42lists 16test_*paths); (3) bug §03 TDD matrix; (4) author-supplied. If chain exhausts with no result, emitSUBSUMES_TEST_REF_REQUIREDAskUserQuestion: option (a) Author-supplied test path (Recommended — required for §07 verification), (b) Defer classification, (c) Skip subsumption.
02.4 Implement bidirectional frontmatter writes (plan + bug 00-overview)
- Implement plan-side write. Read
plans/<name>/00-overview.md; parse YAML frontmatter; append to (or create)subsumes: list[SubsumptionClaim]array; write atomically viatempfile.NamedTemporaryFile+os.replace. - Implement bug-side write. For each subsumed bug-id: read
bug-tracker/plans/BUG-XX-NNN/00-overview.md; parse frontmatter; setsubsumed_by: 'plans/<name>/'; write atomically. - Implement atomicity guard. After both writes complete, verify by re-reading both files; if either side missing the write, ROLLBACK both (revert to pre-write state). Document the guard as best-effort filesystem atomicity (no two-phase commit; verify-then-rollback is the discipline).
- Schema validation: post-write, run
python -m scripts.plan_corpus check plans/<name>/ bug-tracker/plans/BUG-XX-NNN/and assert exit 0. If schema rejects (likely indicates §05 not yet shipped), abort the classification with a clear error citing §05 dependency.
02.5 Implement bug status flip + HISTORY entries + cross-bug-blocker check
- Implement status flip. Bug
status:→subsumed. Requires §05 schema extension (OVERVIEW_STATUSES + FIX_STATUSES includesubsumed). Pre-flight: readscripts/plan_corpus/schemas.pyand assertsubsumedis in the relevant frozenset; abort if not (cite §05 unmet dependency). - Implement HISTORY entries. Plan side: append to
00-overview.mdHISTORY block: “YYYY-MM-DD — Subsumed BUG-XX-NNN (signals: 1=Y, 2=Y, 3=Y; verification_test=<path>; payload={...}).” Bug side: append to bug’s00-overview.mdHISTORY block (or create the block if absent): “YYYY-MM-DD — Subsumed byplans/<name>/. Signals confirmed: 1=Y, 2=Y, 3=Y. Verification at plan-completion gate per §07; un-subsumes on completion-gate failure or plan abandonment.” - Implement cross-bug-blocker check. For each subsumed bug-id, run
git grep -l "blocked_by:.*BUG-XX-NNN" bug-tracker/plans/. Non-empty result → emitSUBSUMED_BLOCKER_DEPENDENCYAskUserQuestion. Options: (a) Co-subsume the dependent bug — runs §02.3+§02.4+§02.5 recursively for the dependent (Recommended when 3-signal fires for dependent too), (b) Rehome — re-point dependent’sblocked_by:fromBUG-XX-NNNtoplans/<name>/(treating the plan as the new blocker via §05’s cross-validator), (c) Skip subsumption — leave the chain intact, this bug stays in tracker. Concrete reference: BUG-04-111 isblocked_by: ["BUG-04-118"]perbug-tracker/plans/BUG-04-111/00-overview.md:5-6; if BUG-04-118 is subsumed byplans/aims-burden-tracking/, this check fires and offers co-subsumption.
02.6 Idempotency + —called-by-orchestrator behavior tests
- Implement idempotency check. Re-run on a plan with non-empty
subsumes:: read existing claims; for each, skip the bug-enumeration entry; deduplicate by bug-id; do not re-emit HISTORY. Emit a one-line summary: “N claims already present; M new candidates; K newly subsumed.” - Implement
--called-by-orchestratorflag handling perskill-control-contract.md §Hybrid Contract. When set: run §02.2 enumeration + §02.3 inference (without AskUserQuestion); return structured exit-state{status: "subsumption_classification_pending", candidates: [...], subsystems: [...]}to caller; do NOT write any files. Caller (/review-draft-proposalStep 12 or/migrate-feature) consumes the exit state. - Test cases (TDD-style — author tests BEFORE implementation per CLAUDE.md §Tests That Expose Bugs):
- (a) Plan with empty
touches:→ no candidates, no prompts, emptysubsumes:, exit clean. - (b) Plan with single subsystem, single candidate → single AskUserQuestion, single classification write.
- (c) Plan with N candidates across M subsystems → ≤4 candidates per question, M questions, all batched before execution.
- (d) Re-run on already-classified plan → idempotent (no duplicate writes, no duplicate HISTORY).
- (e)
--called-by-orchestratorflag → no AskUserQuestion emitted; exit state returned. - (f) Candidate
status: in-progresswith recent commit →MIGRATION_RACE_GUARDwarning surfaces. - (g) Candidate target of another bug’s
blocked_by:→SUBSUMED_BLOCKER_DEPENDENCYAskUserQuestion fires. - (h) Candidate with no locatable test →
SUBSUMES_TEST_REF_REQUIREDAskUserQuestion fires. - (i) §05 schema not shipped (subsumed not in OVERVIEW_STATUSES) → step aborts with clear error citing §05 dependency.
- (a) Plan with empty
02.R Third Party Review Findings
- (no findings yet — populated post-TPR by Step 6
/tpr-reviewround)
02.N Completion Checklist
- All §02.1–§02.6 implementation items checked.
- Test matrix from §02.6 (a)–(i) all passing.
-
python3 scripts/prose-lint.py .claude/skills/create-plan/SKILL.md .claude/skills/create-plan/references/exit 0. -
python -m scripts.plan_corpus checkexit 0 across the corpus. -
grep -nE '\(placeholder' plans/plan-bug-subsumption/section-02-create-plan-classification-step.mdreturns no hits. -
grep -nE '^- \[ \]' plans/plan-bug-subsumption/section-02-create-plan-classification-step.md— every remaining unchecked carries a concrete artifact pointer. -
/create-planPhase 0.6 dry-run on a real candidate plan (e.g.plans/aims-burden-tracking/) demonstrates: enumeration runs; AskUserQuestion fires per subsystem;subsumption_classification_pendingexit state under--called-by-orchestrator. - §05
OVERVIEW_STATUSESincludessubsumed(verified bygrep "subsumed" scripts/plan_corpus/schemas.py). - Section frontmatter
status:flippednot-started→complete;00-overview.mdmission criteria checkbox for §02 flipped[x];index.mdrow updated. - (NOT-APPLICABLE:)
compiler_repo/test-all.sh— skill-infra-docs plan, no compiler crate touched. - (NOT-APPLICABLE:)
/impl-hygiene-review— skill-infra-docs plan, no compiler Rust source touched.