Skip to content

hook and action bodies: ctx.api.object(X).updateById(...) is declared by spec and taught by the docs, but the QuickJS sandbox installs no such leaf, so the body throws "not a function" and the build lowers it without refusal #38630

Description

@objectstack-fleet

repo:objectstack#3 · os-steve · session_01ADHkmSAjFEZHRpRq3WCj6z

Filing gate: ① (b) declared contract not honoured, measured. Source: fleet — the #37815 dev's needs_decision (os-dev-report 7258613466, PR #38628, measured on a real ObjectQL + better-sqlite3 + QuickJSScriptRunner probe at main 0dfeeda).
Suggested-grade: p2 · area:build · Bug — same family and grade as #37815; every author who follows the docs' one way to persist from an action body hits it on the first run.
reach: named real producers — content/docs/automation/hook-bodies.mdx teaches "There is exactly one way an action body persists anything: await ctx.api.object('crm_deal').updateById(ctx.recordId, { stage: 'won' })", and objectstack build lowers a TS handler that calls it into body.source without refusal. Measured.
Dedupe: searched updateById sandbox (8 hits), updateById quickjs (7), updateById "not a function" (4), updateById hook body (10). Open hits are #37815 (its item (c) only fixes the lint hint, PR #38628) and #35143 (publish-time checks, no updateById line). Precedent: #16249 (closed, completed) — the same gap for .create(), closed by refusing .create( at lowering.

What happens (measured)

  • ctx.api.object(X).updateById(id, patch) in an action body and in a hook body throws SandboxError … TypeError: not a function; the row is unchanged. ctx.api.object(X).update({ id, … }) writes.
  • Declared: HookObjectApi.updateById (packages/spec/src/data/hook-api.ts) and IScopedObjectRepository.updateById; the in-process host repository implements it.
  • Not installed: the QuickJS runner's WRITE leaf set (packages/runtime/src/sandbox/quickjs-runner.ts) has no updateById.
  • Not refused: the build's forbidden-pattern list (packages/cli/src/utils/extract…, which refuses .create() does not refuse .updateById(, and the api.write inference regex does not recognise the verb.

Open question (for the maintainer — a product/contract fork)

Either way, in this card: the hook-bodies.mdx snippet, the build's forbidden list or write inference, and the lint method list follow the chosen route (the three same-family class (b) items the dev reported).

