Skip to content

docs(actions, skills): a record id in an action's own params is input the body checks as the caller - #39773

Draft
objectstack-fleet[bot] wants to merge 1 commit into
mainfrom
claude/actions-param-authorization-doc
Draft

objectstack-fleet[bot] wants to merge 1 commit into
mainfrom
claude/actions-param-authorization-doc

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Source: security seat order

Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:写动作脚本的开发者和读技能包的 AI,在「动作内的授权」一节和动作技能页里多看到一条规则:动作自己的参数里带来的记录编号,平台不会替调用人核对,脚本要自己先核对再动手。平台行为没有变,用户无感。
  • 为什么做:属于「动作授权文档补全」这件事,由安全席按维护者的话派出;原来的文档只讲了平台替调用人读「当前记录」和「勾选的多条记录」,没讲参数里的编号不在其中。
  • 出错会怎样:只改文档和技能页的措辞,最坏是这句话写得不准,撤回这次合并即可恢复原文。
  • 要你做什么:无。

What changes

  • content/docs/ui/actions.mdx, section "Authorization inside an action": one new paragraph after the param pass-through paragraph. It says that, for a script body or a registered handler, the call's recordId and its params._selectedIds are the only ids the platform reads as the caller; that a record id arriving in the action's own params (a declared lookup param, or a custom key a param-less handler action passes through) is the body's input; that the param contract judges presence and value shape and reads no row; and that the body checks such an id as the caller, from ctx.user and the row, before acting on it. It closes by pointing at the flow start door, which does load an input a flow reads as a record id in the caller's own scope.
  • skills/objectstack-ui/rules/actions.md, section "Action body context (ctx)": one sentence saying the same.
  • .changeset/actions-param-record-id-is-input.md: @objectstack/skills patch (the package is published; its private key is absent).

Nothing in the platform changes.

Each sentence, and the code it was read against

Sentence Read against
The call's recordId and params._selectedIds are the only ids read as the caller for a script body or handler packages/runtime/src/action-dispatch.ts, the admission that ends in loadActionSubjectRecord and loadActionSelectionRecords: these two are the only caller-scope reads before the script dispatch; packages/runtime/src/action-execution.ts loadActionSubjectRecord, loadActionSelectionRecords, actionSelectionIsRead
A declared param is judged for presence and value shape, and no row is read packages/runtime/src/action-execution.ts enforceActionParams; packages/spec/src/ui/action-params.zod.ts validateActionParams (a pure check: required, valueSchemaFor(..., 'stored'), unknown keys)
A param-less handler action passes its custom keys through enforceActionParams, the !declaresParams && !isDeclarativeUpdateAction(action) arm returns null unless a key is a near-miss of a built-in
The body's ctx.api is elevated and reads and writes the row either way buildActionExecutionContext (isSystem: true plus the 'action' mark), buildActionApi
ctx.user and ctx.params are on the context a body and a handler receive action-dispatch.ts, the actionContext literal of the script dispatch (user, params: { ...params, recordId, objectName })
A type: 'flow' action has an input the flow's definition reads as a record id loaded in the caller's scope before the run action-execution.ts, the flow dispatch's call of refuseUnreadableFlowStartRecords with inputs: flowActionStartInputs(...), and that function's doc comment; the linked row of content/docs/automation/flows.mdx ("Run a flow via API")

Skills size (required readings)

Before After
skills/objectstack-ui/rules/actions.md, lines 269 268
skills/objectstack-ui/rules/actions.md, bytes 16282 16281
skills/objectstack-ui/rules/actions.md, priced tokens 4071 (ceiling 4071) 4071 (ceiling 4071)
every SKILL.md in skills/, lines summed 2120 2120
skills/objectstack-ui shipped files (all but evals/), lines and bytes 2205 / 126990 2204 / 126989
ratcheted (authored) total, priced tokens 182338 / 182338 182338 / 182338

