fix(mcp): renumber deduped guided tour steps - #1889
Conversation
|
✅ Health of changed files: 10.0 (unchanged) 📋 At a glance ✅ Health gate: passed 🔎 More signals (1)🔥 Hotspot touched (1)
👀 Suggested reviewers @RaghavChamadiya 📊 See the full report for this PR |
19bb722 to
2f6f577
Compare
|
Thanks @mikemikimike. I am taking #1878 for #1872, which landed about four hours earlier with the identical Your test is the better one though, and I would rather have it than not. #1878's case feeds four steps that do not deduplicate, so the orders are 1, 2, 3, 4 before and after the fix and the assertion assert [step["order"] for step in result["guided_tour"]] == [1, 2, 3]
assert [step["target_path"] for step in result["guided_tour"]] == ["a.py", "b.py", "d.py"]
assert json.loads(page.metadata_json) == metadataChecking the target paths as well as the numbers is what proves the renumbering follows the surviving steps rather than just producing a tidy sequence, and asserting So: once #1878 merges, send this as a test-only PR against
|
|
Thanks @RaghavChamadiya. After the main-branch merge, this PR is now test-only as requested. I ran Ruff on Verification:
The full test suite was not run. |
Summary
guided_toursteps after consecutive duplicate steps are removed.1, 2, 4becoming1, 2, 3in the MCP response.Implementation
The persisted overview metadata is left unchanged. Renumbering happens only while building the MCP projection, so other consumers of the stored tour retain their original ordering.
Compatibility
No API fields were added or removed. The
ordervalues are now contiguous for deduplicated MCP tour responses, matching the response hint's sequential-walk semantics.Validation
python -m py_compile packages/server/src/repowise/server/mcp_server/tool_overview.py tests/unit/server/mcp/test_overview_outline.py— passed locally.