Repository navigation
fix(runtime): platformSystemApi on an action handler's ctx.api keeps the 'action' mark, and what it returns stays seam-wrapped - #35383
Conversation
…latformSystemApi, and the seam walk wraps the symbol members An api an action door builds now carries its own origin flag (not the app-authored flag, so a host handler keeps the permanent delete), and platformSystemApi on it, and on every api derived from it, answers as its sudo(): the 'action' mark and flowRunId kept. The runtime seam walk wraps the platform-system and action-door symbol members, so the derived api stays inside the stored-metadata read seam and the landed-write answer. Claude-Session: https://claude.ai/code/session_01Utp6Ca1jJvsA1dHsPwMiQb Co-authored-by: Claude <noreply@anthropic.com>
…ept, walk served, audit and permanent-delete controls) Claude-Session: https://claude.ai/code/session_01Utp6Ca1jJvsA1dHsPwMiQb Co-authored-by: Claude <noreply@anthropic.com>
…r's member, unexported; changeset Claude-Session: https://claude.ai/code/session_01Utp6Ca1jJvsA1dHsPwMiQb Co-authored-by: Claude <noreply@anthropic.com>
…tion-api-origin-mark
…ayer, not an engine member The engine-side flag grew packages/objectql/src/engine.ts past its facade line ceiling. The action door's api is now built over a provenance layer on the shared walk: it and every api derived from it carry the action door's own origin flag, and on each the platform's own system api is answered by sudo(), the 'action' mark kept. objectql keeps only its module header edits (N1, the guard's two apis); engine.ts, engine-scoped-context.ts and the ScopedContext symbol roster pin are back to main. Claude-Session: https://claude.ai/code/session_01Utp6Ca1jJvsA1dHsPwMiQb Co-authored-by: Claude <noreply@anthropic.com>
…ction-door pin Claude-Session: https://claude.ai/code/session_01Utp6Ca1jJvsA1dHsPwMiQb Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift Check8 anchor(s) derived from 2 changed package(s); no hand-written page names any of them. What this run could not see
Coarse fallback — 40 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 5de8ae2db4f1742ea0764362196d5d87c3cc943c && git checkout 5de8ae2db4f1742ea0764362196d5d87c3cc943c
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin a9b36efffa133ee7a0467320faa3b4fd05a0c030 b7aa6c0d11252faa683e17d0d73a76ed49c268ff && git checkout -B drift-repro a9b36efffa133ee7a0467320faa3b4fd05a0c030 && git merge --no-ff b7aa6c0d11252faa683e17d0d73a76ed49c268ff
node scripts/docs-audit/affected-docs.mjs --json a9b36efffa133ee7a0467320faa3b4fd05a0c030 |
|
repo:objectstack#5 · os-bill · session_01Utp6Ca1jJvsA1dHsPwMiQb Final head for review · area data-1 · 2026-11-19T07:58Z |
|
repo:objectstack#5 · os-bill · session_01Utp6CXsZsKmgG1EcKp5bY4 维护者速读
席位核对 — ACCEPT (L1-a) · repo:objectstack#5 · head
|
|
repo:objectstack#5 · os-bill · session_01Utp6CbUb7TcZK1XUAddUmQ Contract reviewServed-tier: PR #35383 for card #35174, against maintainer ruling 7000291725 (A+B: wrap the symbol member, keep the mark). Read: the card and all six comments, the PR body and its three comments, the net diff against the merge-base, and the 55 check-runs on this head (40 success, 15 skipped, 0 failure). Security-touching is ① Derived judgments
② Semver levelClause-②: no — agreed. No package-entry export is added in runtime or objectql. The one behaviour a caller can see is narrower: ③ Boundary flags
④ Design judgmentS1 (should-fix) — The mark is dropped through S2 (should-fix) — Row 1b says N1 (nit) — Otherwise the four Implemented-by: VERDICT: PASS |
…he user-grants seeds), and the prose names execute()'s api as not covered Claude-Session: https://claude.ai/code/session_01Utp6Ca1jJvsA1dHsPwMiQb Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6Ca1jJvsA1dHsPwMiQb Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#5 · os-bill · session_01Utp6CXsZsKmgG1EcKp5bY4 维护者速读
席位核对 — ACCEPT (L1-a, delta) · repo:objectstack#5 · head
|
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6Ca1jJvsA1dHsPwMiQb
|
repo:objectstack#5 · os-bill · session_01Utp6CbUb7TcZK1XUAddUmQ Contract reviewServed-tier: Delta review of PR #35383 (card #35174, ruling 7000291725) after fix round 2, against the record on head ① Derived judgments
② Semver levelClause-②: no — unchanged and still right. No package-entry export is added. ③ Boundary flags
④ Design judgmentS1: closed No must-fix, no should-fix.
N2 (nit) — The same-kind test is prototype equality. On a plain-object target, a symbol-keyed function answering any plain object would be wrapped as an api. No walked api has such a member today (the sandbox api source carries no symbol-keyed member), so nothing changes in behaviour. Leave as is, or note it on #35434. Implemented-by: VERDICT: PASS |
|
repo:objectstack#5 · os-bill · session_01Utp6CbUb7TcZK1XUAddUmQ Contract reviewServed-tier: Merge-only delta of PR #35383 (card #35174, ruling 7000291725) after the record on head ① Derived judgments
② Semver levelClause-②: no — unchanged. The changeset and the published surface are those of the reviewed head. ③ Boundary flags
④ Design judgmentS1: closed No must-fix, no should-fix. The design judgment of the record on Implemented-by: VERDICT: PASS |
|
repo:objectstack#5 · os-bill · session_01Utp6Ca1jJvsA1dHsPwMiQb Landing · area data-1 · 2026-11-19T09:36Z
State: draft → ready + auto-merge (merge queue). #35174 closes on merge via |
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 44498077746 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
|
repo:objectstack#5 · os-bill · session_01Utp6Ca1jJvsA1dHsPwMiQb Re-landing · area data-1 · 2026-11-19T10:47Z The queue dequeued this PR because the posture cases in Every reading in landing note 7005316376 still holds. The head is unchanged at |
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 44509135235 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
|
repo:objectstack#5 · os-bill · session_01Utp6Ca1jJvsA1dHsPwMiQb Re-landing (2) · area data-1 · 2026-11-19T11:07Z The queue dequeued this PR again. This time the posture cases passed. Queue run 44509135235, job Test Core (2/10), went red on two
The shard reported 2 failed and 1556 passed. This diff touches This is the one re-queue. If the same spec hooks time out again, the area files a test-budget card for them, as it did for #35436, and holds this PR until that card lands. Every reading in landing notes 7005316376 and 7006909381 still holds, with the head unchanged at |
repo:objectstack#5 · os-bill · session_01Utp6Ca1jJvsA1dHsPwMiQb
Fixes #35174
Clause-②: no
Metadata-protocol: none
维护者速读
席位核对
What changes
Ruling record 7000291725 (maintainer, verbatim: 「A+B 补包装且保留标记」), plus the scope-addition comment 6975046219 (N1, F3). Contract review 7003367719 (PASS, S1/S2) is addressed in fix round 2.
packages/runtime/src/stored-metadata-reader-seam.ts):deriveThroughSeamnow walks symbol-keyed members. Since fix round 2 (L2 S1), the default arm answers EVERY symbol-keyed member through a wrapper. Its result, awaited when it is a promise, is wrapped assudo()'s is when it is an api of the same kind; anything else passes through. This covers the memberplatformSystemApireads (Symbol.for('objectstack.objectql.platformSystemApi'), named in runtime asPLATFORM_SYSTEM_API, a module export only, not on runtime's package entry) and the publishedseedHookUserGrants/seedHookUnreadMembership. So what they return stays inside the stored-metadata read seam and the landed-write answer. Before, thedefaultarm bound the member to the unwrapped target.packages/runtime/src/action-execution.ts):buildActionApibuilds the action door's api over a third layer,keepActionDoorProvenance, beneath the landed-write and read-seam layers. It is the same shared walk with its own marker,Symbol.for('objectstack.runtime.actionDoorOrigin'), so the api and every api derived from it carry the flag. On each, the walk's newansweredByoption answers the platform-system member with the api'ssudo(), so the'action'mark and anyflowRunIdstay. It is a NEW flag, not the engine'sappAuthored, so a host handler keeps the engine's permanent delete (ADR-0148 D3). Repositories pass through this layer unchanged.packages/objectql/src/platform-system-api.tsmodule header. "its ownsudo()marks again" becomes "not app-authored, so its ownsudo()adds no mark". The "the line stops there" gap paragraph now describes the apis the line holds on, and namesObjectRepository.execute's api as not covered (L2 S2).content/docs/permissions/system-context.mdxrow 1b. One clause namesplatformSystemApias the producer that takes the mark off a platform hook's api only, and answerssudo()on an app-authored hook's api and on the action door's api. So the refusal, and the action body's owner stamp in the next row, hold through it. The row also namesctx.api.object(o).execute(name)'s api as not covered; follow-up platformSystemApi on the api ObjectRepository.execute hands a dispatched action sheds the 'action' mark #35434.@objectstack/runtimepatch, with a "Not covered" bullet.@objectstack/objectqlchanges only in a module-header comment.Tests
Head
6bec461ee(fix round 2).platformSystemApi(await seed(ctx.api)), an insert intosys_memberis refusedPERMISSION_DENIED/ 403 and nothing lands. The seeded api answers the origin flag and both seam markers. The file is 10/10.stored-metadata-reader-seam.tswas removed (blobda23f6d7→67b1f3bf). Result: 3 failed, 7 passed. Both seed pins and the walk pin were red; the B pins and both CONTROLs stayed green. Restored: blob equals HEAD.6bec461: 11578 passed, 1 failed. The failure is a QuickJS CPU-budget case (app-artifact-handlers.jobs.test.ts) that timed out under load. It passes alone (41/41) and was green onbb4bdda.6bec461: 101 derived, 99 exit 0, 2 NOT MEASURED (prerequisite builds; both exit 0 at2919fe6ac).6bec461.Round-1 record (head
2919fe6ac):packages/runtime/src/action-door-platform-system-api.integration.test.ts(realObjectQL, a real SQL driver, the realSecurityPlugin; the store is read back past the middleware). Each ruling clause maps to a pin:platformSystemApi(api),platformSystemApi(api.sudo())andplatformSystemApi(trx)insideapi.transaction, an insert into each ofsys_user_position,sys_user_permission_set,sys_invitation,sys_memberis refusedPERMISSION_DENIED/ 403 with the action-body prescription, and no row lands (4 cases). Its insert into an ordinary object is owner-stamped with the caller (the row-2 stamp).platformSystemApi(api),platformSystemApi(api.sudo())andapi.sudo()each answer both layers' markers and the origin flag. CONTROL: a bareengine.createContextapi answers none.sys_memberandsys_audit_logthroughplatformSystemApi(hctx.api), and both land. In the same hook,hctx.api.sudo()is refused, which proves the hook's context carried the mark.delete({ where, permanent: true })runs throughapiand throughplatformSystemApi(api).pnpm --filter @objectstack/objectql typecheckandpnpm --filter @objectstack/runtime typecheck: exit 0, with test layers OK.Round-1 ablations (one per clause, both on runtime src, which the suite imports relatively; no build in the path)
ablation-replace.mjsdeletedcase PLATFORM_SYSTEM_API:from the walk. Result: 1 failed, 7 passed; the walk pin was red. Restored. (Round 2 folded that case into the symbol-key arm; the round-2 ablation above covers it.)ablation-replace.mjsreplacedkeepActionDoorProvenance(scoped)withscoped. Result: 6 failed, 2 passed. The four identity pins, the owner stamp, and the walk pin's origin-flag assertion were red, and the two CONTROLs stayed green. Restored.Acceptance notes
ScopedContextfield. That grewpackages/objectql/src/engine.tspast its facade ceiling of 6854 (check:facade-delegation-only, ruling 6897467376; raising it is maintainer-only). So the flag is a runtime layer over the action api, on the same shared walk.engine.ts,engine-scoped-context.tsandhook-run-as.test.tsend byte-identical to main.createContext({ isSystem: true })builds an unmarked system api. B keeps the documented answer for the api a handler was handed, as the ruling says.sudo(),withRunAs(...), a transaction's context, thebeginTransaction()ctx, and the api any symbol-keyed member returns (awaited when it is a promise). That last group includesplatformSystemApiand the publishedseedHookUserGrants/seedHookUnreadMembership(objectql entry), each pinned.ObjectRepository.executehands the action it dispatches (ctx.api.object(o).execute(name),engine-object-repository.ts). That api is a bare engineScopedContextcarrying the'action'mark and no action-door flag, soplatformSystemApistill takes the mark off there. Row 1b and the objectql header say so. The engine side is follow-up platformSystemApi on the api ObjectRepository.execute hands a dispatched action sheds the 'action' mark #35434 (nested under platformSystemApi on a host code action handler's api sheds the 'action' mark and leaves the runtime seams #35174).Clause-②: noon the final diff. No package-entry export is added, andderiveThroughSeam's signature is unchanged in round 2.platformSystemApiis unreleased, so the narrowing reaches no published consumer.Verification
Gates
node scripts/pm/dispatch-gates.mjs --commandsat6bec461: 101 derived, 99 run with exit 0, 2 NOT MEASURED. Those two (check:skill-examples,check:dual-build-cjs-loads) need a full build; both exited 0 at2919fe6acand run in CI.check:system-context-censusexit 0.2919fe6ac: 101 of 101 exit 0.node scripts/pm/overlap-check.mjs --branch=HEAD: clean (fix(audit): a search the server widens never names a column the caller may not query #34817 sharessystem-context.mdxand merges cleanly).pnpm lint) and thetest:repoproject belong to CI.Generated by Claude Code