Repository navigation
feat(mcp): state the authoring contract version and refuse a client on another spec major - #35838
Conversation
…ion, serve the restriction profile
- initialize: where a connection lists authoring tools, the open server's
default instructions carry "Authoring contract: @objectstack/spec <version>"
as their second paragraph, read off the spec package the process resolves.
The longest default text measures 2,604 characters (bound: under 4,096).
- save_metadata_draft: optional clientSpecVersion. Another major is refused
VALIDATION_ERROR 400 before anything is written, naming both versions and
`npm i -D @objectstack/spec@<server version>`; another minor is saved with
a specVersionAdvisory; a non-SemVer value is refused as an input error; no
value, or the same major and minor, answers exactly as before.
- GET {basePath}/discovery/restriction-profile: the route the CLI's
`os validate --target <url>` reads, answering { success: true, data } with
a RestrictionProfileSchema value that restricts nothing and names the spec
and skills versions the runtime runs. One REST route ledger row.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4d1k1GRsQbF3vCPKxhz
📓 Docs Drift Check5 anchor(s) derived from 2 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run. What this run could not see
Coarse fallback — 37 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 8e8725d26881a0e69a0e8637cda6184fa1b63175 && git checkout 8e8725d26881a0e69a0e8637cda6184fa1b63175
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin e1143241de6256fcb825da88bc096c12f31b56a8 a8e9136eee238a2ccb08d5b0d9fa36f87b54f98d && git checkout -B drift-repro e1143241de6256fcb825da88bc096c12f31b56a8 && git merge --no-ff a8e9136eee238a2ccb08d5b0d9fa36f87b54f98d
node scripts/docs-audit/affected-docs.mjs --json e1143241de6256fcb825da88bc096c12f31b56a8 |
…ute too
`api.enableDiscovery` off removes three routes, not two: the
GET {basePath}/discovery/restriction-profile route this branch adds is
registered with the discovery routes, under the same switch. The mount-table
pin is edited in place (2 routes -> 3).
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4d1k1GRsQbF3vCPKxhz
|
repo:objectstack#4 · os-elon-musk · session_016WV4d1k1GRsQbF3vCPKxhz Final green head:
|
|
repo:objectstack#4 · os-elon-musk · session_016WV4d1eW7iLBvc8c6xv9Fx L1 verdict (L1-a): ACCEPT at head Gates on this head:
What I checked (holds):
Non-blocking notes:
NOT MEASURED: the stdio server's default text, out of scope and carried by p3 #35841. The full rest, mcp and runtime suites: I ran the targeted files above, and CI Test Core is green on this head. Landing: not governed. Clause-② widening. The seat's xhigh contract read follows, then a4-C lands. Generated by Claude Code |
|
repo:objectstack#4 · os-elon-musk · session_016WV4d1PJ4isQ3eD7Fk1fnF Contract review — FAIL at c7890e5Head-sha: Face: the ① Derived judgments
② Semver level
③ Boundary flags
F1 gets a card that cites this record. The head that fixes it owes a new full L2 round. Implemented-by: VERDICT: FAIL |
The anonymous GET {basePath}/discovery/restriction-profile route is outside
ADR-0138 D2's closed anonymous list, so it waits for a ruled amendment and is
parked on its own branch. This removes the route, its route-ledger row, the
mount-table pin's third discovery route and its conformance cases, returning
packages/rest to the merge base. The authoring contract line and the
clientSpecVersion judgement stay; two comments no longer name the route, and
the changeset drops @objectstack/rest and the route paragraph.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4d1k1GRsQbF3vCPKxhz
|
repo:objectstack#4 · os-elon-musk · session_016WV4d1k1GRsQbF3vCPKxhz Final green head (round 3, split):
|
|
repo:objectstack#4 · os-elon-musk · session_016WV4d1eW7iLBvc8c6xv9Fx L1 delta verdict (L1-a): ACCEPT at head Gates on this head: The delta (one commit,
Not re-run by me: the code of faces 1 and 2 did not move, so I take my run at Landing: not governed. The seat's contract re-read of the narrowed PR follows, then a4-C lands. #34774 stays open for #35848. Generated by Claude Code |
|
repo:objectstack#4 · os-elon-musk · session_016WV4d1PJ4isQ3eD7Fk1fnF Contract review — PASS at a8e9136Head-sha: Face: the ① Derived judgments
② Semver level
③ Boundary flags
Only nits remain, so this is the final round. N3 is a retitle, not a new head. Implemented-by: VERDICT: PASS |
|
repo:objectstack#4 · os-elon-musk · session_016WV4d1k1GRsQbF3vCPKxhz Landing: ready + auto-merge at
|
…get reads (ADR-0138 D2 amendment) (objectstack-ai#35887) <!-- claude-projects-attribution: {"github_login":"os-elon-musk"} --> _Requested by **Elon** · [project thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9DDxdrYJq965rUfrZBso8FS3)_ Fixes objectstack-ai#34774 Clause-②: yes — widening: one new anonymous read-only discovery route (an open restriction profile); nothing served today changes Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:自托管服务器的开发者用命令行校验工程时,可以直接指向自己的服务器地址读取它的限制配置(开放、无限制,附带它运行的规范版本),以前这一步对自托管服务器总是失败。 - 为什么做:属于 MCP 本地优先编写入口那条主线,补上“对自托管服务器校验”的后一半;你在决策卡(自托管服务器能否不登录公开限制配置)上选了 A。 - 出错会怎样:未登录的人只能多读到一个规范版本号,不涉及任何业务数据;关掉服务器的发现功能就一并隐藏;随时可以撤回。 - 要你做什么:这次改动修订了访客模型那篇架构决策记录,需要你本人批准后才能合并。 ## What changes Face 3 of objectstack-ai#34774, resumed under the maintainer's ruling **A** on decision card objectstack-ai#35848 (recorded on the card in comment 7043884056; card objectstack-ai#35848 is resolved by the seat when this merges). Faces 1 and 2 landed in PR objectstack-ai#35838 as `Part of objectstack-ai#34774`; this PR closes the card. - **The route** (`packages/rest/src/discovery-routes.ts`): `GET {basePath}/discovery/restriction-profile`, ported unchanged in behaviour from the parked branch `claude/area-a4C-34774-route` @ `c7890e5b` (main had not moved the four files since that branch's base). It is anonymous (no `enforceAuth`, as `/discovery`), refuses every query parameter (`refuseUnknownQueryParams(req, res, [])` → 400 `VALIDATION_ERROR`), answers 503 `SERVICE_UNAVAILABLE` when the `@objectstack/spec` manifest cannot be read, serves `{ success: true, data }` with `data` an open `RestrictionProfileSchema` value and `versions { spec, skills }`, and is mounted inside `registerDiscoveryEndpoints`, so `api.enableDiscovery` gates it. The docblock is corrected per review note N4 of 7038862149: the anonymous peer is `/discovery`'s `version`, not the MCP `initialize` text, and it now cites the ADR-0138 D2 amendment. - **One `REST_ROUTE_LEDGER` row** (`family: 'discovery'`, `disposition: 'server-only'`; the CLI reads it, not `@objectstack/client`). - **Behaviour pin flipped in place:** `rest-config-mount-table.pin.test.ts`, `api.enableDiscovery` off removes 2 routes → 3 routes (the new one added), ruled by objectstack-ai#34774 face 3 and objectstack-ai#35848 A. - **ADR-0138 D2 amendment** (`docs/adr/0138-…md`), in the invitation-preview amendment's form and place: a `· **Amended** (2026-11-20, …)` entry on the status line, and a dated note under D2's table after the 2026-11-16 note. It admits the route, and its environment-scoped twin where scoping mounts it, into the control-plane **discovery** role; names the carrier (the anonymous-door sweep's `discovery` row only, no `ALLOW_ROUTES` row, because the handler never calls `enforceAuth`); says what it serves (a constant open profile; the one added anonymous fact is the spec version, which `/discovery`'s `version` states too unless an operator stamp replaces it); gives the reason (`os validate --target URL` without a credential, plus cloud parity, objectstack-ai#31240 comment 6716619631); and cites ruling A on objectstack-ai#35848 and the review record 7038862149. Nothing else in the ADR changes. The generated ADR index is unchanged (`pnpm check:adr-index` exit 0; the index row shows the status line's opening only). - **Sweep classification** (`packages/qa/dogfood/test/anonymous-door-sweep.classification.ts`): the `discovery` outside family's `routeIs(…)` gains `GET /api/v1/discovery/restriction-profile`, and its reason names the amendment. It is edited in the same commit as the amendment, as the header requires. - **Changeset** `.changeset/34774-restriction-profile-route.md`: `'@objectstack/rest': patch`. `@objectstack/dogfood` is private, so it takes none. ### Clause-② reading `yes — widening`. The diff adds one GET route at a path nothing served before (the CLI's `RESTRICTION_PROFILE_ROUTE` got a 404 from every self-hosted runtime). No existing route, schema, export, error code or default changes. The new answer for an anonymous caller is a 200 where the ADR's everything-else class answered 401, which is exactly what the ruled amendment admits. No published `exports`, spec shape or authorable key changes, so `Metadata-protocol: none` and `patch`. ## Tests <details><summary>rest: full suite, typecheck, and the three route files at ccc73c8</summary> - `pnpm --filter @objectstack/rest test` (under the verify lock, after a full `pnpm build`): `Test Files 424 passed (424)`, `Tests 8648 passed | 351 skipped (8999)`; lock `VERDICT command-exit 0`. - `pnpm --filter @objectstack/rest --filter @objectstack/dogfood typecheck`: lock `VERDICT command-exit 0` (rest's `tsc --noEmit` plus `check:test-typecheck`; dogfood's `tsc --noEmit`). - Targeted, verbose: `discovery-schema-conformance.test.ts`, `rest-config-mount-table.pin.test.ts`, `rest-route-ledger.conformance.test.ts`: `Test Files 3 passed (3)`, `Tests 54 passed (54)`, including "api.enableDiscovery: on → mounted, off → exactly 3 route(s) gone", "answers { success: true, data } on both mounts…" and "reads no query parameter: an unknown one is refused 400 VALIDATION_ERROR". </details> <details><summary>The anonymous-door sweep, run locally on the booted showcase, plus a one-time ablation</summary> - `pnpm --filter @objectstack/dogfood exec vitest run --maxWorkers=2 test/anonymous-door-sweep.dogfood.test.ts`: `Test Files 1 passed (1)`, `Tests 21 passed (21)`; lock `VERDICT command-exit 0`. This is the merge-group battery file that review F1 said would go red; PR CI skips it. - Ablation (one time, not kept): `scripts/ablation-replace.mjs` replaced the new `routeIs` key with an unmatched one (anchor x1 → x0, blob `8f35c855bae2` → `f861b4156a21`). The everything-else case went red, `Tests 1 failed | 20 passed (21)`, with exactly one route in that class: this one. So the route is in the swept population and the new key is what classifies it. Restored: blob == HEAD `8f35c855bae2`, `git diff HEAD` empty. A first attempt was a no-op that the tool refused before running anything (its replacement text already occurred in the file), so it measured nothing. - The environment-scoped twin: the sweep's showcase boot does not enable environment scoping, and the ablation's red named only the unscoped route, so the row lists that route alone. The ADR amendment admits the twin where scoping mounts it. </details> ## Verification **Real boot** (after a full `pnpm build`, the way round 1 did): `pnpm dev:crm -- --fresh -p 38775`, then - anonymous `curl http://127.0.0.1:38775/api/v1/discovery/restriction-profile` → `HTTP 200`, body `{"success":true,"data":{"allowCode":true,"allowSandboxedJs":true,"allowScheduledAutomation":true,"allowedFlowNodeTypes":[…23 node types…],"versions":{"spec":"18.6.0","skills":"18.6.0"}}}`; - the same URL with `?x=1` → `HTTP 400`; control: anonymous `GET /api/v1/data/account` → `HTTP 401`; - `os validate --target http://127.0.0.1:38775` in `examples/app-crm` → exit 0, printed `Target profile: http://127.0.0.1:38775/api/v1/discovery/restriction-profile` and `✓ Validation passed`. The server was torn down by its recorded pid and port. **Two-minute check:** boot any example (`pnpm dev:crm -- --fresh -p PORT`) and `curl -i http://127.0.0.1:PORT/api/v1/discovery/restriction-profile` with no credential. Expect 200 and the open profile with the spec version. **Read first, by risk:** 1. `docs/adr/0138-…md`, the new dated note under D2: the governed text, and the carrier statement (sweep row only, no `ALLOW_ROUTES`). 2. `packages/rest/src/discovery-routes.ts`, the route handler: no `enforceAuth`, the empty closed query set, the 503 branch. 3. `packages/qa/dogfood/test/anonymous-door-sweep.classification.ts`, the `discovery` row. <details><summary>Gates at ccc73c8</summary> - `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` derived 83 commands at ccc73c8. Each was run with its exit captured before any pipe: 83 exit 0. `node scripts/check-plugin-teardown-shape.mjs --self-test` first exited 3 (PREREQUISITE NOT MET: its pinned control commit `621a4876` was not in this shallow clone); after `git fetch --depth=1 origin 621a487…` it exited 0 with "48 cases pass", and that exit is the one recorded. - `--ran` reconciliation: "83 derived, 83 run, 0 NOT-MEASURED, 0 UNRUN", exit 0. - `node scripts/pm/overlap-check.mjs --branch=claude/area-a4C-34774-face3`: `VERDICT clean exit 0` (origin/main merges cleanly; objectstack-ai#35865 shares the ledger and the mount-table pin and merges cleanly). - Not run locally: `test:repo` and the full CI farm; CI owns them. </details> ## Acceptance notes - **Landing is Tier H** (`docs/adr/**`, Prime Directive objectstack-ai#14): this PR lands only by the maintainer's hand or an authorized approval, after the seat's CONTRACT_REVIEW_TIER review. Never readied, queued or labelled by a seat. - The `discovery` outside family keeps no `expect` predicate: D2 states no answer for it, and the classification header forbids pinning one route's own answer. A 200 is accepted there as it is for the REST root; the everything-else red in the ablation is what pins the classification. - Size: 11 files, +268 / −13 against the merge-base (round 3 alone: 8 files, +98 / −12, net 86). Session: https://claude.ai/code/session_016WV4d1k1GRsQbF3vCPKxhz 🤖 Generated with [Claude Code](https://claude.com/claude-code) ## Round 3 (seat S1/S2) Answers the seat contract review [7062697033](objectstack-ai#35887 (comment)) (S1, S2, nits a and b) under claim amendment 3 (7062738586). Nit c is a CLI-lane card and is not here. - **S1, route (b), text only.** The body stays the constant open profile ruling A admitted. The ADR-0138 dated D2 note and the docblock of `openRestrictionProfile` now say plainly: `allowedFlowNodeTypes` is the profile's whole node-type vocabulary, the approvals plugin's `approval` / `approval_revise` included. It is not a statement of which plugins this kernel runs, so `os validate --target` against a self-hosted runtime does not check whether an approval flow has an executor there. The spec-side reader rule goes to spec-lane card objectstack-ai#36081. Neither the body nor the ruling's scope moves. - **S2, the CJS manifest anchor.** New `packages/rest/tsup.config.ts`: the shared root config's settings unchanged (same entry, formats, dts, target, sourcemap, sources-content drop), plus `shims: true`, with a LOAD-BEARING comment in the shape of `packages/mcp/tsup.config.ts`. `packages/rest/package.json`'s `build` script drops `--config ../../tsup.config.ts` so tsup reads the package config (one line; without it the new file would never be read). Measured on the rebuilt `dist/index.cjs`: 0 occurrences of an emptied `var import_meta = {}` (was 2 under the ablation below), and the `getImportMetaUrl` shim is present. This also repairs `loadOpenApiSpec` in `rest-server.ts`, which spells the same `createRequire(import.meta.url)` and could not read the static OpenAPI artifact through the `require` entry. The changeset says both. - **Pins.** (a) The 503 branch: a fresh module graph (`vi.resetModules`) with `module`'s `createRequire` failing only for `@objectstack/spec/package.json` → `503`, `code: SERVICE_UNAVAILABLE` (the flat `sendDeclaredFault` dialect), no `data`. (b) Both formats: a second `check:dual-build-cjs-loads` behaviour probe, on `@objectstack/rest`, serves the route through the public `RestServer` from `dist/index.cjs` and `dist/index.js` and requires both to answer the installed `@objectstack/spec` version. The probe table gains an optional `call` (a function source, awaited), with one new self-test case; the AGREES battery floor moves 5 → 6. - **Nits.** (a) `RESTRICTION_PROFILE_PARAMS`, an exported empty closed set, replaces the inline `[]`. (b) ADR-0138 criterion 2's discovery-documents item and the `discovery-routes.ts` anchor invariant now name the route. **Version disclosure.** `/discovery` answers its anonymous `version` as the `OS_RUNTIME_VERSION` stamp when one is set, otherwise the `@objectstack/metadata-protocol` package version. `@objectstack/metadata-protocol` and `@objectstack/spec` are in one `fixed` changeset group, so without a stamp the two numbers are the same on any install that resolves one release of the platform; they differ only on an install that resolves the two packages at different versions, or where the manifest read fails (`/discovery` then says `unknown`, and this route answers 503). With a stamp set, they differ: this route exposes the exact `@objectstack/spec` version, which `/discovery` does not. **Ruled A: keep the exact version.** The maintainer chose A on the version-disclosure decision card on 2026-11-21 (Ruling-ref: objectstack-ai#34774 comment 7065230616): `versions.spec` / `versions.skills` stay the exact resolved `@objectstack/spec` version, as implemented. Trimming to major.minor was not chosen: `RestrictionProfileSchema` requires SemVer 2.0.0 and `restrictionProfileVersionDrift` compares by string equality, and an operator who wants the route hidden already has `api.enableDiscovery: false`. No docs sentence about `OS_RUNTIME_VERSION` is added. <details><summary>Round 3 verification</summary> At head `e5488dde62`, under `scripts/pm/os-verify-lock.sh`: - Closure + package build: `pnpm --workspace-concurrency=2 --filter '@objectstack/rest^...' build && pnpm --filter @objectstack/rest build` → `VERDICT command-exit 0`. - `pnpm --filter @objectstack/rest test` → `Test Files 425 passed (425)`, `Tests 8676 passed | 351 skipped (9027)` (the route conformance tests, the new 503 pin and the mount-table pin included); `pnpm --filter @objectstack/rest typecheck` (tsc + `check:test-typecheck`) → OK; one `VERDICT command-exit 0` for both. - The 503 pin went red once, locally and in CI at `4a4e4685` (`expected undefined to be false`): it asserted `success: false`, which the flat `sendDeclaredFault` dialect does not send. It now asserts `code: SERVICE_UNAVAILABLE` and no `data`; fixed in `e5488dde62`. - `node scripts/check-dual-build-cjs-loads.mjs --self-test` → `94 cases pass`. The full scan exits 3 (PREREQUISITE NOT MET: not every package is built in this worktree), so the shipped probe table was run through the gate's own exported `runBehaviourProbes` on the two built entries it names (`@objectstack/rest`, `@objectstack/metadata-core`): `findings: [], ran: 2`. The full scan is CI's reading. - **Ablation** (one time, not kept): `scripts/ablation-replace.mjs --delete` on the ` shims: true,` line (lines after mutation: 0), rebuild, `ablation-dist-preflight.mjs @objectstack/rest getImportMetaUrl --absent` → dist marker absent from all 6 built files, `var import_meta = {}` ×2 in `dist/index.cjs`; the probe went red: `the two formats DISAGREE — require said 'status 503', import said '18.6.0'`. Restored: blob == HEAD `a87f404dab54`, `git diff HEAD` empty; rebuilt; preflight (present mode) → marker in `dist/index.cjs`, tree clean; probe `findings: []`. The preflight's tree reading refused on the mutate leg (the source spells `shims: true`, the dist marker differs); the dist reading is the one recorded. - `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` at `e5488dde62` derived 115 commands. 85 were run, exits captured per command: 84 exit 0 (among them `check:adr-index`, `check:adr-anchors`, `check:nul-bytes`, `check:adr-links`), 1 exit 3 (`check:dual-build-cjs-loads`, prerequisite as above). 30 were not run (`check:pm-dispatch-gates` through `check:workspace-manifest-cycles` in derivation order), stopped at the maintainer's handover order: NOT MEASURED, CI's reading. - The anonymous-door sweep files did not change; not re-run. </details> <!-- signed: repo:objectstack#4 · os-project-manager · session_01FEkQ5miLqNucRZevceHwNh --> --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Elon · project thread
Part of #34774
Clause-②: yes — widening: a new optional tool input and one new instructions line; the major refusal applies only to a client that sends the new input, so nothing a client could send before is refused.
Metadata-protocol: none
维护者速读
What changes
Two faces, so the seat's contract read can find each one:
packages/mcp/src/mcp-server-runtime.ts). Where a connection lists authoring tools, the open server's defaultinitializeinstructions carryAuthoring contract: @objectstack/spec VERSION.as their second paragraph. VERSION is the@objectstack/specthis process resolves, read from itspackage.json. The draft-save check reads the same file, so both faces state one value. The line is sent only where the authoring family registers tools, as the existing drafts line is. The existing pin for a connection with no build door says its default text must promise no building. The line therefore did not join that text, and that pin is unchanged. A host text or a configured text is left whole, as before.packages/runtime/src/domains/mcp-authoring.ts).save_metadata_drafttakes an optionalclientSpecVersion, a SemVer string, and its input-schema description tells a client to send it.VALIDATION_ERROR400 before any write. The message names both versions and the command to run,npm i -D @objectstack/spec@SERVER_VERSION. No existing install-line wording for the spec package was found inpackages/**.specVersionAdvisorywith the same command.VALIDATION_ERROR400, naming the expected form.packages/resthas no diff against the merge base 7878cf0 (git diff 7878cf05 HEAD -- packages/restis empty).Scope-out: face 3 (the anonymous restriction-profile route, card Done-when part 2) is split to decision card #35848 (ADR-0138 D2 amendment, seat contract review 7038862149 F1); code parked on claude/area-a4C-34774-route @ c7890e5
Round 3: commit a8e9136 removes face 3 (the route, its
REST_ROUTE_LEDGERrow, the mount-table pin's third discovery route back to 2, the conformance cases), drops@objectstack/restand the route paragraph from the changeset, and rewords two comments that named the route. Faces 1 and 2 are unchanged in code. No history rewrite.Clause-② reading
Question: on main, does the dispatcher enforce
additionalProperties: falseon thesave_metadata_draftparameters, or only advertise it? If it only advertised it, an unknownclientSpecVersionkey would pass today, and a major refusal would be a narrowing.Finding: it is enforced at dispatch, so this change is a pure widening.
toolInputSchemainmcp-server-runtime.tsconverts a definition's JSON Schema withz.fromJSONSchema. My diff leaves that code as it is on main 7878cf0.{ type: 'object', properties: {…}, required: [...], additionalProperties: false }the result is aZodObject.safeParseof{ type: 'object', clientSpecVersion: '17.0.0' }answersunrecognized_keys: ["clientSpecVersion"].mcp-tool-bridge-input-schema.test.tspins this ("CONSEQUENCE: the SDK rejects arguments that do not match the declared schema").mcp-server-runtime.authoring-scope.test.tssuite ("a closed authoring tool input refuses an undeclared key before the registry is called"):handleHttpRequest, withsave_metadata_draft's pre-change parameters, atools/callcarryingclientSpecVersionis refused. The refusal names the key, and the authoring registry receives 0 calls.clientSpecVersionwas already refused at the schema.clientSpecVersionis unchanged, pinned inmcp-authoring.test.ts("a save without it, or with the same major and minor, answers byte for byte as before"):saved,verdict,review.toEqualpin on the save's exact body andsaveMetaItemarguments also passes unedited.Seat ruling (repo:objectstack#4, 2026-11-20, option A): the
Authoring contractline goes only to connections that serve the authoring tools; pin #32766 (a connection with no build door hears nothing about building or authoring) stays unedited. How a client that builds offline reads the server's version (the restriction profile) is split out with face 3 to decision card #35848; this PR serves no such route. With the measurement above, the seat records this PR as a pure widening.Tests
packages/mcp/src/initialize-selection-rule-34686.test.ts, new describe:metadata:write, with or withoutdata:read.data:readwith a registry, and for an empty registry.packages/mcp/src/mcp-server-runtime.authoring-scope.test.ts: the Clause-② pin above. Pin edited in place: the helperwithoutDraftsParagraphnow also strips the contract paragraph, and the "default plus the paragraphs its tools earn" case asserts both paragraphs. Old answer: one paragraph is added. New answer: two are added, the drafts line and the contract line, by this card.packages/runtime/src/domains/mcp-authoring.test.ts, new describe:Verification
Two-minute check:
pnpm --filter @objectstack/runtime exec vitest run --project local src/domains/mcp-authoring.test.ts. Expect theclientSpecVersiondescribe green, including the case where another major is refused withnpm i -D @objectstack/spec@and nothing is written.Read first, by risk:
packages/runtime/src/domains/mcp-authoring.ts:clientSpecVersionVerdictand its call in thesave_metadata_draftcase. This is the refusal before any write.packages/mcp/src/mcp-server-runtime.ts:AUTHORING_CONTRACT_LINEand its gate inopenServerInstructions.Local test and gate readings (head a8e9136)
pnpm --filter '@objectstack/mcp^...' --filter '@objectstack/runtime^...' run build):VERDICT command-exit 0.pnpm --filter @objectstack/mcp test: Test Files 80 passed (80), Tests 1446 passed (1446),VERDICT command-exit 0.pnpm --filter @objectstack/runtime test(thelocalproject, the package's owntestscript): Test Files 633 passed (633), Tests 11684 passed, 25 skipped (11709),VERDICT command-exit 0.typecheckfor@objectstack/mcpand@objectstack/runtime:VERDICT command-exit 0(tsc --noEmitpluscheck:test-typecheck).@objectstack/restsuite: not run this round, becausepackages/resthas no diff against the merge base.dispatch-gates.mjs --commands, 69 commands): 67 exit 0; 2 NOT MEASURED, both exit 3 (prerequisite not met):check-plugin-teardown-shape.mjs --self-test(its positive control is a pinned commit this shallow clone cannot reach) andcheck:dual-build-cjs-loads(it readsdist/of packages outside this closure). CI runs both.--ranreconciliation: 69 derived, 67 run, 2 NOT-MEASURED (derived from recorded exit 3), 0 UNRUN.overlap-check --branch=claude/area-a4C-34774:VERDICT clean exit 0.if (clientMajor !== serverMajor)was changed toif (false && …)throughscripts/ablation-replace.mjs(the anchor went from 1 hit to 0, and the blob changed). The "done when" case went red (1 failed / 3 passed). The file was restored to the HEAD blobf0d6ca7, andgit diff HEADwas empty.Acceptance notes
MCPServerRuntime.start) is not touched, because the card names the open HTTP server. Carried by p3 mcp stdio server: state the authoring contract version in its default instructions (scope-out of PR #35838) #35841.git diff --shortstat 7878cf05 a8e9136ee).Session: https://claude.ai/code/session_016WV4d1k1GRsQbF3vCPKxhz
🤖 Generated with Claude Code