Skip to content

fix(rest, runtime)!: the /meta action doors and MCP list_actions serve an action entry as the object door projects it (ADR-0106) - #31104

Merged
objectstack-fleet[bot] merged 6 commits into
mainfrom
claude/sec-hardening-r21
Nov 7, 2026
Merged

objectstack-fleet[bot] merged 6 commits into
mainfrom
claude/sec-hardening-r21

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

security#1 · os-tesla · session_01L9qibvynRbCtMndW8EHNGc

Clause-②: no (narrowing) — the /meta action reads (the list, the item read, /layers with its ?layers=true spelling, and /published, on both transports) and MCP list_actions now answer a caller only the action entries the /meta object 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") already promises, so no stated contract is narrowed; what narrows is the answer to a caller with a readable: false field. Nothing is widened: no answer member, error code or status is added; the new exports are the shared projection the doors ask.
Metadata-protocol: none
Skills-docs: no move — skills/** teaches no /meta action read; content/docs/ai/connect-mcp.mdx and content/docs/deployment/environment-variables.mdx state the projection.

维护者速读

  • 改了什么:/meta 的 action 读取(列表、单项、/layers 及 ?layers=true、/published,REST 与 runtime dispatcher 两端)与 MCP list_actions,对每个独立动作条目按 /meta 对象门对该调用者的 ADR-0106 投影判定:参数绑定了调用者不可读字段的动作(按参数所指对象判定:有 objectOverride 取其目标,否则取动作的 objectName;含无所属对象的 global 动作)不再列出,单项读取的回答与不存在的名字逐字节相同;list_actions 对 objectOverride 参数的摘要改读目标对象的字段。
  • 为什么改:ADR-0106 D1 要求不可读字段在任何门都不存在;/meta/object 已隐去这类动作,但独立 action 条目的各个读取门与 MCP 的 global 动作仍未投影。
  • 风险与回滚:对带 readable: false 字段的调用者是收窄(标题带 !);动作所属对象的字段可见性无法评估时与对象门一样拒绝(FIELD_VISIBILITY_UNRESOLVED / 503)。无限制调用者、D4 豁免者(manage_metadata、system)、无 security 服务或关闭掩码的部署逐字节不变;执行门(MCP run_action、POST /actions)及其参数校验与拒绝文案不变。回滚即 revert 本 PR。
  • 先看:packages/rest/src/meta-item-read-gate.ts(projectMetaActionForCaller 及列表 7a、单项 4a、分层 3a 三步)、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 45 passed (45)。
  • 需要你做的:无,席位落地。

What changes

  • packages/rest/src/meta-item-read-gate.ts — projectMetaActionForCaller(sources, action, ownerName): one action entry as this caller is served it. The action is projected as its own object's only actions entry through projectMetaObjectSchema over the posture related to that document (the object door's maskDeniedFieldReferences → actionParamReadsDenied, objectOverride judged on the object it names), not a second rule. A passthrough posture serves the entry with no object read. An action with no own-object definition has only its objectOverride params judged, each on the caller's posture for the object it names; a posture that cannot be evaluated or is undetermined withholds it.
    • The list chain (step 7a) leaves a withheld entry out. The item chain (step 4a), the layered chain (step 3a, every present layer) and both /published doors answer it as a name with nothing behind it. projectMetaActionItem is the item-read entry the cached arm and the published doors ask.
  • packages/rest/src/meta-item-read-routes.ts — the cached item arm (the default door for action) asks the same projection, and judges If-None-Match after it, so a withheld entry is answered 404, never 304.
  • packages/metadata-core/src/object-schema-fls.ts — actionObjectOverrideTargets and actionServedWithoutOwnObject, the object door's own rule for an action with no own-object definition.
  • packages/runtime/src/domains/mcp.ts — servedActionObject delegates to projectMetaActionForCaller, so an object-less action is judged on the objects its objectOverride params name; listActions hands summarizeAction the served object of each override target.
  • packages/runtime/src/action-execution.ts — summarizeAction, summarizeActionParams and resolveDeclaredActionParams take an optional object lookup and read an objectOverride param's field on the object it names; a target the lookup does not resolve reads the own object's field, as before. enforceActionParams passes no lookup, so the run doors' validation and refusal text are unchanged.
  • packages/rest/src/rest-server.ts, packages/runtime/src/domains/meta.ts — each transport hands the item, layered and published chains its object masker (resolveObjectMasker).
  • Docs: connect-mcp.mdx and environment-variables.mdx state the projection. Changeset: a patch for @objectstack/metadata-core, @objectstack/rest and @objectstack/runtime, the BREAKING banner and the ADR-0087 not-required disposition.

Tests

A new top-level describe in packages/runtime/src/domains/mcp-object-schema-mask.test.ts: the real SecurityPlugin on a real ObjectQL over a real SqlDriver, the protocol over that engine, RestServer's registered handlers (cached arm, and a deployment with the cache off) and the runtime dispatcher, plus the MCP bridge.

  • A member denied a bound field (an own-object field, and a global action's objectOverride field) is not listed the action, and its item, /layers, ?layers=true and /published reads answer byte-identical to an unknown name, on every door. None of the field's label, help text or the param's label appears in the list.
  • The cached arm answers a member holding the staff's validator 404, and the staff still revalidates 304.
  • MCP list_actions withholds the global action; an objectOverride param is summarised with the target field's label and type.
  • Controls: a readable-field action, a field-less action and a readable global override are served to the member as to the staff; an author holding manage_metadata and the system context are answered byte-identical to the same caller with no security service, on every sub-door.
  • Unit pins: resolveDeclaredActionParams with and without the lookup (and enforceActionParams unchanged); actionObjectOverrideTargets and actionServedWithoutOwnObject.

Acceptance notes

  • Ablating the projection (projectMetaActionForCaller returns serve first) turns the 16 refused legs red (list, item, /layers, ?layers=true, /published per door, the 304 leg, MCP global, and the two fix(runtime)!: MCP list_actions summarises each action against the object as the caller is served it (ADR-0106) #31075 legs) while the 29 controls stay green. Ablating the target-field lookup turns the two summary pins red.
  • The /meta doors read an action's own object from its spec objectName; @objectstack/rest cannot reach objectql's legacy object rung, so an entry carrying only that key is judged as object-less there.

Verification

All on head c97eb416db (origin/main merged in), under the verify lock:

  • pnpm --filter @objectstack/metadata-core test — Test Files 25 passed (25), Tests 966 passed (966); typecheck exit 0.
  • pnpm --filter @objectstack/rest test — Test Files 393 passed (393), Tests 7486 passed, 332 skipped (7818); typecheck exit 0.
  • pnpm --filter @objectstack/runtime test — Test Files 553 passed (553), Tests 8909 passed, 19 skipped (8928); typecheck exit 0.
  • pnpm --filter @objectstack/runtime exec vitest run src/domains/mcp-object-schema-mask.test.ts — Tests 45 passed (45).
  • Dogfood battery (pnpm --filter '@objectstack/dogfood^...' build, then pnpm --filter @objectstack/dogfood test) — Test Files 434 passed, 3 skipped (437), Tests 3596 passed, 41 skipped (3637).
  • node scripts/pm/dispatch-gates.mjs --commands — 93 derived gate commands, all exit 0 (check:skill-examples and check:dual-build-cjs-loads re-run after their build prerequisite); --ran reconciles 93 derived, 93 run, 0 unrun.

Generated by Claude Code

…or and MCP list_actions

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9qibvynRbCtMndW8EHNGc
…d the object-less action judgment

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9qibvynRbCtMndW8EHNGc
…gh the action entry projection

The /meta/action/:name/layers read (and its ?layers=true spelling) and the
/published read answer a caller an action entry exactly as the plain item
read does: an entry binding a field the caller cannot read, judged on the
object each param names, is answered as a name with nothing behind it.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9qibvynRbCtMndW8EHNGc
…s and MCP list_actions

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9qibvynRbCtMndW8EHNGc
@github-actions github-actions Bot added size/l documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 7, 2026
@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 3 package(s): @objectstack/metadata-core, @objectstack/rest, @objectstack/runtime, touching 44 documentable anchor(s). ⚠️ 1 changed file(s) yielded no anchor (packages/rest/src/index.ts), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

13 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/ai/connect-mcp.mdx (via /meta/object/:name (route, a path literal in a comment on a changed line))
  • content/docs/api/wire-format.mdx (via /meta/object/:name (route, a path literal in a comment on a changed line))
  • content/docs/concepts/metadata-lifecycle.mdx (via /meta/object/:name (route, a path literal in a comment on a changed line))
  • content/docs/data-modeling/formulas.mdx (via /meta/object/:name (route, a path literal in a comment on a changed line))
  • content/docs/deployment/production-readiness.mdx (via /meta/object/:name (route, a path literal in a comment on a changed line))
  • content/docs/frontend/data-objectstack.mdx (via /app/:appId/bundle (route, bridged from symbol createMetaItemAnswer — its route source's handler names it; bridged from symbol metaItemAnswerSources — its route source's handler names it; bridged from symbol metaListSource — its route source's handler names it))
  • content/docs/kernel/contracts/metadata-service.mdx (via getPublished (sdk, the bare tail of client method meta.getPublished, bound to GET /api/v1/meta/:type/:name/published; the bare tail of client method meta.getPublished, bound to GET /meta/:type/:name/published))
  • content/docs/kernel/runtime-services/sharing-service.mdx (via NOT_FOUND (literal, a string literal in registerMetaItemPublishedRoute))
  • content/docs/permissions/authorization.mdx (via buildMcpBridge (symbol, a top-level function))
  • content/docs/permissions/system-context.mdx (via handleMetadataRequest (symbol, a top-level function))
  • content/docs/protocol/kernel/http-protocol.mdx (via /meta/object/:name (route, a path literal in a comment on a changed line))
  • content/docs/protocol/objectql/state-machine.mdx (via /meta/object/:name (route, a path literal in a comment on a changed line))
  • content/docs/ui/forms.mdx (via /meta/object/:name (route, a path literal in a comment on a changed line))

⛔ 5 release-owned page(s) also name something this change touched. These are read-only:

  • content/docs/releases/v17/17-0.mdx (via /meta/object/:name (route, a path literal in a comment on a changed line))
  • content/docs/releases/v17/17-1.mdx (via /meta/object/:name (route, a path literal in a comment on a changed line))
  • content/docs/releases/v17/17-3.mdx (via /:type/:name/published (route, bridged from symbol metaListSource — its route source's handler names it; bridged from symbol projectMetaActionItem — its route source's handler names it))
  • content/docs/releases/v17/17-7.mdx (via /meta/object/:name (route, a path literal in a comment on a changed line))
  • content/docs/releases/v18/18-3.mdx (via /app/:appId/bundle (route, bridged from symbol createMetaItemAnswer — its route source's handler names it; bridged from symbol metaItemAnswerSources — its route source's handler names it; bridged from symbol metaListSource — its route source's handler names it))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

What this run could not see
  • 1 changed file(s) yielded no anchor (packages/rest/src/index.ts) — pages documenting those are invisible to this run
  • 1 cross-cutting symbol(s) contributed no route anchor: resolveObjectMasker (4 routes)
  • 1 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 63 of 226 client-bound route-ledger rows — the other 163 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 163: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 104 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 39 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 465c2bea3ae57c41332908bae2e4e932a235f325 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from f0f9611ef9fcae227f5873b3baca6d9805ac579a — the merge of head c97eb416db5710fcd97a0193aa5f2f7433248331 into base 465c2bea3ae57c41332908bae2e4e932a235f325, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin f0f9611ef9fcae227f5873b3baca6d9805ac579a && git checkout f0f9611ef9fcae227f5873b3baca6d9805ac579a
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 465c2bea3ae57c41332908bae2e4e932a235f325 c97eb416db5710fcd97a0193aa5f2f7433248331 && git checkout -B drift-repro 465c2bea3ae57c41332908bae2e4e932a235f325 && git merge --no-ff c97eb416db5710fcd97a0193aa5f2f7433248331

node scripts/docs-audit/affected-docs.mjs --json 465c2bea3ae57c41332908bae2e4e932a235f325

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 465c2bea3ae57c41332908bae2e4e932a235f325 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

security#1 · os-tesla · session_01L9qibvynRbCtMndW8EHNGc

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: c97eb416db5710fcd97a0193aa5f2f7433248331
Local-runs: none
Scope: packages/metadata-core/src/object-schema-fls.ts, packages/metadata-core/src/object-schema-fls.test.ts, packages/rest/src/index.ts, packages/rest/src/meta-item-history-routes.ts, packages/rest/src/meta-item-read-gate.ts, packages/rest/src/meta-item-read-routes.ts, packages/rest/src/rest-server.ts, packages/runtime/src/action-execution.ts, packages/runtime/src/action-params-enforcement.test.ts, packages/runtime/src/domains/mcp-object-schema-mask.test.ts, packages/runtime/src/domains/mcp.ts, packages/runtime/src/domains/meta.ts, .changeset/meta-action-entry-field-mask.md, content/docs/ai/connect-mcp.mdx, content/docs/deployment/environment-variables.mdx + docs/adr/0106-metadata-plane-fls-object-schema-masking.md, packages/metadata-core/src/object-schema-fls-references.ts, packages/metadata-protocol/src/protocol-search-and-cache.ts, packages/rest/src/meta-collection-routes.ts, packages/rest/src/meta-representation-validator.ts, packages/runtime/src/domains/actions.ts, packages/objectql/src/action-governance.ts, packages/spec/src/ui/action.zod.ts, packages/client/src/index.ts, packages/client-react/src/metadata-hooks.tsx, ui/packages/app-shell/src/views/setup/PackagedActionsSection.tsx, ui/packages/app-shell/src/views/setup/packagedActions.ts, ui/packages/app-shell/src/hooks/useConsoleActionRuntime.tsx, ui/packages/app-shell/src/hooks/useNavActionDispatch.ts

Reviewed 2026-11-07T08:52Z on the face the changeset's Clause-②: no (narrowing) line decides: record-recognisers --paths over the file list names no face of its own and defers to that line, which carries the (narrowing) arm, so the narrowing face and this tier. Read: the PR body, the file list, the three-dot diff against the merge base on main, the head's check-runs, and the cited code on main. Nothing was built, run or re-run.

Check-runs on this head at review time: every concluded run is success or skipped (PR-body guards, Governed Surface Queue Guard, Dogfood Regression Gate, Check Changeset, Check Documentation Links, Spec property liveness, Test UI, Flag docs affected). Nine are still in progress: Build Core, Build Docs, the four Type Check legs, the eight Test Core shards counted as their parent, the six Lint legs and Live E2E UI. The PASS below is conditional on those going green; a red among them returns the head to the dev, not to this record.

① Derived judgments

The one rule, as shipped. projectMetaActionForCaller (@objectstack/rest) builds the document { ...ownObject, actions: [entry] } and hands it to projectMetaObjectSchema over relateObjectSchemaMaskPosture, so an entry is withheld exactly where GET /meta/object/:name already drops it from that object's actions on main: a param whose field the caller cannot read on the object the param names (objectOverride first, else the owner), or any other position of the entry that reads such a field (maskDeniedFieldReferences, actionParamReadsDenied). An entry that survives is served as declared, never rewritten. A passthrough posture (D4-exempt caller, no security service, mask switched off) serves every entry with no object read, so those callers are byte-identical to main by construction. An owner-less entry, or one whose owner names no object definition, is judged through the two new @objectstack/metadata-core helpers, which call the same maskDeniedFieldReferences with an empty own-denied set and the caller's readable set per named object; a named object whose posture cannot be evaluated, or is undetermined, is related as undefined, which the existing MaskScope.related rule already treats as withhold. Right: it is the object door's rule, reached by the object door's function, with the object door's three D6 tiers (fault on a thrown or emptied own object, private, no-store on an undetermined own object, withhold on an unresolvable related object).

Accept-set changes, each judged:

  1. GET /meta/action list, REST (meta-collection-routes.ts through createMetaListAnswer) and dispatcher (answerMetaList), step 7a. A withheld entry is left out; one owner whose posture throws or whose projection empties fails the whole page with the field-visibility fault, as the object list does (D5(2), "a hole no client can see"); the page carries private, no-store when any entry's posture was undetermined. The validator is computed over the served list (metaRepresentationCaching, private, no-cache), so cohorts never share a 304 across different bodies. Right.
  2. GET /meta/action/:name, uncached arm (createMetaItemAnswer step 4a, both transports). A withheld entry is the chain's step-1 absent refusal, sent by the same code path as a name with nothing behind it (sendMetaItemAbsent on REST, deps.error('Not found', 404) on the dispatcher). Byte-identical by construction, not by comparison. Right.
  3. GET /meta/action/:name, REST cached arm, the default door. If-None-Match is withheld from getMetaItemCached for action (actionProjects), so the protocol cannot answer 304 before the projection; I read protocol-search-and-cache.ts on main and it judges ifNoneMatch alone, never If-Modified-Since, so no second validator reaches a 304 first. After the projection: withheld answers sendMetaItemAbsent; fault answers the field-visibility fault; undetermined owner answers private, no-store with no ETag; served and determined compares the request validator to the protocol's, and that value equals the emitted ETag because every fingerprint the arm folds for an action is empty. A shared validator is correct here because a served entry is the same bytes for every caller it is served to; the only per-caller variation is served-or-absent, and absent carries no validator. The ordering is the ADR's fetch, project, send. Right.
  4. /layers and ?layers=true, both transports (createMetaLayeredAnswer step 3a). Every present layer is projected under one memoised source; an owner read off any layer stands in for a layer that names none; any layer withheld answers the whole read absent through step 1's refusal. Fail-closed is right: a layered view with one layer missing is a different shape from the plain answer and would say, by its shape, that the name exists. The draft layer is judged as an action entry like the others; it reaches only callers the stored-version door admits, who hold the write capability and are therefore D4-exempt in every shipped permission set, so no member depends on how a stored draft row is shaped. Right.
  5. /published, REST (registerMetaItemPublishedRoute, after the gate and the object mask) and dispatcher (servePublished). A withheld entry answers the literal 404 { NOT_FOUND, Not found } on REST and deps.error('Not found', 404) on the dispatcher; I read both doors' unknown-name tails and they are those same bodies. Right.
  6. MCP list_actions (servedActionObject). The PR fix(runtime)!: MCP list_actions summarises each action against the object as the caller is served it (ADR-0106) #31075 inline rule is replaced by a call to the seam over the same masker; an owner-less entry (isObjectLessActionKey) and an owner that names no served object are judged through the owner-less arm; a fault throws the door's own fieldVisibilityRefusal. Summaries receive a lookup so a param bound through objectOverride is described from the field of the object it names. The lookup hands back the raw target object, which is safe only because the seam has already judged that field readable for this caller before the summary runs; the own object handed to the summary is the projected one. run_action, resume_run and capabilityRefusal read the declarations unchanged. Right.
  7. summarizeAction, summarizeActionParams, resolveDeclaredActionParams take an optional lookup; enforceActionParams passes none, pinned by a unit test that compares the two readings and the refusal sentence. The run doors (POST /actions, MCP run_action) are byte-identical. Right.
  8. New exports (projectMetaActionForCaller, projectMetaActionItem, two types) on @objectstack/rest; two helpers on @objectstack/metadata-core. Additive, consumed by @objectstack/runtime in the same diff. Right.

Consumer hunt, on main, every reader of /meta/action (list or item), /layers and /published:

  • Console. The only reader of GET /meta/action is Setup › Packaged automation (PackagedActionsSection.tsx, packagedActions.ts): an operator page reached under setup.access, which OBJECT_SCHEMA_READ_ONLY_EXEMPT_CAPABILITIES exempts, so it is answered as before; it also tolerates an empty answer by design. Record-page action buttons are rendered from objectDef.actions, the object schema served by /meta/object (useConsoleActionRuntime.tsx), which main already projects; no console path renders record or toolbar actions from /meta/action. App navigation items of type: 'action' carry a name and dispatch to the run door (useNavActionDispatch.ts); they read no action definition. The Studio and metadata-admin readers of /layers (ResourceEditPage, EmbeddedItemEditor, LayeredDiff, ObjectActionsPanel, pairObjectActions, StudioNavItemInspector) are authoring surfaces under studio.access or manage_metadata, both exempt.
  • Client SDK. @objectstack/client's listActions targets the automation descriptors route, not /meta/action; its generic meta.get, meta.getCached, meta.layered and meta.getPublished are pass-through readers with no action-specific contract. @objectstack/client-react's metadata hooks read object schemas.
  • CLI, examples, skills. No reader of /meta/action; the one skill eval that names the route names its write door. content/docs states nothing that the narrowing contradicts; the two pages that describe the projection are updated in this diff.
  • A member who can run an action but can no longer read its entry. The run door still runs it, so nothing a member could do is taken away; what is taken away is the entry's statement that a field exists, which is D1's own promise. It is consistent with /meta/object/X, which already withholds the same action from that object's actions on main; before this diff the standalone entry contradicted the object door for the same caller.

No legitimate caller loses an answer it reads today. The accept set narrows for exactly one class: a non-exempt caller holding a readable: false field that a standalone or owner-less action binds, on a deployment with a security service and the mask on.

② Semver level

patch on @objectstack/metadata-core, @objectstack/rest and @objectstack/runtime is the level the Post-Task Checklist step 3 gives a non-protocol narrowing: Metadata-protocol: none is right (no key, accepted value or type an author writes moves; the two new exports and the optional lookup parameter are additive), and none takes patch. Clause-②: no (narrowing) is BREAKING by that same rule, so the ! in the title and the changeset's first line, the BREAKING banner, and the ADR-0087 not-required (no-migration-prescription) marker (a category the gate lists) are all consistent with each other; nothing authorable is removed, so no migration and no tombstone are owed. Both declaration lines appear line-initial in the PR body and the changeset body.

Skills-docs: is present, as a (narrowing) arm requires, and its substance is true: skills/** teaches no /meta action read and the two docs pages are updated in the diff. Its spelling, no move — …, is outside the closed set the dispatch template fixes (updated here | follow-up owed — FILES | follow-up #N | none — REASON). No gate reads the line, so this is a should-fix on the PR body and changeset, not a block: updated here is the truthful spelling for a diff that teaches the rule in the docs.

③ Boundary flags

Judged at rule level; mechanisms stay out of this record.

  • (a) The run doors resolve an objectOverride param's type and options on the own object. This is a param-validation question under ADR-0104 D2, not a disclosure one; changing it changes refusal text and the accepted value set at the run door, which is its own changeset and its own card. Separate step. Not a block.
  • (b) The /meta doors read an entry's owner from objectName only; an entry carrying only the legacy object key is judged owner-less there, while collectActionDeclarations (and so MCP) still honours that key as the owner. The two doors can therefore disagree about one entry, and on the /meta doors such an entry's own-object field params are not judged at all: that is serving on a guess, which the fail-closed rule the PR itself states for an undetermined target does not allow. The same holds for an owner that names no object definition in the list read: with no objectOverride params the entry is served as declared. Should-fix: either read the legacy owner key as the declarations collector does and withhold an entry binding own-object fields whose owner cannot be resolved, or state the objectName-only reading in the changeset so the shipped CHANGELOG does not claim more than the doors do. Not a block: on every path main served the entry whole, so the head is strictly narrower than main and the remaining gap is coverage, not regression.
  • (c) GET /meta/action/:name/references answers 200 for a withheld entry, naming objects only. It serves no field, label or option, so nothing D1 protects reaches the caller through it, but it does say by its status that the name exists. Should-fix in a separate step: that door's absence answer should follow the item read's, as /published and /layers now do.
  • (d) App navigation items name actions. A name in a navigation item is served by the app door under the app's own gates and carries no field; the run it triggers is unchanged. Separate step, if any; nothing here is owed by this PR.
  • (e) Inline actions embedded in views and pages are not run through this projection. Those documents are served by the view and page doors, which are not object-schema doors, and D1's "any plane" reaches them. Separate step with its own card; it is outside the narrowing this PR declares and does not weaken it.

④ Design judgment

One seam over projectMetaObjectSchema is the right shape: a second rule for standalone entries would have to be proven equal to the object door's on every position object-schema-fls-references.ts enumerates, and would drift; building the object document and asking the object door's own function makes equality structural. The cost is honest: for a project posture the item doors now read the object list to find the owner. Probes against the cited code on main:

  • Owner-less (global) actions. No own object, so only objectOverride params can bind a field; each target is asked through the transport's masker and related as readable-set or undefined. A target whose posture throws or is undetermined withholds the entry, which is the object door's rule for a related object (unlike its own-object tiers, and deliberately so: nothing of another object is served on a guess). An entry with no target is served as declared. Holds.
  • An objectOverride naming an object that does not exist. Owned arm: relate asks the security service, gets no array, relates undefined, withholds. Owner-less arm: the masker throws or answers undetermined, the target is related undefined, withholds. Holds, fail-closed on both arms.
  • An action with no params. Nothing binds a field, so the only positions judged are the entry's other field-reading positions, as on the object door. Served as declared. Holds.
  • Flow-backed params. The projection judges declared params; a flow's screen fields are not object fields and the object door has never judged them. summarizeActionParams keeps its flow reading. Consistent with the object door; not widened by this diff.
  • A caller with no readable field on an owner. The own-object projection empties, which is the D6 fault, and on the list door it fails the whole page. This is exactly what GET /meta/object already does for that caller, so the action list is no worse than the object list for them; a deployment living in that state is already loud there.
  • Cache keys shared across callers. The protocol cache keeps one document per type, name, locale and environment with no caller dimension, and every projection here runs after that cache, per D3. The list door's validator is over the served list; the cached item arm's validator is the protocol's, which is correct because a served entry is caller-invariant and a withheld one carries no validator. No shared store can hand a projected caller another cohort's body.
  • The cached arm's validator reuse. A validator issued to an unrestricted caller and presented by a restricted one is answered the absence body, never 304; a restricted caller whose permission is later granted is answered 304 on a match, which is right because the body is identical. If-Modified-Since cannot shortcut this: the protocol never judges it.
  • Two observations, neither a block. First, metaActionProjectionSources resolves an owner by listing every object through listMetaItems('object') even for a single item read, although MetaReadGateListSource.getObjectItem is a by-name read on the same source; a cost, not a contract matter. Second, a protocol with an item read but no list read makes the item door throw a TypeError for a project posture rather than answer the field-visibility fault; no shipped protocol has that shape, and loud is the right default for it.

On the narrowing face the question is whether the narrowing takes a declared capability away at the consumer or makes the spec's own refusal real. It makes D1 real on the action doors for objectName-owned and owner-less entries, and takes nothing a consumer reads today away; the one declared-owner spelling it does not yet read is named in ③(b).

Implemented-by: claude/sec-hardening-r21
Reviewed-by: session_01L9qibvynRbCtMndW8EHNGc

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

security#1 · os-tesla · session_01L9qibvynRbCtMndW8EHNGc

Test Core (2/8) went red on this head (run 42356119351). The failure is not this PR's.

  • The one failing test is packages/core/src/security/vouched-reference-callers.pin.test.ts › "this tree is green on the .ts surface". It failed with "Test timed out in 5000ms" before any assertion ran.
  • That pin came in with chore(ci): census the call sites that set the vouched-reference mark #31086, and this diff does not touch it. Its tree scan runs under vitest's default 5s budget, which a busy runner can exceed.
  • A fix that gives the pin an explicit scan budget, as the sibling operation-private-keys pin does, is being prepared from this seat on claude/sec-hardening-r22.
  • The failed jobs here were re-run once (2026-11-07T09:03Z).

Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

security#1 · os-tesla · session_01L9qibvynRbCtMndW8EHNGc

席位核对

ACCEPT · 2026-11-07T09:18Z · head c97eb416db5710fcd97a0193aa5f2f7433248331

  • Contract review: PASS at this head, at CONTRACT_REVIEW_TIER on the narrowing face, record 6704723718. It was conditional on CI, and every check-run is now green. There is no must-fix. Its should-fixes go into this seat's follow-up list, and none of them changes what lands here:
    • the Skills-docs: line respelled into the template's closed set;
    • the owner read also taking the legacy object key, or withholding an entry whose owner names no object definition;
    • the action references door answering a withheld entry the way the item read does.
  • What lands: each /meta action read projects a standalone action entry through the object door's own ADR-0106 projection. That covers the list, the item read (cached and uncached), /layers with ?layers=true, and /published, on REST and on the runtime dispatcher. MCP list_actions uses the same projection, global actions included. It is one seam, and each param is judged on the object it names. A withheld entry answers the same as an unknown name, and a parameter summary reads an objectOverride param's field on its target object. D4-exempt callers, and deployments with no security service or with masking off, see byte-identical answers. The run doors are unchanged.
  • Consumer hunt (record ①): the only console reader of /meta/action is a D4-exempt Setup section. Record-page and toolbar actions come from /meta/object, which main already projects. Studio's layered readers are exempt authors. No legitimate caller loses an action it is allowed to see.
  • Checks: 36 check-runs are success and 14 skipped. Test Core (2/8) first timed out in a pin from chore(ci): census the call sites that set the vouched-reference mark #31086 that this diff does not touch (note 6704829275). Its single re-run is green, and the pin's fix is on claude/sec-hardening-r22. git merge-tree against current main is clean.
  • Gates (dev, at this head): dispatch-gates --commands derived 93 and ran 93. All are green; two of them went green after the closure builds. The metadata-core, rest and runtime suites are green, as is the dogfood battery (434 files, 3596 tests, no failures). The projection ablation turned the refused legs red, the controls stayed green, and the ablation was restored.
  • Shape: base main, no closing keyword. Patch for each moved package, under the ! banner, with Clause-②: no (narrowing) and Metadata-protocol: none.
  • Governed: check-governed-merges.mjs --pr 31104 says not governed, with 906 changed lines, which is ≤ 3000, so Tier S.
  • Landing authority: the maintainer's standing approval for this seat's security PRs at Tier S, given 2026-11-06 in the seat's thread.
  • Next: relay pr_ready and automerge_enable.

Generated by Claude Code

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 7, 2026 09:19
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge November 7, 2026 09:19
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 7, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 7, 2026
@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

⛔ merge queue 构建失败 — 先分诊,再决定要不要重排

队列构建 42359300139 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集),
所以失败的测试可能在本 PR 没碰过的包里 —— 那不是重排能修的。每次盲目重排都会让排在后面的所有 PR 重建一轮。

分类:failure —— 按下面的日志分诊。

失败的 job(日志抽取,best effort):

  • Test Core (2/8) — 失败步骤: Run this shard's tests

    @objectstack/core:test:repo:  FAIL   repo  src/security/vouched-reference-callers.pin.test.ts > check:vouch-for-reference-callers > this tree is green on the .ts surface: the only production caller is
      ↳ 失败原因: @objectstack/core:test:repo: Error: Test timed out in 5000ms.
    

↳ 失败原因 是判读的关键:超时(Test timed out in … / Hook timed out in …)多半是负载/时序,不是本 PR 的回归;
断言(AssertionError: …)才指向真实的行为改变。两者的 FAIL 行长得一模一样,只有这一行能区分。

⚠️ 断言这一侧有一类例外,判据是断言在测什么,不是它是不是 AssertionError。 断言的对象是产品行为(一个值、一个形状、一次拒收)⇒ 照上面读:真实的行为改变,去查,⛔ 不要重排掉;
断言的对象是这次实验自身的有效性前提(跑完的耗时、负载下的先后、任何只在时间预算内才成立的条件)⇒ 它跟超时是同一类,同样对负载敏感,重排一次是合法的判别手段。
识别是机械的:断言的消息或它比较的值本身点名了一段时长、一个时间戳、一个耗时计数。实测过的一对 —— AssertionError: SecurityPlugin.init() ran: expected false to be true 测的是产品行为(真回归);
AssertionError: this run took over a second, so second-precision stamps could have differed too: expected 1006 to be less than 1000 测的是实验前提:它守护的那条不变式当时是绿的,同一个 head 原样重排一次即成功。
穿着 AssertionError 外衣的时间测量,仍然是时间测量。(⛔ 这只改「怎么读一次红」,不改「哪些测试可以重排」——后者由别处管。)

跨 PR 相同签名(24h,按失败测试文件聚合):

  • src/security/vouched-reference-callers.pin.test.ts — 24h 窗口内只有本 PR 撞到过,暂不汇总(再有一个不同 PR 撞到就会自动开汇总 issue)。
  • ⚠️ 24h 评论账本没读完(超过 5 页仍未读到窗口尽头),所以上面的「不同 PR 数」是下界,不是全量。

历史信号:

  • 本 PR 过去 24h 无队列失败记录(首次)。
  • 过去 24h 队列共有 18 个失败构建(不含本次)。

分诊清单:

  1. 失败测试在本 PR 改动的包里 → 真回归,修 PR。
  2. 失败测试与本 PR 无关 → 看上面的「跨 PR 相同签名」;已有汇总 issue ⇒ flaky/环境问题实锤,去那张 issue 上谈,修好前重排只会再烧一轮全队列。
  3. 两者都不是 → 可能与同组 PR 语义冲突;等前面的 PR 落地或失败出队后再重排一次即可,不要连续重排。

Generated by Claude Code · merge-queue-triage workflow (#4859)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/l tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant