tests-and-docs
Goal
Prove the end-to-end dedup behavior through the real entry point and record the tool change.
Implementation Sketch
Deliver the tests-and-docs 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
- Author the north-star probe at the plan-wide criterion’s FROZEN path scripts/add_bug_runtime/tests/probe_graph_native_dedup.py (probe_ prefix, not test_ — keeps it out of default pytest collection while remaining runnable standalone; s-2ec02902’s w-23df97d8 later extends this SAME file for the plan-vs-plan/plan-vs-bug half, so structure it with a per-entry-point seam, e.g. separate bug-side/plan-side functions emitting a combined reading, rather than a monolithic script the plan half must rewrite). Drive the REAL /add-bug entry point via cli.main([“append”, “—entry-json”, …]) (the shape test_append_error_mapping.py:39 already uses) against a fixture bug-tracker + a fake/live graph — never append_open_bug alone. Feed the re-file input as VERBATIM title+repro text (the calibration pattern from test_bug_dedup_calibration.py, not a paraphrase) so the exact-duplicate and related_enhance legs clear their live-calibrated bands (BUG_DEDUP_RELATED_BAND=40.0, GRAPH_FIRED_THRESHOLD=35.0) instead of vacuously failing; never tune the bands to fit a weaker input. Assert exit_reason in {duplicate_bug, enhanced_existing}. Assert the regex/Jaccard extractors (_extract_symbols/_extract_paths/_tokenize_words) are unreachable from compute_relatedness/compute_bug_dedup/graph_query.py — a decision-path-scoped assertion, never a repo-wide grep (the extractors stay intentionally in signals.py for the retained compute_relatedness_heuristic A/B parity probe; do not delete or skip them to force this green).
- Audit the existing dedup matrix coverage against the exact/related/distinct-subsystem/empty-corpus/closed-bug-regression-hint/graph-down-fail-open cells: cross-check test_bug_dedup.py, test_append_dedup_wiring.py, test_relatedness_graph_path.py, and test_relatedness_dedup_matrix.py against this six-cell list. Author ONLY the genuinely-missing cells (e.g. a CLI-level closed-hint passthrough gap, if one exists) — do NOT re-pin any cell already covered by the existing inventory; a duplicate pin here is LEAK:algorithmic-duplication at the test layer. Record the audit outcome (which cells were already covered vs newly added) so the section’s close evidence is traceable.
- Run the full add_bug_runtime + bug_tracker test suites +
python -m scripts.add_bug_runtime --self-test; all green. - Update the design log .claude/skills/improve-tooling/add-bug-design.md §6 Improvement Log with the graph-native relatedness + dedup change.
Fresh intel (regenerated)
{ “schema_version”: 1, “target”: { “kind”: “plan-section”, “ref”: “graph-native-bug-relatedness/s-4c8c5a6c” }, “generated_at”: “2026-07-14T04:16:27.748132+00:00”, “graph_state”: { “head_sha”: “d281786e3”, “last_code_import_at”: “2026-07-14T03:15:17.453000000+00:00”, “embedding_stale”: false, “insights_stale”: false, “cpg_stale”: false }, “surfaces”: {}, “summary”: “intel-package[plan-section:graph-native-bug-relatedness/s-4c8c5a6c] agent-authored dossier”, “degraded”: false, “dossier”: { “objective_symbols”: [], “tiers”: {}, “agent_authored”: true, “constrained_symbols”: [ “append_bug_entry”, “enhance_bug_entry”, “_extract_symbols”, “_extract_paths”, “_tokenize_words”, “run_intel_query” ], “difficulty”: { “class”: “routine”, “research_online”: false, “research_mode”: “auto”, “signals”: [], “plan_dir”: “/home/eric/projects/ori_lang/plans/graph-native-bug-relatedness” } } }
(full dossier: tests-and-docs—s-4c8c5a6c.intel.json)