Open
Conversation
Treat root scope aliases in the shared scoped-search helper so callers like plan_change can search from the repository root with scope='.' or an explicit empty scope. This fixes the failure mode where the shared hierarchy collector treated '.' as a literal hierarchy path and returned no entities, even though the same query succeeded when unscoped or when given a concrete semantic path. Keep the change in rpg-nav search instead of adding MCP- or planner-specific normalization so all shared search consumers inherit the same behavior automatically. The scope parser now maps whole-input root aliases to the full graph, preserves '.' as a root alias inside comma-separated scope lists, and ignores empty trailing scope fragments so malformed lists do not widen unexpectedly. Add search-layer regressions for root-scope parity and empty-fragment handling, plus a planner-level regression covering the reported user-visible failure mode.
ebb5ceb to
53bfb24
Compare
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.
PR: Fix root scope handling for
plan_changeand shared scoped searchSummary
This change fixes root-scope handling in shared navigation search so
plan_change(scope=".")andplan_change(scope="")behave like unscoped repository-root searches.The fix is intentionally placed in the shared scoped-search helper rather than in MCP glue or planner-specific logic, so all downstream search consumers inherit consistent scope semantics.
Problem
plan_changecould returnNo relevant entities foundwhen called withscope=".", even though the same query succeeded with no scope or with an explicit semantic path.That happened because the shared scope collector treated
.as a literal hierarchy path instead of a repository-root alias.What Changed
Production code
Updated
crates/rpg-nav/src/search.rs:scope.trim()equal to"."or""now maps to the full graph"."segment inside comma-separated scopes also maps to the full graphThis keeps existing multi-scope union behavior intact while making root scope work consistently.
Tests
Added shared search-layer regressions in
crates/rpg-nav/tests/search.rs:test_root_scope_matches_unscoped_searchtest_multi_scope_with_empty_segment_does_not_widenAdded planner-level symptom coverage in
crates/rpg-nav/src/planner.rs:test_plan_root_scope_matches_unscoped_searchWhy This Approach
The bug was caused by shared scope interpretation, not by MCP parameter parsing.
Fixing it in
rpg-navsearch has a few advantages:Validation
Targeted local tests
Passed:
Workspace checks
Passed:
Note: full
cargo test --workspacecan be blocked on Windows when the worktree-builtrpg-mcp-server.exeis actively running, because Cargo cannot replace the locked executable. When the MCP server process is stopped, the workspace test run can proceed normally.Live MCP verification
Verified against the rebuilt
rpg_developmentMCP server:Both returned valid change plans.
Files Changed
crates/rpg-nav/src/search.rscrates/rpg-nav/src/planner.rscrates/rpg-nav/tests/search.rsReview Notes
crates/rpg-mcp/src/tools.rs