80%

skill-surface

Goal

Make /add-bug consume the dedup verdict and stop documenting a duplicate-check that never existed.

Implementation Sketch

Deliver the skill-surface slice of the graph-native relatedness + dedup capability per the plan mission; ground every claim against the verified intel-graph facts in the overview.

Work Items

  • add-bug workflow.md Step T2: consume the dedup verdict (duplicate_bug -> surface existing + do not file; enhanced_existing -> report the enhanced id; new -> proceed), running dedup BEFORE the plan-relatedness redirect.
  • CORRECT the inaccurate workflow.md claim that a title-keyword grep over open-bugs.json rejects duplicates via append_bug_entry validators (false — append only rejects exact-id collisions); state the real graph-driven dedup gate.
  • add-bug workflow.md Step T7: extend the CLI-to-skill exit_reason mapping table to pass through duplicate_bug and enhanced_existing unchanged, alongside the existing appended -> needs_routing and needs_plan_escalation passthrough entries — duplicate_bug surfaces directly from the Step T2 dedup-check short-circuit (surface existing + stop, append never reached); enhanced_existing is emitted by the Step T5 append when the in-append dedup verdict is related_enhance (the enforcement backstop path, reached when Step T2’s new-verdict lets the flow proceed to write).
  • add-bug SKILL.md: exit_reasons duplicate_bug + enhanced_existing are ALREADY landed in frontmatter (verify-first against SKILL.md:15-18 and orchestration-rules.json:2635-2636 parity — do not re-add, do not restate the descriptions differently). Add the MISSING SKILL.md body section: a bug-vs-bug dedup section (consume, never re-implement — cite compute_bug_dedup / BUG_DEDUP_RELATED_BAND / append_open_bug by name; never restate the verdict-gate algorithm) mirroring the existing ‘Relatedness verdict — server-side’ section (SKILL.md:55-68). Keep the dedup_into_section (plan-subsumption) and duplicate_bug/enhanced_existing (bug-vs-bug) vocabularies visibly distinct per the dossier’s NAMING hazard flag.

Fresh intel (regenerated)

VERDICT: s-6beb9df5 is a DRIFT-CLOSURE section, not a capability section — the runtime it documents is 100% landed and live at HEAD, and the skill’s own frontmatter + the caller registry ALREADY declare the new exit_reasons; the ONLY remaining gap is that workflow.md (the executable protocol) contradicts the wired runtime. Verified at HEAD: compute_bug_dedup exists and gates verdicts corpus-side (scripts/add_bug_runtime/bug_dedup.py), append_open_bug runs dedup FIRST on every append path (bug_tracker_io.py), the CLI emits duplicate_bug / enhanced_existing (__main__.py:268,278), orchestration-rules.json carries both in the add-bug exit-reason registry AND in three caller handler lists (fix-bug / fix-next-bug / review-bugs), and add-bug/SKILL.md frontmatter already lists both exit_reasons (lines 15-18). Meanwhile workflow.md Step T2 says nothing about dedup, Step T7’s mapping table omits both exit_reasons, and workflow.md:99 still asserts a duplicate-check that has NEVER existed.

The decisive [JOIN] (runtime call order x workflow step order): the dedup enforcement point (append_open_bug) sits at Step T5, but the plan-relatedness redirect fires at Step T2 — so on the redirect path (needs_plan_escalation) the append never runs and dedup NEVER executes. A bug that is BOTH a duplicate of an open bug AND related to an active plan is today redirected into /create-plan --inline with zero dedup. That is exactly why w-9d8b0c60 words the deliverable as “running dedup BEFORE the plan-relatedness redirect”: the doc shape that satisfies it is Step T2 consuming the read-only python -m scripts.add_bug_runtime dedup-check --entry-json ... verdict FIRST (duplicate_bug -> surface + stop; related_enhance -> the enhance lands via the Step T5 append; new -> proceed to relatedness-check), with the in-append dedup (plus its lock-scoped pre-write re-check) documented as the enforcement backstop, never re-implemented in prose.

Decisions this package forces before any edit:

  1. Verify-first on w-d9108c0e — half already landed. SKILL.md frontmatter exit_reasons: already carries duplicate_bug + enhanced_existing with accurate descriptions (parity with orchestration-rules.json:2635-2636, landed by s-6924d386’s Decision-31 parity work). The remaining w-d9108c0e deliverable is ONLY the SKILL.md BODY section (a bug-vs-bug dedup section mirroring the existing “Relatedness verdict — server-side” section) + the Step T7 CLI-to-skill exit_reason mapping. Re-adding the frontmatter is a no-op; contradicting it is drift.
  2. The w-ccc2162d correction is doubly grounded — state it precisely. append_bug_entry (scripts/plan_corpus/bug_tracker/_append.py:37) rejects ONLY an exact bug-id collision in the destination aggregate (“duplicate-id is a corpus invariant violation”); there is no title-keyword grep anywhere in the append path. Resolved BUG-07-221 documents that even the id check historically missed the OTHER aggregate. The corrected text names compute_bug_dedup (graph-ranks / corpus-confirms) as the real dedup gate and append_bug_entry’s id-collision check as a corpus INVARIANT, not a dedup feature.
  3. Document verdict semantics EXACTLY — the live probe falsifies the naive reading. A live dedup-check probe re-filing an open bug’s VERBATIM title (fresh id, different repro) returned related_enhance at 49.36, NOT exact_duplicate: texts_confirm_duplicate requires title equality/containment AND repro token-overlap when both sides carry a repro. “Same title, new repro detail” folds into the existing entry (enhance) by design. Skill-surface text claiming “identical title => refused as duplicate” would be the same class of behavior-that-does-not-exist claim w-ccc2162d deletes.
  4. Do not overclaim scope. related-nodes --kind plan returns 0 live (Plan.name/full_name NULL corpus-wide, probed this session); plan-side dedup is s-b546c83e/s-f5e63376 territory. The bug-vs-bug section documents --kind bug only.
  5. Two tracker bugs were inspected as fold candidates: BUG-07-206 (doc-accuracy defect in the SAME workflow.md — retired section-NN tracker-index format described inconsistently with open-bugs.json) and BUG-07-342 (targets the symbol-signal stoplist of the heuristic path that s-c7999cd5 already removed from the decision path — likely OBE). Normal bug routing now applies to any remaining valid work.

DIG DEEPER

python -m scripts.plan_corpus.read --summary plans/graph-native-bug-relatedness
sed -n '77,100p' .claude/skills/add-bug/workflow.md      # Step T2 + the false claim at :99
sed -n '8,19p' .claude/skills/add-bug/SKILL.md           # frontmatter exit_reasons already landed
grep -n 'duplicate_bug\|enhanced_existing' .claude/rules/orchestration-rules.json

(full dossier: skill-surface—s-6beb9df5.intel.md)