No ceiling moves. The sentence is paid for inside the file; the changeset lists what leaves: three words of the ctx sentence ("server-side", "target", "scoped"), five lines or clauses of the examples (errorMessage in the reassign example, successMessage and the second visible clause in the convert example, timeoutMs and the status value in the add-to-campaign example), and a few connecting words in two notes.

Tests

Docs and skills wording only; no package source changes, so no package test or typecheck is owed. All readings below are on head 884b279db7f.

Gate readings
  • node scripts/pm/dispatch-gates.mjs --ran: Run reconciliation — 73 derived, 69 run, 4 NOT-MEASURED, 0 UNRUN.
  • node scripts/check-skills-token-ratchet.mjs: exit 0, skills/objectstack-ui/rules/actions.md is 4071 tokens (ceiling 4071; headroom 0).
  • pnpm --filter @objectstack/spec run check:skill-examples: exit 0 after building the @objectstack/client-react closure, 345 prose examples type-check across 3 surface(s).
  • pnpm --filter @objectstack/spec run check:docs, check:empty-state, check:liveness, check:strictness-ledger, check:variant-docs, check:yaml-examples: exit 0 each.
  • pnpm --filter @objectstack/lint run check:doc-formula-expressions, check:doc-security-posture: exit 0 each.
  • pnpm check:doc-anchors, check:doc-authoring, check:doc-frontmatter, check:docs-transcript-drift, check:corpus-claim-drift, check:skill-links, check:skill-identifier-liveness, check:skill-compatibility, check:skill-frame-sync, check:nul-bytes, check:published-files, check:changeset-gate-self-tests, and the remaining derived node-script families: exit 0 each.
  • NOT MEASURED: pnpm check:dts-closure, check:dual-build-cjs-loads, check:lean-entry-closure, check:sourcemap-no-sources-content, reason: each refused with exit 3 asking for a full build of every package, which this diff does not touch; CI owns them.
  • Red, and not from this diff: node scripts/ci/snapshot-next.mjs --self-test exits 1 with one failed case of its stable-lane battery. It exits 1 the same way with the three changed files put back to the base commit 56bed066364.

Acceptance notes

  • The same section's table says a body sees ctx.recordLoadDenied: true when the caller cannot read the row. refuseDeniedSubjectLoadBeforeDispatch in action-execution.ts now refuses that call with 404 RECORD_NOT_FOUND before a script body or a flow starts, so the guard the section teaches is one the platform already makes on those arms. Not changed here: the order covers the params rule only.
  • content/docs/automation/flows.mdx describes a start input's objectName as planned and read by no start door in its variables table, and as loaded in the caller's scope in the "Run a flow via API" table. Not changed here.

Verification

Read first, by risk:

  1. content/docs/ui/actions.mdx, the new paragraph: every claim is in the table above.
  2. skills/objectstack-ui/rules/actions.md, the ctx paragraph and the trimmed example lines.

Two-minute check: node scripts/check-skills-token-ratchet.mjs prints skills/objectstack-ui/rules/actions.md is 4071 tokens (ceiling 4071; headroom 0) and exits 0.


Generated by Claude Code

… the body checks as the caller

Source: security seat order

Claude-Session: https://claude.ai/code/session_01ASNY8XNef4ywkQio6S9ju4
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/s documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Dec 5, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

security@os-mickey · os-mickey · session_01ASNY8XNef4ywkQio6S9ju4

Handover · 2026-12-05T13:11Z. This draft moves to the seat security@sunhaolin (mailbox #39815), on the maintainer's word in this session (verbatim 「你剩下的任务都交接给 sunhaolin」).

  • State: waiting on a maintainer ruling. Two examples on the same skill page do not follow the rule this PR adds.
  • The seat's recommendation, not yet ruled:
    • fix those two examples in this PR, so the rule and its examples agree before 19.0.0;
    • file the caller-scoped read API for action bodies as a separate feature card for after 19.0.
  • Owed next: the ruling, then a patch round, then a review and landing.

This branch has not been deployed

No deployments
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/s 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