-
Notifications
You must be signed in to change notification settings - Fork 2k
chore: update spec.types.ts from upstream #2027
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,7 @@ | |
| * | ||
| * Source: https://github.com/modelcontextprotocol/modelcontextprotocol | ||
| * Pulled from: https://raw.githubusercontent.com/modelcontextprotocol/modelcontextprotocol/main/schema/draft/schema.ts | ||
| * Last updated from commit: 71e306956a4959c9655e5036be215d41986596e6 | ||
| * Last updated from commit: f7e99af6417ec978233d8e27e1ac878b12106542 | ||
| * | ||
| * DO NOT EDIT THIS FILE MANUALLY. Changes will be overwritten by automated updates. | ||
| * To update this file, run: pnpm run fetch:spec-types 2026-07-28 | ||
|
|
@@ -1317,7 +1317,7 @@ export interface SubscriptionsListenRequest extends JSONRPCRequest { | |
| * @see {@link MetaObject} for key naming rules and reserved prefixes. | ||
| * @category `subscriptions/listen` | ||
| */ | ||
| export interface SubscriptionsListenResultMeta extends ResultMetaObject { | ||
| export interface SubscriptionsListenResultMetaObject extends ResultMetaObject { | ||
| /** | ||
| * Identifies the subscription stream this response closes, so the client can | ||
| * correlate it with the originating subscription — mirroring the same key on | ||
|
Comment on lines
1317
to
1323
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 This re-pull (71e30695 → f7e99af6) renames the exported Extended reasoning...What the bug isThis spec re-pull (71e30695 → f7e99af6) makes two changes to the 2026-07-28 anchor file with no companion update anywhere else in the tree:
The anchor file exists precisely so the drift-guard test trips CI when the spec moves — and it trips three ways here, but the PR ships only the anchor, leaving the tree red. Verified failures (each reproduced empirically at the PR head, 36c2108)A) B) Export-count pin fails. The test's C) Comprehensive-coverage check fails. The Step-by-step proof
Why nothing existing prevents itAll prior review comments on this PR cover the earlier 71e30695-era deltas (the How to fixOne companion port alongside the anchor update:
Per the repo's own REVIEW.md Schema Compliance rule ("confirm the |
||
|
|
@@ -1341,7 +1341,20 @@ export interface SubscriptionsListenResultMeta extends ResultMetaObject { | |
| * @category `subscriptions/listen` | ||
| */ | ||
| export interface SubscriptionsListenResult extends Result { | ||
| _meta: SubscriptionsListenResultMeta; | ||
| _meta: SubscriptionsListenResultMetaObject; | ||
| } | ||
|
|
||
| /** | ||
| * A successful response from the server for a {@link SubscriptionsListenRequest | subscriptions/listen} | ||
| * request, sent when the server tears the subscription down gracefully. | ||
| * | ||
| * @example Subscription closed gracefully response | ||
| * {@includeCode ./examples/SubscriptionsListenResultResponse/listen-closed-response.json} | ||
| * | ||
| * @category `subscriptions/listen` | ||
| */ | ||
| export interface SubscriptionsListenResultResponse extends JSONRPCResultResponse { | ||
| result: SubscriptionsListenResult; | ||
| } | ||
|
Comment on lines
+1346
to
1358
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 Upstream commit f7e99af6 changed Extended reasoning...What the bug isThis re-pull (71e30695 → f7e99af6) creates a situation none of the prior twin/corpus comments cover: the anchor and its generated That makes the OPERATIVE lifecycle rule 4 ( Why the refresh is mutually blockingUpstream did add the example this hunk's JSDoc references:
Why existing CI doesn't catch the desyncThe sha-lock in Step-by-step proof
Relationship to prior commentsThis is not a duplicate of the existing companion-port comments: the confirmed spec.types finding on this PR scopes the drift-guard pins and the missing wire How to fixTwo workable scopings for the (already-blocking) companion port:
Either way, the twin manifest's |
||
|
|
||
| /** | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 Prose sweep to fold into the already-blocking companion port: (1) the rename
SubscriptionsListenResultMeta→SubscriptionsListenResultMetaObjectstales six SDK comments that cite the old spec export as a spec citation (listenRouter.ts:108/:308, server.ts:247, buildSchemas.ts:1073, createMcpHandlerListen.test.ts:256, serveStdioListen.test.ts:125) — none covered by the existing line-1323 companion-port comment, which enumerates only code-symbol sites; (2) the newSubscriptionsListenResultResponsemakes the pre-existing justification comment at encodeContract.ts:49-51 ("subscriptions/listen … never emits a JSON-RPC result … per the spec") unambiguously false, since the spec now formalizes exactly that response wrapper and the SDK's own listenRouter emits the graceful-close listen result on both transports. Both fixes are comment-only: sweep the six citations to the new name, and rewrite the encodeContract justification (the functional exclusion from EXTENDED_RESULT_TYPE_METHODS stays correct — listen results are always 'complete'). The encodeContract comment is pre-existing (that file is untouched by this PR), but the companion port this sync forces touches exactly that wire surface, so it's the right moment to fix it.Extended reasoning...
Part 1 — rename stales six spec-citation comments
This sync renames the anchor export
SubscriptionsListenResultMeta→SubscriptionsListenResultMetaObject(spec.types.2026-07-28.ts:1320, plus the_metareference at :1344). Six SDK comments cite the old name as a spec citation, and after this PR merges, grep forSubscriptionsListenResultMeta\bin the anchor finds nothing — the cited spec export no longer exists:packages/server/src/server/listenRouter.ts:108— "graceful-close result's_meta(the spec'sSubscriptionsListenResultMeta…"packages/server/src/server/listenRouter.ts:308— "results'_meta(the spec'sSubscriptionsListenResultMetaextends…"packages/server/src/server/server.ts:247— "SubscriptionsListenResultMetaextendsResultMetaObject, so it carries…"packages/core-internal/src/wire/rev2026-07-28/buildSchemas.ts:1073— "Anchor SubscriptionsListenResultMeta — required subscriptionId stamp…" (explicitly cites the anchor type by its now-dead name)packages/server/test/server/createMcpHandlerListen.test.ts:256andpackages/server/test/server/serveStdioListen.test.ts:125— same citation in test commentsNot a duplicate of the existing blocking companion-port comment on line 1323: that comment enumerates only code-symbol sites (the
test/spec.types.2026-07-28.test.ts:807parity key, the export-count/coverage pins, the missing Wire2026SubscriptionsListenResultResponseSchema, and the optional SDK-sideSubscriptionsListenResultMetaSchemarename in types.ts:384 / schemas.ts:990 / the codemod mapping). Fixing everything on that list still leaves these six prose citations pointing at a nonexistent spec export — squarely the repo's Completeness recurring catch (surviving instances of the old form after a rename). CHANGELOG entries citing the old name are historical records and need no edit.Proof: merge this PR, then run
grep -n 'SubscriptionsListenResultMeta\\b' packages/core-internal/src/types/spec.types.2026-07-28.ts→ zero hits. Now open listenRouter.ts:108: the comment tells a reader the graceful-close_metashape comes from "the spec'sSubscriptionsListenResultMeta" — a symbol the spec anchor no longer exports. A reader cross-referencing the anchor finds onlySubscriptionsListenResultMetaObjectand has to guess whether the SDK comment refers to a deleted type or a renamed one.Part 2 — encodeContract.ts justification comment is now unambiguously false
packages/core-internal/src/wire/rev2026-07-28/encodeContract.ts:49-51justifies excludingsubscriptions/listenfromEXTENDED_RESULT_TYPE_METHODSwith: "subscriptions/listen is NOT in this set: it never emits a JSON-RPC result — termination is stream close (HTTP) ornotifications/cancelled(stdio) per the spec." Every factual claim in that sentence is wrong:SubscriptionsListenResult("this result is sent only when the server tears the subscription down", spec.types.2026-07-28.ts:1331-1346), and this PR addsSubscriptionsListenResultResponse(:1348-1358) formalizing the exact JSON-RPC success response the comment says never exists "per the spec".writeFrameof{jsonrpc, id, result: {resultType: 'complete', _meta: {subscriptionId, serverInfo}}}; interface prose at :112-117: "closeAll(): emits the empty subscriptions/listen JSON-RPC result"). The stdio router likewise returns graceful-closeListenCloseFrameresults fromStdioListenRouter.teardownAll(listenRouter.ts:271, :406-408) — so on stdio, graceful termination is the listen result, notnotifications/cancelled.Why it matters: this is the normative justification on the encode contract that decides which methods may pass a non-
'complete'resultTypethrough the 2026 wire stamp. A maintainer doing the companion port this PR forces (which per the existing blocking comment must add a Wire2026SubscriptionsListenResultResponseSchemaor an owned allowlist entry) reads "listen never emits a result" and could wrongly conclude the listen graceful-close frames bypass the encode/stamping contract — when the entry-built frames deliberately mirror it (resultType + serverInfo stamps at listenRouter.ts:181-184).Pre-existing scope: encodeContract.ts is not modified by this PR, and the comment was already false against the pre-PR anchor's
SubscriptionsListenResultand the listenRouter implementation (it survived #2513, the very companion port that added serverInfo stamping onto listen graceful-close results). This PR's new response wrapper merely makes the "per the spec" attribution unambiguously false. It does not block on its own.Fix
Both fixes are comment-only, no runtime or CI effect, and belong in the companion port this PR already forces:
s/SubscriptionsListenResultMeta/SubscriptionsListenResultMetaObject/across the six citation sites.EXTENDED_RESULT_TYPE_METHODSstays as-is — it remains correct.