Repository navigation
perf(mcp): disclose retained-view guidance on demand - #9353
kaoru0822-kitauji wants to merge 10 commits into
Conversation
[Medium impact] The reviewed changes appear safe to merge. SummaryThe PR moves format-specific
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Compiled tool guidance] --> C[Shared guidance index]
B[Installed workflow guides] --> C
C --> D[search_guidance]
D --> E[Section locator]
E --> F[read_guidance_section]
A --> G[Tool discovery keywords]
Reviews (8) · Last reviewed commit: "docs(mcp): scope module guidance to reta..." · Reviewed by Greptile |
7d176ac to
229ebd4
Compare
|
Lane A cross-stack audit at Both Portable tests and Test shard 5/6 fail Source-derived cause: compiled selector guides are now indexed alongside packaged workflow guides, changing their ranking/ownership relationship. I am not claiming the newly selected guide is factually wrong. Please establish the intended workflow-versus-selector routing rule and make its regression coverage explicit; resolve the producing rule or strengthen an obsolete oracle rather than merely dropping the first-result assertion. Lane A #9352 extends this same first-result retrieval test, so the combined stack needs both workflow and selector lookups checked. No Lane B file or branch was modified in this audit. |
|
Maintenance claim for this session (2026-11-12): I am updating this PR in a fresh isolated worktree, merging current main a8527d4 into codex/mcp-context-guidance, reviewing existing feedback and preserving its focused scope. I will push normally after checking the remote head and refresh validation evidence. Please coordinate here before concurrent edits to this branch. |
|
Coordination from session |
inspect_analysis_viewadvertises 17,453 bytes of cross-domain instructions. Keep shared source/Evidence/paging rules inline (1,026 bytes, 94.1% smaller) and serve selectors through the existing guidance tools.Part of #9347 / #5861. Stacked on #9351, including its latest verification commit. Compiled documentation shares guidance digest/index/locator/capacity ownership. Hot/cold discovery searches the same content and includes it in policy identity. Canonical validation, Evidence, family exclusions and complete exports remain authoritative. No skill-source or managed skill inventory changes.
Deferred and combined verification
Head
9fd5eca98; Node 24.22.1 / npm 11.16.0 / macOS arm64, real MCP JS SDK 2.3.1 clients.stale_locator,stale_continuation, and both tools'bundle_unavailablemembers over legacy/full and modern/hot-cold. A malformed locator still givesinvalid_requestwithout structured success data. Restoring exact bundle bytes restores the original digest and locator; SDK output validation and listings stay correct throughout. Faults affect only temporary runtime copies; these cases are not fresh npm installations.autonegotiation verify hot/cold union guidance before and after session reset. HTTP intentionally composes the legacy server;autocorrectly falls back to2025-11-25, including unsolicited refresh notifications.72d5e72e6with the original missing-resultSDK error. They fail before the new guide lookup.2025-11-25, 246 tools) and modern/hot-cold (2026-07-28, 5 → 9 tools), plus independently installed SDK 1.32.2 legacy clients with both full and hot/cold catalogs. SDK 1's default output validator, unsolicited refresh notification and explicit relisting also pass. Root-union guidance is the first materializing call; compiled section retrieval, both union members, malformed-input errors, stable listings, authored OpenAPI facts, source deletion, retained reads and Evidence links all pass. The package has its own 150 production dependencies, without a worktree dependency symlink. The SDK 1 compatibility probes use a separate client installation and 30 s / 3 GiB process-family guards with 1-GiB Node heaps; neither guard fired. They are manual qualification, not a new CI dependency. Install scripts and optional dependencies were disabled; native providers were not exercised. Packed runtime is from229ebd49d(subsequent changes only extend lifecycle/HTTP tests); tarball SHA-1bf3d7148d20e36a2d0cda330080e73a974e3a58f.9fd5eca98: the exact-module handoff now promises retained facts and source locations, matching the workflow's actual result. It no longer promises original code. Six focused cases pass (guidance search, MCP retrieval, full/hot-cold compiled retained-facts workflows), pluscheck:fast.check:fastand touched formatting/diff checks pass. The task-specific first-result routing oracle remains; the broad query independently verifies both workflow and selector guidance and the latter's explicit handoff. Earlier build, documentation, test-discovery and HTTP checks remain recorded in the pinned qualifications below.Combined CI: manual qualification run 42559394989 targets exact stacked head
17e8deebfd0d66c01295d5159d21937864f85a0c(#9351 + #9353). It completed with 39 successful jobs, three failed jobs (one guidance-search assertion plus dependent aggregate gates), two skipped jobs, and one cancelled Apple artifact job. All 22 deferred-schema cases passed on Linux. The ambiguous-query ordering assertion is corrected ated307b8d5, with an explicit workflow handoff in the compiled JavaScript selector guide and separate broad-query and task-specific routing checks. Validation ated307b8d5passed 22 deferred cases, four guidance/MCP-boundary cases, two acceptance workflows andcheck:fast. The subsequent wording correction was checked with six guidance/MCP/acceptance cases andcheck:fast; the full 22-case matrix was not repeated for that prose-only change. Full current-head CI has not been rerun. The standalone source/Python jobs intentionally skip on full tier; they are not counted as passes. The Apple job hit its 15-minute workflow bound during native/process regressions; its coverage remains incomplete and no timeout was raised. This run is the feature branch, distinct from the locally qualified current-main combination below.Current-main qualification: combined feature
454d7121fplus pinned mainc78c8aed4, exact merged treef00ecd00409b2f85345d3fb20481f0f835f031ca, in a separate unpublished worktree with a fresh locked install. All 79 MCP boundary cases and 53 source cases pass, together with build,check:fastanddocs:check. The initial direct run passed 28 cases but two suites could not collect because generated.cache/mcp-tool-catalog.jsontest metadata was missing; the focused runner prepared it and both suites then passed all 51 cases without test changes or repeating the 28 passes. This qualifies upstream compatibility locally; it does not claim combined CI or change either PR's base.The matrix uses the repository's official SDK/Ajv validation fixture to share compiled validators, without dropping schema constraints. Context measurements below use the stock SDK default validator. The 12 cases are representative, not an exhaustive 24-cell product. Modern protocol behavior is exercised over stdio; HTTP uses its supported legacy protocol, including automatic fallback.
Review corrections
check:fastpass; no related cleanup remains.awaitAcknowledgementowner to race the marker against the actual request and a deadline, and joins the marker observer with all launched work after release infinally. Both real cancellation/reconnection cases pass in the full 20-case qualification; no related cleanup remains.subscriptions/listentool-list subscription (or the SDK convenience handler); registering a handler alone does not receive modern changes. The protocol distinction is now documented and exercised.Context measurements
Pinned main
72d5e72e6against measured implementation229ebd49d. Later test additions and the JavaScript guidance handoff are not a fresh token benchmark. Full initial name/description/input-schema context remains 70,308 → 67,164 estimated tokens, 246 tools. Fulltools/listresult JSON: 4,407,654 → 4,391,167 bytes; output schemas still dominate.Task: inspect an authored OpenAPI document, delete it, then read GET /items twice from retained Evidence. Candidate costs include guidance search/read and their hot/cold discovery. Latest qualification reran two fresh candidate sessions using the original harness/fixture; parent/view Evidence IDs match the pinned baseline and authored method/path/source pointers.
tiktoken 0.14.0 / o200k_base estimates count distinct input definitions, instructions, fixed question, every argument and text reply. Output schemas are separate transport costs. Actual model usage, repeated-turn prompt assembly, caching and agent selection are unmeasured. Hot/cold initial guidance-search documentation adds four estimated tokens.
Processes were fresh; filesystem caches were warm and unflushed. Baseline and follow-up samples are not contemporaneous. CPU sums waited-for harness/server children; family RSS is sampled at 50 ms and can miss short-lived peaks. Guards: 60 s / 3 GiB, 1-GiB Node heaps; none hit, normal cleanup completed. Single shared-host samples establish no latency or memory improvement. Earlier failed guidance pilots led to #9351 and remain excluded from successful-task measurements.
Scope decision: not applicable; existing documentation/discovery. Real deep providers, other OSes and application-specific automatic refresh remain unverified. Full defaults remain unchanged; large output-schema transport cost remains.
Author readiness
Human owner: @kaoru0822-kitauji