@unbrained/pm-cli 2026.8.24 → 2026.8.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +46 -0
  3. package/dist/cli-bundle/bundle-manifest.json +149 -149
  4. package/dist/cli-bundle/chunks/chunk-E2GCFJSU.js +35 -0
  5. package/dist/cli-bundle/chunks/{chunk-TEQDR5KI.js → chunk-ES25LX3D.js} +62 -62
  6. package/dist/cli-bundle/chunks/{chunk-I5Q7QSZX.js → chunk-FRDWWB6R.js} +2 -2
  7. package/dist/cli-bundle/chunks/{chunk-X7WWQDYQ.js → chunk-ICQ3RVIY.js} +2 -2
  8. package/dist/cli-bundle/chunks/{chunk-YOLLRCLY.js → chunk-IV64RJVE.js} +2 -2
  9. package/dist/cli-bundle/chunks/{chunk-L22NP5MA.js → chunk-KBFP3E4E.js} +86 -86
  10. package/dist/cli-bundle/chunks/{chunk-AGUL3HUT.js → chunk-MVYLQ67M.js} +2 -2
  11. package/dist/cli-bundle/chunks/{chunk-DJNJBWAQ.js → chunk-S4U76VZF.js} +2 -2
  12. package/dist/cli-bundle/chunks/{chunk-IW72J5FW.js → chunk-UKBCRPA2.js} +2 -2
  13. package/dist/cli-bundle/chunks/chunk-WRHJ3MB6.js +8 -0
  14. package/dist/cli-bundle/chunks/{chunk-ZAVCS2GH.js → chunk-ZNRLJ54C.js} +60 -60
  15. package/dist/cli-bundle/chunks/{register-list-query-37A4P6O4.js → register-list-query-EMCPMICY.js} +2 -2
  16. package/dist/cli-bundle/chunks/{register-mutation-TBJDHYIT.js → register-mutation-OJ67ABCB.js} +3 -3
  17. package/dist/cli-bundle/chunks/{register-operations-WRZNEBUM.js → register-operations-H2GLP7LT.js} +2 -2
  18. package/dist/cli-bundle/chunks/{register-setup-H4PDLACD.js → register-setup-GLZAHLVI.js} +2 -2
  19. package/dist/cli-bundle/focused-chunks/{chunk-IMWTYKII.js → chunk-4K2II4TV.js} +2 -2
  20. package/dist/cli-bundle/focused-chunks/chunk-4XNH2HM7.js +2 -0
  21. package/dist/cli-bundle/focused-chunks/{chunk-GJR6YEMR.js → chunk-57XY346D.js} +2 -2
  22. package/dist/cli-bundle/focused-chunks/{chunk-4WP7LNE3.js → chunk-66VGB23P.js} +2 -2
  23. package/dist/cli-bundle/focused-chunks/chunk-72T6JGAE.js +50 -0
  24. package/dist/cli-bundle/focused-chunks/{chunk-BFA6KKCI.js → chunk-7I23XGWO.js} +2 -2
  25. package/dist/cli-bundle/focused-chunks/{chunk-6Z24ZMU3.js → chunk-7YCDTCBC.js} +2 -2
  26. package/dist/cli-bundle/focused-chunks/{chunk-O4ZXNJMT.js → chunk-A644DUFQ.js} +2 -2
  27. package/dist/cli-bundle/focused-chunks/chunk-FXDLT6FL.js +16 -0
  28. package/dist/cli-bundle/focused-chunks/{chunk-RASVBJX5.js → chunk-IBHXMFE7.js} +2 -2
  29. package/dist/cli-bundle/focused-chunks/chunk-LMKG3DFE.js +5 -0
  30. package/dist/cli-bundle/focused-chunks/{chunk-6MUTDXMP.js → chunk-LV5N3LK5.js} +2 -2
  31. package/dist/cli-bundle/focused-chunks/{chunk-CWCN5RLO.js → chunk-MMXUPDDJ.js} +2 -2
  32. package/dist/cli-bundle/focused-chunks/{chunk-WZLSSGEU.js → chunk-OHIHZ7HS.js} +2 -2
  33. package/dist/cli-bundle/focused-chunks/chunk-P2E6LDAE.js +19 -0
  34. package/dist/cli-bundle/focused-chunks/{chunk-IZNRRCU3.js → chunk-TMJDFHVD.js} +2 -2
  35. package/dist/cli-bundle/focused-chunks/{chunk-QBP5FSBX.js → chunk-UYBA57GY.js} +4 -4
  36. package/dist/cli-bundle/focused-chunks/{chunk-MNPECIRL.js → chunk-YO3ZF3FI.js} +2 -2
  37. package/dist/cli-bundle/main.js +2 -2
  38. package/dist/cli-bundle/sdk-authoring.js +1 -1
  39. package/dist/cli-bundle/sdk-contracts.js +2 -2
  40. package/dist/cli-bundle/sdk-core.js +41 -41
  41. package/dist/cli-bundle/sdk-governance.js +1 -1
  42. package/dist/cli-bundle/sdk-graph.js +1 -1
  43. package/dist/cli-bundle/sdk-merge.js +32 -33
  44. package/dist/cli-bundle/sdk-query.js +1 -1
  45. package/dist/cli-bundle/sdk-runtime.js +1 -1
  46. package/dist/cli-bundle/sdk-testing.js +1 -1
  47. package/dist/cli-bundle/sdk.js +7 -6
  48. package/dist/core/diagnostics/remediation.js +17 -2
  49. package/dist/core/extensions/manifest-schema.d.ts +20 -0
  50. package/dist/core/extensions/manifest-schema.js +28 -10
  51. package/dist/mcp/http-server.d.ts +60 -0
  52. package/dist/mcp/http-server.js +451 -0
  53. package/dist/mcp/legacy-adapter.d.ts +50 -0
  54. package/dist/mcp/legacy-adapter.js +64 -0
  55. package/dist/mcp/server.d.ts +42 -9
  56. package/dist/mcp/server.js +457 -58
  57. package/dist/sdk/agent/refusal-closure-census.d.ts +6 -2
  58. package/dist/sdk/agent/refusal-closure-census.js +16 -8
  59. package/dist/sdk/cli-contracts/runtime-contracts.d.ts +10 -0
  60. package/dist/sdk/cli-contracts/runtime-contracts.js +20 -3
  61. package/dist/sdk/compose.d.ts +4 -1
  62. package/dist/sdk/compose.js +23 -36
  63. package/dist/sdk/extension/author-manifest.d.ts +22 -0
  64. package/dist/sdk/extension/author-manifest.js +93 -0
  65. package/dist/sdk/extension.js +6 -3
  66. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +67 -28
  67. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +30 -3
  68. package/dist/sdk/governance/health.js +103 -11
  69. package/dist/sdk/governance/validate.js +15 -9
  70. package/dist/sdk/history-repair.d.ts +24 -0
  71. package/dist/sdk/history-repair.js +145 -4
  72. package/dist/sdk/index.d.ts +6 -0
  73. package/dist/sdk/index.js +8 -2
  74. package/dist/sdk/mcp/authorization.d.ts +134 -0
  75. package/dist/sdk/mcp/authorization.js +405 -0
  76. package/dist/sdk/mcp/interactions.d.ts +118 -0
  77. package/dist/sdk/mcp/interactions.js +337 -0
  78. package/dist/sdk/mcp/protocol.d.ts +142 -0
  79. package/dist/sdk/mcp/protocol.js +174 -0
  80. package/dist/sdk/mcp/subscriptions.d.ts +65 -0
  81. package/dist/sdk/mcp/subscriptions.js +212 -0
  82. package/dist/sdk/mcp/tasks.d.ts +107 -0
  83. package/dist/sdk/mcp/tasks.js +431 -0
  84. package/dist/sdk/mcp/transport.d.ts +30 -0
  85. package/dist/sdk/mcp/transport.js +261 -0
  86. package/dist/sdk/merge/driver.js +25 -4
  87. package/dist/sdk/merge/receipt-file-boundary.d.ts +21 -0
  88. package/dist/sdk/merge/receipt-file-boundary.js +47 -0
  89. package/dist/sdk/merge/receipts.d.ts +40 -1
  90. package/dist/sdk/merge/receipts.js +343 -36
  91. package/dist/sdk/merge/reconcile.js +117 -47
  92. package/dist/sdk/read-output/continuation.d.ts +15 -2
  93. package/dist/sdk/read-output/continuation.js +86 -6
  94. package/dist/sdk/read-output-contracts.d.ts +4 -1
  95. package/dist/sdk/read-output-contracts.js +9 -6
  96. package/dist/sdk/runtime-primitives.d.ts +1 -1
  97. package/dist/sdk/runtime-primitives.js +3 -3
  98. package/dist/sdk/test/execution.d.ts +6 -0
  99. package/dist/sdk/test/execution.js +32 -3
  100. package/docs/AGENT_PROVENANCE_ADR.md +6 -4
  101. package/docs/AGENT_RUNTIME_PRIMITIVES.md +6 -5
  102. package/docs/CLAUDE_CODE_PLUGIN.md +12 -5
  103. package/docs/DIAGNOSTIC_OUTPUT_CONTRACTS.md +8 -0
  104. package/docs/EXTENSIONS.md +3 -4
  105. package/docs/MCP_2026_07_28.md +138 -0
  106. package/docs/MCP_2026_07_28_CONFORMANCE.md +30 -0
  107. package/docs/MCP_REMOTE_TRANSPORT_SECURITY.md +180 -0
  108. package/docs/MERGE_SAFETY.md +34 -5
  109. package/docs/OUTPUT_PROJECTION_CONTRACTS.md +13 -1
  110. package/docs/README.md +4 -0
  111. package/docs/READ_OUTPUT_CONTRACTS.md +25 -2
  112. package/docs/RELEASING.md +3 -2
  113. package/docs/SDK.md +22 -1
  114. package/docs/SDK_AGENT_SESSION_CONTEXT.md +18 -13
  115. package/docs/SDK_MCP_INTERACTIONS.md +227 -0
  116. package/docs/TESTING.md +4 -0
  117. package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +13 -8
  118. package/marketplace.json +2 -2
  119. package/package.json +7 -5
  120. package/packages/pm-beads/package.json +1 -1
  121. package/packages/pm-calendar/package.json +1 -1
  122. package/packages/pm-command-kit/package.json +1 -1
  123. package/packages/pm-digital-twin/package.json +1 -1
  124. package/packages/pm-governance-audit/package.json +1 -1
  125. package/packages/pm-guide-shell/package.json +1 -1
  126. package/packages/pm-kanban/package.json +1 -1
  127. package/packages/pm-lifecycle-hooks/package.json +1 -1
  128. package/packages/pm-linked-test-adapters/package.json +1 -1
  129. package/packages/pm-search-advanced/package.json +1 -1
  130. package/packages/pm-templates/package.json +1 -1
  131. package/packages/pm-todos/package.json +1 -1
  132. package/packages/pm-vcs/package.json +1 -1
  133. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  134. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  135. package/scripts/finalize-build.mjs +1 -0
  136. package/sdk/public-surface.json +762 -15
  137. package/dist/cli-bundle/chunks/chunk-MKE6MD2K.js +0 -36
  138. package/dist/cli-bundle/chunks/chunk-NXBFO63A.js +0 -8
  139. package/dist/cli-bundle/focused-chunks/chunk-FCTT4CZU.js +0 -5
  140. package/dist/cli-bundle/focused-chunks/chunk-Q63PSLO4.js +0 -2
  141. package/dist/cli-bundle/focused-chunks/chunk-QV5UP27O.js +0 -51
  142. package/dist/cli-bundle/focused-chunks/chunk-RPRLENVA.js +0 -16
  143. package/dist/cli-bundle/focused-chunks/chunk-TOFVXBWA.js +0 -19
