Repository navigation
feat(registry): scope cross_repo_search to a subset of the registry - #915
mohammad-rj wants to merge 1 commit into
Conversation
536fd84 to
08c8c02
Compare
code-review-graph reviewOverall risk: 0.40 (MEDIUM) — 16 changed function(s)/class(es), 29 affected flow(s), 2 test gap(s) Risk-scored changes
Affected execution flows
Test gaps
Token savings: this graph-backed report used ~28,168 fewer tokens (~76%) than reading every changed file in full (estimated, chars/4 approximation). Powered by code-review-graph — local-first analysis; no code leaves the CI runner. |
|
Good feature and the right shape — a pure filter over the already-trusted registry, backward compatible to the byte (no argument, One thing blocks it, and it goes straight at what this project is for.
The budget test can't catch it, which is worth knowing: Second, colliding names silently search a subset.
That is the sibling-repo topology #914 and #311 use as the motivating example ( Smaller ones, worth folding into the same push:
Gates are green — 2994 passed, ruff and mypy clean, 13/13 checks — so this is about bounds and resolution semantics, not correctness of the plumbing. |
cross_repo_search always fanned out over the whole registry, and a registry that spans unrelated products let every repository contribute its best local rank to the top of the merged list. The existing bounds cap the size of that response but not its relevance, so a query aimed at one product still paid for all of them, and the caller had to read and discard the rest. Adds an optional `repos` argument, on the func and on the MCP tool. Omitted or empty keeps the current behaviour exactly, so no existing caller changes. Given names, entries are matched by alias first and then by the folder name of their path, and only those repositories are opened. Selection preserves registry order, so the caller cannot change the rank-interleave tie-breaker by reordering the argument, and the merge from tirth8205#619 is untouched. Names matching no registry entry come back in `unknown` instead of being dropped: a silently skipped repository is indistinguishable from one that had no matches, which is the same reason the existing missing-db skip is hard to diagnose. A selection matching nothing searches nothing rather than falling back to the full registry. Closes tirth8205#914 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
08c8c02 to
18e5461
Compare
|
All of it is addressed in the amended commit. Bounds. The budget test. The entry now carries Resolution. Docs. The MCP docstring and Verification: full suite 3,003 passed, coverage 85.06%, ruff and mypy clean. |
|
Integrated on |
|
Merged into |
…o a subset of the registry Port the reviewed token-efficiency implementation with targeted regression coverage. Source-PR: tirth8205#915 Maintainer corrections and scope extraction applied where needed.
Closes #914
Problem
cross_repo_searchfans out over the whole registry with no way to narrow it. On a registryof 10 repositories spanning four unrelated products, one query returned 23 results across all
10, with the two functions it was actually about ranked below hits from products that could
not answer it. The rank-interleave from #619 and
_MAX_CROSS_REPO_RESULTSbound the size ofthat response, not its relevance. #311 makes this the normal case rather than an edge case:
one IDE-fixed cwd over many sibling repositories, all registered.
Change
reposoncross_repo_search_funcandcross_repo_search_tool. Omitted or emptykeeps current behaviour exactly.
the argument.
unknownrather than dropped, and a selection matchingnothing searches nothing rather than the full registry.
Same query scoped to one product's three repositories: 5 results across 3, both wanted
functions in the top three.
Tests
Nine new tests: four on the selection helper, four on the func end to end, one on the MCP tool
forwarding the argument. Full suite passes; ruff and mypy clean. Docs updated in
README.md,docs/COMMANDS.mdand the tool docstrings.