Repository navigation
test(mcp): prove facets forwards scoped filters - #1570
Conversation
Problem: #873 now exposes query-scoped facets through MCP, but the last slice only proved the published schema and witness. A runtime regression could still drop filters before calling the shared facets contract. What changed: add a focused MCP facets contract test covering query/provider forwarding into ConversationQuerySpec and the unscoped no-filter path calling poly.facets(None). Verification: pytest -q tests/unit/mcp/test_facets_tool_contract.py tests/unit/mcp/test_query_tool_schema_derivation.py --tb=short; devtools verify --json. Ref #873
|
Warning Review limit reached
Your plan includes 1 review of capacity. Refill in 14 minutes and 41 seconds. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more review capacity refills, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Adds a focused runtime contract for the MCP
facetstool so the query-scoped facets surface is pinned beyond the published schema witness.Problem
#873 requires scoped facets across CLI/API/daemon/MCP. #1569 exposed
queryin the MCP facets input schema, but a regression could still accept the parameter and then drop it before calling the sharedPolylogue.facets()contract.Solution
The new MCP facets contract test invokes the registered tool with
query+providerand asserts that it forwards aConversationQuerySpeccarrying both filters. It also covers the no-filter path and asserts that MCP callspoly.facets(None)for the global view.Verification
pytest -q tests/unit/mcp/test_facets_tool_contract.py tests/unit/mcp/test_query_tool_schema_derivation.py --tb=short→ 9 passedruff format --check tests/unit/mcp/test_facets_tool_contract.py tests/unit/mcp/test_tool_contracts.py→ passedruff check tests/unit/mcp/test_facets_tool_contract.py tests/unit/mcp/test_tool_contracts.py→ passedmypy tests/unit/mcp/test_facets_tool_contract.py tests/unit/mcp/test_tool_contracts.py→ passeddevtools verify --json→ PASS, 66 affected pytest nodes selecteddevtools verify --quick→ PASSRef #873