@@ -0,0 +1,30 @@
1
+ # MCP 2026-07-28 Conformance Matrix
2
+
3
+ Tracker: [pm-55yf1t](../.agents/pm/tasks/pm-55yf1t.toon). The official
4
+ 2026-07-28 schema and key-changes document are normative; this matrix assigns
5
+ every revision-level change to one canonical pm owner and records executable
6
+ evidence or an explicit open obligation.
7
+
8
+ | Requirement family | Canonical owner | Current disposition | Executable evidence |
9
+ | -------------------------------------------------------------------------------------------------- | --------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------- |
10
+ | Stateless per-request version, client capabilities, and identity | [pm-vae5ec](../.agents/pm/features/pm-vae5ec.toon) | Implemented | `tests/unit/sdk/mcp/protocol.spec.ts`, `tests/integration/mcp-stateless-protocol.spec.ts` |
11
+ | Mandatory `server/discover`, deterministic capabilities and identity | [pm-vae5ec](../.agents/pm/features/pm-vae5ec.toon) | Implemented | direct SDK/server tests plus plugin and release real-process probes |
12
+ | Unsupported version `-32022` | [pm-vae5ec](../.agents/pm/features/pm-vae5ec.toon) | Implemented | SDK and server negative controls |
13
+ | Header mismatch `-32020` and missing capability `-32021` | [pm-vae5ec](../.agents/pm/features/pm-vae5ec.toon) | Implemented in SDK, stdio, and Streamable HTTP | SDK negative controls and `tests/integration/mcp-streamable-http.spec.ts` |
14
+ | Required result `resultType`; legacy omission means complete only at compatibility boundary | [pm-vae5ec](../.agents/pm/features/pm-vae5ec.toon) | Implemented for modern pm results | SDK unit and modern direct-server tests |
15
+ | No modern initialize, initialized notification, ping, or protocol session | [pm-sqvshj](../.agents/pm/decisions/pm-sqvshj.toon) | Implemented with bounded legacy stdio adapter | modern removed-method and legacy handshake tests |
16
+ | MRTR `input_required`, retry state, and reverse-request removal | [pm-rz9gep](../.agents/pm/features/pm-rz9gep.toon) | Implemented for SDK and stateless stdio adapter | `tests/unit/sdk/mcp/interactions.spec.ts`; direct server negative controls |
17
+ | `subscriptions/listen`, request-scoped streams, no SSE resumability | [pm-v7e337](../.agents/pm/features/pm-v7e337.toon) | Implemented locally; packed and published proof follows merge | subscription SDK, stdio, HTTP, backpressure, disconnect, and retry tests |
18
+ | Official `io.modelcontextprotocol/tasks` extension | [pm-rzs24j](../.agents/pm/features/pm-rzs24j.toon) | Implemented for eligible tool calls, durable lifecycle, and stdio methods; notifications remain with subscriptions owner | `tests/unit/sdk/mcp/tasks.spec.ts`, `tests/integration/mcp-stateless-protocol.spec.ts` |
19
+ | Cacheable list/read results, deterministic tools, JSON Schema 2020-12, any JSON structured content | [pm-hv1x1x](../.agents/pm/features/pm-hv1x1x.toon) | Implemented for current pm tool/resource/prompt surfaces | SDK schema/cache tests and direct modern server surface suite |
20
+ | Issuer-bound authorization, client metadata documents, consent, headers, OpenTelemetry | [pm-3zh9s4](../.agents/pm/features/pm-3zh9s4.toon) | Implemented locally; deployment verifier integration remains host-owned | authorization SDK adversarial tests, real HTTP bearer suite, and threat model |
21
+ | Core extension negotiation and official extension fallback | [pm-pznhee](../.agents/pm/features/pm-pznhee.toon) | Open | owner acceptance criteria and release matrix |
22
+ | Skills over MCP | [pm-8nzivt](../.agents/pm/features/pm-8nzivt.toon) | Open | owner acceptance criteria define capability and token-budget proof |
23
+ | Deprecated Roots, Sampling, Logging, HTTP+SSE, `includeContext`, dynamic registration | [pm-vzcisw](../.agents/pm/chores/pm-vzcisw.toon) | Canonical source ratcheted; bounded stdio adapter and dated migration policy remain | generated inventory, negative controls, adapter tests, and migration guide |
24
+ | Official schema, real stdio/HTTP, packed/published, npx/bunx, negative controls | [pm-55yf1t](../.agents/pm/tasks/pm-55yf1t.toon) | Foundation implemented; remains open until every owner above closes | SDK/server suites, plugin smokes, published-release verifier |
25
+
26
+ The programme gate remains intentionally incomplete while any row says `Open`
27
+ or while local-only rows lack their packed and published evidence. Provider
28
+ silence, a successful legacy initialize, or source-only unit coverage cannot
29
+ promote such a row. Completion requires the owner's positive and negative
30
+ tests plus exact packed and published consumer proof.
@@ -0,0 +1,180 @@
1
+ # MCP Remote Transport, Authorization, and Migration
2
+
3
+ Tracker references: [pm-v7e337](../.agents/pm/features/pm-v7e337.toon),
4
+ [pm-3zh9s4](../.agents/pm/features/pm-3zh9s4.toon), and
5
+ [pm-vzcisw](../.agents/pm/chores/pm-vzcisw.toon).
6
+
7
+ pm exposes the same MCP 2026-07-28 dispatcher through two adapters:
8
+
9
+ - `pm-mcp` is the local JSON-RPC/stdio process. It retains a bounded
10
+ `2025-06-18` compatibility adapter for existing local consumers.
11
+ - `pm-mcp-http` is the canonical sessionless Streamable HTTP POST process. It
12
+ accepts only modern request-local protocol metadata and never creates an
13
+ MCP session.
14
+
15
+ The public `@unbrained/pm-cli/sdk` entrypoint owns subscription filtering,
16
+ HTTP header projection, authorization discovery and validation, issuer-keyed
17
+ credentials, bearer enforcement, and trace-context isolation. Adapters remain
18
+ thin bindings over those contracts.
19
+
20
+ ## Run the HTTP adapter
21
+
22
+ The safe default binds only `127.0.0.1:3000`:
23
+
24
+ ```bash
25
+ pm-mcp-http
26
+ ```
27
+
28
+ Configuration is explicit and environment-only:
29
+
30
+ | Variable | Meaning | Default |
31
+ | ----------------------------- | --------------------------------------------------- | ------------------ |
32
+ | `PM_MCP_HTTP_HOST` | Bind host | `127.0.0.1` |
33
+ | `PM_MCP_HTTP_PORT` | Bind port, including `0` for an ephemeral test port | `3000` |
34
+ | `PM_MCP_HTTP_ALLOWED_ORIGINS` | Comma-separated exact browser origins | none |
35
+ | `PM_MCP_HTTP_BEARER_TOKEN` | Opaque deployment token for the bundled verifier | none |
36
+ | `PM_MCP_HTTP_AUTH_ISSUER` | Exact HTTPS authorization-server issuer | none |
37
+ | `PM_MCP_HTTP_RESOURCE` | Canonical MCP resource/audience URI | none |
38
+ | `PM_MCP_HTTP_SCOPES` | Space-separated consent scopes | `pm:read pm:write` |
39
+
40
+ A non-loopback bind fails closed unless token, issuer, and resource are all
41
+ present. Production deployments should normally call
42
+ `createPmMcpHttpServer()` with an OAuth access-token verifier backed by their
43
+ authorization server instead of using the executable's single opaque-token
44
+ bootstrap verifier.
45
+
46
+ For example, this starts a deliberately local protected endpoint without
47
+ placing a real credential in documentation:
48
+
49
+ ```bash
50
+ PM_MCP_HTTP_BEARER_TOKEN='<deployment-secret>' \
51
+ PM_MCP_HTTP_AUTH_ISSUER='https://auth.example.test' \
52
+ PM_MCP_HTTP_RESOURCE='http://127.0.0.1:3000/mcp' \
53
+ pm-mcp-http
54
+ ```
55
+
56
+ The adapter serves RFC 9728 protected-resource metadata at both
57
+ `/.well-known/oauth-protected-resource` and the path-qualified
58
+ `/.well-known/oauth-protected-resource/mcp` location.
59
+
60
+ ## Stream and header contract
61
+
62
+ Every HTTP request is a POST to `/mcp` and negotiates both
63
+ `application/json` and `text/event-stream`. Normal finite requests return
64
+ JSON. `subscriptions/listen` returns an SSE response whose first message is
65
+ `notifications/subscriptions/acknowledged`; every later subscription
66
+ notification carries the listen request's JSON-RPC id in
67
+ `io.modelcontextprotocol/subscriptionId`.
68
+
69
+ The supported opt-ins are tool-list, prompt-list, resource-list, and exact
70
+ resource-update notifications. Each stream serializes writes and drops a sink
71
+ that fails or remains backpressured beyond the bounded write deadline; tool
72
+ calls do not await subscriber delivery. Disconnecting deletes the
73
+ request-scoped subscription. A broken stream has no replay cursor: there are no
74
+ SSE event ids and `Last-Event-ID` is rejected. The caller retries the lost
75
+ operation with a new JSON-RPC request id.
76
+
77
+ `MCP-Protocol-Version` and `Mcp-Method` are built and validated against every
78
+ JSON-RPC request body. `Mcp-Name` is required only for `prompts/get`,
79
+ `resources/read`, and `tools/call`; methods such as `tools/list` omit it. Tool
80
+ properties may declare `x-mcp-header` in their JSON Schema; the SDK validates
81
+ the header name, rejects reserved or duplicate mappings, encodes non-ASCII and
82
+ ambiguous values with the MCP Base64 sentinel, and compares the decoded header
83
+ with the argument value before dispatch. CR/LF and control-character values
84
+ are always rejected.
85
+
86
+ Current pm handlers do not emit request progress or deprecated MCP log-message
87
+ notifications. A `progressToken` or request-local
88
+ `io.modelcontextprotocol/logLevel` is therefore never promoted to a shared
89
+ subscription. Work that returns a durable task remains observable through the
90
+ task lifecycle; remote operational logging belongs in the deployment's
91
+ OpenTelemetry pipeline.
92
+
93
+ ## Authorization lifecycle
94
+
95
+ Remote hosts can compose the public SDK primitives into a complete OAuth
96
+ client/resource lifecycle:
97
+
98
+ 1. Build or read protected-resource metadata and choose an advertised
99
+ authorization-server issuer.
100
+ 2. Probe OAuth and OpenID discovery URLs in the specified order. Require the
101
+ metadata `issuer` to match exactly and require S256 PKCE.
102
+ 3. Prefer a pre-registered client, then a validated Client ID Metadata
103
+ Document, then bounded Dynamic Client Registration, and finally explicit
104
+ user-supplied registration.
105
+ 4. Validate a returned `iss` when present or advertised, bind stored
106
+ credentials to the exact issuer, and never reuse them across issuers.
107
+ 5. Request only the scopes needed for the operation. The resource verifies
108
+ bearer location, issuer, audience, and every required consent scope before
109
+ MCP dispatch.
110
+ 6. Replace an issuer's stored credential after refresh. Delete only that
111
+ issuer's entry on revocation, invalid grant, or re-registration; discovery
112
+ and consent then run again without affecting other issuers.
113
+
114
+ `PmMcpIssuerCredentialStore` deliberately provides cloned `set`, `get`, and
115
+ `delete` operations rather than owning token refresh network traffic. This
116
+ keeps refresh, revocation, persistence encryption, and user interaction in the
117
+ host that owns the authorization relationship.
118
+
119
+ ## Trace and privacy boundary
120
+
121
+ Modern request `_meta` may carry W3C `traceparent`, `tracestate`, and baggage.
122
+ The SDK validates syntax and byte bounds, drops every baggage member that is
123
+ not on the host-provided allowlist, and stores the resulting context in an
124
+ `AsyncLocalStorage` scope for only that request. Concurrent requests cannot
125
+ inherit one another's trace context. Raw bearer tokens are hashed for
126
+ constant-time comparison by the bundled verifier and are never included in
127
+ claims, errors, traces, or JSON-RPC result data.
128
+
129
+ | Threat | Enforced boundary |
130
+ | ------------------------------ | ------------------------------------------------------------------------------- |
131
+ | DNS rebinding/browser drive-by | Loopback default plus exact `Origin` allowlist |
132
+ | Token passthrough | Bearer is verified at pm and never forwarded to another service |
133
+ | Issuer mix-up | Exact discovery/response issuer checks and issuer-keyed credentials |
134
+ | Confused audience | Exact protected-resource audience check |
135
+ | Excess authority | Required-scope intersection before dispatch |
136
+ | Query/log credential leak | Query tokens rejected; challenges and errors omit token material |
137
+ | Header injection | Schema-derived allowlist, reserved-name checks, control-byte rejection |
138
+ | Trace privacy leak | Syntax/size validation, baggage-key allowlist, request-local storage |
139
+ | Proxy cache disclosure | MCP and metadata errors use explicit content types; MCP results use `no-store` |
140
+ | Replay after disconnect | No session, event id, resume cursor, or redelivery; retry uses a new request id |
141
+
142
+ ## Deprecated-feature inventory and sunset
143
+
144
+ Run the generated ratchet locally or in CI:
145
+
146
+ ```bash
147
+ pnpm quality:mcp-deprecations
148
+ ```
149
+
150
+ The inventory classifies every match as canonical source, the isolated legacy
151
+ adapter, migration documentation, a negative control, or
152
+ `bounded_source_control`. The last disposition applies only to exact,
153
+ single-use source lines in the reviewed fixed allowlist; an adjacent marker or
154
+ an unlisted source path cannot create that exemption. Any canonical match for a
155
+ removed method, session header, SSE resume mechanism, legacy
156
+ resource-subscription method, or deprecated server policy fails the gate.
157
+
158
+ The compatibility adapter supports only protocol `2025-06-18` on local stdio.
159
+ It may be removed after telemetry and installed-consumer probes show no
160
+ required legacy clients for two consecutive release windows. Deprecated
161
+ 2026-07-28 fields remain available only where the normative registry requires
162
+ its minimum compatibility period; no pm sunset occurs earlier than
163
+ 2027-07-28. A removal is always a reviewed release change with packed and
164
+ published consumer proof.
165
+
166
+ ## Verification
167
+
168
+ Focused release evidence is reproducible with:
169
+
170
+ ```bash
171
+ node scripts/run-tests.mjs test -- tests/unit/sdk/mcp/subscriptions.spec.ts
172
+ node scripts/run-tests.mjs test -- tests/unit/sdk/mcp/transport.spec.ts
173
+ node scripts/run-tests.mjs test -- tests/unit/sdk/mcp/authorization.spec.ts
174
+ node scripts/run-tests.mjs test -- tests/integration/mcp-streamable-http.spec.ts
175
+ node scripts/run-tests.mjs test -- tests/unit/scripts/release/mcp-deprecation-gate.spec.ts
176
+ pnpm quality:mcp-deprecations
177
+ ```
178
+
179
+ The full release gates, packed artifact probes, installed `npx`/`bunx`
180
+ consumers, and published artifact checks remain distinct closeout evidence.
@@ -2,6 +2,9 @@
2
2
 
