|
| 1 | +# Agent enrichment wave — tracer workflow (plans 1–4) |
| 2 | + |
| 3 | +> **Status:** in-flight · **Scope:** four P2 plans ranked by consumer/agent ROI |
| 4 | +> |
| 5 | +> **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). |
| 6 | +> |
| 7 | +> **Plans (execution order):** [evidence-chains](./evidence-chains-on-recipe-rows.md) → [graph-estimated-crap](./graph-estimated-crap.md) → [coverage-deletion-confidence](./coverage-deletion-confidence.md) → [audit-delta-attribution](./audit-delta-attribution.md) |
| 8 | +
|
| 9 | +--- |
| 10 | + |
| 11 | +## Shared conventions (locked) |
| 12 | + |
| 13 | +| Convention | Applies to | |
| 14 | +| ------------------------------------------------------------------------------------- | ---------- | |
| 15 | +| **Moat A** — no `pass`/`fail` engine verdict; extra columns only | All four | |
| 16 | +| **`reason` TEXT** — machine code + short clause where useful | #1, #3 | |
| 17 | +| **`evidence_json` TEXT** — bounded JSON array (≤3 hops) | #1 | |
| 18 | +| **`confidence` / `coverage_source` / `attribution`** — recipe-specific enums | #2, #3, #4 | |
| 19 | +| **Golden update per slice** — `fixtures/golden/minimal/*.json` + `scenarios.json` | All | |
| 20 | +| **`/harden-pr lite`** after each tracer commit; **`/harden-pr full`** before PR merge | All | |
| 21 | + |
| 22 | +**Cross-plan synergy:** #1 `reason` on recipes complements #4 `attribution` on audit `added` rows (optional merge in evidence plan v2). #2 and #3 both touch coverage semantics — ship #2 before #3 so agents have CRAP tiers before deletion-confidence narrows rows. |
| 23 | + |
| 24 | +--- |
| 25 | + |
| 26 | +## Plan 1 — Evidence chains (`evidence-chains-on-recipe-rows.md`) |
| 27 | + |
| 28 | +| Slice | Deliverable | Verify | |
| 29 | +| ----------------------------- | ------------------------------------------------------------------ | --------------------- | |
| 30 | +| **1.0 contract** | `docs/golden-queries.md` § evidence columns; one architecture line | doc review | |
| 31 | +| **1.1 `boundary-violations`** | `reason` + `evidence_json` in SQL; `.md` + golden | `bun run test:golden` | |
| 32 | +| **1.2 `deprecated-symbols`** | caller hops in `evidence_json` | golden + matrix | |
| 33 | +| **1.3 `unimported-exports`** | `re_export_chains` LEFT JOIN; `reason` variants | golden | |
| 34 | +| **1.4 agent surface** | `templates/agent-content/rule/00-full.md` one-liner | consumer check | |
| 35 | + |
| 36 | +**Open decisions (locked for v1):** E.2 `evidence_json` only (not typed columns); E.1 SQL-only (no query-engine post-processor). |
| 37 | + |
| 38 | +--- |
| 39 | + |
| 40 | +## Plan 2 — Graph-estimated CRAP (`graph-estimated-crap.md`) |
| 41 | + |
| 42 | +| Slice | Deliverable | Verify | |
| 43 | +| ------------------------- | --------------------------------------------------------------- | ----------------- | |
| 44 | +| **2.0 spike** | Reachability CTE on `fixtures/minimal` (script or ad-hoc query) | manual row counts | |
| 45 | +| **2.1 recipe** | `high-crap-score.sql` + `.md`; `scenarios.json` | `test:golden` | |
| 46 | +| **2.2 measured override** | golden with `ingest-coverage` setup | golden matrix | |
| 47 | +| **2.3 cross-link** | `high-complexity-untested.md` points at CRAP when no ingest | doc | |
| 48 | + |
| 49 | +**Grill before 2.1 if spike ambiguous:** Q1 type-only imports in walk (default: value edges only); Q2 recipe id `high-crap-score`. |
| 50 | + |
| 51 | +--- |
| 52 | + |
| 53 | +## Plan 3 — Coverage deletion confidence (`coverage-deletion-confidence.md`) |
| 54 | + |
| 55 | +| Slice | Deliverable | Verify | |
| 56 | +| -------------------------- | -------------------------------------------------------------- | ------------- | |
| 57 | +| **3.1 recipe fork** | `coverage-confirmed-dead.sql` + `.md` from `untested-and-dead` | query CLI | |
| 58 | +| **3.2 golden no-ingest** | `confidence: medium` policy (per D.4) | `test:golden` | |
| 59 | +| **3.3 golden with ingest** | fixture coverage → `confidence: high` | `test:golden` | |
| 60 | +| **3.4 classifier** | intent keywords if needed | optional | |
| 61 | + |
| 62 | +**Grill before 3.1:** Q3 without ingest — `medium` rows vs empty + stderr (plan D.4 leans medium rows). |
| 63 | + |
| 64 | +--- |
| 65 | + |
| 66 | +## Plan 4 — Audit delta attribution (`audit-delta-attribution.md`) |
| 67 | + |
| 68 | +| Slice | Deliverable | Verify | |
| 69 | +| -------------------------------- | --------------------------------------- | ---------------------- | |
| 70 | +| **4.1 `findingKey()`** | pure helper + unit tests | `audit-engine.test.ts` | |
| 71 | +| **4.2 `deprecated` delta** | `attribution` on `added[]` for `--base` | branch fixture test | |
| 72 | +| **4.3 `files` + `dependencies`** | generalize key sets from base cache | tests | |
| 73 | +| **4.4 transport parity** | MCP/HTTP envelope match CLI | handler test | |
| 74 | +| **4.5 docs** | `architecture.md` envelope § | doc | |
| 75 | + |
| 76 | +--- |
| 77 | + |
| 78 | +## PR cadence |
| 79 | + |
| 80 | +| PR | Contents | Changeset | |
| 81 | +| -------------------------- | ------------------------------------ | --------- | |
| 82 | +| **#A Evidence wave 1** | Slices 1.0–1.1 (boundary-violations) | patch | |
| 83 | +| **#B Evidence wave 2** | Slices 1.2–1.4 | patch | |
| 84 | +| **#C CRAP recipe** | Plan 2 complete | patch | |
| 85 | +| **#D Deletion confidence** | Plan 3 complete | patch | |
| 86 | +| **#E Audit attribution** | Plan 4 complete | patch | |
| 87 | + |
| 88 | +Each PR: `harden-pr full` → merge. Do not batch plans 1–4 into one PR. |
| 89 | + |
| 90 | +--- |
| 91 | + |
| 92 | +## Current slice |
| 93 | + |
| 94 | +**Active:** Plan 1 shipped in [**PR #174**](https://github.com/stainless-code/codemap/pull/174) (awaiting merge) — next: Plan 2 spike **2.0** (`graph-estimated-crap.md`). |
0 commit comments