Skip to content

Commit f5ea01b

Browse files
committed
harden: retire coverage-deletion-confidence plan and lift contract
Delete shipped plan doc, mark roadmap item done, slim agent-enrichment-wave to plan 4 only, cross-link untested-and-dead, refresh fixture README goldens.
1 parent 96c504c commit f5ea01b

8 files changed

Lines changed: 29 additions & 157 deletions

File tree

Lines changed: 20 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,29 @@
1-
# Agent enrichment wave — tracer workflow (plans 3–4)
1+
# Agent enrichment wave — tracer workflow (plan 4)
22

3-
> **Status:** in-flight · **Scope:** remaining P2 plans ranked by consumer/agent ROI
3+
> **Status:** in-flight · **Scope:** remaining P2 plan ranked by consumer/agent ROI
44
>
55
> **Goal:** Ship tracer bullets that cut agent round-trips, improve answer trust, and sharpen PR/CI deltas — all Moat-A (predicate columns, no verdict primitives).
66
>
7-
> **Shipped (plans retired):** Evidence chains ([#174](https://github.com/stainless-code/codemap/pull/174)) · Graph-estimated CRAP ([#175](https://github.com/stainless-code/codemap/pull/175)) — durable contract in `golden-queries.md` + `architecture.md`; plan files deleted per [docs-governance](../../.agents/skills/docs-governance/SKILL.md) § Closing a plan.
7+
> **Shipped (plans retired):** Evidence chains ([#174](https://github.com/stainless-code/codemap/pull/174)) · Graph-estimated CRAP ([#175](https://github.com/stainless-code/codemap/pull/175)) · Coverage deletion confidence (PR **#D**) — durable contracts in `golden-queries.md` + `architecture.md`; plan files deleted per [docs-governance](../../.agents/skills/docs-governance/SKILL.md) § Closing a plan.
88
>
9-
> **Remaining:** [coverage-deletion-confidence](./coverage-deletion-confidence.md)[audit-delta-attribution](./audit-delta-attribution.md)
9+
> **Remaining:** [audit-delta-attribution](./audit-delta-attribution.md)
1010
1111
---
1212

1313
## Shared conventions (locked)
1414

15-
| Convention | Applies to |
16-
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
17-
| **Moat A** — no `pass`/`fail` engine verdict; extra columns only | All |
18-
| **`reason` TEXT** — machine code + short clause where useful | #3 |
19-
| **`evidence_json` TEXT** — bounded JSON array (≤3 hops) | shipped #1 |
20-
| **`confidence` / `coverage_source` / `attribution`** — recipe-specific enums | #3, #4 |
21-
| **Golden update per slice**`fixtures/golden/minimal/*.json` + `scenarios.json` | All |
22-
| **`/harden-pr lite`** after each tracer commit; **`/harden-pr full`** before PR merge | All |
23-
| **Retire plan on merge** — delete `docs/plans/<topic>.md` + lift to reference docs/roadmap in the **same PR** (never leave shipped plans as leftovers) | All |
24-
| **No deferring complements** — agent surfaces (rule/skill/MCP), glossary, golden/script tests, and plan acceptance items ship **in the same PR** unless explicitly listed under plan **Out of scope** | All |
15+
| Convention | Applies to |
16+
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- |
17+
| **Moat A** — no `pass`/`fail` engine verdict; extra columns only | All |
18+
| **`reason` TEXT** — machine code + short clause where useful | shipped |
19+
| **`evidence_json` TEXT** — bounded JSON array (≤3 hops) | shipped |
20+
| **`confidence` / `coverage_source` / `attribution`** — recipe-specific enums | shipped #3, #4 |
21+
| **Golden update per slice**`fixtures/golden/minimal/*.json` + `scenarios.json` | All |
22+
| **`/harden-pr lite`** after each tracer commit; **`/harden-pr full`** before PR merge | All |
23+
| **Retire plan on merge** — delete `docs/plans/<topic>.md` + lift to reference docs/roadmap in the **same PR** (never leave shipped plans as leftovers) | All |
24+
| **No deferring complements** — agent surfaces (rule/skill/MCP), glossary, golden/script tests, and plan acceptance items ship in the **same PR** unless explicitly listed under plan **Out of scope** | All |
2525

26-
**Cross-plan synergy:** shipped evidence `reason` complements #4 `attribution` on audit `added` rows. CRAP `coverage_source` (#175) ships before #3 so deletion-confidence can narrow rows with coverage semantics.
27-
28-
---
29-
30-
## Plan 3 — Coverage deletion confidence (`coverage-deletion-confidence.md`)
31-
32-
| Slice | Deliverable | Verify |
33-
| -------------------------- | -------------------------------------------------------------- | ------------- |
34-
| **3.1 recipe fork** | `coverage-confirmed-dead.sql` + `.md` from `untested-and-dead` | query CLI |
35-
| **3.2 golden no-ingest** | `confidence: medium` policy (per D.4) | `test:golden` |
36-
| **3.3 golden with ingest** | fixture coverage → `confidence: high` | `test:golden` |
37-
| **3.4 classifier** | intent keywords if needed | optional |
38-
39-
**Grill before 3.1:** Q3 without ingest — `medium` rows vs empty + stderr (plan D.4 leans medium rows).
26+
**Cross-plan synergy:** shipped evidence `reason` complements #4 `attribution` on audit `added` rows. Shipped `confidence` (#D) narrows deletion triage after `ingest-coverage`.
4027

4128
---
4229

@@ -54,15 +41,14 @@
5441

5542
## PR cadence
5643

57-
| PR | Contents | Changeset | Retire plan on merge |
58-
| -------------------------- | --------------- | --------- | --------------------------------- |
59-
| **#D Deletion confidence** | Plan 3 complete | patch | `coverage-deletion-confidence.md` |
60-
| **#E Audit attribution** | Plan 4 complete | patch | `audit-delta-attribution.md` |
44+
| PR | Contents | Changeset | Retire plan on merge |
45+
| ------------------------ | --------------- | --------- | ---------------------------- |
46+
| **#E Audit attribution** | Plan 4 complete | patch | `audit-delta-attribution.md` |
6147

62-
Each PR: `harden-pr full` (includes plan retirement) → merge. Do not batch plans 3–4 into one PR.
48+
Each PR: `harden-pr full` (includes plan retirement) → merge.
6349

6450
---
6551

6652
## Current slice
6753

68-
**Active:** Plan 3 complete on `feat/coverage-confirmed-dead` — run **`/harden-pr full`** → PR **#D** → retire `coverage-deletion-confidence.md` on merge.
54+
**Active:** Plan 4 slice **4.1** on fresh branch from `main` after **#D** merges — `findingKey()` helper + unit tests.

docs/plans/coverage-deletion-confidence.md

Lines changed: 0 additions & 116 deletions
This file was deleted.

docs/roadmap.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ Predicate-as-API only — enrich row shape and audit deltas; no standalone pass/
9090
- [x] **Evidence chains on recipe rows** — shipped on `boundary-violations`, `deprecated-symbols`, `unimported-exports` (`reason` + `evidence_json`; includes `reexport_chain_possible` and `unresolved_import_blind_spot`). Contract: [golden-queries.md § Evidence columns](./golden-queries.md#evidence-columns-high-judgment-recipes). v2 optional: audit `added` attribution merge ([Moat A](./roadmap.md#moats-load-bearing)).
9191
- [ ] **Tiered lookup fast paths**`show` / exact-name recipe paths hit covering indexes first; document latency expectations in MCP tool descriptions. FTS and broad scans remain explicit fallbacks. Effort: S–M.
9292
- [x] **Graph-estimated CRAP recipe** — bundled `high-crap-score`: CRAP = `CC² × (1 - coverage/100)³ + CC` using `symbols.complexity`; **measured** `coverage` when ingested, else **graph-estimated** tiers (85% / 40% / 0% from test-file reachability over `dependencies` / `calls` / `test_suites`). Rows expose `coverage_source: measured | estimated`. Contract: [golden-queries.md § Coverage columns](./golden-queries.md#coverage-columns-crap--enrichment-recipes). Complements `high-complexity-untested` when no coverage file exists.
93-
- [ ] **Coverage-confirmed dead recipe** — bundled `coverage-confirmed-dead`: JOIN static dead-code predicate (uncalled exports, suppression-aware) with ingested `coverage` — rows carry `confidence: high` when callers = 0 and `coverage_pct = 0`, `medium` when coverage not ingested. Predicate columns only, no verdict primitive ([Moat A](./roadmap.md#moats-load-bearing)). Plan: [`plans/coverage-deletion-confidence.md`](./plans/coverage-deletion-confidence.md). Effort: L–M.
93+
- [x] **Coverage-confirmed dead recipe** — bundled `coverage-confirmed-dead`: static dead predicate (uncalled exports, suppression-aware) with **`confidence: high`** when ingested `coverage_pct = 0`, **`medium`** when unmeasured. Predicate columns only, no verdict primitive ([Moat A](./roadmap.md#moats-load-bearing)). Contract: [golden-queries.md § Confidence columns](./golden-queries.md#confidence-columns-deletion-confidence-recipes).
9494

9595
### Distribution & evaluation depth
9696

fixtures/golden/minimal/files-hashes.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
},
1414
{
1515
"path": "README.md",
16-
"content_hash": "2ddba8d7d07352340f7d76a8bbe542335cc84ef3a32681afb01ad3734929391c",
16+
"content_hash": "9f557281e7bed140f9ab0d8e792c7b22abcbbd6a718f01eeb5207e19f1f38259",
1717
"language": "md",
18-
"line_count": 59
18+
"line_count": 60
1919
},
2020
{
2121
"path": "package.json",

fixtures/golden/minimal/files-largest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
},
88
{
99
"path": "README.md",
10-
"line_count": 59,
11-
"size": 9819,
10+
"line_count": 60,
11+
"size": 9922,
1212
"language": "md"
1313
},
1414
{

fixtures/minimal/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,10 @@ bun run test:golden -- --update
5050
# Benchmark
5151
CODEMAP_ROOT="$(pwd)/fixtures/minimal" bun run benchmark
5252

53-
# Coverage ingest + killer recipe
53+
# Coverage ingest + killer recipes
5454
CODEMAP_ROOT="$(pwd)/fixtures/minimal" bun src/index.ts ingest-coverage coverage/coverage-final.json
5555
CODEMAP_ROOT="$(pwd)/fixtures/minimal" bun src/index.ts query --recipe untested-and-dead --json
56+
CODEMAP_ROOT="$(pwd)/fixtures/minimal" bun src/index.ts query --recipe coverage-confirmed-dead --json
5657
```
5758

5859
**Editor / `tsc`:** run `bun install` here so `react` + `@types/react` resolve `react/jsx-runtime` for `.tsx` (`jsx: "react-jsx"` in `tsconfig.json`).

templates/agent-content/rule/00-full.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ If the question matches any of these, use the index instead of grepping:
8787
| Deprecated symbols | `SELECT name, kind, file_path FROM symbols WHERE doc_comment LIKE '%@deprecated%'` |
8888
| Symbol coverage | `SELECT name, hit_statements, total_statements, coverage_pct FROM coverage WHERE file_path = '...'` |
8989
| Untested + dead exports | `codemap query --json --recipe untested-and-dead` |
90+
| Coverage-confirmed dead | `codemap query --json --recipe coverage-confirmed-dead` (sort by `confidence`) |
9091

9192
## When Grep / Read IS appropriate
9293

0 commit comments

Comments
 (0)