Repository navigation
feat(mcp): search and read the installed apps' manuals over MCP, with the answer order in initialize - #35564
Conversation
Claude-Session: https://claude.ai/code/session_01Utp6CZLCXjj9QDJSWktRrW Co-authored-by: Claude <noreply@anthropic.com>
…a fixture package Claude-Session: https://claude.ai/code/session_01Utp6CZLCXjj9QDJSWktRrW Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6CZLCXjj9QDJSWktRrW Co-authored-by: Claude <noreply@anthropic.com>
…ay the metadata load at collection Claude-Session: https://claude.ai/code/session_01Utp6CZLCXjj9QDJSWktRrW Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 3 package(s): 38 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 9 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 184 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 c858927e8f8fd40a1d57c2d1239f1e78724decb4 && git checkout c858927e8f8fd40a1d57c2d1239f1e78724decb4
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin bf69cb41cc1f6351b0b0365ad7842a561611190f 3bbf1a9817cfeb7b09d0a60b34eb78fbcf58747a && git checkout -B drift-repro bf69cb41cc1f6351b0b0365ad7842a561611190f && git merge --no-ff 3bbf1a9817cfeb7b09d0a60b34eb78fbcf58747a
node scripts/docs-audit/affected-docs.mjs --json bf69cb41cc1f6351b0b0365ad7842a561611190f
|
|
repo:objectstack#5 · os-bill · session_01Utp6CY9JfbUzkuca2gUyu6 Final green head for review · 2026-11-19T16:00Z |
|
repo:objectstack#5 · os-bill · session_01Utp6CXsZsKmgG1EcKp5bY4 维护者速读
席位核对L1-a: ACCEPT · head Readings, my own: Visibility: one rule, the gate's.
Answer order. Pins (names grepped).
Declaration: agreed.
Nit, non-blocking. The changeset and the Routing. The diff touches |
|
repo:objectstack#5 · os-bill · session_01Utp6CbUb7TcZK1XUAddUmQ Contract reviewServed-tier: PR #35564, card #35442. Read: the card body and its six comments, the PR body and its eleven files, the net diff against ① Derived judgments
② Semver levelClause-②: yes — agreed. Two tools on the published door and two names on one exported list widen the surface; the line stands on the PR body and in the changeset, with no arm written, which the rule allows. The changeset is ③ Boundary flagsThe dev report's
SQL push-down: the diff adds no SQL and no id materialisation. The search is an in-app scan of the merged ④ Design judgment
S1 (should-fix) — the stated ranking is not the implemented one. The S2 (should-fix) — on an OAuth grant the audience is asked about the token's envelope, not the person.
Close it one of two ways: ask the gate about the delegator's own holdings on an agent envelope, with a pin for that case; or keep the envelope, say so in the two descriptions, the changeset and the header, and pin the agent case as the stated limit. ③ escalates the choice. N1 (nit) — both descriptions promise a url to cite. A page with no N2 (nit) — N3 (nit) — each call makes three list reads (the doc list, the book list inside the doc arm, the book list again), and Implemented-by: VERDICT: PASS |
- search_package_docs: the description, the registerPackageDocTools jsdoc, the runtime helper header and the changeset state the real order: pages with more of the terms first, then the sum of where each is found (title, heading, text), then title. - Both doc tools say that on an OAuth connection the docs audience is judged on the connection's grant, not the person's own permission sets; the helper header drops its parity claim. A runtime test pins it: on the agent envelope a permission-set manual is neither found nor read, though the delegating person holds the set. - Both descriptions promise a url only where the page has one. - The heading parse is line-based and linear, with tests for a long-whitespace heading and a bare '#' line followed by text. Claude-Session: https://claude.ai/code/session_01Utp6CZLCXjj9QDJSWktRrW Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#5 · os-bill · session_01Utp6CY9JfbUzkuca2gUyu6 Final green head for review (fix round 1, from L2 7014988834 and the seat's routing) · 2026-11-19T17:18Z |
|
repo:objectstack#5 · os-bill · session_01Utp6CbUb7TcZK1XUAddUmQ Contract reviewServed-tier: Delta d1 on PR #35564, card #35442, over the record in comment 7014988834 (head What moved: one commit, Check-runs on this head: 73 runs, 59 success, 13 skipped, none failed, one cancelled. The cancelled one is a ① Derived judgments
② Semver levelClause-②: yes — agreed, unchanged. The line stands on the PR body and in the changeset. The changeset's frontmatter is untouched: ③ Boundary flagsThe dev delta raises no open question. The three items the first record escalated:
SQL push-down: the delta adds no SQL and no id materialisation. No finding. ④ Design judgment
S1: closed N2 and N3 are untouched and stay as nits, left or for a follow-up. No must-fix, no should-fix. N4 (nit) — the agent case's ceiling set is spelled N5 (nit) — N6 (nit) — the stated order (the count before the place sum) holds for up to six distinct terms, since one score carries both. The door caps Implemented-by: VERDICT: PASS |
|
repo:objectstack#5 · os-bill · session_01Utp6CY9JfbUzkuca2gUyu6 Landing · ACCEPT (L1-a) → PR #35564 comment 7014557265 · L2 PASS 7014988834 + delta PASS 7016747283 · head
Area ai-1 landing armed (ready + auto-merge). The PR is |
…person's own permission sets (objectstack-ai#35888) <!-- 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#35584 Clause-②: yes — widening: on a delegated agent token whose scope reaches the docs tools, a permission-set-gated package doc is now found and read when the delegating person holds that set (ADR-0090 D10, ceiling ∩ delegator); nothing served today is refused, a non-holder and a token without docs-tool access still see nothing. Seat runs a contract read before ready; security#2 checks the head read-only before merge. Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:用户通过自己的 AI 助手授权登录后,助手能搜到、读到只给某个权限集看的应用手册——前提是本人持有这个权限集,且这次授权包含读数据的范围;其他人和其他手册不变。 - 为什么做:外部 AI 助手接入平台这条线上的遗留问题(应用手册查询的后续);本人在控制台能看的手册,在自己的助手里却搜不到。 - 出错会怎样:碰到的是通过授权登录使用 AI 助手查手册的人;最坏是该看的手册仍看不到,或权限集手册多给了不持有的人看;改动只在一处读权限的地方,可直接撤回。 - 要你做什么:无。 ## What changes On an OAuth MCP connection the request is an agent acting on behalf of the person who consented (ADR-0090 D10). `search_package_docs` and `read_package_doc` read every page through the `/meta/doc` docs-audience gate; for a manual whose audience is `{ permissionSet }`, the gate asks the security service for the caller's permission-set names. Until now that caller was the agent envelope, whose sets are the token's scope-derived ceiling, so a manual restricted to a set the person holds was neither found nor read on that connection. - `packages/runtime/src/domains/mcp-package-docs.ts`: `packageDocsReadGate` takes the data engine. On a delegated agent envelope (`principalKind: 'agent'` with `onBehalfOf.userId`), the holdings the audience reads are the person's own: `resolveUserAuthzGrants` in the request's organization (`tenantId`), the grant resolution the open draft door uses, without that door's `manage_metadata` admission. It fails closed the way the security plugin's delegator resolution does: no `sys_user` row, no current membership in the organization (`vetOrganizationClaim`), or a read that throws leaves the person with no set, so permission-set audiences stay closed. The envelope's ceiling sets are never read for the audience and never unioned in. Holdings are resolved once per gate, and only when a permission-set audience is in play. A non-delegated principal (session, API key, AI service account) is unchanged. - `packages/runtime/src/domains/mcp.ts`: the docs seam rides the bridge only where the grant reaches the docs tools (no grant, or `data:read`). `packageDocToolsServed` in `@objectstack/mcp` stays the authority on listing; the runtime reads the same condition so a token that cannot reach the tools never has the person's holdings read. The bridge call site hands the gate this request's data engine. - PR objectstack-ai#35564's stated limit: the helper header (`mcp-package-docs.ts`) no longer says the envelope's ceiling is the caller, and the test header and the pin are rewritten to match. The pending objectstack-ai#35442 changeset is corrected (below). - `packages/mcp/src/mcp-http-tools.ts`, text only (commit 3dae06c, under the amended claim): the `registerPackageDocTools` docblock, the `searchPackageDocs` bridge-member docblock and both tool descriptions now say that on an OAuth connection whose grant reaches the docs tools, the docs audience is the delegating person's own permission sets, never wider. Each description is shorter than before (`tools/list` weight, objectstack-ai#34689): `search_package_docs` -25 bytes (100 to 75 for the changed sentence), `read_package_doc` -29 bytes (93 to 64). No behaviour changes; no test pins either string. - Changeset `.changeset/35584-delegated-docs-audience.md` (`@objectstack/mcp` and `@objectstack/runtime`, patch). **DELIBERATE CORRECTION** of a pending release note: `.changeset/35442-mcp-app-docs-tools.md` (unreleased). Its sentence about OAuth grants now reads: "On an OAuth grant the request is an agent acting for the person who consented, and a permission-set audience is read against that person's own permission sets (ADR-0090 D10), never the token's scope-derived sets." The dropped sentence ("Both tool descriptions say so.") no longer holds. `check-empty-changeset` is red on this by design; the dispatching seat's record confirms it. **Pin flipped in place** (`mcp-package-docs.test.ts`): "on an OAuth grant the caller is the agent: the page is neither found nor read though the delegator holds the set" answered CLOSED for a holder; it is replaced by "the holder of the set finds and reads the page", which answers OPEN. Card objectstack-ai#35584, maintainer ruling A. ## Ruling conditions | Condition (ruling A) | Pin in `packages/runtime/src/domains/mcp-package-docs.test.ts` | |:--|:--| | 1. The token's scope must still reach the docs tools. | `a token whose scope does not reach the docs tools is carried no docs member, whatever the person holds` (person holds the set; token `metadata:write` + `actions:execute`; both members absent, scopes passed unchanged to the MCP runtime) | | 2. Delegator's own holdings by grant resolution; fails closed for a missing person or one outside the organization; never a union; AI service accounts keep their own sets. | `the holder of the set finds and reads the page…`; `fails closed: a person with no user row, or with no membership in the request's organization, holds no set`; `no union: a manual whose audience is a set only the token's ceiling carries stays closed`; `an AI service account keeps its own sets` | | 3. Keep the non-holder control; a token that cannot reach the docs tools finds and reads nothing. | `control: a person who does not hold the set in the token's organization neither finds nor reads it` (new, OAuth); the session pair `a page only a permission-set manual claims is neither found nor read without the set` / `control: the holder…` kept; the scope pin above | | 4. security#2 does a read-only check of the head before merge. | Not a code pin: security#2 checks this PR's head read-only before merge. | Default-audience pages are unchanged: every OAuth pin asserts the default page `crm_order_payment` is still found, including the fail-closed and no-union cases. ## Clause-② reading Widening only. Nothing served today is refused: the change opens permission-set manuals to a delegated token whose person holds the set and whose scope already reaches the tools. Every answer that was CLOSED for a non-holder stays CLOSED, and a token without `data:read` was already listed neither tool by the MCP runtime, so dropping the seam from its bridge changes nothing it is served. ## Verification - Two-minute check: `pnpm --filter @objectstack/runtime exec vitest run --maxWorkers=2 src/domains/mcp-package-docs.test.ts` — 18 tests pass. - Files to read first, by risk: `mcp-package-docs.ts` (`packageDocsReadGate`, `delegatorHoldingsCaller`), `mcp.ts` (the `packageDocs` scope condition), the new describe block in the test. <details><summary>Ablation (each leg mutated on disk through scripts/ablation-replace.mjs, then restored; HEAD blob hashes re-matched)</summary> - A1 user-row check removed: red on `fails closed…` (1 failed / 17 passed). - A2 membership vet removed: red on `fails closed…` (1 / 17). - A3 delegated person not resolved (the old envelope behaviour): red on `the holder…` and `no union…` (2 / 16). - A4 union of the person's sets with the envelope's ceiling: red on `no union…` (1 / 17). - A5 scope condition removed in `mcp.ts`: red on `a token whose scope does not reach the docs tools…` (1 / 17). - After restore: `git diff HEAD` empty; `mcp-package-docs.ts` 2334108 and `mcp.ts` f101e59 equal their HEAD blobs. </details> <details><summary>Local runs at head 3dae06c (origin/main 8145424 merged in, then the mcp text commit)</summary> - Closure build `pnpm --workspace-concurrency=2 --filter '@objectstack/mcp^...' --filter '@objectstack/runtime^...' build`: VERDICT command-exit 0. - `vitest run src/domains/mcp-package-docs.test.ts` (runtime): 18 passed (18). `vitest run` of the mcp doc-tool, tools-list weight and initialize selection-rule files: 3 files, 26 passed (26). - `pnpm --filter @objectstack/mcp test`: Test Files 82 passed (82), Tests 1452 passed (1452). `pnpm --filter @objectstack/mcp typecheck` and `pnpm --filter @objectstack/runtime typecheck`: VERDICT command-exit 0 (`check:test-typecheck: OK` for both). - `dispatch-gates --commands` (68 families, change set vs merge base 8145424), exit codes captured before any pipe: 66 exit 0; `check-empty-changeset --base origin/main` exit 1 (only `.changeset/35442-mcp-app-docs-tools.md`, the DELIBERATE CORRECTION, red by design); `check:dual-build-cjs-loads` exit 3 PREREQUISITE NOT MET (needs a whole-repo build), NOT MEASURED. `--ran` reconciliation: 68 derived, 67 run, 1 NOT-MEASURED. After the changeset line for `@objectstack/mcp` was added, the changeset, nul-byte, citation, closing-keyword and affected-docs gates were re-run on the final head: same answers. - `overlap-check --branch=claude/area-a4C-35584`: exit 1, the only overlap the bot's Version Packages PR objectstack-ai#35129 on `.changeset/35442-mcp-app-docs-tools.md`; `origin/main` merges cleanly. - Full runtime suite not re-run this round (runtime code unchanged since 942869d); CI runs it. </details> <details><summary>Earlier local runs (head 942869d; code identical to ea97649, the commit after which only a changeset changed)</summary> - Closure build `pnpm --workspace-concurrency=2 --filter '@objectstack/runtime^...' build`: VERDICT command-exit 0. - `pnpm --filter @objectstack/runtime typecheck`: exit 0 (`check:test-typecheck: OK`). - `pnpm --filter @objectstack/runtime test` (code tree ea97649): Test Files 634 passed (634); Tests 11712 passed, 25 skipped (11737); VERDICT command-exit 0. - `dispatch-gates --commands` (68 families), each run with its exit code captured: 65 exit 0; `check-empty-changeset --base origin/main` exit 1 (the DELIBERATE CORRECTION above, red by design); NOT MEASURED, exit 3 PREREQUISITE NOT MET: `check-plugin-teardown-shape --self-test` (shallow clone cannot reach its pinned fixture commit) and `check:dual-build-cjs-loads` (needs a whole-repo build). `--ran` reconciliation: 68 derived, 66 run, 2 NOT-MEASURED, 0 UNRUN. - `overlap-check --branch=claude/area-a4C-35584`: exit 1, the only overlap being the bot's standing Version Packages PR (objectstack-ai#35129), which consumes `.changeset/35442-mcp-app-docs-tools.md`; it is regenerated from `main`. </details> ## Round 3 (seat S1/S2) Head `183bed4d56`, text only, two files: - **S1** `packages/mcp/README.md`: the bridge paragraph now says that on an OAuth connection whose grant reaches the docs tools, a permission-set audience is read against the delegating person's own permission sets, never wider. A search of the head for the old sentence ("judged on the token's grant", "caller is the agent", "person's own permission sets") outside CHANGELOGs found no other stale copy. - **S2** `.changeset/35584-delegated-docs-audience.md`, second bullet: the organization sentences use the seat's wording verbatim (the organization the request runs in: the one the token's consent bound, while the membership there is current; no user row holds no set; an ended membership is read with no active organization, so no grant stored in an organization applies). No `Regen-provenance:` line is added to the changeset: that line is a seat-posted thread pointer (`scripts/pm/record-recognisers.mjs`), not changeset text. - Nits: nit a (a second membership pin through `oauthEnvelope`) was drafted but not verified before the handover stop, so it is not in this head. Nit b was not done: `packageDocsReadGate` has no logger, so it would take more than one line per arm. Nit c skipped, as the order says. - Not re-run this round: the closure build was stopped for the handover, so the runtime and mcp tests, typecheck and derived gates are NOT MEASURED on this head. No code changed; CI runs them. `check-nul-bytes`: OK. `overlap-check`: exit 1, the same Version Packages PR objectstack-ai#35129 overlap on `.changeset/35442-mcp-app-docs-tools.md` as before; `origin/main` merges cleanly. ## Acceptance notes - Holdings are resolved through `resolveUserAuthzGrants` directly in `mcp-package-docs.ts` rather than via a helper shared with `mcp-authoring.ts`: that file is outside this PR's claimed surface, and its reader is admitted on `manage_metadata`, which the ruling says must not apply here. The two readers now share the grant call, not the admission. - The scope condition (`data:read`, or no grant) is spelled once more in the runtime beside `packageDocToolsServed`, as the draft door reads `metadata:write` beside `grantsAuthoringTools`. If the MCP runtime's docs family ever changes, both must move. Session: https://claude.ai/code/session_016WV4d1k1GRsQbF3vCPKxhz 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- signed: repo:objectstack#4 · os-elon-musk · session_016WV4d1k1GRsQbF3vCPKxhz --> --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Bill · project thread
repo:objectstack#5 · os-bill · session_01Utp6CZLCXjj9QDJSWktRrW
Part of #35442 (the card stays open for the cloud carrier and the live acceptance).
Clause-②: yes
Metadata-protocol: none
维护者速读
What changes
packages/mcp):search_package_docs({ terms, package? })andread_package_doc({ name, package?, locale? }), the names the cloudservice-airegistry already holds. They register where the bridge carries both new optional members (searchPackageDocs,readPackageDoc) and the grant is the read family's (an API key or session, ordata:read). Search is a substring match on title, heading and text. Pages that contain more of the terms come first, then by the sum of where each contained term is found (title 3, heading 2, text 1), then by title; at most 10 results with excerpts. The description states the match rule, the order and the cap. The heading parse is line-based and linear. Read answers the Markdown content, cut at 60,000 characters with a note. An answer carries the page's console address/_console/apps/PACKAGE/docs/BOOK/NAMEwhere the page has one (a page with no package has none), and both descriptions say so.packages/runtime/src/domains/mcp-package-docs.ts, wired inmcp.ts) implements both members over the protocol's/metalist read. It reads thedocandbooklists throughcreateMetaListReadGate(the ADR-0046 §6.7 docs-audience gate), with this request's execution context as the caller, and adds no second visibility rule. A page the caller may not read is neither found nor read, and reading it answersRESOURCE_NOT_FOUND. On an OAuth grant the caller is the agent envelope (ADR-0090 D10), so the docs audience is judged on the token's grant (its scope-derived sets), not on the person's own permission sets: a{ permissionSet }manual the person holds stays hidden on that connection. This fails closed and is kept on purpose; both tool descriptions, the changeset and the helper header state it. BOOK is the home manual the Console's flat-permalink redirect would pick: the first readable manual of the page's package that claims it, else that package's first readable manual, else its implicit manual (§6.4). The bridge carries the members only where the protocol hasgetMetaItems.mcp-server-runtime.ts,initializeinstructions, gated like the mcp: the open door's initialize instructions carry the ask-data selection rule and the skills install line; /mcp/skill renders from the published skill #34686 selection rule): read the manuals first. A concept is answered from the manual, and a general explanation is labelled as one. A process or rule also needs its real definition, which wins where the two differ and the difference is named. The answer ends with page titles and urls. It names only tools the connection lists:describe_metadata, elseget_metadata_item, read off the authoring registry undermetadata:write. With neither, it says to answer from the manual and state that the configured process was not checked. Host and configured instructions are unchanged.skills/**is untouched.MCP_DOOR_TOOL_NAMES(@objectstack/spec/system) gains the pair.PLATFORM_PROVIDED_TOOL_NAMESis unchanged, since door/cloud overlap is by design (describe_object,query_records, …).scripts/check-route-envelope.mjsdeclares the new domain-folder file as{ handBuilt: 0 }(area-approved, comment 7013028695). README and a changeset are included.Tests
packages/runtime/src/domains/mcp-package-docs.test.ts(item 4) drives the bridge the real/mcpentry builds, over a fixture package with two manual pages. 「什么是回款」 (term 回款) finds 《订单与回款手册》 at/_console/apps/com.example.crm/docs/sales/crm_order_payment. 「商机的审批流程」 (商机, 审批) finds 《商机——阶段、提醒与审批》 first, with both terms matched. A page that only a{ permissionSet }manual claims is neither found nor read without the set; the control is that the holder finds and reads it through that manual's address. On the agent envelope an OAuth token produces, the page is neither found nor read even though the delegating person holds the set. The file also covers the implicit-manual address, the package filter, a translation match plus a locale read, the cap andtruncated, an ambiguous name, the no-list-read host, a long-whitespace heading (parses fast) and a bare#line followed by text (not a heading).packages/mcp/src/mcp-package-doc-tools-35442.test.tscovers the registration gate (grant and members, each with a control), argument hand-off and cap, thequery→termsrefusal, the read cut, and coded refusal relay. It also covers the rule's presence and absence withtools/list, the definition-reader naming (describe_metadata>get_metadata_item> none, with a writes-only registry as control), and that host and configured texts stay whole.mcp-file-tools.test.tsadds the pair to the conformance test that holdswireBridgeToolsequal toMCP_DOOR_TOOL_NAMES.Readings (head after the one pre-PR merge of main; fix-round readings last)
pnpm --filter @objectstack/mcp test: 79 files, 1439/1439 (before the merge; the merge touched no mcp file). After the merge, the three mcp files above: 77/77.src/**/mcp*.test.tsplus each test that builds the bridge (buildMcpBridge/handleMcp(), 38 files, 1096/1096. After the merge,mcp-package-docs.test.tsandhttp-dispatcher.mcp.test.ts: 29/29. The fullpnpm --filter @objectstack/runtime testexceeds the container's 10-minute foreground cap (exit 124): NOT MEASURED locally, left to CI'sTest Core.platform-tool-names.test.ts11/11;@objectstack/lintvalidate-ai-tool-references.test.ts28/28. Typecheck ofmcp,runtimeandspecpasses.spec check:generated: all 14 artifacts up to date after the merge rebuild.node scripts/ablation-replace.mjsreplacedawait createMetaListReadGate(readGate, 'doc')(…)with the raw list (anchor x1 → x0, marker x0 → x1). Result: 1 failed / 8 passed, with "a page only a permission-set manual claims is neither found nor read without the set" red. It then restored the file (blob == HEAD,git diff HEADempty). The runtime test imports the source, so no dist leg.dispatch-gates --commands) was run with exit codes, and the record is in the os-dev-report on the card. Two came back red and were fixed in this PR:check:route-envelope(the new file was undeclared) andcheck:test-source-alias(a module-topimport '@objectstack/metadata'). NOT MEASURED locally, all environment prerequisites and not findings:check-plugin-teardown-shape --self-test(shallow clone),check:skill-examples(exit 3, prerequisite),check:dual-build-cjs-loads(exit 3, needs a full build), andpnpm --dir ui exec vitest run scripts/(@objectstack/clientunbuilt here).mcp-package-docs.test.ts12/12; the mcp pair (mcp-package-doc-tools-35442.test.ts,mcp-file-tools.test.ts) 65/65;tsc --noEmitofmcpandruntimepass. Ablation of the agent pin:ablation-replace.mjshanded the gateonBehalfOf ?? ecinstead ofecinmcp.ts(anchor x1 → x0); result 1 failed / 11 passed, the agent-envelope case red; file restored. The gates the changed files derive were re-run, all exit 0 (record on the card).Acceptance notes
describe_metadata") cannot be followed on an API-key ordata:readconnection, because no tool there reads a flow or approval definition.describe_metadatais a cloud authoring tool and the open door'sget_metadata_itemneedsmetadata:write. Per the area's route (claim amendment 7012002705), the rule says the configuration was not checked there, and the door's own metadata read stays with Decision: open-source MCP — the client thinks locally, the server keeps a thin door (a metadata draft write entry for building; the data door for 问数), plus policy, version skew and the 问数 eval #34659 M-2 (on hold).opportunity_approvalread) is for after merge. CI covers the fixture.stdio-data-bridge.tsuntouched), so the stdio server lists neither tool. The README says so.locale, else the request'sAccept-Language, else the base text. Book labels are served as authored, without the translation bundle.initializetext gets no rule appended, the same as the mcp: the open door's initialize instructions carry the ask-data selection rule and the skills install line; /mcp/skill renders from the published skill #34686 rule. A cloud host that wants the order adds it to its own text.Verification
Read first, highest risk first:
packages/runtime/src/domains/mcp-package-docs.ts:readableDocsAndBooks, the two gate calls, which are the only visibility rule.packages/mcp/src/mcp-server-runtime.ts:packageDocAnswerRule/definitionReaderServed, the text every client reads.packages/mcp/src/mcp-http-tools.ts:registerPackageDocTools, the registration gate.Two-minute check:
pnpm --filter @objectstack/runtime exec vitest run --project local src/domains/mcp-package-docs.test.tsshould show 12 passed, including the two maintainer questions and the agent-envelope case.🤖 Generated with Claude Code
https://claude.ai/code/session_01Utp6CZLCXjj9QDJSWktRrW