3
3
  Tracked by [pm-wc1r](../.agents/pm/features/pm-wc1r.toon), with the integrity and concurrency fixes [pm-9q2t](../.agents/pm/issues/pm-9q2t.toon), [pm-cxyv](../.agents/pm/issues/pm-cxyv.toon), [pm-gpo7](../.agents/pm/issues/pm-gpo7.toon), [pm-m3nl](../.agents/pm/issues/pm-m3nl.toon), [pm-wwfd](../.agents/pm/issues/pm-wwfd.toon), and [pm-xdn6](../.agents/pm/issues/pm-xdn6.toon). Fresh-init fence ownership is tracked by [pm-1w3ljt](../.agents/pm/issues/pm-1w3ljt.toon); runtime-cache index governance by [pm-hous](../.agents/pm/issues/pm-hous.toon); local allocation safety by [pm-khdq](../.agents/pm/issues/pm-khdq.toon); fence-coverage completeness and drift detection by [pm-i4fx](../.agents/pm/issues/pm-i4fx.toon); package-defined item coverage by [pm-5rexki](../.agents/pm/issues/pm-5rexki.toon); non-item JSON coverage by [pm-gjicmx](../.agents/pm/issues/pm-gjicmx.toon); portable driver identity by [pm-w91mvg](../.agents/pm/issues/pm-w91mvg.toon); pending receipt validation by [pm-ysqb6n](../.agents/pm/issues/pm-ysqb6n.toon); receipt classification by [pm-jtwsct](../.agents/pm/issues/pm-jtwsct.toon); direction-independent item conflict selection by [pm-dlx7v7](../.agents/pm/issues/pm-dlx7v7.toon); corrected reconciliation guidance by [pm-lwmstb](../.agents/pm/issues/pm-lwmstb.toon); cross-branch id collision safety by [pm-pibw](../.agents/pm/issues/pm-pibw.toon); auditable merge history by [pm-9j2r3b](../.agents/pm/tasks/pm-9j2r3b.toon); durable conflict decisions by [pm-rh98vo](../.agents/pm/issues/pm-rh98vo.toon); continuous conformance by [pm-76dnfg](../.agents/pm/tasks/pm-76dnfg.toon); workspace-wide CI enforcement by [pm-pdr8t1](../.agents/pm/tasks/pm-pdr8t1.toon); post-merge reconciliation by [pm-mfkv92](../.agents/pm/issues/pm-mfkv92.toon); linked-command execution trust by [pm-ed28wi](../.agents/pm/issues/pm-ed28wi.toon); this repository's own adoption by [pm-iwsj](../.agents/pm/chores/pm-iwsj.toon).
4
4
 
5
+ Lossless receipt health gating is tracked by
6
+ [pm-baksix](../.agents/pm/issues/pm-baksix.toon).
7
+
5
8
  pm stores project context as reviewable repository files. Concurrent agents can therefore use ordinary branches and worktrees, but tracker artifacts need semantic merge behavior: raw line merging cannot preserve TOON collection counts, JSON object structure, or append-only history hash chains.
6
9
 
7
10
  ## Install the repository merge contract
@@ -118,11 +121,37 @@ pm merge reconcile --force --message "Accept reviewed merge decisions" --json
118
121
  ```
119
122
 
120
123
  The preview reports every drifted stream and pending receipt without mutation.
121
- Lossless receipts are reported as provenance but do not become blocking merge
122
- decisions. Receipts with discarded scalar values remain blocking and the apply
123
- pass refuses them unless the coordinator explicitly supplies `--force` after
124
- review. This prevents a routine history repair from silently accepting data
125
- loss while preserving a zero-noise path for merges that retained both changes.
124
+ Lossless receipts do not become discarded-value decisions and reconcile without
125
+ `--force`, but `pm health` reports `merge_receipts_pending:<n>` and remains
126
+ non-green until the apply pass settles them. `pm history-repair` cannot clear
127
+ that receipt finding. When a drifted item also has a pending receipt, the
128
+ `history_drift` remediation map prioritizes `pm merge reconcile --dry-run` only
129
+ when canonical item path, changed-field, and merged-value hash evidence all
130
+ attribute that finding to one or more receipts loaded from the clone-local Git
131
+ evidence store. Every field declared by each receipt must match its current merged-value
132
+ hash, even when only a subset appears in the history reconciliation diff.
133
+ Disjoint valid receipts may collectively cover a multi-field reconciliation;
134
+ the audit and settlement then retain every individually proven receipt id.
135
+ Serialized source claims are ignored. Receipt readers validate the complete
136
+ bounded schema, safe identifiers, filename and item-path identity, timestamps,
137
+ and bounded decision structure before a sidecar enters health or
138
+ reconciliation. Reads use size-preflighted, no-follow regular-file descriptors;
139
+ durable decisions must retain hash-only values. Legacy or durable-only receipts,
140
+ receipts whose declared fields disagree with their hashes, same-item tampering,
141
+ and drift on unrelated items fail closed to the normal `pm history-repair`
142
+ guidance. Health indexes clone-local evidence once by item and reconciliation
143
+ uses the same per-item groups with a fixed receipt-only worker pool, so committed
144
+ sidecars cannot amplify drift scans into unbounded parallel repair work.
145
+ Apply-mode reconciliation repeats the same proof against the exact
146
+ item snapshot used by the audited history rewrite. The audit event and
147
+ settlement include only the individually proven receipt id, so one valid receipt
148
+ cannot authorize an untrusted same-item sibling. Failed or unproven receipts
149
+ remain pending unless the coordinator explicitly reviews and supplies `--force`.
150
+ Receipts with discarded scalar values retain the distinct
151
+ `merge_decisions_unreviewed:<n>` finding, and the apply pass refuses them unless
152
+ the coordinator explicitly supplies `--force` after review. This prevents a
153
+ routine history repair from hiding unfinished reconciliation or silently
154
+ accepting data loss.
126
155
  It exits nonzero while either merge-critical validation check is non-green, so
127
156
  CI and explicit post-merge hooks cannot approve unresolved receipts or drift.
128
157
  The apply pass uses the audited history rewrite boundary to append a
@@ -16,7 +16,10 @@ selectors are tracked by
16
16
  and canonical TOON tables are tracked by
17
17
  [pm-gjjurs](../.agents/pm/issues/pm-gjjurs.toon) and
18
18
  [pm-5y05kq](../.agents/pm/issues/pm-5y05kq.toon). Nested evidence continuation
19
- is tracked by [pm-8nev0o](../.agents/pm/issues/pm-8nev0o.toon).
19
+ is tracked by [pm-8nev0o](../.agents/pm/issues/pm-8nev0o.toon) and
20
+ [pm-oahhyc](../.agents/pm/issues/pm-oahhyc.toon). Exact command-local
21
+ projection discovery is tracked by
22
+ [pm-q4isdq](../.agents/pm/issues/pm-q4isdq.toon).
20
23
 
21
24
  ## Agent Quick Context
22
25
 
@@ -112,6 +115,15 @@ machine-iterable without a command-specific selector. `fields` is always explici
112
115
  shape. NDJSON event streams do not carry an envelope and therefore do not
113
116
  publish a row contract.
114
117
 
118
+ Projection mode discovery is command-local even though the compatibility
119
+ degradation ladder is global. Read
120
+ `output_projection_contracts.commands` from a command-scoped contracts call or
121
+ the full contracts matrix before selecting a whole-result mode. The
122
+ contract labels the global ladder `union_not_per_command`, so clients cannot
123
+ infer that `list` accepts `summary` or that `health` accepts `compact`.
124
+ `PM_READ_OUTPUT_SURFACE_CONTRACTS[].projection_modes` provides the identical
125
+ canonical matrix to SDK and package consumers.
126
+
115
127
  SDK and package authors can import `PM_READ_ROW_CONTRACTS`,
116
128
  `PM_READ_ROW_JQ_SELECTOR`, and `resolveReadRowContract` from
117
129
  `@unbrained/pm-cli/sdk`. Existing package declarations are preserved only
package/docs/README.md CHANGED
@@ -44,6 +44,10 @@ pm guide release --json
44
44
  - [SDK Primitive Inventory](SDK_PRIMITIVE_INVENTORY.md) - SDK-first migration map and private-import ratchet for CLI/MCP layering.
45
45
  - [Package SDK Contract Conformance](PACKAGE_SDK_CONTRACT_CONFORMANCE.md) - authoritative public types, `typeof` module derivation, and the first-party parity gate.
46
46
  - [SDK Action and Boundary Conformance](SDK_ACTION_CONFORMANCE.md) - derived CLI/SDK/MCP action vocabulary, public-import ratchets, intent budget diagnostics, and package-runner proof.
47
+ - [MCP 2026-07-28 Protocol Decision](MCP_2026_07_28.md) - stateless request metadata, discovery, result envelopes, explicit legacy boundary, and migration policy.
48
+ - [MCP 2026-07-28 Conformance Matrix](MCP_2026_07_28_CONFORMANCE.md) - official revision changes mapped to canonical owners and executable evidence.
49
+ - [MCP Interaction and Task SDK](SDK_MCP_INTERACTIONS.md) - public MRTR continuation, cache/schema validation, and durable task-store contracts.
50
+ - [MCP Remote Transport, Authorization, and Migration](MCP_REMOTE_TRANSPORT_SECURITY.md) - Streamable HTTP operation, subscriptions, OAuth and trace boundaries, threat model, and deprecated-feature ratchet.
47
51
  - [SDK Artifact Output Contracts](SDK_ARTIFACT_OUTPUT.md) - clean stdout/file exporter channels, bounded receipts, binary-safe delivery, and shared NDJSON terminal framing.
48
52
  - [Context Relevance and Packing](CONTEXT_RELEVANCE.md) - shared CLI/SDK signals, derived-store provenance, ranking explanations, and token budgets.
49
53
  - [Output Projection and Omission Contracts](OUTPUT_PROJECTION_CONTRACTS.md) - explicit withheld-field receipts, mode-paired row keys, and completion resolver outcomes.
@@ -1,6 +1,6 @@
1
1
  # Universal Read Output Contracts
2
2
 
3
- Tracker references: [pm-hb7ug8](../.agents/pm/features/pm-hb7ug8.toon), [pm-cxr0jb](../.agents/pm/features/pm-cxr0jb.toon), [pm-hid9g1](../.agents/pm/features/pm-hid9g1.toon), [pm-h8tpeh](../.agents/pm/features/pm-h8tpeh.toon), [pm-5t33or](../.agents/pm/features/pm-5t33or.toon), [pm-srns](../.agents/pm/issues/pm-srns.toon), [pm-sb0tns](../.agents/pm/issues/pm-sb0tns.toon), [pm-gjjurs](../.agents/pm/issues/pm-gjjurs.toon), [pm-eugaqy](../.agents/pm/issues/pm-eugaqy.toon), [pm-jt8aa2](../.agents/pm/issues/pm-jt8aa2.toon), [pm-kyjdne](../.agents/pm/issues/pm-kyjdne.toon), [pm-8nev0o](../.agents/pm/issues/pm-8nev0o.toon), [pm-e5gl05](../.agents/pm/issues/pm-e5gl05.toon), [pm-cha95z](../.agents/pm/tasks/pm-cha95z.toon), [pm-2qvq7a](../.agents/pm/issues/pm-2qvq7a.toon), and [pm-xam9bt](../.agents/pm/issues/pm-xam9bt.toon).
3
+ Tracker references: [pm-hb7ug8](../.agents/pm/features/pm-hb7ug8.toon), [pm-cxr0jb](../.agents/pm/features/pm-cxr0jb.toon), [pm-hid9g1](../.agents/pm/features/pm-hid9g1.toon), [pm-h8tpeh](../.agents/pm/features/pm-h8tpeh.toon), [pm-5t33or](../.agents/pm/features/pm-5t33or.toon), [pm-srns](../.agents/pm/issues/pm-srns.toon), [pm-sb0tns](../.agents/pm/issues/pm-sb0tns.toon), [pm-gjjurs](../.agents/pm/issues/pm-gjjurs.toon), [pm-eugaqy](../.agents/pm/issues/pm-eugaqy.toon), [pm-jt8aa2](../.agents/pm/issues/pm-jt8aa2.toon), [pm-kyjdne](../.agents/pm/issues/pm-kyjdne.toon), [pm-8nev0o](../.agents/pm/issues/pm-8nev0o.toon), [pm-oahhyc](../.agents/pm/issues/pm-oahhyc.toon), [pm-q4isdq](../.agents/pm/issues/pm-q4isdq.toon), [pm-e5gl05](../.agents/pm/issues/pm-e5gl05.toon), [pm-cha95z](../.agents/pm/tasks/pm-cha95z.toon), [pm-2qvq7a](../.agents/pm/issues/pm-2qvq7a.toon), and [pm-xam9bt](../.agents/pm/issues/pm-xam9bt.toon).
4
4
 
5
5
  ## Agent Quick Context
6
6
 
@@ -60,6 +60,17 @@ removing spelling receipts and volatile run metadata. A selector that matches
60
60
  neither a declared mode nor any field on any returned row is refused with the
61
61
  legal domain, rather than returning rows with every field removed.
62
62
 
63
+ Runtime discovery publishes the same exact vocabulary before invocation.
64
+ `pm contracts --command <command> --summary` returns
65
+ `output_projection_contracts.commands`, while
66
+ `output_projection_contracts.global_ladder_scope: "union_not_per_command"`
67
+ explicitly marks `output_policy.degradation_ladder` as a cross-command union,
68
+ not a promise that every member is accepted by the selected command. For
69
+ example, `list` declares `brief`, `compact`, and `full`; `health` declares
70
+ `brief`, `full`, and `summary`. The full `read_output_dimensions` matrix also
71
+ includes `projection_modes` for every canonical read surface, including an
72
+ explicit empty array when a surface has no whole-result modes.
73
+
63
74
  ## Cross-Call Context Sessions
64
75
 
65
76
  `--output-session <json>` / `outputSession` composes the four per-call
@@ -164,6 +175,18 @@ an unbounded multi-megabyte response;
164
175
  `recovery_budget_multiplier: 1` declares that each next page retains the same
165
176
  useful-result ceiling.
166
177
 
178
+ Health continuation fingerprints use a versioned nonvolatile-snapshot policy
179
+ for the `checks` row. Command-lifecycle telemetry may refresh timestamps, queue
180
+ counters, and pending spans between pages, so the policy excludes only those
181
+ explicit direct fields from the `telemetry` row's `details`. The row identity,
182
+ verdict, enabled state, capture level, endpoint, environment overrides, probe
183
+ result, and failure errors remain fingerprinted. Every other health check also
184
+ remains fully fingerprinted; changing storage, integrity, history, or another
185
+ stable check fails closed. `PM_READ_OUTPUT_CONTINUATION_FINGERPRINT_POLICIES`
186
+ publishes the exact ignored detail fields per dynamic row. Other commands still
187
+ fingerprint every field, including fields with the same spelling, and any
188
+ policy-version change fails closed against an older cursor.
189
+
167
190
  When compaction affects a nested collection that is not declared resumable,
168
191
  the recovery budget is derived from the larger of the binding ceiling plus one
169
192
  and the measured pre-compaction result. The SDK adds a 25% envelope margin and
@@ -221,7 +244,7 @@ const result = await pm.list({
221
244
  });
222
245
  ```
