Repository navigation
fix(runtime)!: MCP list_actions summarises each action against the object as the caller is served it (ADR-0106) - #31075
Conversation
… the caller is served it Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibvynRbCtMndW8EHNGc
…ied field's name Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibvynRbCtMndW8EHNGc
…projection Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibvynRbCtMndW8EHNGc
… field of an action's object Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibvynRbCtMndW8EHNGc
📓 Docs Drift CheckThis PR changes 1 package(s): 1 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
What this run could not see
Coarse fallback — 28 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 c13c292c112e0f12ffeb0540329165e6db6c0613 && git checkout c13c292c112e0f12ffeb0540329165e6db6c0613
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 3f61e4f8fb567160f839c3269ee95aa89ee4f1db fee5571477bdbf70e38ed3724b5a00a6e481b12c && git checkout -B drift-repro 3f61e4f8fb567160f839c3269ee95aa89ee4f1db && git merge --no-ff fee5571477bdbf70e38ed3724b5a00a6e481b12c
node scripts/docs-audit/affected-docs.mjs --json 3f61e4f8fb567160f839c3269ee95aa89ee4f1db
|
|
security#1 · os-tesla · session_01L9qibvynRbCtMndW8EHNGc Contract reviewServed-tier: Read against ① Derived judgmentsThe diff makes exactly one accept-set change and inherits one consequence of it. 1. Two things the body under-describes, both inherited from the 2. The refusal. A caller whose field visibility on a listed action's object cannot be evaluated, or whose projection leaves that object with no field, is refused the whole 3. The 4. Unchanged, confirmed in the cited code. Consumer hunt. Every reader of
Stock-boot judgment. The only shipped ② Semver level
③ Boundary flags
④ Design judgmentReusing the Break attempts, each against the published spec on
The narrowing takes no declared capability away at the consumer — no reader of the summary shape depends on a field the caller cannot read — and makes the spec's own promise real on the one MCP read where it was not. The cited code was read, not reviewed; nothing in it must change for this PR to hold. Implemented-by: VERDICT: PASS |
|
security#1 · os-tesla · session_01L9qibvynRbCtMndW8EHNGc 席位核对ACCEPT · 2026-11-07T03:51Z · head
Generated by Claude Code |
security#1 · os-tesla · session_01L9qibvynRbCtMndW8EHNGc
Clause-②: no (narrowing) —
list_actionsover/api/v1/mcpnow answers a caller only the actions, and the param details, that the/metaobject door's projection serves that caller, which ADR-0106 D1 ("a field the caller cannot read does not exist for that caller, on any plane") and the MCP security model already promise, so no stated contract is narrowed; what narrows is the answer to a caller with areadable: falsefield. Nothing is widened: no export, answer member, error code or status is added.Metadata-protocol: none
Skills-docs: no move —
skills/**teaches no param summary forlist_actions;content/docs/ai/connect-mcp.mdxstates the projection.维护者速读
list_actions(HTTP)对每个动作,按/meta对象门对该调用者的 ADR-0106 投影来判定与摘要:投影会隐去的动作(参数绑定了调用者不可读的字段,含objectOverride指向的他对象字段)不再列出;列出的动作,其参数摘要只读投影后的对象,不再带出不可读字段的名称、标签、说明或选项。/meta已隐去这类动作、describe_object已按调用者投影,唯独list_actions仍从未投影的对象读字段元数据。readable: false字段的调用者是收窄(标题带!);某动作所属对象的字段可见性无法评估或投影后无字段时,list_actions与list_objects一样拒绝(FIELD_VISIBILITY_UNRESOLVED/ 503);点名sys_*对象的run_action预筛以列表为准,被隐去的动作在那里同样被拒。无限制调用者、D4 豁免者、无 security 服务的部署逐字节不变。回滚即 revert 本 PR。packages/runtime/src/domains/mcp.ts(servedActionObject及其在listActions的调用点)、packages/runtime/src/domains/mcp-object-schema-mask.test.ts(新增的最后一个 describe)。pnpm --filter @objectstack/runtime exec vitest run src/domains/mcp-object-schema-mask.test.ts,预期Tests 23 passed (23)。What changes
packages/runtime/src/domains/mcp.ts— the HTTP MCP bridge gainsservedActionObject(action, obj): the action is projected as its object's onlyactionsentry throughservedToCaller, the same/metamasker and projection (resolveObjectMasker→maskObjectSchema)describe_objectuses.listActionsskips an action that projection withholds and summarises every kept one against the projected object. That is the/metaobject door's own rule (maskDeniedFieldReferences, an action'sparamsread byactionParamReadsDenied,objectOverridejudged on the object it names), not a second one.capabilityRefusal,run_actionandresume_runkeep readingreadServedObjects()whole, as before.content/docs/ai/connect-mcp.mdx— the security model states thelist_actionsprojection, and the troubleshooting row names it as a reason an action is missing.@objectstack/runtimepatch, BREAKING banner and the ADR-0087not-requireddisposition.Tests
A new top-level
describein the shared harnesspackages/runtime/src/domains/mcp-object-schema-mask.test.ts: the realSecurityPluginon a realObjectQLover a realSqlDriver, the protocol over that engine, the bridgehandleMcpbuilds for each persona over/api/v1/mcp, and the dispatcher's/metadata/object/:namedoor beside it.budgetand the other object'sratereadable: falseis listed neitherset_budget(params: [{ field: 'budget' }]) norquote_rate(params: [{ field: 'rate', objectOverride: … }]), and the listing equals the action set the/metadatadoor serves them; the field names, the label, the help text and the other object's label appear nowhere in the answer.objectOverrideto the other object's readablebudgetis listed, and its summary carries no label or help of this object's deniedbudget.FIELD_VISIBILITY_UNRESOLVED/ 503, aslist_objectsrefuses them.set_budgetsummary (budget,number,Approved budget — Spend ceiling the board signed off) and the cross-object one, byte-identical to a deployment with no security service; an action binding a readable field, and one binding none, is summarised to the restricted member exactly as to the control.Ablations, each through
scripts/ablation-replace.mjs(anchor hit 1 → 0, blob changed, restored to the HEAD blob withgit diff HEADempty). The suite imports the bridge fromsrc, so nodistleg applies.servedActionObjectreturns the object unprojected): 3 failed | 20 passed — the restricted listing, the cross-object summary and the refusal go red; the precondition, both controls and the 17 earlier cases of the file stay green.bb679937a9, before the refusal case was added (the refusal is raised by the projection itself, which this mutation keeps) — only the cross-object summary pin goes red.Acceptance notes
listActions(packages/mcp/src/stdio-data-bridge.ts), solist_actionsis an HTTP-only tool; nothing changes there.run_actionandresume_runresolve and gate against the unprojected declarations, unchanged. Running an action is judged byai.exposed, the capability gate, the installation switch, the param contract, confirmation and the subject record under row-level security; field readability is not one of those gates, and that is unchanged here. One consequence of the listing: therun_actionpre-screen for a call naming asys_*object admits only a listed action, so an action withheld here is refused there with the system-object sentence.Verification
Targeted suite
pnpm --filter @objectstack/runtime exec vitest run --maxWorkers=2 src/domains/mcp-object-schema-mask.test.ts→Test Files 1 passed (1)·Tests 23 passed (23).@objectstack/runtime, whole package, at fee5571 (origin/main merged)
pnpm --filter @objectstack/runtime testunder the verify lock →Test Files 553 passed (553)·Tests 8875 passed | 19 skipped (8894)·VERDICT command-exit 0.pnpm --filter @objectstack/runtime typecheck→VERDICT command-exit 0;check:test-typecheck: OK, the test layer held to its shrink-only debt ledger.pnpm --filter '@objectstack/runtime...' build, exit 0.Derived gate families (scripts/pm/dispatch-gates.mjs --commands, at fee5571)
90 derived, 90 run locally. 87 exit 0. Three refused on a prerequisite (exit 3), so NOT MEASURED here, each run by CI on this PR:
pnpm check:dual-build-cjs-loads, reason: it reads every package's built output and this worktree built only the runtime closure.pnpm --filter @objectstack/spec run check:skill-examples, reason:packages/client-react/distnot built here.pnpm check:type-check-debt, reason: its re-measure build did not get a turn on the shared verify lock (queue-timeout).--ranreconciliation: 90 derived, 90 run, 0 UNRUN.NOT MEASURED at open: the dogfood battery (
pnpm --filter @objectstack/dogfood test, title carries!), reason: queued behind another run on the shared verify lock; its reading goes to the seat's report.Generated by Claude Code