Repository navigation
fix(lint): the record-write-discarded hint prescribes a write the sandbox installs; app-dependencies lists the closure-judged bindings - #38628
Conversation
… id, … }), a write the sandbox installs Claude-Session: https://claude.ai/code/session_01ADHkmSwS4mQyXWrddL4r6B Co-authored-by: Claude <noreply@anthropic.com>
…does not read it as a rule id Claude-Session: https://claude.ai/code/session_01ADHkmSwS4mQyXWrddL4r6B Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift Check2 anchor(s) derived from 1 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 — 4 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 6b269940633b8ddca2309d60d2e2766778a905ff && git checkout 6b269940633b8ddca2309d60d2e2766778a905ff
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin eec2bc3e3a0ec0dda41ab73d73cda4a71d37d32a c2b9cffb57c128e3922f52b1b9cd4345ee277c0b && git checkout -B drift-repro eec2bc3e3a0ec0dda41ab73d73cda4a71d37d32a && git merge --no-ff c2b9cffb57c128e3922f52b1b9cd4345ee277c0b
node scripts/docs-audit/affected-docs.mjs --json eec2bc3e3a0ec0dda41ab73d73cda4a71d37d32a |
|
repo:objectstack#3 · os-steve · session_01ADHkmSwS4mQyXWrddL4r6B Final green head · 2026-11-29T16:37Z · zone o3-B · |
|
repo:objectstack#3 · os-steve · session_01ADHkmQm8PTU4AkVU5kdwEv L1-a, the seat's L1 thread · 2026-11-29T16:41Z · first review 席位核对ACCEPT @ Read at this head
Out of scope
Nit, not blocking
Landing note
|
|
repo:objectstack#3 · os-steve · session_01ADHkmSwS4mQyXWrddL4r6B Landing · 2026-11-29T16:42Z · zone o3-B · head
State: ready for review + auto-merge in this stroke. Body says |
…the engine accepts it (objectstack-ai#38635) <!-- claude-projects-attribution: {"github_login":"os-steve"} --> _Requested by **Steve** · [project thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9JeHmqv6CKCkW8ewrPBLekk)_ Refs objectstack-ai#38433 (items 1, 2) Clause-②: no Metadata-protocol: none ## 维护者速读 - 作者与智能体在校验或保存看板视图时看到的修复建议变了:分组字段是多值、JSON 存储或公式字段时,不再建议改用表格分组,而是建议改用表格列;普通文本、数字、日期字段的建议不变。 - 属于看板分组字段校验规则的复核跟进:原建议会把作者引到一个打开即报错的表格分组。 - 只是提示文字和规则说明变了,不改任何校验结论或严重级别;出错时作者只会读到不准确的建议,可直接撤回。 - 无。 ## What changes `list-view-kanban-group-field-uncategorical` now offers the grid-grouping remedy only on the branch where it holds. - **Hint** (`checkKanbanGroupField`, `packages/lint/src/validate-list-view-field-refs.ts`): the tail is keyed on the engine's own refusal set, read from the same spec predicates the two `engine.aggregate` doors use: - multi-valued (`isMultiValueField`, the multi branch) and structured-JSON (`STRUCTURED_JSON_TYPES`) are refused by `assertGroupByNamesNoJsonStoredField`; - virtual `formula` (`isVirtualSearchField`) is refused by `assertGroupByTargetsAreStored`; - both answer `400 INVALID_FIELD`. A list view `grouping` compiles to that group-header query (`compileListViewGroupQuery`), which the grid sends. - For those three classes the hint now ends `or show "FIELD" as a grid column (a list cannot be grouped by REASON)`; every other warned field (text, number, date and the rest of the stored single-valued scalars) keeps `or show "FIELD" as a grid grouping`. - **Explanation** (`rule-explanations.ts`, this rule's entry only): the fix paragraph now says the same, branch by branch: stored single-valued field gives grid grouping; multi-valued, JSON-stored or `formula` gives grid column only, with the reason. - Measured from the rule's code: before this PR a JSON-stored or `formula` group field already warned, on the **single-valued** branch (it is not in `KANBAN_CATEGORICAL_TYPES`), and got the grid-grouping tail. No finding, severity or accept set changes. - **N2 (item 4), decided: keep the short list deliberately.** `select`, boolean and lookup are the heads of the three families the rule accepts (`select`/`radio`, `BOOLEAN_VALUE_TYPES`, `REFERENCE_VALUE_TYPES`). Naming each member would hand-copy `KANBAN_CATEGORICAL_TYPES` into prose that drifts from it, and would lengthen a hint held to 200 characters. Read first, by risk: 1. `packages/lint/src/validate-list-view-field-refs.ts`, the `ungroupable` / `gridRemedy` hunk in `checkKanbanGroupField`: this is where the set is keyed. 2. `packages/lint/src/validate-list-view-kanban-lanes.test.ts`, the new per-field `it.each`. Two-minute check: `pnpm --filter @objectstack/lint exec vitest run --maxWorkers=2 src/validate-list-view-kanban-lanes.test.ts`. Expect 34 passed. The `tags`, `watchers`, `meta`, `address` and `score` rows assert a grid column; `amount`, `due_date` and `subject` assert a grid grouping. ## Tests At head `e0e643722a`: <details><summary>@objectstack/lint: full suite and typecheck</summary> - `pnpm --filter @objectstack/lint exec vitest run --maxWorkers=2`: Test Files 246 passed (246), Tests 9962 passed, 5 skipped (9967). - `pnpm --filter @objectstack/lint typecheck`: exit 0; check:test-typecheck OK. - `src/validate-list-view-kanban-lanes.test.ts`: 34 passed. </details> <details><summary>Ablation</summary> Forced `gridRemedy` to always take the grid-grouping arm, on disk, then ran the target file: 5 failed / 29 passed. The failures were exactly the five ungroupable rows (`tags`, `watchers`, `meta`, `address`, `score`). Restored with `git checkout HEAD --`, tree clean. </details> ## Acceptance notes - Item 3 of the card (a finding of its own for a `grouping.fields[].field` naming a multi-value, JSON-stored or non-stored field) is not in this PR. It is a narrowing and stays on the card. - `engine.aggregate` also refuses a `groupBy` on a credential or `internal`-flagged column (`rejectCredentialEvaluation`, `rejectInternalFieldEvaluation`). The hint is not keyed on those, because the refusal comes from a flag and not from the storage class. A kanban board grouped by a password field is not a realistic producer. Noted only. ## Verification <details><summary>Derived local gates (dispatch-gates --commands, 70 families)</summary> - `dispatch-gates --ran`: 70 derived, 67 run with exit 0, 3 NOT MEASURED (exit 3, prerequisite), 0 unrun. - NOT MEASURED: `check-plugin-teardown-shape --self-test` (shallow clone cannot reach its pinned fixture commit), `check:dual-build-cjs-loads` and `check:lean-entry-closure` (need dist of packages outside this diff's closure). Left to CI. - `check:docs-transcript-drift` was re-run after building `@objectstack/lint`: exit 0. `check:type-check-debt` and `check:query-options-erasure`: exit 0. - `overlap-check --branch=HEAD`: clean against origin/main and objectstack-ai#38628, objectstack-ai#38605, objectstack-ai#38594, objectstack-ai#38550. </details> --- _Generated by [Claude Code](https://claude.ai/code/session_01ADHkmSwS4mQyXWrddL4r6B)_ <!-- signed: repo:objectstack#3 · os-steve · session_01ADHkmSwS4mQyXWrddL4r6B --> --------- Co-authored-by: Claude <noreply@anthropic.com>
…it was not granted (objectstack-ai#38650) <!-- claude-projects-attribution: {"github_login":"os-steve"} --> _Requested by **Steve** · [project thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9JeHmqv6CKCkW8ewrPBLekk)_ Refs objectstack-ai#37815 (items a, b) Clause-②: no (narrowing) Metadata-protocol: narrowed Skills-docs: follow-up objectstack-ai#38655 ## 维护者速读 - 用户能看到什么变化:应用作者保存或校验一个脚本动作或自己写的钩子脚本时,如果代码调用了沙箱需要授权的功能(写数据、事务、日志、发邮件、写活动记录等)却没有声明对应权限,现在会在保存和本地校验时直接被拒并说明要加哪个权限;以前能保存,但每次运行都报错。 - 为什么做:属于脚本动作与钩子的权限检查跟进工作,把只覆盖动作写数据的检查扩展到钩子和沙箱的全部授权项。 - 出错会怎样:误判会让一个本来能运行的动作或钩子保存不了;用函数写、由构建转换出来的钩子和动作这次不做新增检查;已存的元数据不受影响,可以直接撤回;现有示例应用实测无一被拒。 - 要你做什么:无。 ## What changes The QuickJS sandbox gates seven tokens, and before this PR lint judged one of them on one kind of body (`ctx.api` writes on action bodies, `action-body-write-capability-undeclared`). A hook body, and an action body calling any other gate, saved and published clean and then threw `403 INSUFFICIENT_PRIVILEGES` at every call. - **Runner census (measured first, read-only).** Every capability gate in `packages/runtime/src/sandbox/quickjs-runner.ts` at `0ba5e06ae7`: `api.read` on the `READ` leaves `find` / `findOne` / `count` / `aggregate` (`installApiMethod`, line 755) and on `ctx.title(FIELD)` with an argument (line 1035, hook bodies only: the action face builds no `ctx.title`); `api.write` on the `WRITE` leaves (line 756); `api.transaction` on `ctx.api.transaction` (`installTxLeaf`, line 783); `log` on `ctx.log.debug|info|warn|error` (line 881); `crypto.uuid` on `ctx.crypto.randomUUID` (line 907); `email.send` on `ctx.email.send` and `activity.append` on `ctx.activity.append` (`installDoor`, lines 941 to 994). That set is exactly `HookBodyCapability` in the spec. The rule judges exactly that set, as `SANDBOX_CAPABILITY_GATES`. - **Arm (a), authored hook bodies.** `validateActionBodyCapabilities` now walks `stack.hooks` too, with the same reading (blanked source; the member itself, a local bound once to it, or a handle bound once to `.object(…)`). New id `hook-body-capability-undeclared`, one finding per body and token, at `hooks[i].body.capabilities`. A hook body is never granted `email.send` (the hook's parse refuses the grant), so its `ctx.email.send` call is refused with the remedy that works: remove the call and send the mail from an action, a job or a flow. **Scope (route C): authored hook bodies only.** A hook body that `os build` / `os verify` lowered from an inline `handler` is not judged (`isLoweredHandlerBody`): under the CLI exactly when `ctx.loweredHookRefs` holds the hook's string `handler`, and at a door that hands no lowered refs (the runtime publish doors) whenever a string `handler` sits beside the body, the shape a build artifact carries. Its grant is the build's inference, and the extractor does not yet infer `api.transaction` or a read through a bound handle, so a finding there would name a grant the handler author cannot write. objectstack-ai#38653 carries the lowered-handler reading and both extractor gaps. The registry entry keeps its name and gains `hook` in `runtimeTypes` (the `validateHookAndJobBodyCompiles` precedent: one entry, ids per kind), and now receives `ctx`. - **Arm (b), the other tokens, authored action bodies.** On action bodies, every gate other than the writes is judged under the new id `action-body-capability-undeclared`. A missing `api.write` keeps its own id and its exact words, so nothing that matches on it today changes. **Scope (contract review M1, claim amendment 3): authored action bodies only, past the writes.** An action body that `os build` / `os verify` lowered from an inline `target` function is judged for `api.write` only, as before (`isLoweredTargetBody`). Measured before the edit: the CLI hands no lowered-action ref set (`LoweringResult` carries `loweredHookRefs` only), and `lowerActionCallable` leaves a string `target` (the registered ref) beside the minted body. So on every door, the CLI included, a body is read as lowered when a string `target` sits beside it. No `packages/cli` edit was needed. A JS body runs only on a `script` action, where `target` is kept for legacy `functions` references alone; an authored body beside a string `target` is therefore not judged for the other tokens either, a missed finding, never a false one. In `examples/app-showcase`, none of the 296 JS-body actions (318 actions in all) carries a string `target`. objectstack-ai#38653 carries the lowered reading. - **Pin.** The new test file reads the runner's source: the token set from `caps.has('…')`, the `installApiMethod` tokens and the `installDoor` calls must equal the census; the `caps.has(NAME)` calls with a variable must be exactly the two known ones, so a third parametrised gate turns it red; the `READ` list, the log levels and the door triples are pinned; and the census token set must equal `HookBodyCapability.options`. - **L1-a's nit from objectstack-ai#38628.** The `action-body-write-unknown-field` explanation now lists the installed field-carrying leaves: `insert`, `update({ id, … })`, `updateById(id, { … })`, `upsert`, `updateMany`. `updateById` landed with objectstack-ai#38643, which this branch merged from `main`; the census and the gate table read the runner's `WRITE` list and needed no edit. - `os explain` entries for both new ids, and two rows in `content/docs/deployment/validating-metadata.mdx`. - **Upgrade guide and barrel.** `packages/lint/src/index.ts` exports both new id constants. A new upgrade-guide entry, `packages/spec/src/migrations/entries/semantic/19.hook-and-action-bodies-calling-an-ungranted-gate-refused.ts`, follows the `hook-job-body-does-not-compile-refused` precedent and says the hook arm covers authored bodies only; the changeset marker is `registered` with that id, and the changeset carries an `@objectstack/spec` patch line. The `os build` extractor (`packages/cli`) is unchanged: byte-identical to `main`. The rule file's header names `hook` as the third runtime door (review N2), and the upgrade-guide entry's `acceptanceCriteria` names the inline path `objects[N].actions[M].body.capabilities` (N2). S1 (`updateById` in the `action-body-write-unknown-field` leaf list) was met at `a60a6de915`. This touches a contract face: the lint rule family's accept set at the save door and in `os validate` (a narrowing). ## Tests - New file `packages/lint/src/validate-action-body-capabilities.hook-and-tokens-37815.test.ts`: per arm a refused case, a granted control that passes, and an ungated call that stays quiet; the hook case through the save door (`runRuntimeAuthoringRules` on `type: 'hook'`) and through `runAuthoringRules` for `validate` / `build` / `lint`; the hook `email.send` remedy; `ctx.title(FIELD)` against `ctx.title()`; a shape table for `bodyGatedCalls`; the runner pin. - M1 pins, both sides, on one source (a write inside `ctx.api.transaction`, granted `api.write` only, as the extractor infers): the authored action body is refused; the same body beside a string `target` is not judged, through `validateActionBodyCapabilities`, through `runAuthoringRules` for `validate` / `build` / `lint` at the top level and inline on an object, and at the `action` and `object` doors (each with an authored positive control); a lowered body without `api.write` is still refused under the write id. - Route C pins, both sides, on one source (a read through a bound handle): the authored body is refused; the same body lowered from a handler is not judged, through `validateActionBodyCapabilities`, through `runAuthoringRules` for `validate` / `build` / `lint` with `loweredHookRefs`, and at the save door with a string `handler` beside the body; a string `handler` the build did not lower leaves the authored body judged. - One ablation per behaviour with `scripts/ablation-replace.mjs`, each restored to a clean tree. <details><summary>Readings at 4c07e0d, 29d3b0f, a60a6de and c3319db</summary> - At 29d3b0f: `pnpm --filter @objectstack/lint typecheck && pnpm --filter @objectstack/lint test`: typecheck clean, `check:test-typecheck` OK; Test Files 248 passed, Tests 10035 passed. The new test file: 46 passed. Ablation of the M1 exemption (`if (lowered) continue;` deleted): Tests 3 failed / 43 passed, exactly the three lowered-target pins; restored, blob equal to HEAD. `check-adr-0087-registration --base origin/main`, `check-changeset-no-major`, `check:spec-changes`, `check:upgrade-guide` and `check-nul-bytes` exit 0; overlap-check clean. - Full dogfood battery on 29d3b0f (`pnpm --filter @objectstack/dogfood test` under the lock, after building the dogfood closure): Test Files 495 passed / 3 skipped (498), Tests 4187 passed / 68 skipped (4255), VERDICT command-exit 0. The head after it, 4c07e0d, changes only one sentence of the upgrade-guide entry's guidance text. - At 4c07e0d, after a cli build: `pnpm --filter @objectstack/cli exec vitest run --maxWorkers=2 test/migrate-meta-engine-guidance.test.ts test/explain-rule-id.test.ts test/verify-delete-behaviors.test.ts`: Test Files 3 passed, Tests 20 passed. The entry's printed guidance names no tracker, so the Test Core (2/12) red at 29d3b0f is fixed. `check-adr-0087-registration`, `check-changeset-no-major`, `check:spec-changes`, `check:upgrade-guide`, `check:generated` and `check-nul-bytes` exit 0; overlap-check clean. - At a60a6de (after merging `main` with objectstack-ai#38643): `pnpm --filter @objectstack/lint typecheck && pnpm --filter @objectstack/lint test`: typecheck clean, `check:test-typecheck` OK; Test Files 248 passed, Tests 10031 passed. The new test file, census pin included: 42 passed. `check-adr-0087-registration --base origin/main` exit 0; `check-changeset-no-major` exit 0. - At c3319db: lint suite Test Files 248 passed, Tests 10019 passed. - `pnpm --filter @objectstack/cli exec vitest run --maxWorkers=2 test/verify-delete-behaviors.test.ts test/published-subpath-hook-body.pin.test.ts test/explain-rule-id.test.ts test/extract-hook-body.test.ts test/lint-hook-rules-reach-handler-hooks.test.ts` (after a cli build): Test Files 5 passed, Tests 109 passed. - Ablation of the narrowing (the `isLoweredHandlerBody` early return deleted): Tests 2 failed / 40 passed, exactly the two not-judged pins; restored, blob equal to HEAD. - Round 1 ablations: the hook walk removed, 8 failed / 31 passed; the `api.transaction` gate entry removed, 8 failed / 31 passed; both restored. - After the build: `check-adr-0087-registration` exit 0 (1 migration entry added); `check:spec-changes` exit 0; `check:upgrade-guide` exit 0; `check:generated` all 14 artifacts current; `check-nul-bytes` OK. The upgrade guide was regenerated with `gen:upgrade-guide` only. - `node scripts/pm/dispatch-gates.mjs --commands`: 118 families derived; 116 exit 0, 2 NOT MEASURED (exit 3, PREREQUISITE NOT MET: `check:skill-examples`, `check:dual-build-cjs-loads`); `--ran` reconciliation: 118 accounted for. CI on c3319db: 72 check-runs, 62 success and 10 skipped, among them `Lint & Repo Gates`, `Test Core`, `Check Changeset` and `Dogfood Regression Gate` green. - Full dogfood battery on c3319db (`pnpm --filter @objectstack/dogfood test` under the lock, after building the dogfood closure): Test Files 495 passed / 3 skipped (498), Tests 4187 passed / 68 skipped (4255), VERDICT command-exit 0. - First-party measurement of example apps before any edit: 0 findings. A sweep of 50 handlers under `packages/*/test/**` and `examples/**` found one body refused under the lowered-handler reading (`packages/cli/test/verify-delete-behaviors.test.ts`); under route C it is not judged, and that test is green. </details> ## Acceptance notes - Scope, route C (claim amendment 2): the hook arm judges authored hook bodies only. Lowered handlers, and the two extractor gaps under them (no `api.transaction` inference; no `api.read` inference through a bound handle, `?.` before the leaf or an argument holding parentheses), are carried by objectstack-ai#38653, a widening that follows this PR. The published `@objectstack/cli/hook-body` type and its pin are untouched, so this PR keeps its one Clause-② arm. - At the runtime publish doors a hook carrying both a string `handler` and a body is read as a build artifact and not judged. A hand-written hook with both keys is therefore not judged either: a missed finding, never a false one. - An action carrying both a string `target` and a JS body is read as lowered on every door, the CLI included, and judged for `api.write` only. That covers an author who wrote a body beside a `target` function, too: `lowerActionCallable` keeps that authored body and still turns the `target` into a string ref. A missed finding, never a false one. objectstack-ai#38653 carries the lowered reading for both arms. - Not changed, per the review: N1 (`ctx.title(undefined)` / `ctx.title(null)` read as the related-record form) and N3 (job bodies are not judged). ## Verification Read first: `packages/lint/src/validate-action-body-capabilities.ts` (`SANDBOX_CAPABILITY_GATES`, `bodyGatedCalls`, the hook walk), then `isLoweredTargetBody` and the action loop's `lowered` skip, then the new test file's runner-pin block, its M1 pins and its route C pins, then the `authoring-rules.ts` entry (`runtimeTypes` gains `hook`, `run` receives `ctx`). Two-minute check: `pnpm --filter @objectstack/lint exec vitest run src/validate-action-body-capabilities.hook-and-tokens-37815.test.ts` shows 46 passed. --- _Generated by [Claude Code](https://claude.ai/code/session_01ADHkmSwS4mQyXWrddL4r6B)_ <!-- signed: repo:objectstack#3 · os-steve · session_01ADHkmSwS4mQyXWrddL4r6B --> --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Steve · project thread
Refs #37815 (items c, d)
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
action-record-write-discardedhint. It prescribedctx.api.object('OBJECT').updateById(ctx.recordId, { … }). Probed for real (below): a sandboxed action body or hook body has noupdateByIdonctx.api.object(…), so following the hint throwsTypeError: not a functionand writes nothing. The hint now prescribesctx.api.object('OBJECT').update({ id: ctx.recordId, FIELD: … }), the single-record form the sandbox installs andHookObjectApi.updatedocuments (the id travels inside the payload). The method name lives in one constant,ACTION_RECORD_WRITE_REMEDY_METHOD(not re-exported from the package index), pinned toSANDBOX_API_WRITE_METHODS, which is itself pinned to the runner'sWRITElist.os explain action-body-write-unknown-fieldtext said an action body persists "only throughinsert / create / update / updateById".createandupdateByIdare not installed in the sandbox either. It now namesinsert({ … })andupdate({ id, … }). Same defect class, same file, bounded fix.content/docs/deployment/app-dependencies.mdx. The page said the save door judges "a list view" against the package closure. It now has a table of the bindings that door judges, including the two that PR fix(lint)!: three publish-time checks for seeds, flow nodes and actions that save and do not work #37807 added: a standalone action'sobjectNameand a flowget_record/create_record/update_record/delete_record/ object-formscreennode'sobjectName. Sources:validateObjectReferencesruns on theflow,datasetandactionruntime doors (packages/lint/src/reference-integrity-suite.ts, memberruntimeTypes: ['flow', 'dataset', 'action'], handedctx.packageScope), and the flow-node and action sites are inpackages/lint/src/validate-object-references.ts(OBJECT_BOUND_FLOW_NODE_TYPES,actions[i].objectName). The form and knowledge-source rows come fromform-object-outside-closure(validate-form-items.ts) andknowledge-source-object-unknown(validate-knowledge-source.ts). The table says "include" because other closure-aware rules exist (email template holes, AI tool and context references) that this PR did not audit.updateByIdpayload in a body is still graded (API_WRITE_METHODS, the ledger'sapi-crud-literalsyntax line and example, and the explanations that say what is judged), because a body can still contain the call.Tests
validate-action-body-writes.test.ts: the existing case that pinnedhintto containupdateByIdnow pins the remedy method. A new case asserts the method the hint calls is inSANDBOX_API_WRITE_METHODSand that the payload is addressed byid: ctx.recordId. Subjects, not prose.updateById(ctx.recordId, …)viascripts/ablation-replace.mjs, anchor 1 to 0, blob 262ceea2 to a2f3f908): 2 cases red (expected [ 'updateById' ] to deeply equal [ 'update' ]), 50 passed. Restored:git diff HEADempty, 0 hits of the mutation.Sandbox probe (throwaway test, not committed): real ObjectQL, real better-sqlite3 SqlDriver, real QuickJSScriptRunner and body-runner factories
Hook bodies run in the same sandbox and fail the same way.
Local runs (head c2b9cff)
pnpm --filter @objectstack/lint exec vitest run --maxWorkers=2(the whole package) at c2b9cff: lock VERDICT command-exit 0, Test Files 246 passed (246), Tests 9959 passed (9959). The first whole-package run, at 0dfeeda, had 1 red inrule-id-barrel-exports.test.ts: it reads an unannotated exported string constant as a rule id. The constant is now annotatedstring(second commit).pnpm --filter @objectstack/lint typecheck: VERDICT command-exit 0.dispatch-gates.mjs --commandsderived 100 families; all 100 run locally: 97 exit 0; 3 exit 3 PREREQUISITE NOT MET, so NOT MEASURED here and left to CI (check-plugin-teardown-shape --self-testneeds an unshallow clone;spec check:skill-examplesandcheck:dual-build-cjs-loadsneed packages this worktree did not build). None of the three reads a file this PR changes.--ranreconciliation: 100 derived, 100 run, 0 UNRUN. Re-run on c2b9cff after the second commit:check:doc-authoring,check:issue-citations,check:nul-bytes,check:adr-anchors,check:cross-package-test-inputs,check:undeclared-dep-imports,check:type-check-debt,check:closed-ceremony-text, all exit 0.test:reponot run locally (CI'sTest Core).Acceptance notes
content/docs/automation/hook-bodies.mdx(the "exactly one way an action body persists anything" snippet) still teachesupdateById(ctx.recordId, …)in an action body. The spec contract (HookObjectApi.updateByIdinpackages/spec/src/data/hook-api.ts,IScopedObjectRepository.updateById) declares the member a body cannot call, andobjectstack builddoes not refuse.updateById(at lowering the way it refuses.create(. Whether the sandbox should install the leaf or the body-facing contract should drop it is a decision; it is raised in the report.api-crud-literalsyntax line and example still nameupdateById: they mirror the extractor's graded verbs (validate-readonly-hook-writes.test.tsreads the syntax line as that mirror) and are not shown to authors.Verification
Read first:
packages/lint/src/validate-action-body-writes.ts(the hint andACTION_RECORD_WRITE_REMEDY_METHOD), then the new test case, then the docs table.Two-minute check:
pnpm --filter @objectstack/lint exec vitest run src/validate-action-body-writes.test.tsshows all cases passing, and theprescribes a write the sandbox installscase among them.Generated by Claude Code
🤖 Generated with Claude Code
https://claude.ai/code/session_01ADHkmSwS4mQyXWrddL4r6B