223
246
 
224
- Package authors should use the exported read-output contracts instead of inventing package-local limit or projection vocabularies. `PM_READ_OUTPUT_SURFACE_CONTRACTS` is the machine-readable matrix and `resolveReadOutputDimensions` plus `applyReadOutputDimensions` are the shared execution primitives.
247
+ Package authors should use the exported read-output contracts instead of inventing package-local limit or projection vocabularies. `PM_READ_OUTPUT_SURFACE_CONTRACTS` is the machine-readable matrix, `PM_READ_OUTPUT_CONTINUATION_FINGERPRINT_POLICIES` declares stable-snapshot exceptions, and `resolveReadOutputDimensions` plus `applyReadOutputDimensions` are the shared execution primitives.
225
248
 
226
249
  ## Drift Gates
227
250
 
package/docs/RELEASING.md CHANGED
@@ -386,8 +386,9 @@ git push origin v<version>
386
386
  Bun caches plus an empty npm user config so maintainer credentials and cached
387
387
  metadata cannot mask a public-registry outage. The verifier dispatches a real
388
388
  `pm contracts` command through both explicit-bin and package-default
389
- invocations, performs a JSON-RPC initialize handshake against the
390
- symlink-resolved `pm-mcp` bin under both npx and bunx, derives bin coverage
389
+ invocations, performs stateless JSON-RPC `server/discover` against the
390
+ symlink-resolved `pm-mcp` bin under both npx and bunx, requires canonical
391
+ `2026-07-28` metadata/result envelopes, derives bin coverage
391
392
  from `package.json`, and proves missing-bin and missing-command controls fail.
