Skip to content

feat: route surface-enrichment for retrieval — opt-in, measured +0, default off#489

Merged
manojmallick merged 3 commits into
developfrom
feat/surface-enrichment-488
Jul 12, 2026
Merged

feat: route surface-enrichment for retrieval — opt-in, measured +0, default off#489
manojmallick merged 3 commits into
developfrom
feat/surface-enrichment-488

Conversation

@manojmallick

Copy link
Copy Markdown
Owner

Closes #488. The last open §7.4 Phase-2 build — implemented, measured, and shipped dark per the gate, completing the pattern set by the call-graph boost.

The measurement

npm run benchmark:surface-enrichment — 280 route pseudo-signatures added across 18 repos, 90 tasks through the full rank(): arm A 80% / arm B 80%, delta +0, no repo moved (arm values are harness-internal, not headline-comparable; the delta is the gate). The corpus is file-discovery-flavored and never asks route-worded questions — so the fixture test proves the value case directly: a route-worded query retrieves the controller only when enrichment is on. Default stays false; report saved.

What

  • collectRoutes(files, cwd) split out of route-table.analyze (markdown byte-identical, tested)
  • enrichWithSurfaces(index, cwd): deterministic route METHOD /path pseudo-sigs on the defining file — sorted, deduped, copy-on-write (cached arrays never mutated), idempotent
  • retrieval.surfaceEnrichment: false wired non-fatally into ask / --query / query_context
  • Headline BM25 harness untouched — 87.8% reproduces after the change

Tests

4 new (test/integration/surface-enrichment.test.js): rows + unchanged markdown, copy-on-write + determinism + idempotence, the retrieval value case, config-gated CLI wiring. Full suite 118/118 + unit green; tests meta 124.

Supply-chain gate: local audit PASS (tarball 546KB/159 files).

🤖 Generated with Claude Code

…loses #488)

The last open §7.4 Phase-2 build (Retrieval ceiling). Route rows from
the map analyzer never reached the rankable index — a query like
'payment webhook route' could not match a controller whose signatures
never mention the path.

- route-table: analyze split into collectRoutes(files,cwd) → rows +
  markdown formatting (output byte-identical, tested)
- src/retrieval/enrich-from-maps.js: enrichWithSurfaces(index, cwd) —
  appends deterministic pseudo-signatures ('route POST /api/x') to the
  defining file's sig list; sorted, deduped, copy-on-write so cached
  arrays are never mutated; idempotent
- retrieval.surfaceEnrichment: false — wired non-fatal into ask,
  --query, and query_context (same pattern as callGraphBoost)
- MEASURED (benchmark:surface-enrichment, saved report): 280 route
  pseudo-sigs across 18 repos, 90 tasks through full rank() — delta +0,
  no repo moved. The corpus is file-discovery-flavored and never asks
  route-worded questions; the fixture test proves the value case
  directly (route query retrieves the controller ONLY when enriched).
  Per the gate the default stays OFF; headline BM25 reproduces 87.8%
- 4 integration tests (124 derived); bundle rebuilt, repro green
@manojmallick manojmallick merged commit 9587c9f into develop Jul 12, 2026
5 checks passed
@manojmallick manojmallick deleted the feat/surface-enrichment-488 branch July 12, 2026 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant