feat(mcp): expose conservative tools list cache contract - #170
Merged
Conversation
|
Warning Review limit reachedNext included review available in 7 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
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 |
seonghobae
marked this pull request as ready for review
August 24, 2026 11:00
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.
Direct-main MCP discovery refinement after PR #168 merged into protected main.
Buyer-visible gap
Protected main now contains deterministic MCP
2026-07-28tools/callrouting and the reviewed tool-to-action catalog, but a transport adapter still needs a typedtools/listrequest/result boundary. Without it, an adapter could invent result disposition, freshness/shareability, accept pagination state OriginWeave never issued, or treat malformed routing metadata differently fromtools/call.Current implementation
The exact branch:
MCP_TOOL_CATALOGused by routing;McpResultType::Complete,ttl_ms = 0,McpCacheScope::Private, andnext_cursor = None;tools/listrouting/body agreement;Current dependency / ancestry
Protected main:
b05d5acca82b9d916ada2c8e82f59f92a89817e1.Exact #170 head:
5bb5a7bb934d4282c30b0ea4f4b2efc9a00a1f2d.After #168 merged, this branch was retargeted to
mainand reconstructed non-destructively from the protected-main tree. The sharedtools/callhardening from main was preserved; only the intendedtools/listboundary, tests, doctoring, changelog, and current-main MCP documentation reconciliation remain in the direct-main delta. GitHub currently reports the PR mergeable.Repair lineage
An earlier audit found that
tools/listcompared arbitrary routing/body method strings without applying the same bounded method syntax as protected-maintools/call. A regression on test-only head8b83eafe9579b4504044c0bed963430267c90408required malformed and oversized method metadata to fail asInvalidMethod; no exact-head CI run was generated for that transient test-only head, so it remains structural RED evidence only. Production added the shared method bound and the error-contract test was strengthened after exact coverage exposed the newInvalidMethoddisplay arm as otherwise unmeasured.A fresh exact-current audit then found a second resource-validation-order defect: the required protocol-version header and structured request protocol metadata were compared to each other while still arbitrary-length attacker-controlled
&strvalues. This allowed work proportional to both untrusted strings before the fixed supported-version guard.The new regression reached exact test-only head
9d1cfd08a7aa4203f697a40fd3e5fb30bbbd4d31. CI run32708025503, Rust job97373217858, passed repository contracts and canonical formatting, then failed the semantic testmcp_tools_list_bounds_protocol_metadata_before_cross_field_comparison: the oversized protocol value producedProtocolVersionHeaderBodyMismatchwhere the bounded contract requiredUnsupportedProtocolVersion.Production repair head
c25fb51d01ee318cc49d2fe8223e6427d7f8e1b0now rejects either protocol-version value when its byte length exceedsMCP_PROTOCOL_VERSION.len()before comparing the two untrusted values. Normal bounded mismatch semantics remain unchanged. Subsequent documentation-only commits reconciled the MCP contract with current protected main without changing the repaired production boundary.Exact-current evidence
On unchanged exact head
5bb5a7bb934d4282c30b0ea4f4b2efc9a00a1f2d:32709650376: success;97378116870: repository contracts, canonical formatting, locked workspace/all-target check, full tests, strict Clippy, and rustdoc success;97378117285: exact owned-production function/line/region/branch enforcement success;5bb5a7bb934d4282c30b0ea4f4b2efc9a00a1f2dand ended withproduction functions, lines, regions, and branches are 100% covered;9513635865, SHA-2567db543011131d5f20639f619f0abcf83e244f5a6d8aa491d0a4e8eee0c9810e5;32709650277: success;32709650285: success;32709650296: success;Skipped/predecessor/status/model evidence is not promoted to success. All current-head native gates exposed for this branch are complete and successful, so the PR is ready for independent review; no approval is inferred from CI or scanner state.
Truth boundary
This is an adapter contract, not a complete MCP server. It does not serialize JSON-RPC/HTTP, authenticate a client/server, implement OAuth, invoke a tool, perform browser I/O, persist discovery state, or implement general pagination. A future transport adapter must serialize this reviewed value without widening routing, cache, metadata, or OriginWeave authority semantics.
This scheduled actor does not merge, self-approve, force-push, destructively rebase, alter workflows, add secrets, weaken checks, tag, or publish.