feat: route surface-enrichment for retrieval — opt-in, measured +0, default off#489
Merged
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 fullrank(): 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 staysfalse; report saved.What
collectRoutes(files, cwd)split out ofroute-table.analyze(markdown byte-identical, tested)enrichWithSurfaces(index, cwd): deterministicroute METHOD /pathpseudo-sigs on the defining file — sorted, deduped, copy-on-write (cached arrays never mutated), idempotentretrieval.surfaceEnrichment: falsewired non-fatally intoask/--query/query_contextTests
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