392
393
  - exact-package installed acceptance through
393
394
  `scripts/release/verify-installed-agent-session.mjs`. Separate npm and Bun
package/docs/SDK.md CHANGED
@@ -62,6 +62,13 @@ Terminal recurrence and executable recovery are tracked by
62
62
 
63
63
  Use it for extension authoring, package authoring, command/action contract discovery, and deterministic app or CI automation. Do not import private `src/core/...` modules from external integrations or packages.
64
64
 
65
+ MCP hosts can build on the public stateless protocol, MRTR, cache/schema, and
66
+ durable task primitives described in
67
+ [MCP Interaction and Task SDK](SDK_MCP_INTERACTIONS.md). Those contracts are
68
+ owned by [pm-rz9gep](../.agents/pm/features/pm-rz9gep.toon),
69
+ [pm-rzs24j](../.agents/pm/features/pm-rzs24j.toon), and
70
+ [pm-hv1x1x](../.agents/pm/features/pm-hv1x1x.toon).
71
+
65
72
  ## Install
66
73
 
67
74
  ```bash
@@ -244,6 +251,7 @@ Common authoring exports:
244
251
  the same remediation used by runtime activation.
245
252
  - `renderExtensionSurfaceMarkdown` (render a describe summary to a drift-free Markdown reference doc for a package README)
246
253
  - `checkExtensionManifestCompatibility` (author-time `pm_min_version`/`pm_max_version` check against a target pm version)
254
+ - `inspectExtensionManifestSchema` / `lintExtensionManifestSchema` (pure raw-manifest schema inspection and actionable finding boundary)
247
255
  - `preflightExtension` (one-call capstone: lint + manifest synthesis + version-compat in a single consolidated report)
248
256
  - `RESERVED_ITEM_FIELD_NAMES` (the shared runtime/authoring denylist); `lintExtensionBlueprint`, preflight, and the test harness reject blueprint item fields that shadow these metadata keys before publication
249
257
  - `EXTENSION_CAPABILITIES`
@@ -2783,8 +2791,18 @@ bound, a `pm_min_version` the target is below, or a `block`-mode `pm_max_version
2783
2791
  the target exceeds) and stays quiet on advisory `*_unchecked` / `*_exceeded_warn`
