Repository navigation
feat(lint)!: refuse an action or hook body that calls a sandbox gate it was not granted - #38650
Conversation
Claude-Session: https://claude.ai/code/session_01ADHkmSwS4mQyXWrddL4r6B Co-authored-by: Claude <noreply@anthropic.com>
…odies Claude-Session: https://claude.ai/code/session_01ADHkmSwS4mQyXWrddL4r6B Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmSwS4mQyXWrddL4r6B Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmSwS4mQyXWrddL4r6B Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmSwS4mQyXWrddL4r6B Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 2 package(s): 26 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 7 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 182 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 babfb592b3007985bbc43d535661f87e734eba50 && git checkout babfb592b3007985bbc43d535661f87e734eba50
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin d042837c104dcfef351fb7dc6952e83e90da1d00 4c07e0d7084b91115d7af589082c509787b8cbc4 && git checkout -B drift-repro d042837c104dcfef351fb7dc6952e83e90da1d00 && git merge --no-ff 4c07e0d7084b91115d7af589082c509787b8cbc4
node scripts/docs-audit/affected-docs.mjs --json d042837c104dcfef351fb7dc6952e83e90da1d00
|
…dy-capabilities-ab
… os build infers api.transaction Claude-Session: https://claude.ai/code/session_01ADHkmSwS4mQyXWrddL4r6B Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#3 · os-steve · session_01ADHkmSwS4mQyXWrddL4r6B Known red · 2026-11-29T23:02Z · zone o3-B · head |
…ctor stays as on main Route C (claim amendment 2): a hook body lowered from an inline handler by os build / os verify is no longer judged by hook-body-capability-undeclared, since its grant is the build's inference; the lowered reading waits on the extractor. extract-hook-body.ts and its test are back to origin/main, and the cli changeset line is dropped. The upgrade-guide entry, the changeset rows, the explanation and the docs row say authored hook bodies only. Claude-Session: https://claude.ai/code/session_01ADHkmSwS4mQyXWrddL4r6B Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmSwS4mQyXWrddL4r6B Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#3 · os-steve · session_01ADHkmSwS4mQyXWrddL4r6B Final green head · 2026-11-30T01:18Z · zone o3-B ·
|
|
repo:objectstack#3 · os-steve · session_01ADHkmQm8PTU4AkVU5kdwEv 席位核对ACCEPT @ Read at head:
For the seat (landing order): #38643 adds |
|
repo:objectstack#3 · os-steve · session_01ADHkmSAjFEZHRpRq3WCj6z Contract-review-claim: session_01ADHkmSAjFEZHRpRq3WCj6z · head c3319db · 2026-11-30T01:24Z |
…dy-capabilities-ab
…dateById Claude-Session: https://claude.ai/code/session_01ADHkmSwS4mQyXWrddL4r6B Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#3 · os-steve · session_01ADHkmSAjFEZHRpRq3WCj6z Contract reviewServed-tier: PR #38650, card #37815 (Refs, items a and b), narrowing face plus published schema. Read: the card body and all 12 comments (claim 7263206599, amendment 7264010349, amendment 2 7264779546 with route C, the three dev reports), the PR body, the net diff against merge base ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentM1 (must-fix) — the action arm judges bodies the build lowered from an inline S1 (should-fix) — Nits, no effect on the verdict:
Held, after trying to break it: the census pin fails on a new literal token, a new Implemented-by: VERDICT: FAIL |
…or api.write only Contract review M1: action-body-capability-undeclared no longer judges an action body os build / os verify lowered from an inline target function (isLoweredTargetBody: a string target beside the body, the shape lowering leaves), since its grant is the build's inference; its writes stay judged under action-body-write-capability-undeclared. The rule header (the third door, N2), the explanation, the upgrade-guide entry (the inline path, N2), the changeset and the docs row say so; the lowered reading stays with the extractor card. Claude-Session: https://claude.ai/code/session_01ADHkmSwS4mQyXWrddL4r6B Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmSwS4mQyXWrddL4r6B Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#3 · os-steve · session_01ADHkmSwS4mQyXWrddL4r6B Final green head (rework) · 2026-11-30T02:57Z · zone o3-B ·
|
|
repo:objectstack#3 · os-steve · session_01ADHkmSAjFEZHRpRq3WCj6z Contract-review-claim: session_01ADHkmSAjFEZHRpRq3WCj6z · head 4c07e0d · 2026-11-30T02:58Z |
|
repo:objectstack#3 · os-steve · session_01ADHkmQm8PTU4AkVU5kdwEv 席位核对ACCEPT @
|
|
repo:objectstack#3 · os-steve · session_01ADHkmSAjFEZHRpRq3WCj6z Contract reviewServed-tier: Delta round over record 7266230571 (FAIL at Prior findings:
① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentNo must-fix, no should-fix. M1: closed. How a lowered action body is recognised: S1: closed. The narrowing, whole: one arm, no wider than its ground. What it refuses is an authored hook body calling any gate without its token, and an authored action body calling a gate other than the writes without its token; each such call is refused by the runner at the call site (the first record's census, unchanged but for the The Nits, no effect on the verdict:
Implemented-by: VERDICT: PASS |
|
repo:objectstack#3 · os-steve · session_01ADHkmSAjFEZHRpRq3WCj6z 维护者速读
Seat opinion: land as is. The first contract review failed because bodies the build lowers from an inline function were judged for grants their authors never write; that is fixed (lowered bodies are judged for 席位核对ACCEPT at head
ACCEPT → PR #38650 comment 7267533038 · Contract review → comment 7267534418 |
… whose documentBy is not a single-valued parent link (objectstack-ai#38662) <!-- claude-projects-attribution: {"github_login":"os-warren"} --> _Requested by **Warren** · [project thread](https://claude.ai/code/project/chan_01U5RdnAAmkSQmZbqh6FtqZ8?thread=cmsg_01U5RdnAAmkSQmZbqh6FtqZ8Xj6YfMRKw8XnmTA1ohBr6K)_ Fixes objectstack-ai#38537 Clause-②: no Metadata-protocol: none **Lands after objectstack-ai#38594** (merged 2026-11-30T01:10Z; main merged into this branch at `d1e1ba3f03`). Both PRs are seat 2's. The overlap is two files (`packages/lint/src/index.ts`, `packages/lint/src/rule-explanations.ts`), in hunks far apart; `overlap-check` reads both clean against each other and main. ## 维护者速读 - 用户能看到什么变化:知识源的“文档单位”(`documentBy`)如果填的不是指向父记录的单值查找字段,`os validate` / `os build` / `os lint` 和发布时都会报错并说明怎么改。之前只有在 Studio / 元数据 API 保存时才会拒绝。 - 为什么做:随包发布或代码注册的知识源不经过保存这道门,填错了没人拦,检索按父记录聚合会悄悄失效。这是 objectstack-ai#38537 的第二个也是最后一个 PR。 - 出错会怎样:只影响声明了 `documentBy` 的知识源;规则误判会让正确的知识源发布失败,删掉 `documentBy` 即可绕开。 - 要你做什么:无。 ## What changes - **New rule** `knowledge-source-document-by-not-parent-link` (`error`) in `validate-knowledge-source.ts`. It refuses a `source.documentBy` that `metadataFields` lists and that is not a single-valued parent link of the indexed object. The checks run in the save door's order: declared by the object, neither credential-class nor `internal`, a `lookup` / `master_detail` type, a target `referenceTargetOf` can read, and not `multiple: true`. Each reason gets its own message, worded like the save door's `documentUnitRefusalText`, naming the field and the fix. Path: `knowledgeSources[i].source.documentBy`. - **Where it runs.** The rule rides the existing `validateKnowledgeSource` registry entry, so it reaches `os validate` / `build` / `lint` and the runtime publish gate (`knowledge_source` writes) with no new wiring. This is what judges a source a package ships or code registers; until now only the metadata API's save door did (objectstack-ai#38564). - **Not judged twice.** A `documentBy` that `metadataFields` does not list is left to the parse, which already names that fix. A member the object does not have is reported once, as `knowledge-source-field-unknown`. An object with no readable field map is not judged. - **Published and explained.** The rule id is re-exported from the root barrel (`index.ts`, one line in the knowledge block). `rule-explanations.ts` gets its `os explain` entry and table row beside the five sibling rules. - **Census pin** (`packages/core/src/security/second-object-read-exposure.pin.test.ts`): the new `referenceTargetOf` import makes `validate-knowledge-source.ts` a caller of the reference-target arbiter, so it is classified `not-a-served-read` beside the other lint callers. It only asks whether a target is declared, and reads and serves nothing of the target. Admitted by the seat for this fix after CI's Test Core (8/12) flagged the unclassified caller. Locally: 1 failed / 3 passed before the entry, 4/4 after. - **Changeset** `patch` for `@objectstack/lint`. ## Route chosen for the parent-link rule (objectstack-ai#38564's PR 2 question) objectstack-ai#38564 left PR 2 two ways to reach `parentLinkRule` / `documentUnitOf` (`service-knowledge`'s `knowledge-search-scope.ts`). The seat accepted a third: - **A: lint imports `@objectstack/service-knowledge`.** Not taken. `@objectstack/lint`'s package description says it "Depends on @objectstack/spec; never on a runtime", and service-knowledge is a runtime service. It would also need a new line on service-knowledge's `exports` surface. - **B: move the rule to "a package lint already reads, for example `@objectstack/core`".** Not taken. Lint does not depend on `@objectstack/core`; its workspace dependencies are `formula`, `metadata-core`, `sdui-parser` and `spec`. Moving it to `spec` would put runtime-shaped logic into the protocol package and widen this PR well past its card. - **C (taken): compose the verdict in lint from the spec predicates `parentLinkRule` itself asks.** Withheld = `isMaskedOnReadFieldType(type, managedBy)` or `internal === true`. That is the reading this file already takes for `knowledge-source-field-never-indexed`, and the one `collectCredentialWriteResponseFields` / `collectInternalWriteResponseFields` compute in core. Target = `referenceTargetOf` (`@objectstack/spec/data`). The type pair `lookup` / `master_detail` is spelled locally, as eight other lint rule files already spell it. Cost: the four-part rule now lives in two places. No test pins their agreement, because no package that depends on both can import `documentUnitOf` without one more barrel line in service-knowledge. The module header names the save door's function so a change to one points at the other. ## Why ADR-0161 K4: "a packaged item meets the gates that need no principal in `os validate` and at publish". `documentBy` is such a gate: it reads only the object definition. objectstack-ai#38564 left it judged at save only, and its body says "PR 2's `os validate` rule covers packaged sources." ## Clause-② and Metadata-protocol, measured from the diff `Clause-②: no` / `Metadata-protocol: none`, a judgement call stated here for review. The rule refuses values of `source.documentBy`, a key objectstack-ai#38564 added in this same prerelease line. Its changeset `.changeset/38537-knowledge-document-by.md` is still pending (not moved to `.changeset/pre/`), so no published version carries the key and nothing an author could write against a release is refused. The metadata API's save door already refuses the same values. Read against `main` instead, a packaged source with a non-parent-link `documentBy` passed `os validate` before this PR and fails it after. If review prefers that reading, the lines become `Clause-②: no (narrowing)` / `Metadata-protocol: narrowed` (level `minor` and an ADR-0087 disposition). ## Verification ### Acceptance (the card's `os validate` half) | Card line | Test (`validate-knowledge-source.document-by.test.ts`) | |:--|:--| | Refuse a text field, a `user` field, an `internal` lookup and a `multiple` lookup, each naming the fix | "refuses a text field / a user field / an internal lookup / a multiple lookup as the document unit, naming the field and the fix" | | (the save door's other reasons) | "… a credential-class field", "… a lookup with no readable target", "… a system column the platform adds" | | Positive controls | "CONTROL: a lookup and a master_detail to the parent are admitted", "CONTROL: a source without documentBy is judged as before" | | Same verdict at publish | "refuses the publish with the words os validate prints", "CONTROL: a single-valued parent link publishes with nothing to report" | | Published id + `os explain` | "the root barrel re-exports it", "os explain answers it" | ### Ablation (`scripts/ablation-replace.mjs`, each mutation verified on disk, each restore verified blob == HEAD `d9f63681062f` with an empty `git diff HEAD`) <details><summary>Call site disabled (<code>const refusal = documentUnitRefusal(…)</code> → <code>undefined</code>): 9 red</summary> `validate-knowledge-source.document-by.test.ts`: 9 failed / 8 passed. All seven refusal tests, "a fields array is read like a field map", and "refuses the publish with the words os validate prints". The controls stay green. </details> <details><summary><code>multiple</code> arm deleted: 1 red</summary> 1 failed / 16 passed: "refuses a multiple lookup as the document unit…". </details> <details><summary><code>internal</code> half of the withheld arm removed: 1 red</summary> 1 failed / 16 passed: "refuses an internal lookup as the document unit…". (A first attempt was refused by the tool before running anything, because its replacement text already occurred in the file; it was re-run with a distinct replacement.) </details> ### Package suite and typecheck - `pnpm --filter @objectstack/lint test`: Test Files 248 passed (248), Tests 9989 passed / 5 skipped. Exit 0. - `pnpm --filter @objectstack/lint typecheck` (tsc + test layer): exit 0. - `eslint` on the four changed source files: exit 0. - `overlap-check`: VERDICT clean exit 0. origin/main merges cleanly, and so do the 7 open PRs sharing a file (objectstack-ai#38651, objectstack-ai#38650, objectstack-ai#38643, objectstack-ai#38605, objectstack-ai#38594, objectstack-ai#38550, objectstack-ai#38497). ### Derived gate families (`dispatch-gates.mjs --commands`, 70) - First pass, captured per the tool's idiom: `--ran` reports "70 derived famil(ies) accounted for — 66 run, 4 NOT-MEASURED (4 DERIVED from a recorded exit 3)". All 66 that ran exited 0, including `check-changeset-no-major --base origin/main`, `check-adr-0087-registration --base origin/main`, `check:doc-authoring`, `check:issue-citations` and `check:cross-package-test-inputs`. - The four exit-3 families each had a prerequisite missing. Three were re-run after fixing it, each exit 0: `check-plugin-teardown-shape --self-test` (needed `git fetch --unshallow`), `check:docs-transcript-drift` (needed the built lint) and `check:lean-entry-closure` (needed the built objectql). These re-runs were by hand, outside the `--ran` record. - `check:dual-build-cjs-loads` was not measured locally: it reads every package's `dist/`, which needs a full build. CI's `Build Core` job runs it on this PR. ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. (spec untouched) - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran; `pnpm lint` passes (eslint on the changed files). - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. - [x] 6. `packages/spec` touched: n/a. - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English (the 维护者速读 block is the maintainer's Chinese brief). - [x] The *Before Submitting* list in CONTRIBUTING.md is done. ## Read first 1. `packages/lint/src/validate-knowledge-source.ts`: `documentUnitRefusal` and the call site after `judgeMembers('metadataFields')`. 2. `packages/services/service-knowledge/src/knowledge-search-scope.ts`: `parentLinkRule` / `documentUnitOf`, the save door's rule this one restates. **Two-minute check:** `pnpm --filter @objectstack/lint exec vitest run src/validate-knowledge-source.document-by.test.ts`. Expect 17 passed. Dogfood: n/a (no `!` in the title, no `(narrowing)` arm). 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01JQwxbWsSJprjGydwaCH1gD <!-- signed: repo:objectstack#2 · os-warren · session_01JQwxbWsSJprjGydwaCH1gD --> --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Steve · project thread
Refs #37815 (items a, b)
Clause-②: no (narrowing)
Metadata-protocol: narrowed
Skills-docs: follow-up #38655
维护者速读
What changes
The QuickJS sandbox gates seven tokens, and before this PR lint judged one of them on one kind of body (
ctx.apiwrites 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 threw403 INSUFFICIENT_PRIVILEGESat every call.packages/runtime/src/sandbox/quickjs-runner.tsat0ba5e06ae7:api.readon theREADleavesfind/findOne/count/aggregate(installApiMethod, line 755) and onctx.title(FIELD)with an argument (line 1035, hook bodies only: the action face builds noctx.title);api.writeon theWRITEleaves (line 756);api.transactiononctx.api.transaction(installTxLeaf, line 783);logonctx.log.debug|info|warn|error(line 881);crypto.uuidonctx.crypto.randomUUID(line 907);email.sendonctx.email.sendandactivity.appendonctx.activity.append(installDoor, lines 941 to 994). That set is exactlyHookBodyCapabilityin the spec. The rule judges exactly that set, asSANDBOX_CAPABILITY_GATES.validateActionBodyCapabilitiesnow walksstack.hookstoo, with the same reading (blanked source; the member itself, a local bound once to it, or a handle bound once to.object(…)). New idhook-body-capability-undeclared, one finding per body and token, athooks[i].body.capabilities. A hook body is never grantedemail.send(the hook's parse refuses the grant), so itsctx.email.sendcall 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 thatos build/os verifylowered from an inlinehandleris not judged (isLoweredHandlerBody): under the CLI exactly whenctx.loweredHookRefsholds the hook's stringhandler, and at a door that hands no lowered refs (the runtime publish doors) whenever a stringhandlersits beside the body, the shape a build artifact carries. Its grant is the build's inference, and the extractor does not yet inferapi.transactionor a read through a bound handle, so a finding there would name a grant the handler author cannot write. cli: the hook-body extractor infers noapi.transactionand noapi.readthrough a bound object handle, so a lowered handler's inferred capabilities miss calls it makes #38653 carries the lowered-handler reading and both extractor gaps. The registry entry keeps its name and gainshookinruntimeTypes(thevalidateHookAndJobBodyCompilesprecedent: one entry, ids per kind), and now receivesctx.action-body-capability-undeclared. A missingapi.writekeeps 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 thatos build/os verifylowered from an inlinetargetfunction is judged forapi.writeonly, as before (isLoweredTargetBody). Measured before the edit: the CLI hands no lowered-action ref set (LoweringResultcarriesloweredHookRefsonly), andlowerActionCallableleaves a stringtarget(the registered ref) beside the minted body. So on every door, the CLI included, a body is read as lowered when a stringtargetsits beside it. Nopackages/cliedit was needed. A JS body runs only on ascriptaction, wheretargetis kept for legacyfunctionsreferences alone; an authored body beside a stringtargetis therefore not judged for the other tokens either, a missed finding, never a false one. Inexamples/app-showcase, none of the 296 JS-body actions (318 actions in all) carries a stringtarget. cli: the hook-body extractor infers noapi.transactionand noapi.readthrough a bound object handle, so a lowered handler's inferred capabilities miss calls it makes #38653 carries the lowered reading.caps.has('…'), theinstallApiMethodtokens and theinstallDoorcalls must equal the census; thecaps.has(NAME)calls with a variable must be exactly the two known ones, so a third parametrised gate turns it red; theREADlist, the log levels and the door triples are pinned; and the census token set must equalHookBodyCapability.options.action-body-write-unknown-fieldexplanation now lists the installed field-carrying leaves:insert,update({ id, … }),updateById(id, { … }),upsert,updateMany.updateByIdlanded with fix(runtime,cli,lint,spec)!: a sandboxed body's ctx.api.object(X).updateById(id, patch) writes the row #38643, which this branch merged frommain; the census and the gate table read the runner'sWRITElist and needed no edit.os explainentries for both new ids, and two rows incontent/docs/deployment/validating-metadata.mdx.packages/lint/src/index.tsexports 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 thehook-job-body-does-not-compile-refusedprecedent and says the hook arm covers authored bodies only; the changeset marker isregisteredwith that id, and the changeset carries an@objectstack/specpatch line. Theos buildextractor (packages/cli) is unchanged: byte-identical tomain.The rule file's header names
hookas the third runtime door (review N2), and the upgrade-guide entry'sacceptanceCriterianames the inline pathobjects[N].actions[M].body.capabilities(N2). S1 (updateByIdin theaction-body-write-unknown-fieldleaf list) was met ata60a6de915.This touches a contract face: the lint rule family's accept set at the save door and in
os validate(a narrowing).Tests
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 (runRuntimeAuthoringRulesontype: 'hook') and throughrunAuthoringRulesforvalidate/build/lint; the hookemail.sendremedy;ctx.title(FIELD)againstctx.title(); a shape table forbodyGatedCalls; the runner pin.ctx.api.transaction, grantedapi.writeonly, as the extractor infers): the authored action body is refused; the same body beside a stringtargetis not judged, throughvalidateActionBodyCapabilities, throughrunAuthoringRulesforvalidate/build/lintat the top level and inline on an object, and at theactionandobjectdoors (each with an authored positive control); a lowered body withoutapi.writeis still refused under the write id.validateActionBodyCapabilities, throughrunAuthoringRulesforvalidate/build/lintwithloweredHookRefs, and at the save door with a stringhandlerbeside the body; a stringhandlerthe build did not lower leaves the authored body judged.scripts/ablation-replace.mjs, each restored to a clean tree.Readings at 4c07e0d, 29d3b0f, a60a6de and c3319db
pnpm --filter @objectstack/lint typecheck && pnpm --filter @objectstack/lint test: typecheck clean,check:test-typecheckOK; 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-guideandcheck-nul-bytesexit 0; overlap-check clean.pnpm --filter @objectstack/dogfood testunder 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.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:generatedandcheck-nul-bytesexit 0; overlap-check clean.mainwith fix(runtime,cli,lint,spec)!: a sandboxed body's ctx.api.object(X).updateById(id, patch) writes the row #38643):pnpm --filter @objectstack/lint typecheck && pnpm --filter @objectstack/lint test: typecheck clean,check:test-typecheckOK; Test Files 248 passed, Tests 10031 passed. The new test file, census pin included: 42 passed.check-adr-0087-registration --base origin/mainexit 0;check-changeset-no-majorexit 0.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.isLoweredHandlerBodyearly return deleted): Tests 2 failed / 40 passed, exactly the two not-judged pins; restored, blob equal to HEAD.api.transactiongate entry removed, 8 failed / 31 passed; both restored.check-adr-0087-registrationexit 0 (1 migration entry added);check:spec-changesexit 0;check:upgrade-guideexit 0;check:generatedall 14 artifacts current;check-nul-bytesOK. The upgrade guide was regenerated withgen:upgrade-guideonly.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);--ranreconciliation: 118 accounted for. CI on c3319db: 72 check-runs, 62 success and 10 skipped, among themLint & Repo Gates,Test Core,Check ChangesetandDogfood Regression Gategreen.pnpm --filter @objectstack/dogfood testunder the lock, after building the dogfood closure): Test Files 495 passed / 3 skipped (498), Tests 4187 passed / 68 skipped (4255), VERDICT command-exit 0.packages/*/test/**andexamples/**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.Acceptance notes
api.transactioninference; noapi.readinference through a bound handle,?.before the leaf or an argument holding parentheses), are carried by cli: the hook-body extractor infers noapi.transactionand noapi.readthrough a bound object handle, so a lowered handler's inferred capabilities miss calls it makes #38653, a widening that follows this PR. The published@objectstack/cli/hook-bodytype and its pin are untouched, so this PR keeps its one Clause-② arm.handlerand 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.targetand a JS body is read as lowered on every door, the CLI included, and judged forapi.writeonly. That covers an author who wrote a body beside atargetfunction, too:lowerActionCallablekeeps that authored body and still turns thetargetinto a string ref. A missed finding, never a false one. cli: the hook-body extractor infers noapi.transactionand noapi.readthrough a bound object handle, so a lowered handler's inferred capabilities miss calls it makes #38653 carries the lowered reading for both arms.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), thenisLoweredTargetBodyand the action loop'sloweredskip, then the new test file's runner-pin block, its M1 pins and its route C pins, then theauthoring-rules.tsentry (runtimeTypesgainshook,runreceivesctx).Two-minute check:
pnpm --filter @objectstack/lint exec vitest run src/validate-action-body-capabilities.hook-and-tokens-37815.test.tsshows 46 passed.Generated by Claude Code