Repository navigation
feat(data): one record lock read owned by the data layer (ADR-0162 D9) - #38913
Conversation
The engine answers { locked, lockSource?, lockReason? } | null for one
record and for a page of up to 200, composing its closed-state judgement
with the approvals plugin's, which it reads through an internal engine
slot the plugin fills beside its lock hooks. The data protocol, two data
routes, two SDK methods and the upload-link door ask it; docs and the
changeset come with it. Tests follow.
Claude-Session: https://claude.ai/code/session_01WGufzfGw8DS75kHUYrjbLM
Co-authored-by: Claude <noreply@anthropic.com>
…nk door Every combination on a real engine with the real approvals plugin (and without it), the page bound and entry-by-entry answers, the field-hidden state field, the slot's lifetime; the two REST doors against the ledgered schemas; the upload-link door's two sentences by the lock's reason. Claude-Session: https://claude.ai/code/session_01WGufzfGw8DS75kHUYrjbLM Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 7 package(s): 32 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 10 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 193 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 e60168e94017f126187ced3b7790e71c0de3178f && git checkout e60168e94017f126187ced3b7790e71c0de3178f
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin ec7b37d091aabf26a0bc47aaf7b811dab6ba9557 1eb27e75b91a3da4f1bf9aa4ad2d54a970e572d3 && git checkout -B drift-repro ec7b37d091aabf26a0bc47aaf7b811dab6ba9557 && git merge --no-ff 1eb27e75b91a3da4f1bf9aa4ad2d54a970e572d3
node scripts/docs-audit/affected-docs.mjs --json ec7b37d091aabf26a0bc47aaf7b811dab6ba9557
|
…d schemas Claude-Session: https://claude.ai/code/session_01WGufzfGw8DS75kHUYrjbLM Co-authored-by: Claude <noreply@anthropic.com>
…k read Claude-Session: https://claude.ai/code/session_01WGufzfGw8DS75kHUYrjbLM Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufzfGw8DS75kHUYrjbLM Co-authored-by: Claude <noreply@anthropic.com>
…erated reference page Claude-Session: https://claude.ai/code/session_01WGufzfGw8DS75kHUYrjbLM Co-authored-by: Claude <noreply@anthropic.com>
… so spec is a minor The authorable-surface api shard records the two new request and response shapes, which the level axis reads as Metadata-protocol: added. Claude-Session: https://claude.ai/code/session_01WGufzfGw8DS75kHUYrjbLM Co-authored-by: Claude <noreply@anthropic.com>
…lock read module Claude-Session: https://claude.ai/code/session_01WGufzfGw8DS75kHUYrjbLM Co-authored-by: Claude <noreply@anthropic.com>
…c pins (#37770) - engine.ts: getRecordLock/getRecordLocks are one-statement forwarders handing record-lock-read.ts the update facet host and the engine. - record-lock-routes.ts answers refusals through handleRouteError and is declared conformant in check-route-envelope. - RecordLockSource/RecordLockReason are z.input aliases; the six record lock shapes are pinned isomorphic (ADR-0122). - The integration test passes its engine options untyped-cast-free. Claude-Session: https://claude.ai/code/session_01WGufzfGw8DS75kHUYrjbLM Co-authored-by: Claude <noreply@anthropic.com>
…acet names (#37770) - record-lock-routes.ts joins REST_SERVER_REGISTRAR_FILES, with its query-slot floor (0) and docblock floor (9); the page door's #8497 disposition is no-record-echo. - The protocol facet functions are readRecordLock / readRecordLocks, so the canonical-fold census resolves the stubs to their bodies. - The approvals producer's record-id sets no longer read as pending slates. - engine.ts drops the blank line after the two forwarders (+3). Claude-Session: https://claude.ai/code/session_01WGufzfGw8DS75kHUYrjbLM Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzfGw8DS75kHUYrjbLM CI status (2026-12-01T13:47Z): one known red, waiting on a maintainer ruling
The other reds on the earlier heads (route-envelope, ADR-0122 aliases, query-options erasure, the protocol fold census, the approver-address census, the REST registrar censuses) are fixed at Generated by Claude Code |
…4264 (#37770) The maintainer ruled the engine.ts line ceiling may rise by the measured growth of the record lock read's two forwarders and their import (+3), ruling record 7314474264 on #37770. baseLines/baseCommit re-measured at dd7675d (6860 lines); maxLines 6860. Claude-Session: https://claude.ai/code/session_01WGufzfGw8DS75kHUYrjbLM Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzfGw8DS75kHUYrjbLM The brief handed to the isolated contract reviewer for the record that follows (filled template, Contract review brief — PR #38913 @
|
|
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzfGw8DS75kHUYrjbLM Contract reviewServed-tier: PR #38913 for card #37770, reviewed read-only: the card with its five comments, the PR body and file list (40 files), the net diff against ① Derived judgmentsEvery accept-set and public-surface change the diff implies:
② Semver levelClause-②: yes (widening) The changeset names seven packages and the diff moves exactly those seven. ③ Boundary flags
④ Design judgment
Implementing files, against the contract:
Nits. None changes a served answer on a path the contract names. Each is left as an accepted deviation or a follow-up card; none is to be fixed on this head.
No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
|
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhGA3zoCFquQgku4pm L1 review · PR #38913 (#37770) · head 1eb27e7 · 2026-12-01T15:05ZNot yet ACCEPT: one paper must-fix, which does not move the head. The code and the docs are ACCEPT-ready. I read L2 7314973164 at this head: PASS at the contract-review tier, no must-fix and no should-fix, N1 to N5 nits. I adopt it as the contract record. P1 (must-fix, PR body only) · the
|
|
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhGA3zoCFquQgku4pm L1 confirm · PR #38913 · head 1eb27e7 (unchanged) · 2026-12-01T15:07ZP1 is closed, and L1 is ACCEPT on this head. The PR body now reads |
|
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhPdWmTd47Fi2bKYZS 席位核对ACCEPT — PR #38913 @
落地
State change: ready for review + auto-merge, by the owning seat; on merge it closes #37770. |
|
repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhPdWmTd47Fi2bKYZS 落地Re-arm after a dequeue read as a timing flake. Queue group Head unchanged at |
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 46677410580 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
Requested by Yibo Wang · project thread
Fixes #37770
Clause-②: yes (widening)
Metadata-protocol: added
Skills-docs: follow-up #38961
维护者速读
What changes
ADR-0162 D9: one answer to "is this record locked, and by which lock", for both locks a record can be under.
packages/spec/src/api/record-lock.zod.ts):RecordLockSchema,GetRecordLocksRequestSchema,RecordLockEntrySchema,GetRecordLocksResponseSchema,RECORD_LOCKS_MAX_RECORD_IDS = 200. Spelled as two strict arms (locked: truewith both kinds,locked: falsewith none) so the published JSON Schema carries the "both kinds exactly when locked" rule too. Done-when item 5 (N12): the internal seam requires the source, solockSourceis never optional underapproval.packages/objectql/src/record-lock-read.ts,ObjectQL#getRecordLock/#getRecordLocks). Readability is read as the caller, with each form's approvals-counterpart anchor (seat ruling 7152650156): the single read counts any row its by-id read returns and judges the engine-spelled id; the page counts a row only when its id is the asked id. The closed-state producer reads straight from the driver, above the caller's grants (so field permissions on the state field do not hide the answer, per D9) and inside the caller's org scope (buildDriverOptions). A store read that fails is thrown, never read as open. Order:closed_statebeforeapproval; within a reasonmasterbeforerecord.packages/plugins/plugin-approvals/src/record-lock-producer.ts): pending under a locking node, or a passage on aclosedStatesobject, for the record itself and formaster_detaillines of such a master. It reuses the lock hooks' own helpers (four of them gainexportinlifecycle-hooks.ts, which the package entry does not re-export). It is bound beside the lock hooks inside thedisableAutoHooksblock and cleared indestroy(), so a composition that binds no approval lock answers no approval lock.packages/metadata-protocol/src/protocol-record-lock.ts):getRecordLock/getRecordLocks, the object-existence gate first, then the engine. An engine without the read answersundefined, which the REST doors turn into 501.packages/rest/src/record-lock-routes.ts, registered fromdata-action-routes.ts, sorest-server.tsdoes not move): closed empty query sets,sendOkenvelope, the by-id read's localized404 RECORD_NOT_FOUNDwithVary, 400 for a bad page body, 501 when the read is missing. Two ledger rows (data.getRecordLock,data.getRecordLocks) with their response schemas.packages/client):data.getRecordLock(object, id)anddata.getRecordLocks(object, recordIds), with the types re-exported.packages/services/service-storage/src/record-file-access.ts): asksengine.getRecordLockas the caller before it issues a field link and refuses409 RECORD_LOCKEDwith "the record is closed, so no file can be added to it" onclosed_state, or the existing approval sentence onapproval. An engine without the read falls back to the approvals service, as before.content/docs/api/data-api.mdx§ Record locks,content/docs/api/client-sdk.mdx, and a pointer from the approvals lock reads incontent/docs/automation/approvals.mdx.engine.tsgains one import line and two one-statement forwarders (+3, 6857 → 6860). Thecheck:facade-delegation-onlyrow is raised by that measured growth, per the maintainer's ruling record 7314474264 on One lock read owned by the data layer: "is this record locked, and by which lock" for closed states and pending approvals (ADR-0162 item 2) #37770 (「提到 6861」):baseLines6860 atdd7675de60,maxLines6860. No other engine growth is covered by that ruling.apiauthorable-surface shard, which the changeset level axis reads asMetadata-protocol: added, so@objectstack/specis aminor; the other packages arepatch.Out of scope here: moving the console askers (record page, grid, line grid) onto this read belongs to #37773, together with its wording.
Follow-ups: #38961 (the skills page § Reading the lock points at this read) and #38962 (the contract review's nits: pin the passage arm and the read's jsdoc on a failed store read; the closed-state lines' semi-join and the repeated foreign-key read).
Why
A client could only ask the approvals read, which knows nothing of closed states, so a closed invoice looked editable until the save was refused. ADR-0162 D9 (adopted, ruling record 7200732942) puts one read in the data layer for both.
Tests
plugin-approvals/src/record-lock-one-read-37770.integration.test.ts(11): real ObjectQL over better-sqlite3 with the realApprovalsServicePlugin. Every Done-when combination: closed own, line of a closed master, held by an approval, line of a held master, both at once, neither, unreadable, missing; agreement with the write path; the reader whose field permissions hide the state field is toldclosed_state; no read on the object refuses the same for every id;lockRecord: falseand a decided request let go; the approvals-family read still calls a closed record unlocked; without the plugin only closed states lock;destroy()empties the slot, and the cross-package key is the one the engine reads; the page answers entry by entry, refuses 201 ids and takes 200.rest/src/record-lock-routes.test.ts(10): both doors, parsed against the ledgered schemas; only the three members are served; 404/Vary; relayed refusals; 501; 400 for each bad body; closed query sets.rest/src/rest-write-route-hook-refusal-sentence.ledger.test.ts: the page door's write-verb row is driven.service-storage/src/record-file-access.integration.test.ts: the fixture's approvals stand-in now also fills the engine slot; a new case pins the closed-state sentence and that closed wins over held.Acceptance notes
git diff origin/main -- packages/rest/src/approvals-routes.ts packages/spec/src/contractsand the client'sapprovals.*methods: no change (Done-when item 7).Verification
dispatch-gates --commands: every derived gate was run locally. The ones that failed were fixed (route envelope, query-options erasure, ADR-0122 alias pins, api surface, docs, export origins, llms.txt, facade ceiling under ruling 7314474264). Four could not run here, for environment reasons only:check-plugin-teardown-shape --self-testneeds an unshallow clone, andcheck:skill-examples,check:dual-build-cjs-loadsandcheck:i18nneed built dists. CI runs all four.overlap-check: clean against origin/main, feat(spec)!: a view holds lists only; view-held forms are tombstoned #38908, feat(spec)!: a view holds lists only; view-held forms are tombstoned #38888.Human Minimum
packages/specholds no runtime logic.pnpm lintpasses.main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01WGufzfGw8DS75kHUYrjbLM