2784
2792
  warnings, which still load:
2785
2793
 
2794
+ Use `lintExtensionManifestSchema(manifest)` when only the manifest vocabulary is
2795
+ in scope. It returns stable `manifest_unknown_key` and
2796
+ `no_version_bounds_declared` findings without requiring a target pm version.
2797
+ Compatibility results retain the existing combined `findings` array, while the
2798
+ dedicated lint result gives SDK, CLI, and MCP adapters a stable schema-only
2799
+ boundary.
2800
+
2786
2801
  ```ts
2787
- import { checkExtensionManifestCompatibility } from "@unbrained/pm-cli/sdk";
2802
+ import {
2803
+ checkExtensionManifestCompatibility,
2804
+ lintExtensionManifestSchema,
2805
+ } from "@unbrained/pm-cli/sdk";
2788
2806
  import { assertExtensionManifestCompatible } from "@unbrained/pm-cli/sdk/testing";
2789
2807
 
2790
2808
  // Inspect every bound outcome against a target version…
@@ -2793,6 +2811,9 @@ const report = checkExtensionManifestCompatibility(manifest, {
2793
2811
  });
2794
2812
  // report.compatible === false, report.findings[0].code === "pm_min_version_unmet", …
2795
2813
 
2814
+ const schema = lintExtensionManifestSchema(manifest);
2815
+ // schema.ok === false, schema.findings[0].path === "compatibility", …
2816
+
2796
2817
  // …or fail the package's own suite when a bound would block the load.
2797
2818
  assertExtensionManifestCompatible(manifest, { pmVersion: "2026.6.23" });
2798
2819
  ```
@@ -152,22 +152,27 @@ invalid values.
152
152
 
153
153
  ## Cross an MCP boundary
154
154
 
155
- An embedding MCP client can add bounded `provenance` and `episode` fields to
156
- its initialize `clientInfo`. The server retains only those fields and applies
157
- them to later tool calls from that initialized client.
155
+ An embedding MCP 2026-07-28 client can add bounded `provenance` and `episode`
156
+ fields to request-local `io.modelcontextprotocol/clientInfo`. The server
157
+ retains only those fields while processing that request; no later request
158
+ inherits them.
158
159
 
159
160
  ```json
160
161
  {
161
- "clientInfo": {
162
- "name": "agent-host",
163
- "version": "1.0.0",
164
- "provenance": {
165
- "role": "implementer",
166
- "topic": "release readiness"
167
- },
168
- "episode": {
169
- "id": "release-2026-08-01",
170
- "label": "Release readiness"
162
+ "_meta": {
163
+ "io.modelcontextprotocol/protocolVersion": "2026-07-28",
164
+ "io.modelcontextprotocol/clientCapabilities": {},
165
+ "io.modelcontextprotocol/clientInfo": {
166
+ "name": "agent-host",
167
+ "version": "1.0.0",
168
+ "provenance": {
169
+ "role": "implementer",
170
+ "topic": "release readiness"
171
+ },
172
+ "episode": {
173
+ "id": "release-2026-08-01",
174
+ "label": "Release readiness"
175
+ }
171
176
  }
172
177
  }
173
178
  }