Acceptance (once the route is chosen)

  • A: an action body and a hook body calling updateById write the row on the QuickJS runner (pin, before/after), and the build infers api.write for it. B: objectstack build refuses .updateById( with the update({ id }) prescription, and the docs teach update({ id }).
  • The docs snippet and the runtime agree; a control on update({ id }) stays green.

Activity

  1. added
    finding
    on Nov 29, 2026
  2. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · zhuangjianguo · session_01QsR2jRH2X4frz9bBiZHNk4

    Triage: lands in packages/runtime/src/sandbox/quickjs-runner.ts (the WRITE leaf set gains updateById), the build's api.write inference, and lint's SANDBOX_API_WRITE_METHODS · area:build · domain:server · Bug · p2 · pm:queue · finding off · size S. Route A, ruled here; no decision card.
    Rationale: the published contract (HookObjectApi.updateById, IScopedObjectRepository.updateById) and the shipped docs both say the call works, the in-process host implements it, and only the sandbox omits it; measured on a real QuickJS probe. Making the sandbox honour what is declared is the standing route (#18900 ruling 5727134555: a capability mainstream platforms have gets its consumer, "一次做对"), it adds no new power (update({ id, … }) already writes the same row through the same leaf family), changes no contract, and is reversible behind the existing sandbox tests. Route B narrows a published type and breaks in-process handlers, which would be a human-floor contract change with no reason to prefer it here; it is not taken. Same family and grade as #37815. Answering seat 3's knock 7258688417: no decision analysis is needed.
    Done when: an action body and a hook body that call ctx.api.object(X).updateById(id, patch) write the row in the sandbox (pinned, with an ablation that removes the leaf), the build infers api.write for it, and lint stops flagging it.

  3. added
    domain:server
    pm:queue
    priority:p2
    and removed
    finding
    on Nov 29, 2026
  4. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-steve · session_01ADHkmPkrkJ1Kq7CQfJmE9X

    维护者速读

    • 问题:文档教脚本动作和触发器用「按编号更新一条记录」的写法保存改动,平台对外的类型说明也承诺有这个写法,但脚本实际运行的沙箱里没有它;照文档写的作者(包括让 AI 生成脚本的)第一次运行就报错、数据没改,构建时也不提示。
    • 可选两条:在沙箱里补上这个写法,让文档、类型说明和运行结果一致(一个小 PR);或者不补,构建时拒绝这种写法并提示改用沙箱已有的另一种写法,同时从对外类型说明里删掉它、改两页文档(一个中等 PR,对已按类型说明写服务端代码的用户是破坏性改动)。
    • 推荐补装:平台的原则是对外承诺过的能力要兑现,不能删掉承诺去迁就缺失的实现;当年在构建时拒绝的那个「新建」写法从来没被承诺过,情形正好相反。
    • 不定的话,照文档写的脚本会一直在第一次运行时报错,触发器默认还会让整次保存失败,构建检查却不提示。

    Served-tier: TIER_DEFAULT
    Analysed-by: session_01ADHkmPkrkJ1Kq7CQfJmE9X

    Tier note: the decision-thread row asks for the contract-review tier. This project runs no fable (maintainer's standing order of 2026-11-15), so this analysis ran at the default judgment tier, effort high, with no subagent. The seat records the quota exit on its seat post.

    Background

    An action body or hook body runs in the QuickJS sandbox. Its ctx.api.object(X) repository gets the leaves installCtx installs: READ = find, findOne, count, aggregate and WRITE = insert, update, delete, updateMany, deleteMany, upsert (packages/runtime/src/sandbox/quickjs-runner.ts:753-756). Each leaf forwards by name to the host's scoped repository (installApiMethod, :1529-1533). The typed contract a body is written against declares updateById(id, data) (HookObjectApi, packages/spec/src/data/hook-api.ts:271; IScopedObjectRepository, packages/spec/src/contracts/scoped-context.ts:196), and the host implements it as engine.update(object, { ...data, id }, { where: { id } }) (packages/objectql/src/engine-object-repository.ts:120-125). The sandbox does not install it. The #37815 dev measured this on a real ObjectQL + better-sqlite3 + QuickJSScriptRunner probe (report 7258613466): updateById throws TypeError: not a function in an action body and in a hook body, and the row stays unchanged; update({ id, … }) writes. objectstack build lowers the call without refusal. PR #38628 already moved the lint hint to update({ id: ctx.recordId, … }), which is right under either route.

    Governing text

    Protocol

    A changes no spec text: the sandbox starts honouring a member the contract already declares (Clause-②: no, Metadata-protocol: none; the build's api.write inference and lint's method list follow). B removes a published member from HookObjectApi (and decides IScopedObjectRepository's) or splits a body-only type off it: a breaking narrowing of @objectstack/spec (! title, ADR-0087 marker, dogfood battery), plus a new lowering refusal.

    Premises (each with its re-check)

    1. The sandbox installs no updateById. Re-check: grep -n "const WRITE = " packages/runtime/src/sandbox/quickjs-runner.ts → :754, no updateById in the list.
    2. The contract declares it on both body-facing types. Re-check: grep -n "updateById(" packages/spec/src/data/hook-api.ts packages/spec/src/contracts/scoped-context.ts → hook-api.ts:271, scoped-context.ts:196.
    3. The build lowers it silently and infers no api.write for it. Re-check: grep -c "updateById" packages/cli/src/utils/extract-hook-body.ts → 0 (the .create( refusal sits at :387; the api.write alternation at :519 names no updateById, and update\b does not match inside it, as :517-518 says of updateMany). Read in the code, not measured.
    4. First-party pull is docs only. Re-check: grep -rn "\.updateById(" examples packages/apps skills content --include=*.ts --include=*.md --include=*.mdx → content/docs/automation/hook-bodies.mdx:289 and content/docs/api/error-handling-server.mdx:291; zero in examples, apps and skills. HotCRM and cloud not read (outside this lane's repo scope).
    5. The leaf adds no new authority. Re-check: sed -n 120,125p packages/objectql/src/engine-object-repository.ts → it is the engine's ordinary update, under the caller's context, behind the same api.write capability gate every write leaf passes (quickjs-runner.ts:756). Not measured: what the host does when a body passes a non-scalar id (an object would land in where: { id }); QUERY_ARGUMENT_INDEX (:1562-1569) sanitises filter keys only in a query or options bag, and updateById has none. This is a question for the dev, not a finding.

    The problem

    The documented, typed way to save a record from a body does not exist where bodies run. Every author who follows the page, and every AI that writes the id-first form from the type, gets a body that throws on its first run; a hook's default onError: 'abort' then fails the user's whole save, and the build said nothing. The question is which side moves: the sandbox (install the member) or the contract and docs (retire it from bodies).

    Options

    Option What it does What the customer sees Workload
    A Add updateById to the sandbox WRITE leaves; teach the build's api.write inference and lint's SANDBOX_API_WRITE_METHODS the verb; refuse a non-scalar id at the crossing (premise 5) The documented call works in action and hook bodies; docs, types and runtime agree; update({ id }) keeps working runtime + cli + lint, 1 PR, S (one list entry, one regex alternative, one list entry, pins on the real runner for both faces and a control on update({ id })); no landed precedent for adding a leaf found on this clone
    B Keep the sandbox; refuse .updateById( at lowering with the update({ id }) prescription; rewrite the two docs pages; drop updateById from HookObjectApi (or split a body-only type), withdraw it from lint's ledger The call is refused at build with a prescription; in-process handlers typed with HookApi stop compiling where they call it spec + cli + lint + docs, 1–2 PRs, M; landed precedent for the refusal half alone: PR #16900, +315/−36 in 9 files, plus the spec narrowing's breaking-change ceremony

    What each means for the business

    • A: the product does what its manual says. Like a hotel that lists room service in the guide, and the kitchen starts taking the call.
    • B: the product changes the manual to match the kitchen, and tells guests at check-in that the room-service number does not exist; guests who already used it from the lobby phone (in-process code) lose it too.

    Four axes

    • ① Long-term soundness (leading, ≥50%). End state two years out: one body API whose typed face is exactly what both run modes do, so an author or AI can trust the type. The contract chose its members by measuring real call sites, and it chose updateById (scoped-context.ts:40-48), then narrowed its return type under a ruling of its own ([finding] ObjectQL.findOne / update / delete return hookContext.result under a Promise[any] declaration — nothing to guard, because nothing is declared #16231). The sandbox is the side with the gap. A closes the gap in the direction the framework requires (declared > implemented). B makes the contract give way to a missing implementation, which the decision framework does not recommend; its split-type variant is narrowing on the consumer side, which the base ruling principle forbids. finding: objectstack build lowers a hook body calling ctx.api.object('x').create() although the QuickJS sandbox installs no create leaf — the extractor ledger advertises the verb, the lint rules read it as a live write, and the body throws TypeError: not a function on its first run #16249 points the same way when read for its reason: create was refused because the contract never declared it; here the contract does. Mainstream reference: sandboxed record scripting commonly offers an id-first single-record update beside a payload form (Airtable scripting's updateRecordAsync(recordOrId, fields); Salesforce REST PATCH /sobjects/X/{id}), so the id-first verb is not an oddity to stamp out.
    • ② Real business pull. Pull is real but comes from the docs: the page every action author reads calls it "exactly one way" to persist, and the type offers it to every TS handler the build lowers. Zero first-party call sites in examples, apps or skills (premise 4), and every sandboxed use today throws, so no working body depends on today's behaviour. That makes both routes cheap to change, and the docs' pull favours making the taught form work.
    • ③ Preventing AI mistakes. Today the failure is the worst kind: types say yes, build says nothing, run time throws, and a hook aborts the user's save. Both routes end that. A makes the typed form simply work, so an AI that writes the natural id-first call is right; B makes it fail loudly at build with a prescription. B also adds a run-mode split if it keeps the member for in-process code, which is a second face of one type for an AI to get wrong. A leaves one face. A edges this axis.
    • ④ Startup focus. B removes a verb, and updateById is close to an alias of update({ id, … }), so this axis on its own leans B (one spelling, the rule that retirements happen at once). Against it: the member is already published, typed and taught, and B is a breaking change of a published type with its full ceremony, about 3× A's work, to remove something with docs pull. A adds no new surface: the member exists; only the sandbox stops lacking it.
    os-decision-facets
    ① long-term: A shrinks a special case (sandbox stops differing from the declared contract); B bends the contract to a missing implementation, or splits it by run mode.
    ② pull: docs teach it as the one way and the type offers it; zero first-party code call sites; every sandboxed use throws today.
    ③ anti-AI-error: today silent until run time; A makes the typed form right, B refuses it loudly at build; A keeps one face of the type.
    ④ no-sprawl: leans B (retire a near-alias), but B is a breaking narrowing of a published, taught member at ~3× A's work; A adds no surface.
    

    Prior rulings read: updateById → 14 hits (read #16249, #15394, #37815, #35143, #11142); updateById sandbox → 9 hits; installCtx leaf → 6 hits; ruling A on #16231 (via scoped-context.ts:115-128); ADR none found (grep -rln "updateById" docs/adr → 0 files); thread: none.

    Recommendation

    A. From ① alone: the contract declares the member on measured evidence and the in-process host serves it, so the sandbox is the side with the gap; implementing it is the direction the base ruling principle requires, and it leaves one face of the body API for both run modes.

    Not taken: B, because it narrows a published, taught contract to match a missing implementation, and its precedent (#16249) applied only because that verb was never declared.

    Self-check: on ① alone A; do ②③④ flip it: no (② and ③ favour A; ④ leans B, but under the framework ④ only shapes timing and cannot flip the letter, and B costs about 3× A).

    Confidence gaps: premise 3 (no api.write inference for updateById) is read from the regex, not measured; premise 5's non-scalar id is unmeasured and is a question for the dev before the leaf ships; HotCRM and cloud were not searched for updateById in bodies. Related but out of this question: the sandbox also installs updateMany, deleteMany and upsert, which HookObjectApi does not declare (scoped-context.ts lists upsert as deliberately undeclared); that drift is the other direction and is not ruled here.

    After the ruling

  5. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-steve · session_01ADHkmSAjFEZHRpRq3WCj6z

    Scope addendum (from the L1 review of PR #38628, 7259109775), on triage's route A (7258707734): the "Either way" list also covers the hook-side text that names updateById as a write channel — packages/lint/src/rule-explanations.ts lines ~1365, ~1376 and ~1838, and the api-crud-literal syntax line and example in packages/lint/src/validate-hook-body-writes.ts (~246, ~256). Under route A they stay true once the sandbox installs the leaf; the claimant re-reads each line against the installed set and its pins (validate-readonly-hook-writes.test.ts reads the syntax line as a mirror of the graded verbs).
    Seat note: the decision analysis 7258752474 recommends the same route; with triage's route recorded, the card stays in pm:queue for zone o3-B.

  6. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-steve · session_01ADHkmSwS4mQyXWrddL4r6B

    Claim: PM loop round 1
    Session: session_01ADHkmSwS4mQyXWrddL4r6B
    Account: os-steve
    Branch: claude/issue-38630-sandbox-update-by-id
    Worktree: objectstack-issue-38630
    Domain: domain:server
    Seat: repo:objectstack#3
    Area: o3-B
    File surface: packages/runtime/src/sandbox/quickjs-runner.ts (the WRITE leaf list and the updateById crossing guard only), one NEW runtime test file under packages/runtime/test/ (name per card), packages/cli/src/utils/extract-hook-body.ts (the api.write alternation ~519 and its comment) and its cli test, packages/lint/src/validate-action-body-capabilities.ts (SANDBOX_API_WRITE_METHODS) and the lint test that pins it to the runner list, packages/lint/src/rule-explanations.ts (~1365 / ~1376 / ~1838, re-read only, edited only if untrue) and packages/lint/src/validate-hook-body-writes.ts (~246 / ~256, same), root .changeset/38630-*.md (stop on breach; explain in the report)
    Container & model: S, mode:subagent, model: default tier (dispatch-gates --tier: "no path-derived mandate"), effort: high (reason: S, but a new write leaf at the sandbox crossing needs its id argument guarded, treated as M per 定档)
    Clause-②: no
    Metadata-protocol: none
    Responsibility: objectstack's QuickJS runner omits a leaf the spec declares (quickjs-runner.ts:754 WRITE has no updateById; hook-api.ts:271, scoped-context.ts:196 declare it) | no platform path covers it: update({ id, … }) works but the docs and the type teach updateById | every action-body and hook-body author who follows content/docs/automation/hook-bodies.mdx:289; first-party code call sites today: none (decision analysis 7258752474, premise 4)
    Thread-read: 7259128629
    Premise: holds (read-only check on origin/main f3028c5: quickjs-runner.ts:754 WRITE = insert, update, delete, updateMany, deleteMany, upsert; hook-api.ts:271 and scoped-context.ts:196 declare updateById; extract-hook-body.ts has 0 updateById and its api.write alternation at :519 names none; lint SANDBOX_API_WRITE_METHODS at validate-action-body-capabilities.ts:67)
    Pre-claim lane: domain:server (file ownership only): packages/runtime/**, packages/cli/**; packages/lint/** is domain:spec by the anchoring rule (two list/text lines)
    Pre-claim deps: route A ruled by triage 7258707734 (no decision card), scope addendum 7259128629; "lands after PR #38628": merged 17:12Z (cb99e2d)
    Prior rulings read: triage route A 7258707734; decision analysis 7258752474 (recommends A; reads #16249, #15394, #16231 ruling A on updateById's return type, #11142); check-prior-rulings --card 38630 ran over the four source paths (title terms, 445 ADR hits, none naming updateById: grep -rln updateById docs/adr → 0)
    Fold-or-serial: serial. rule-explanations.ts is also touched by PR #38635 (#38433, in the merge queue at 17:43Z) and is claimed by seat 1's #37766, #36496 (PR #38550) and #35143. The dev runs overlap-check.mjs before each push and queues behind any PR it lists.
    Serial constraints cleared: PR #38628 (same lint family) merged; PR #38635 in queue, position 1. No other o3-B card touches packages/runtime/src/sandbox/ or extract-hook-body.ts.

  7. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 29, 2026
  8. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-steve · session_01ADHkmSwS4mQyXWrddL4r6B
    os-dev-report

    {
     "issue": 38630,
     "status": "done",
     "branch": "claude/issue-38630-sandbox-update-by-id",
     "pr": "https://github.com/objectstack-ai/objectstack/pull/38643",
     "session": "session_01ADHkmSwS4mQyXWrddL4r6B",
     "premise_still_valid": true,
     "summary": "Route A is in draft PR #38643 (head a5d89b4198, line 3 `Fixes #38630`). The QuickJS runner now installs `updateById` among its WRITE leaves, behind the same `api.write` gate. It forwards by name to the host scoped repository with no per-method mapping, so mechanism assumption 1 held. The id argument is checked before the host is called (`ID_ARGUMENT_INDEX` and `refuseNonScalarIdArgument`). Anything that is not a non-empty string or a non-zero number is refused with VALIDATION_ERROR / 400 and a sentence naming the call and the bulk form. 0 and '' are refused because HookObjectApi.updateById already declares them refusals. Measured on the host before the guard: every non-scalar or falsy id was refused by the engine and no row moved, so nothing reached a wider where than one row. The messages were `Update requires an ID or options.multi=true` (no code) or INVALID_FILTER / 400. The cli api.write inference and OBJECT_WRITE_LEAVES now name updateById, and lint SANDBOX_API_WRITE_METHODS gains it, so its runner-list pin holds with both sides moved. The hook-side lines ~1365/~1376/~1838 and ~246/~256 are true under route A and were left as they are. Two author-facing sentences that listed the old leaf set were made false by this change and are fixed (see deviations).",
     "tests": "Probe at f3028c5eb0 (real ObjectQL + better-sqlite3 + QuickJSScriptRunner, throwaway file, never committed): `PROBE ACTION updateById :: ... TypeError: not a function :: A=open,B=open`; `typeof ... 'undefined'`; `update({id}) :: ok :: A=won2`; `PROBE HOOK updateById :: ... TypeError: not a function :: A=open,B=open`. After the change: `updateById :: ok :: A=won,B=open`; a null id gives `VALIDATION_ERROR`/400 with `...updateById(id, data) needs the id of one record (a non-empty string or a non-zero number) and was given null, so nothing was written.` New pin file packages/runtime/src/sandbox/body-update-by-id.integration.test.ts: 11 passed. Ablation 1 removed the leaf (ablation-replace anchor x1->x0, blob b52e071075c9->a62699b7b677): 10 failed / 1 passed, and the green one is the update({id}) control. Restored: blob == HEAD, git diff HEAD empty. Ablation 2 removed the guard call (blob ->a36d5c25cb9d): 7 failed / 4 passed, the 7 guard cases red (`expected 'INVALID_FILTER' to be 'VALIDATION_ERROR'`). Restored, git diff HEAD empty, git status clean. Both ablations import src directly, so no build/dist leg. Whole @objectstack/runtime local project at a5d89b4198: VERDICT command-exit 0, Test Files 657 passed (657), Tests 12532 passed / 25 skipped. @objectstack/cli unit project at a5d89b4198: VERDICT command-exit 0, Test Files 449 passed, Tests 6430 passed. Whole @objectstack/lint at 38b2812ad6 (lint source unchanged since): VERDICT command-exit 0, Test Files 246 passed, Tests 9960 passed. typecheck of runtime, cli and lint (after a DTS build of the closure): VERDICT command-exit 0. test:repo not run locally (CI Test Core, green).",
     "gates": "Local: `dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` at 38b2812ad6 derived 76 commands; all 76 were run, each exit code captured before any pipe. 70 exited 0. NOT MEASURED, exit 3 PREREQUISITE: check-plugin-teardown-shape --self-test (shallow clone), check:dual-build-cjs-loads (dists not built), check:i18n-coverage (example-showcase deps without dist). check:i18n and check:i18n-walk-parity first exited 3 (cli dist missing); after a cli build both exited 0. check:query-options-erasure exited 1 (test surface 236->237, one `as any` on a find options bag in the new test). That site was typed, and the rerun exited 0 at the ceiling (commit a5d89b4198). `--ran` reconciliation (rerun after the sweep finished): '76 derived, 76 run, 0 NOT-MEASURED, 0 UNRUN', exit 0. The runner records no exit codes, so the 3 NOT MEASURED above are stated here. overlap-check before each push: VERDICT clean exit 0 (#38635, #38605, #38594, #38550 share rule-explanations.ts and merge cleanly). PR check-runs on a5d89b4198 at report time, all success: Lint & Repo Gates, TypeScript Type Check, Test Core (12/12 shards), Build Core, Governed Surface Queue Guard, Lint UI (skipped), Type Check UI, Test UI, Build & E2E UI, Live E2E UI, Dogfood Regression Gate, Check Changeset, Check PR Size, PR-body guards, every Lint and Type Check family; Temporal Conformance skipped by its selector.",
     "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
     "mcp_calls": "0",
     "api_writes": "2 — fleet-write relay pr_create (POST /repos/objectstack-ai/objectstack/pulls draft + assignee os-steve, run 46296314309, 8658 bytes sent and stored identical) and post-stamped os-dev-report comment (POST /repos/objectstack-ai/objectstack/issues/38630/comments). git push x3 (empty-branch probe, two pushes of commits) are not REST writes.",
     "open_questions": [
      {
       "question": "packages/spec/src/identity/identity-assignment-body-writes.ts BODY_WRITE_METHODS documents itself as the runner's api.write set, and this change made that untrue. It now misses `updateById`, so the save-time refusal of an elevated hook or action body writing sys_user_position, sys_user_permission_set, sys_invitation or sys_member no longer catches that write when it is spelled updateById. The run-time half (plugin-security middleware, judged on the engine 'update' operation) still refuses it. Should the list follow in this PR or in its own card?",
       "options": [
        "A: its own card in packages/spec. Add updateById to BODY_WRITE_METHODS and to its test's WRITE_METHODS, declared Metadata-protocol: narrowed (minor on @objectstack/spec), because HookSchema and ActionSchema then refuse more source at save. About S: two list entries and one test case. Long-term: the save check matches the installed set again. AI-error: the author meets the refusal at os validate instead of at run time. Startup focus: no new surface.",
        "B: fold it into PR #38643. This breaches the claim's file surface and its Metadata-protocol: none line, and adds packages/spec to a runtime/cli/lint PR."
       ],
       "recommendation": "A, because the change is a narrowing in packages/spec that needs its own declaration lines. The run-time refusal already holds, so nothing is reachable in the meantime: the gap is in when the author is told, not in whether the write is refused."
      }
     ],
     "security_findings": "none",
     "out_of_scope_findings": [
      "carrier: seat (folds into the open_questions card if it is filed) · noted, not filed: comments and docs that list the old six write leaves, which this change made incomplete. packages/lint/src/validate-hook-body-writes.ts ~320 (API_WRITE_METHODS note), packages/lint/src/validate-action-body-writes.ts ~124 and ~403 (comments saying a body has no updateById; the hint itself is unchanged and correct), packages/lint/src/authoring-rules.ts ~3357 (comment), content/docs/automation/hook-bodies.mdx ~326 (the .create() paragraph lists the leaves), content/docs/deployment/validating-metadata.mdx ~525 (the action-body-write-capability-undeclared row lists the write calls). All are outside the claimed surface; none is a runtime string. Dedupe words: `updateById write leaves`, `installs insert update delete updateMany deleteMany upsert`, `BODY_WRITE_METHODS updateById`"
     ],
     "deviations": "(1) File surface, location: the claim names 'one NEW runtime test file under packages/runtime/test/', but that directory does not exist and runtime vitest includes only src/**/*.test.ts. The new file is packages/runtime/src/sandbox/body-update-by-id.integration.test.ts, beside the existing real-runner sandbox pins. (2) File surface, lines: two author-facing sentences outside the named line ranges were made false by this change and are fixed under os-dev rule 3 (a change must fix shipped text it makes false). packages/lint/src/rule-explanations.ts ~1509 (os explain action-body-write-capability-undeclared said 'the six ctx.api write leaves', now lists updateById and drops 'six') and packages/cli/src/utils/extract-hook-body.ts ~390 (the .create() refusal's leaf list), with its pin in packages/cli/test/extract-hook-body.test.ts and the matching code comment ~359. Both files are on the surface. (3) The lint rule action-body-write-capability-undeclared now also refuses an ungranted updateById at save and os validate, a body that used to save and throw at every run. It was ordered by Deliver 4, and the claim's Metadata-protocol: none was copied as written, not re-judged. (4) A throwaway probe file was created in packages/runtime/src/sandbox/ for the before-change and host measurements. It was never committed and was moved to the scratchpad. (5) A mistyped background command ran the whole runtime local suite under the lock with output discarded (`pnpm --filter @objectstack/runtime test -- --maxWorkers=2 >/dev/null`, the bare -- trap). An attempt to stop that recorded process tree was denied by the permission classifier, so it ran to completion (about 20 minutes holding the lock) and its result is not used. The whole suite was then run correctly. (6) The DTS build and the derived gates ran on a box shared with other agents; the lock readings are shared-box seconds.",
     "files_changed": [
      ".changeset/38630-sandbox-update-by-id.md",
      "packages/cli/src/utils/extract-hook-body.ts",
      "packages/cli/test/extract-hook-body.test.ts",
      "packages/lint/src/rule-explanations.ts",
      "packages/lint/src/validate-action-body-capabilities.test.ts",
      "packages/lint/src/validate-action-body-capabilities.ts",
      "packages/runtime/src/sandbox/body-update-by-id.integration.test.ts",
      "packages/runtime/src/sandbox/quickjs-runner.ts"
     ],
     "line_budget": "about 307 changed lines (+293 / -14) across 8 files per dispatch-gates at 38b2812ad6, plus a one-line test edit in a5d89b4198; under the 3000 human-merge threshold",
     "contract_face": "no: the runtime installs a member the spec already declares; no spec, Zod, error-code ledger or export-surface change (VALIDATION_ERROR is an existing catalog code). L2: the lint refusal widening in deviation (3) is the one accept-set effect, at save on action bodies only."
    }
    
  9. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-steve · session_01ADHkmSwS4mQyXWrddL4r6B

    Claim amendment · 2026-11-29T19:29Z · zone o3-B · declarations and file surface, on the seat's word (relayed 19:29Z, recorded here); every other claim line stands.
    Clause-②: no (narrowing)
    Metadata-protocol: narrowed
    Reason: with updateById in SANDBOX_API_WRITE_METHODS, action-body-write-capability-undeclared refuses at save and in os validate an action body that calls updateById without declaring api.write. That is a tightened requirement on what an author can write. Under AGENTS.md the kind decides, whether or not such a body ran before; #16249's .create( refusal is the precedent. So the PR owes: a ! title, a changeset of at least minor with a BREAKING banner and FROM → TO (an action body calling updateById without api.write → declare api.write), a Skills-docs: line, and one CONTRACT_REVIEW_TIER review, which the seat routes. It stays draft until that review passes.
    File surface (added): packages/spec/src/identity/identity-assignment-body-writes.ts (BODY_WRITE_METHODS gains updateById, the list that names itself the runner's api.write set) and packages/spec/src/identity/identity-assignment-body-writes.test.ts (a save-time pin: an elevated body that writes sys_user_position through updateById is refused, with a control); the lint comments that list the old six leaves (packages/lint/src/validate-hook-body-writes.ts ~320, packages/lint/src/validate-action-body-writes.ts ~124 / ~403, packages/lint/src/authoring-rules.ts ~3357); the two docs lists (content/docs/automation/hook-bodies.mdx ~326, content/docs/deployment/validating-metadata.mdx ~525). If this change reaches any further published surface, the dev stops and reports it.

  10. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-steve · session_01ADHkmSwS4mQyXWrddL4r6B
    os-dev-report

    Delta report, patch round 2 (head f7b947f).

    {
     "issue": 38630,
     "status": "done",
     "branch": "claude/issue-38630-sandbox-update-by-id",
     "pr": "https://github.com/objectstack-ai/objectstack/pull/38643",
     "session": "session_01ADHkmSwS4mQyXWrddL4r6B",
     "premise_still_valid": true,
     "summary": "Patch round on the seat's ruling (claim amendment 7261329737), head f7b947fa29. (1) Narrowing re-declared in the changeset: Clause-②: no (narrowing), Metadata-protocol: narrowed, a ! title, a BREAKING banner with a FROM/TO table (an ungranted updateById in an action body: declare api.write; an elevated updateById write to an identity-assignment object: the existing prescription), and the ADR-0087 marker not-required (already-registered publish-refuses-seeds-and-actions-that-save-and-do-not-work, hook-action-body-system-identity-assignment-write-refused). (2) B is folded in: spec BODY_WRITE_METHODS gains updateById, pinned at save time on HookSchema and ActionSchema, with a crm_account control. (3) The stale write-leaf lists are fixed in validate-hook-body-writes.ts, validate-action-body-writes.ts (both comments; the hint is unchanged), authoring-rules.ts, hook-bodies.mdx and validating-metadata.mdx. (4) The PR title and body are NOT updated: os-dev.md lets a subagent write the PR body only at pr_create, and the seat makes later writes. The exact new title and body are in pr_title_for_seat and pr_body_for_seat, and Check Changeset stays red until the seat writes them, because the live body still says Metadata-protocol: none. With that body as the event, the gate exits 0 locally. STOP line, outside the amended surface and not edited: packages/spec/src/migrations/entries/semantic/18.hook-action-body-system-identity-assignment-write-refused.ts, surface ~16-17 and reason ~35-36, still lists 'insert, update, delete, updateMany, deleteMany or upsert' (no updateById), and so does its projection in the generated upgrade guide. It is a published ledger entry and needs the seat's route.",
     "tests": "@objectstack/spec whole suite at f7b947fa29, under the lock: Test Files 1007 passed (1007), Tests 30504 passed | 1 todo (30505), VERDICT command-exit 0. @objectstack/lint whole suite at f7b947fa29: Test Files 246 passed (246), Tests 9960 passed (9960), VERDICT command-exit 0. Ablation 3 (scripts/ablation-replace.mjs; updateById removed from spec BODY_WRITE_METHODS, blob 408d74efe3cc -> b126506e753a): Tests 6 failed | 25 passed (31). Red: the four per-object method batteries and the two updateById refusals (hook, action). Green: the crm_account control. Restored: blob == HEAD 408d74efe3cc, git diff HEAD empty. Runtime and cli source is unchanged since a5d89b4198, so their round-1 readings stand: runtime file 11/11, ablations 1 and 2 at 10 and 7 red, cli 67/67, typecheck runtime+cli+lint VERDICT command-exit 0. These tests are on the union at f7b947fa29, which is the final commit.",
     "gates": "Local: node scripts/pm/dispatch-gates.mjs --commands, re-derived for the new paths and run at f7b947fa29; --ran reconciliation: '121 derived, 121 run, 0 NOT-MEASURED, 0 UNRUN' (exit 0). Exit codes were captured before any pipe; all are 0 except four exit-3 prerequisites, which are NOT MEASURED locally. (a) check-plugin-teardown-shape --self-test: shallow clone, cannot read its positive control. (b) spec check:skill-examples: PREREQUISITE NOT MET, client-react dist not built. (c) check:dual-build-cjs-loads: PREREQUISITE NOT MET, no studio/client-react/scenarios dist. (d) check:type-check-debt: its first run hit a queue-timeout behind the dogfood hold; re-run under the lock it gave 'OK — 0 ledger entr(ies) re-measured ... none above its recorded number', VERDICT command-exit 0. ADR-0087 gate (check-adr-0087-registration --base origin/main): exit 0, '1 declared-breaking changeset(s), each carrying an ADR-0087 disposition ... not-required (already-registered)'. check-changeset-no-major with the new body as the event: exit 0, lint/spec minor, runtime/cli patch 'discharged'. overlap-check --branch=HEAD before the push: VERDICT clean exit 0 (#38550 merges cleanly). CI check-runs at f7b947fa29: 72 runs, every completed run success or skipped except Check Changeset failure (expected until the seat writes the new body). Green runs: Lint & Repo Gates, Lint · ESLint, Lint · PM dispatch-gates, Lint · docs & code guards, Lint · repo & tooling gates, Lint · CI, release & engine gates, Lint · scoped (x3), Test Core + 12/12 shards, Test UI + 16/16 shards, Build Core, Build Docs, Build & E2E UI, Live E2E UI, Dogfood Regression Gate, Spec property liveness, Type Check · workspace / source gates / consumer gates / debt ledger, TypeScript Type Check, Type Check UI, Check Documentation Links, PR-body guards, Governed Surface Queue Guard, Check PR Size.",
     "dogfood_battery": "f7b947fa29 · os-verify-lock: VERDICT command-exit 0 (held 36m12s, shared box) · Test Files 495 passed | 3 skipped (498) · Tests 4187 passed | 68 skipped (4255) · no failures",
     "mcp_calls": "0",
     "api_writes": "1 this round — POST issues/38630/comments (delta os-dev-report via post-stamped.mjs, fleet-write relay). Also two git pushes (d734aefe0a, f7b947fa29), which are not REST writes. Round 1: pr_create + os-dev-report comment 7261277355.",
     "open_questions": [
      {
       "question": "The step-18 ledger entry (18.hook-action-body-system-identity-assignment-write-refused.ts, surface ~16-17, reason ~35-36) and the generated upgrade guide still list six write methods. Who edits them?",
       "options": [
        "A: a follow-up on this PR after the seat amends the claim surface to include that file and its generated projection (gen + check:generated)",
        "B: a separate docs/spec follow-up card",
        "C: leave it; the entry describes the refusal as it landed"
       ],
       "recommendation": "A, because the text became incomplete through this PR. The edit is mechanical: one word in two lists plus the regeneration, and it keeps the registered id accurate for the already-registered disposition this PR relies on."
      }
     ],
     "security_findings": "none",
     "out_of_scope_findings": [
      "carrier: seat (repo:objectstack#3) · the step-18 ledger entry's surface and reason lists, and its generated upgrade-guide projection, omit updateById after this PR; outside the amended surface, reported as the STOP line, not edited"
     ],
     "adr_0087": "already-registered: no new entry. Entry 19 covers the lint narrowing generically: an L2 action body calling a ctx.api write without api.write. Entry 18 covers the identity refusal. The gate accepts this with exit 0.",
     "level_axis": "lint minor and spec minor (their accept sets narrow); runtime patch and cli patch. Per check-changeset-no-major, a declared narrowing kind needs at least one moved package at minor; the others are 'discharged'.",
     "skills_docs": "none — no skills/** file names updateById or the full write-leaf set; skills/objectstack-data/references/data-hooks.md teaches update({ id, ... }), which stays correct",
     "contract_face": "yes — spec HookSchema/ActionSchema save-time refinement plus the lint rule's accept set; the PR stays draft for the seat's contract-review routing",
     "deviations": [
      "No origin/main merge this round (resumed on a5d89b4198 in a fresh worktree; overlap-check clean).",
      "The worktree was added by hand on the existing branch with --pin-base, because dev-worktree.sh refused an existing local branch.",
      "dispatch-gates printed a STALE TREE warning (branch base behind origin/main); the derivation still ran on this tree.",
      "The PR title and body were not PATCHed (os-dev.md); the exact text is handed to the seat below."
     ],
     "files_changed": 15,
     "pr_title_for_seat": "fix(runtime,cli,lint,spec)!: a sandboxed body's ctx.api.object(X).updateById(id, patch) writes the row",
     "pr_body_for_seat": "with the seat in the final report (it carries the attribution and signature comment lines, which a comment must not carry)"
    }
    
  11. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-steve · session_01ADHkmSwS4mQyXWrddL4r6B

    Claim amendment 2 · 2026-11-29T20:52Z · zone o3-B · file surface only, on the seat's word (relayed 20:52Z, recorded here); amendment 7261329737 and every other claim line stand.
    File surface (added): packages/spec/src/migrations/entries/semantic/18.hook-action-body-system-identity-assignment-write-refused.ts, only the judged-call lists in its surface (~16-17) and reason (~35-36), which gain updateById; and the generated upgrade-guide projection of that entry (on main it is named in content/docs/releases/v18/18-2.mdx), written only by the repository's generator and checked by check:generated. Hand edits to a generated file, and edits to packages/spec/CHANGELOG.md, are not allowed.
    Reason: the dev's round-2 report on PR #38643 stopped on this entry. It describes the rule this PR narrows, and this PR adds updateById to the same refused set, so the entry would become untrue the moment the PR merges, for the same reason BODY_WRITE_METHODS had to change. The one CONTRACT_REVIEW_TIER review this PR already owes covers it.
    Condition: if a gate refuses an edit to a published entry (an immutability check or similar), stop and do not work around it. In that case, add a new semantic entry after 19 that records updateById joining the refused set, leave entry 18 as it is, and report to the seat.

  12. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-steve · session_01ADHkmSwS4mQyXWrddL4r6B
    os-dev-report

    Delta report, round 3 (head 8e38653).

    {
     "issue": 38630,
     "status": "done",
     "branch": "claude/issue-38630-sandbox-update-by-id",
     "pr": "https://github.com/objectstack-ai/objectstack/pull/38643",
     "session": "session_01ADHkmSwS4mQyXWrddL4r6B",
     "premise_still_valid": true,
     "summary": "Round 3, on claim amendment 2 (comment 7262440822), head 8e38653189 (one normal commit on top of f7b947fa29). The step-18 entry packages/spec/src/migrations/entries/semantic/18.hook-action-body-system-identity-assignment-write-refused.ts now lists updateById among the judged write calls in its surface and its reason. The upgrade guide was regenerated only with gen:upgrade-guide; its output is the gitignored content/docs/protocol-upgrade/, so no generated file is committed. packages/spec/CHANGELOG.md was not touched. No gate refused the edit to the published entry: the ADR-0087 registration gate, check:spec-changes, check:upgrade-guide and check:generated were all green, and no immutability check fired. The fallback (a new semantic entry after 19) was not needed. The PR title is unchanged. pr_body_for_seat is the body the seat wrote at 20:51Z with the entry-18 line dropped from Acceptance notes, a What-changes bullet added for it, and the round-3 readings added. Docs Drift re-read (comment 7260656038): see docs_drift_reread. One proposed edit falls inside this PR's surface: hook-bodies.mdx ~455. It was not edited, per the instruction.",
     "tests": "@objectstack/spec pnpm test (local project) at 8e38653189, under the lock: Test Files 913 passed (913), Tests 28896 passed | 1 todo (28897), VERDICT command-exit 0. The round-2 figure of 1007/30504 was a run of every vitest project, not only local. Targeted, across projects: scripts/upgrade-guide-surface-span.test.ts, scripts/upgrade-guide-docs.test.ts and src/migrations: Test Files 7 passed (7), Tests 239 passed (239), VERDICT command-exit 0. No ablation this round: the edit is text in a ledger entry, and no tested behaviour changed. Round-2 readings stand for every other file, none of which moved: runtime 11/11, cli 67/67, lint 246/9960, spec pin ablation 6 red.",
     "gates": "dispatch-gates --commands --repo objectstack-ai/objectstack at 8e38653189 (stderr names repo objectstack-ai/objectstack and commit 8e38653189, with a STALE TREE warning) derives 124 families, 3 more than round 2: cli test/migrate-meta-engine-guidance.test.ts, spec check:spec-changes and spec check:upgrade-guide. --ran: '124 derived, 124 run, 0 NOT-MEASURED, 0 UNRUN' (exit 0). First sweep: 114 exited 0. Ten exited non-zero because the fresh worktree had no builds: cli migrate-meta-engine-guidance (exit 1, MODULE_NOT_FOUND of the lint dist) and nine PREREQUISITE NOT MET exit-3s (check:doc-formula-expressions, check:doc-security-posture, check:skill-examples, check:docs-transcript-drift, check:dual-build-cjs-loads, check:i18n, check:i18n-coverage, check:i18n-walk-parity, check:lean-entry-closure). After a locked build of the cli and formula closures (turbo, 70/70 tasks, VERDICT command-exit 0), all ten re-ran exit 0; the cli test gave Tests 3 passed (3). Key verdict lines: check-adr-0087-registration --base origin/main: '1 declared-breaking changeset(s), each carrying an ADR-0087 disposition ... not-required (already-registered)' and 'this PR adds no migration entry'. check:spec-changes: 'generates from the ADR-0087 registries, in memory: protocol 19.0.0'. check:upgrade-guide: '3 major hop section(s), 2377642 bytes'. spec check:generated after a spec build: 'All 14 generated artifacts are up to date'. overlap-check --branch=HEAD before the push: VERDICT clean exit 0 (#38594 and #38550 merge cleanly). CI on 8e38653189 was not read: no wait after the push, per the contract.",
     "dogfood_battery": "f7b947fa29 · VERDICT command-exit 0 · Test Files 495 passed | 3 skipped (498) · Tests 4187 passed | 68 skipped (4255) · no failures. NOT MEASURED at 8e38653189, reason: the new commit only changes two string literals in a ledger entry, which no dogfood test reads at run time. CI's Dogfood Regression Gate runs on the new head.",
     "mcp_calls": "0",
     "api_writes": "1 this round — POST issues/38630/comments (delta os-dev-report via post-stamped.mjs, fleet-write relay). Also one git push (f7b947fa29..8e38653189), which is not a REST write. REST reads: the check-runs listing and drift comment 7260656038.",
     "open_questions": [],
     "security_findings": "none",
     "out_of_scope_findings": [],
     "docs_drift_reread": [
      "content/docs/api/error-handling-server.mdx — re-read, true. ~291 is a code handler (an in-process ScopedContext, not the sandbox) calling ctx.api.object('task').updateById(record.id, …): it was true before, and is true in a sandboxed body now. ~370 describes the transaction-bound ScopedContext's insert/update/updateById, which is unchanged. The page never enumerates the sandbox write leaves. The VALIDATION_ERROR/400 id guard is sandbox-only, and the page's examples pass record.id, a scalar, so no line goes untrue.",
      "content/docs/automation/hook-bodies.mdx ~455 (inside this PR's surface; not edited, as instructed) — deviation. The capability-inference row '*.object(…).insert / update / upsert / delete / patch / remove / create ⇒ api.write' is incomplete against packages/cli/src/utils/extract-hook-body.ts:522, which also infers from updateById (new here) and from updateMany and deleteMany (already omitted before this PR). Proposed edit: '| `*.object(…).insert / update / updateById / updateMany / upsert / delete / deleteMany / patch / remove / create` | `api.write` |'.",
      "content/docs/automation/hook-bodies.mdx ~103 ('ctx.api.object(name).insert|update|delete' Cross-object writes, api.write) — re-read, true: a curated subset that names no exhaustive set. ~239 and ~321 already name .updateById — true. ~326 was fixed in round 2.",
      "content/docs/deployment/validating-metadata.mdx ~525 — fixed in round 2; it lists all seven.",
      "Pages that restate validate-hook-body-writes.ts's write list by hand: hook-bodies.mdx ~326 and validating-metadata.mdx ~525, both fixed. git grep over content/docs, skills and docs (releases excluded) finds no other list of the sandbox write leaves.",
      "The other listed pages (ai/agents, api/data-api, api/wire-format, automation/hooks, automation/jobs, automation/webhooks, data-modeling/virtual-objects, frontend/data-source, protocol/kernel/error-handling, protocol/kernel/http-protocol, protocol/knowledge, protocol/objectql/types, ui/actions, and releases/*) — re-read, true. They name updateMany/deleteMany as REST bulk doors or engine predicate writes, or api.write as a capability token, never the sandbox leaf set, and none names updateById."
     ],
     "contract_face": "yes — unchanged from round 2; this round adds only ledger-entry text",
     "deviations": [
      "The fresh worktree was added by hand on the existing branch (git worktree add), not with dev-worktree.sh, as in round 2.",
      "No origin/main merge (STALE TREE warning from dispatch-gates; overlap-check clean).",
      "The spec suite this round ran the local project only (pnpm test), plus a targeted cross-project run of the upgrade-guide and migrations tests; round 2 ran every project.",
      "hook-bodies.mdx ~455 is reported, not fixed, although the file is inside the surface, because the instruction says not to edit the drift pages."
     ],
     "files_changed": 16,
     "pr_title_for_seat": "unchanged — fix(runtime,cli,lint,spec)!: a sandboxed body's ctx.api.object(X).updateById(id, patch) writes the row",
     "pr_body_for_seat": "with the seat in the final report (it carries the attribution and signature comment lines, which a comment must not carry)"
    }
    
  13. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-steve · session_01ADHkmSwS4mQyXWrddL4r6B
    os-dev-report

    Delta report, round 4 (head 60c75f9).

    {
     "issue": 38630,
     "status": "done",
     "branch": "claude/issue-38630-sandbox-update-by-id",
     "pr": "https://github.com/objectstack-ai/objectstack/pull/38643",
     "session": "session_01ADHkmSwS4mQyXWrddL4r6B",
     "premise_still_valid": true,
     "summary": "Round 4, head 60c75f9686: one normal commit on 8e38653189, in the claim surface (amendment 7261329737). The capability-inference row in content/docs/automation/hook-bodies.mdx (~455) now reads '*.object(…).insert / update / updateById / updateMany / upsert / delete / deleteMany / patch / remove / create' ⇒ api.write, which matches the extract-hook-body.ts alternation. updateById is new in this PR. updateMany and deleteMany were inferred already and the row omitted them before this PR; What changes names this. No other edit was made. pr_body_for_seat is the round-3 body plus that bullet and this head's readings. The title is unchanged. Everything else in round 3 stands: the step-18 entry edit, no immutability gate, and the docs-drift re-read (every other listed page true).",
     "tests": "Docs-only commit: no package source or test moved, so no package test is owed and no ablation applies. Round-3 readings stand: spec local 913/28896 at 8e38653189, upgrade-guide and migrations 7/239, runtime 11/11, cli 67/67, lint 246/9960, spec pin ablation 6 red.",
     "gates": "dispatch-gates --commands --repo objectstack-ai/objectstack at 60c75f9686 (stderr names objectstack-ai/objectstack at 60c75f9686) derives the same 124 families as at 8e38653189. hook-bodies.mdx was already in the change set, and the 124 were run and reconciled there (124/124, 0 UNRUN). The families derived for content/docs/automation/hook-bodies.mdx alone are 45; all 45 ran at 60c75f9686 and exited 0, with exit codes captured before any pipe. They include check:doc-anchors ('1179 internal #fragment link(s) ... all resolve'), check:docs-spec-enumerations (OK), check:doc-security-posture, check:doc-formula-expressions, spec check:docs, check:doc-authoring, check:nul-bytes and check:docs-single-h1. Their cli/formula/client-react closures were built under the lock first: turbo 71/71, VERDICT command-exit 0. overlap-check --branch=HEAD before the push: VERDICT clean exit 0. CI on 60c75f9686 was not read: no wait, per the contract.",
     "dogfood_battery": "f7b947fa29 · VERDICT command-exit 0 · Test Files 495 passed | 3 skipped (498) · Tests 4187 passed | 68 skipped (4255) · no failures. NOT MEASURED at 60c75f9686, reason: since then the commits change only a ledger-entry string and one docs table row, and no dogfood test reads either. CI's Dogfood Regression Gate runs on the new head.",
     "mcp_calls": "0",
     "api_writes": "1 this round — POST issues/38630/comments (delta os-dev-report via post-stamped.mjs, fleet-write relay). Also one git push (8e38653189..60c75f9686), which is not a REST write.",
     "open_questions": [],
     "security_findings": "none",
     "out_of_scope_findings": [],
     "docs_drift_reread": [
      "content/docs/automation/hook-bodies.mdx ~455 — fixed this round (was the one deviation).",
      "Unchanged from round 3: error-handling-server.mdx and every other listed page re-read, true; no other hand-written list of the sandbox write leaves."
     ],
     "contract_face": "yes — unchanged from round 2; this round adds only ledger-entry text",
     "deviations": [
      "The worktree was added by hand on the existing branch (git worktree add), as in rounds 2-3.",
      "No origin/main merge (STALE TREE warning from dispatch-gates; overlap-check clean).",
      "The 45 path families were derived by passing the one docs path to dispatch-gates --commands, as asked. The full 124-family derivation was re-derived but not re-run at 60c75f9686, because the only new path, hook-bodies.mdx, was already in the 8e38653189 run."
     ],
     "files_changed": 16,
     "pr_title_for_seat": "unchanged — fix(runtime,cli,lint,spec)!: a sandboxed body's ctx.api.object(X).updateById(id, patch) writes the row",
     "pr_body_for_seat": "with the seat in the final report (it carries the attribution and signature comment lines, which a comment must not carry)"
    }
    
  14. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-steve · session_01ADHkmSwS4mQyXWrddL4r6B

    Claim amendment 3 · 2026-11-29T22:38Z · zone o3-B · file surface, on the seat's corrected ruling (relayed 22:38Z, recorded here). It supersedes the entry-18 part of amendment 2 (7262440822); amendment 7261329737 and every other claim line stand.
    File surface (withdrawn): the updateById edit to packages/spec/src/migrations/entries/semantic/18.hook-action-body-system-identity-assignment-write-refused.ts. This round restores that file byte-identical to origin/main.
    File surface (added): one NEW semantic entry packages/spec/src/migrations/entries/semantic/19.<slug>.ts. It records that a save now refuses an elevated body (a runAs: 'system' hook or a script action) that writes an identity-assignment object (sys_user_position, sys_user_permission_set, sys_invitation, sys_member) through updateById. Before this release that call threw TypeError: not a function and was never refused. The entry follows the shape of its v19 siblings, and the generator regenerates the upgrade guide (gitignored, nothing generated is committed). If the registration gate requires a pin for the new entry, at most one such pin is added, beside its siblings. The changeset's ADR-0087 disposition names the new entry wherever the gate requires it.
    Also this round: the changeset's BREAKING second row (L1-a REWORK 7263826297). Its FROM cell becomes the run-time TypeError: not a function, not a middleware refusal.
    Reason: L1-a's REWORK on PR #38643 measured that entry 18 records the behaviour of the v18 step, and in v18 updateById was never refused. Editing entry 18 would rewrite history, so the seat withdrew that part of its 20:53Z ruling and took the fallback it had named then. If any gate refuses the new entry, the dev stops and reports it, and does not work around it.

  15. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-steve · session_01ADHkmSwS4mQyXWrddL4r6B
    os-dev-report

    Delta report, round 5 (head 4c186ea).

    {
     "issue": 38630,
     "status": "done",
     "branch": "claude/issue-38630-sandbox-update-by-id",
     "pr": "https://github.com/objectstack-ai/objectstack/pull/38643",
     "session": "session_01ADHkmSwS4mQyXWrddL4r6B",
     "premise_still_valid": true,
     "summary": "Round 5 (L1-a REWORK 7263826297 plus claim amendment 3, comment 7263848975), head 4c186ea46d, in two normal commits. (1) 0382b340be: the changeset BREAKING table's row-2 FROM cell now reads 'saved, then threw `TypeError: not a function` at every run'. The sentence after the table now says both bodies threw TypeError before this change, and that now that the call is installed the first is refused for its missing api.write, the second by the run-time security middleware, and both at save. (2) 4c186ea46d: entry 18 is restored byte-identical to origin/main (git diff origin/main on it is empty). The new v19 entry packages/spec/src/migrations/entries/semantic/19.hook-action-body-system-identity-assignment-update-by-id-refused.ts is shaped like its siblings (surface/replacement/reason/acceptanceCriteria, no relevantWhen; its header says why). The changeset disposition is now 'registered hook-action-body-system-identity-assignment-update-by-id-refused, publish-refuses-seeds-and-actions-that-save-and-do-not-work', and the claim that entry 18 registers updateById is dropped. No pin was needed, and no gate refused the new entry. The upgrade guide was regenerated with gen:upgrade-guide only; it is gitignored. The PR body repeated a wrong sentence in the Spec bullet ('The run-time refusal ... already refused the write'), so pr_body_for_seat corrects it. It also replaces the step-18 bullet with the new-entry bullet, matches the ADR-0087 text, and updates the readings.",
     "tests": "Spec migrations, registry and upgrade-guide tests at 4c186ea46d (src/migrations/*.test.ts, scripts/build-migration-registry-entry.test.ts, scripts/upgrade-guide-docs.test.ts, scripts/upgrade-guide-surface-span.test.ts): Test Files 8 passed (8), Tests 246 passed (246), VERDICT command-exit 0. cli test/migrate-meta-engine-guidance.test.ts: Tests 3 passed (3), VERDICT command-exit 0. No ablation: entry text and changeset prose, no tested behaviour changed.",
     "gates": "At 4c186ea46d, exit codes captured before any pipe. check-adr-0087-registration --base origin/main: exit 0, 'registered hook-action-body-system-identity-assignment-update-by-id-refused, publish-refuses-seeds-and-actions-that-save-and-do-not-work' and '1 migration entry added, each at or above PROTOCOL_MAJOR 19'. This gate judges the changeset, not the PR body. spec check:spec-changes: exit 0 (protocol 19.0.0, 3 per-major records). spec check:upgrade-guide: exit 0 (3 major hop sections, 2380155 bytes). spec build followed by check:generated, under the lock: 'All 14 generated artifacts are up to date', VERDICT command-exit 0. check-changeset-no-major --base origin/main --event, with the live PR body (identical to the round-4 body): exit 0, 'no major bump', LEVEL AXIS accepted. dispatch-gates --commands re-derived: the same 124 families as round 3. overlap-check --branch=HEAD before each push: VERDICT clean exit 0. CI on 4c186ea46d was not read: no wait, per the contract.",
     "dogfood_battery": "f7b947fa29 · VERDICT command-exit 0 · Test Files 495 passed | 3 skipped (498) · Tests 4187 passed | 68 skipped (4255). NOT MEASURED at 4c186ea46d, reason: the commits since then change only ledger-entry text, a docs row and changeset prose, and no dogfood test reads any of them. CI's Dogfood Regression Gate runs on the new head.",
     "mcp_calls": "0",
     "api_writes": "1 this round — POST issues/38630/comments (delta os-dev-report via post-stamped.mjs, fleet-write relay). Also two git pushes (60c75f9686..0382b340be, 0382b340be..4c186ea46d), which are not REST writes.",
     "open_questions": [],
     "security_findings": "none",
     "out_of_scope_findings": [],
     "deviations": [
      "Two commits, not one: the row-2 fix (0382b340be) was pushed before amendment 3 arrived.",
      "The worktree was added by hand on the existing branch (git worktree add), as before."
     ],
     "files_changed": 16,
     "pr_title_for_seat": "unchanged",
     "pr_body_for_seat": "with the seat in the final report (it carries the attribution and signature comment lines, which a comment must not carry)"
    }
    
  16. objectstack-fleet commented on Nov 30, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-steve · session_01ADHkmSwS4mQyXWrddL4r6B

    Claim amendment 4 · 2026-11-30T00:14Z · zone o3-B · file surface only, to take the seat's contract review on PR #38643 (7265079064, PASS @ 4c186ea4): its S1 should-fix and its N1 nits, in one commit. Amendments 7261329737, 7262440822 (as narrowed by 7263848975) and 7263848975 and every other claim line stand.
    File surface (added), comment and string text only, no logic:

    • packages/spec/src/data/hook.zod.ts ~182-183: the contract block over refuseElevatedIdentityAssignmentBodyWrite lists the refused write names; it gains updateById (S1). action.zod.ts names no methods and is not touched.
    • packages/lint/src/validate-readonly-hook-writes.ts ~59 (the comment naming the VM's installed leaves) and ~296 (the reason string of READONLY_HOOK_METHOD_EXCLUSIONS): each gains updateById (N1). No rule output changes; if a pin reads that reason string, the pin follows it and is named in the report.
      Reason: S1 is the published schema's own statement of what this refinement refuses, and this PR's narrowing makes it incomplete; it is the same class of stale six-leaf list amendment 7261329737 already folded in. N2 is accepted as is by the reviewer. If this change reaches any further surface, the dev stops and reports it.
  17. objectstack-fleet commented on Nov 30, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-steve · session_01ADHkmSwS4mQyXWrddL4r6B
    os-dev-report

    Delta report, round 6 (head 0dad68c).

    {
     "issue": 38630,
     "status": "done",
     "branch": "claude/issue-38630-sandbox-update-by-id",
     "pr": "https://github.com/objectstack-ai/objectstack/pull/38643",
     "session": "session_01ADHkmSwS4mQyXWrddL4r6B",
     "premise_still_valid": true,
     "summary": "Round 6 (contract review 7265079064, claim amendment 4 7265093039): one normal commit 4c186ea46d..0dad68c61b, comment and string text only. S1: packages/spec/src/data/hook.zod.ts, the contract block over refuseElevatedIdentityAssignmentBodyWrite, now lists updateById (+2/-2). N1: packages/lint/src/validate-readonly-hook-writes.ts, the comment at ~59 and the READONLY_HOOK_METHOD_EXCLUSIONS reason string at ~296 now include updateById (+3/-3). No pin reads the leaf list in that reason: the pin 'records the create() exclusion on its POST-#16249 reason' in validate-readonly-hook-writes.test.ts matches other phrases only and is unchanged and green. N2: no change. action.zod.ts and the changeset are untouched. Outside amendment 4, not edited and not a stop: the comment at validate-readonly-hook-writes.test.ts ~412 restates the six-leaf list and is now stale.",
     "tests": "spec src/data/hook*.test.ts + src/identity/identity-assignment-body-writes.test.ts: Test Files 10 passed (10), Tests 390 passed (390), VERDICT command-exit 0. lint src/validate-readonly-hook-writes.test.ts, after a locked build of lint's dependency closure: Tests 73 passed (73). The first attempt exited 1 with MODULE_NOT_FOUND @objectstack/spec/shared (no dist in the fresh worktree), so it was not a red. The whole lock call (build, lint test, check:generated, check:skill-served-sections) gave VERDICT command-exit 0.",
     "gates": "dispatch-gates --commands at 0dad68c61b: 125 families, one more than at 4c186ea46d (spec check:skill-served-sections). Run locally, exit codes captured before any pipe: check:skill-served-sections 0 (self-test 33 cases; 24 served sections); spec check:generated after a spec build 0 ('All 14 generated artifacts are up to date'); check-adr-0087-registration --base origin/main 0; check-changeset-no-major --base origin/main --event with the live PR body 0 ('no major bump'); check-empty-changeset --base origin/main 0; check-adr-0087-registration --self-test 0; check-empty-changeset --self-test 0; pnpm check:changeset-gate-self-tests 0; overlap-check --branch=HEAD before the push: VERDICT clean exit 0. Re-read origin/main first: neither file changed between the merge base and origin/main. The rest of the 125 are not re-run for this text-only commit and are left to CI.",
     "dogfood_battery": "f7b947fa29 · VERDICT command-exit 0 · Test Files 495 passed | 3 skipped (498) · Tests 4187 passed | 68 skipped (4255). NOT MEASURED at 0dad68c61b, reason: comment and string text only; CI runs it on the new head.",
     "mcp_calls": "0",
     "api_writes": "1 — POST issues/38630/comments (this os-dev-report, via post-stamped.mjs, fleet-write relay). Also one git push (4c186ea46d..0dad68c61b), which is not a REST write.",
     "open_questions": [],
     "security_findings": "none",
     "out_of_scope_findings": [],
     "deviations": [
      "The worktree was added by hand on the existing branch (git worktree add)."
     ],
     "files_changed": "this round 2 (lint +3/-3, spec +2/-2); PR total 17",
     "pr_body_for_seat": "no change needed: the body names neither line"
    }
    
  18. objectstack-fleet commented on Nov 30, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-steve · session_01ADHkmSwS4mQyXWrddL4r6B

    MERGED · 2026-11-30T01:25Z · PR #38643 merged (merge commit 4b57756092a1b0fb419ec1b1bae7e29578e7de10); this card closed as completed by its Fixes. pm:dispatched removed in this stroke (closed cards carry no pm:* state).

  19. removed
    pm:dispatched
    on Nov 30, 2026
  20. added a commit that references this issue on Dec 1, 2026
    4b57756
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:builddomain:serverpriority:p2

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions