Skip to content

docs(adr): ADR-0142 D4 says which claimant hears 409, 404 or 403 when two claim at once (#39223) - #39233

Queued
objectstack-fleet[bot] wants to merge 3 commits into
mainfrom
claude/project-thread-ohljq3
Queued

objectstack-fleet[bot] wants to merge 3 commits into
mainfrom
claude/project-thread-ohljq3

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Bill · project thread

Fixes #39223

Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:平台行为不变;照文档写应用的人会看到,认领说明页和设计记录不再承诺「没抢到的人一律被告知已被抢先」,改为写清三种回答,以及「一条记录最终只有一个负责人」这条不变的保证。
  • 为什么做:你已裁定「把承诺写准」,这是那次裁定的第一步;下游 CRM 的并发认领测试要等这份修订合入后才能按新说法收紧。
  • 出错会怎样:只改说明文字,不影响任何功能;说法若有误,照文档写认领逻辑的人和 AI 会被带偏,可以直接撤回本次改动。
  • 要你做什么:审阅并批准这份设计记录修订。

What changes

Two files, 65 lines added and 3 removed. This is ruled term (1) of ruling record 7363773549 (letter B) on the claim-race card #39065: what ADR-0142 D4 promises about two claims made at once is written out as ruled. No code, spec schema, status code, message or gate changes, which is ruled term (2).

ADR-0142, three places.

  • Status line. One new Amended segment dated 2026-12-03. It cites the ruling record and points at the notes in D4 and D9, as each earlier amendment of this record did.

  • D4, a dated note after the "One owner" paragraph. It says:

    • "Exactly one owner" is the invariant: among callers without the transfer grant, one claim lands.
    • 409 CONCURRENT_UPDATE goes to a claim the gate admitted (its check read the record unowned and the precondition was set) whose write then matched nothing.
    • A claim judged after the owner is set is answered as any request for the record is answered at that moment: 404 RECORD_NOT_FOUND where the caller cannot read the record, which on a private object is what a member whose only basis was the queue is told; 403 PERMISSION_DENIED where the caller can still read it.
    • The visibility rule stands whole (ruling record 5985885287: a by-id write answers a row the caller cannot read exactly as a nonexistent id). The earlier reading, that every loser hears 409, is narrowed because it cannot hold beside that rule.
    • A request reads the record at the row check, again in the ownership step and again in the sharing gate. A claim that passes an earlier check and is overtaken before a later one is refused 403 by that later check, also where the caller can no longer read the record: PERMISSION_DENIED from the ownership step, FORBIDDEN (the ledger's wire synonym for it) from the sharing gate. The split of 404 from 403 is exact for a claim whose every check runs after the owner is set. (Review finding S1.)
    • A client reads all three statuses, straight after a claim, as "no longer there to claim" and reloads, and reads the status, not the code. A test of claimants without the transfer grant asserts one owner and an answer from the set, never 409 alone.
    • ⛔ The gate does not admit a claim by its arrival time and does not look again at the owner after a refusal (options A and C of the ruling, not taken).

    The existing paragraphs of D4 are untouched.

  • D9, the Codes bullet. A dated note appended inside the bullet: "a lost claim race" is the case D4's note defines; a claim judged after the owner is set carries the existing RECORD_NOT_FOUND 404 or PERMISSION_DENIED 403; a claim overtaken between its own checks is refused 403 under PERMISSION_DENIED or FORBIDDEN; no code is added, renamed or re-registered.

The queues page (content/docs/automation/queues-and-assignment-rules.mdx), two places.

  • The "Only one person wins" paragraph. It now gives the promise (exactly one owner), a three-item list of the answers and who gets which (the private object and its 404 included), a paragraph telling the reader to treat all three as one answer and not to expect 409 in particular, a paragraph saying the line between 404 and 403 is not sharp and that the status, not the code, is what to read (S1), one sentence on a caller who holds the transfer grant, and the paragraph's former last sentence ("any other refusal is 403") rewritten for what it was about, a claim of a record that is still unowned: 404 if the caller cannot read the record, 403 if it can and the gate does not admit the claim (review finding S2).
  • The checklist bullet for code that claims. 409, 404 or 403 straight after a claim means "no longer available": reload. A test of two claims at once, by users without the transfer grant, asserts exactly one owner and a refusal from that set.

Tests

None added and none owed: the diff is prose in one design record and one docs page and changes no behaviour, so there is nothing to ablate. A live check is not owed either: the diff changes no MCP tool text or result, no skills/** file, no dataset behaviour and not the package doc tools.

The ruling's premise clause orders premises 1 to 3 and 5 of the analysis (comment 7361680320) re-read before writing. Read on origin/main at 440331f:

  • Premise 1 holds. grep -n "CLAIM — an unowned record" packages/plugins/plugin-security/src/security-plugin-authz-middleware.ts answers line 2245. The branch under it is entered only when the pre-image, read under the caller's own sight, has an empty owner_id and the payload names the caller. Only there is the precondition set: the file assigns writePrecondition once, at line 2256.
  • Premise 2 holds. The row check of the same file answers first for a record that already has an owner: recordNotFoundError where the caller cannot read the addressed row (the block under the comment at line 1640, "a row the caller cannot READ is a row that does not exist"), and PermissionDeniedError with the record_access_denied sentence where the caller can read it and may not write it. packages/core/src/utils/record-not-found.ts sets code RECORD_NOT_FOUND and status 404.
  • Premise 3 holds. grep -n "detail.claimFailed" ui/packages/app-shell/src/views/RecordDetailView.tsx answers line 2610, and the re-read after every claim answer (notifyDataChanged) is line 2615.
  • Premise 5 holds. ui/packages/plugin-detail/src/queueClaim.ts sends owner_id alone, so a claim leaves the home queue set (its comment at lines 180 to 183), and the gate's insert branch admits a member's owned record that names a queue (lines 2130 to 2137 of the middleware file).
  • NOT MEASURED here: premise 4 and the ruling's named premise (with one I/O tick ahead of one claimant, every round ends with one owner and the loser answered from the set). Reason: both are runs of the probe files, which the ruling keeps out of every pull request; the pin work on the claim-race card owns them (claim 7363867578). What this diff says about the answer a late claim gets rests on the code read under premise 2 and on the rounds in the dev report 7361376821, not on a run of mine.

Readings behind the review fixes (S1, S2), on origin/main at 440331f. Read, not run.

  • Order of the checks. The security middleware is registered in the plugin's start() (registerAuthzMiddleware, packages/plugins/plugin-security/src/security-plugin.ts line 2438) and the sharing middleware in a kernel:ready handler (packages/plugins/plugin-sharing/src/sharing-plugin.ts line 927). registerMiddleware appends and the chain walks the list in order (packages/objectql/src/engine-middleware-and-context.ts). So a by-id write meets the row check, then the ownership step, then the sharing gate, then the write.
  • The ownership step. It reads its pre-image under the caller's own context. A row the caller cannot read comes back null and falls through to denyOwnerWrite, a PermissionDeniedError; the comment above preImage says so ("a caller who can't read the row gets null → deny").
  • The sharing gate. admitsByIdWrite reads the row again when it runs (canEdit, then readWriteVerdictRows in sharing-service.ts), and the refusal after it sets code FORBIDDEN and status 403 (sharing-plugin.ts, lines 1689 to 1696).
  • The code name. packages/spec/src/api/error-code-ledger.zod.ts registers FORBIDDEN with shadows: 'PERMISSION_DENIED', "Pre-gate synonym on the wire".
  • S2. The row check answers an addressed row the caller cannot read with recordNotFoundError and one it can read and may not write with the record-level PermissionDeniedError, both before the ownership step. The claim refusal whose message names the failed condition (CLAIM_REFUSAL) is the ownership step's.

Acceptance notes

  • Review round 1 is answered at head 37e9d22. The contract review record (comment 7365351117 on this pull request, PASS on head 11a12bd) left two should-fix findings open. S1: the split of 404 from 403 left out a claim the owner overtakes between the request's own checks. D4, D9 and the queues page now say what main answers in that case. S2: the page gave 403 for a refused claim of an unowned record, where a caller who cannot read the record hears 404; the sentence is rewritten. Nits N1 and N2 are taken in the same edit. N3 (the published data skill still teaches "the loser gets 409") and N4 (the Console sentence) are not for this pull request; the seat has both.
  • Three statements go past the ruling's wording, and L1, L2 or the approver can strike any of them. The transfer-grant clause is the next item. The second is the S1 paragraph: the ruling sorts a late claim by whether the caller can read the record, and does not name a claim overtaken between two of its own checks. The third is the scope of "one claim lands", now "callers without the transfer grant": zone data-p2 measured on the probe branch (relayed by the seat, not run here; the pin is PR fix(console): a claim answered 404 or 403 says the record is no longer waiting; race pins per ruling B #39238) that two holders of the grant who claim an unowned row at once both get 200 and the last writer owns it. The note says nothing more about that case than its scope.
  • One clause goes past the ruling's wording, and L1, L2 or the approver can strike it. The ruling says a late claim gets "the answer any request gets at that moment: 404 if the caller cannot read the record, 403 if it can". For a caller who can edit the record and holds the transfer grant, the answer any request gets at that moment is not a refusal: D4's closing paragraph already admits that write as a transfer ("a foreign owner on insert or update needs the grant"), and the gate tests the grant ahead of everything else in the step (hasTransferGrant() at line 2220). Without the clause, "404 or 403" would be false for that caller. So the D4 note says so in one clause, and the queues page in one sentence ("One caller is outside this"). Struck, the three answers would read as applying to every caller.
  • The Status line gains a segment. The card asks for a dated note in D4 and in Codes and "nothing else in the ADR changes". The Status segment is how this record registers each of its amendments, so it is taken as part of the note. docs/adr/README.md is unchanged (adr-index --report reads it as current).
  • The Console sentence on the queues page is left as it is. "When someone beats you to it, it says so" is true of the Console's 409 path. For a claim answered 404 or 403 the Console today shows the server's own sentence. Ruled term (3) changes that in the Console work on the claim-race card, and that pull request is where the sentence gets its update: describing the new Console sentence here would document behaviour main does not have yet.
  • Tier. docs/adr/** is Tier H: check-governed-merges.mjs --branch HEAD reads "landing tier: H". The diff replaces three lines, so it is not an add-only note.
  • Changeset. None, with skip-changeset: no package ships docs/adr or content/docs (no package's files reaches either tree, and no build script copies a docs page into a package).
  • Seen and left alone (read from the code here; since measured by zone data-p2 for the pin in PR fix(console): a claim answered 404 or 403 says the record is no longer waiting; race pins per ruling B #39238). On an unowned record the gate tests the transfer grant before the claim case, so a claim by a grant holder (modifyAllRecords covers transfer) carries no owner_id: null precondition. D4's first paragraph puts the claim case "ahead of the grant check" and names modifyAllRecords among the claimants. If two such callers claim at once, the reading is that both are answered 200 and the later write decides the owner: one owner still, and neither caller is told. This diff takes no side on it: both of its statements about the grant holder concern a record that already has an owner, where the ADR and the code agree. The seat has handed it to the pin work under claim 7363867578. The zone's measurement, as the seat relayed it: a modifyAllRecords holder who claims after a member's claim has committed gets 200 and the owner moves; an allowTransfer-only holder without row access gets 404 on a private object and 403 on a public_read one, and the owner stays. Both agree with "a caller who can edit the record and holds the transfer grant".

Verification

Read first, by risk.

  1. docs/adr/0142-ownership-queue-membership-claim-and-assignment-rules.md, the D4 note: the three bullets and the two paragraphs under them, against ruling record 7363773549. The risk is a sentence that says more, or less, than the ruling.
  2. content/docs/automation/queues-and-assignment-rules.mdx, the transfer-grant sentence and the last sentence of the rewritten passage: the two places where the page says something the ruling does not spell out.
  3. The D9 note: three sentences, no code added.

Two-minute check. git diff --numstat origin/main...origin/claude/project-thread-ohljq3 prints two rows: 14 2 for the queues page and 51 1 for ADR-0142. In the Files changed tab, the rich diff of ADR-0142 shows the new note between the "One owner" paragraph and "Release".

Local gates. Derived with node scripts/pm/dispatch-gates.mjs --commands from this branch against merge base 440331f: 49 commands. All 49 ran again at head 37e9d22, each exit code captured before any pipe, and --ran reconciles them.

Reconciliation and the 49 exit codes, objectstack at 37e9d22
Run reconciliation — 49 derived, 49 run, 0 NOT-MEASURED, 0 UNRUN.
✓ dispatch-gates --ran: 49 derived famil(ies) accounted for — 49 run, 0 NOT-MEASURED (a DERIVED zero — all 49 recorded an exit code and none of them is 3).

node scripts/check-adr-links.mjs :: exit 0
node scripts/check-adr-links.mjs --self-test :: exit 0
node scripts/check-closing-keyword-parity.mjs :: exit 0
node scripts/check-closing-keyword-parity.mjs --self-test :: exit 0
node scripts/check-comment-mask-corpus.mjs :: exit 0
node scripts/check-doc-route-spelling.mjs --advisory :: exit 0
node scripts/check-doc-route-spelling.mjs --self-test :: exit 0
node scripts/check-docs-section-name.mjs :: exit 0
node scripts/check-docs-section-name.mjs --self-test :: exit 0
node scripts/check-section-landing-index.mjs :: exit 0
node scripts/check-section-landing-index.mjs --self-test :: exit 0
node scripts/ci/plan-test-core-shards.mjs --self-test :: exit 0
pnpm --filter @objectstack/lint run check:doc-formula-expressions :: exit 0
pnpm --filter @objectstack/lint run check:doc-security-posture :: exit 0
pnpm --filter @objectstack/spec run check:docs :: exit 0
pnpm --filter @objectstack/spec run check:empty-state :: exit 0
pnpm --filter @objectstack/spec run check:liveness :: exit 0
pnpm --filter @objectstack/spec run check:skill-examples :: exit 0
pnpm --filter @objectstack/spec run check:strictness-ledger :: exit 0
pnpm --filter @objectstack/spec run check:variant-docs :: exit 0
pnpm --filter @objectstack/spec run check:yaml-examples :: exit 0
pnpm check:adr-anchors :: exit 0
pnpm check:adr-index :: exit 0
pnpm check:adr-symbol-anchors :: exit 0
pnpm check:ci-filter-parity :: exit 0
pnpm check:closed-ceremony-text :: exit 0
pnpm check:corpus-claim-drift :: exit 0
pnpm check:cross-package-test-inputs :: exit 0
pnpm check:doc-anchors :: exit 0
pnpm check:doc-authoring :: exit 0
pnpm check:doc-frontmatter :: exit 0
pnpm check:docs-audit-scope :: exit 0
pnpm check:docs-redirects :: exit 0
pnpm check:docs-single-h1 :: exit 0
pnpm check:docs-spec-enumerations :: exit 0
pnpm check:docs-transcript-drift :: exit 0
pnpm check:driver-memory-census :: exit 0
pnpm check:gitlink-declared :: exit 0
pnpm check:nul-bytes :: exit 0
pnpm check:pm-expected-skips :: exit 0
pnpm check:pm-governed-merges :: exit 0
pnpm check:pm-prior-rulings :: exit 0
pnpm check:published-readme-links :: exit 0
pnpm check:react-page-adapter-contract :: exit 0
pnpm check:refd-timer-probe :: exit 0
pnpm check:role-word :: exit 0
pnpm check:skill-identifier-liveness :: exit 0
pnpm check:vendor-version-stamps :: exit 0
pnpm check:watch-hint-literal :: exit 0
Verdict lines of the gates that read the two edited trees, objectstack at 37e9d22
check-adr-links: 1288 relative link destination(s) under docs/adr/ resolve
check-adr-symbol-anchors: 4661 anchors across 165 records resolve — 1764 symbol (1735 declaration, 29 literal), 2845 file-level, 52 cross-repo, 6 exempt, 131 continuation.
adr-index --report: OK — docs/adr/README.md is current, every record parsed, self-test 60 assertions green.
check-doc-anchors: 1226 internal #fragment link(s) across 369 source file(s) all resolve to a real heading
check-docs-transcript-drift: 4 declared transcript value(s) across 363 page(s) under content/docs/ equal what the registry derives today, and no undeclared block quotes one.
check-doc-frontmatter: 2 content root(s) verified, each against its own floor — content/docs 363, content/blog 4.
Two builds ran before the twelve gates that read built packages

check:docs-transcript-drift, the two @objectstack/lint doc gates, the seven @objectstack/spec gates, check:docs-spec-enumerations and check:skill-identifier-liveness were run after two builds under the verify lock: pnpm exec turbo run build --filter='@objectstack/lint...' --concurrency=2 (VERDICT command-exit 0, 5 tasks, 93 s) and pnpm exec turbo run build --filter='@objectstack/client-react...' --concurrency=2 (VERDICT command-exit 0, 47 tasks, 209 s). Before the first build check:docs-transcript-drift answered exit 3 (prerequisite not met, nothing measured); the builds changed no tracked file. They were made at head 11a12bd and were not repeated for 37e9d22, which changes only the two prose files.

CI. On the first head, 11a12bd: 56 check runs, 30 success, 26 skipped, none failed. On 37e9d22: NOT MEASURED when this was written, reason: the check runs start at the push. The families the derivation leaves to CI (the type-check lanes, the whole-root scans, the scheduled audit) are CI's to run.


Generated by Claude Code

… the queues page with it

Ruling B of record 7363773549: 409 CONCURRENT_UPDATE goes to a claim whose
check read the record unowned and whose write then found it taken; a claim
judged after the owner is set is answered as any request is at that moment,
404 where the caller cannot read the record and 403 where it can. "Exactly
one owner" is the invariant. Status codes, messages and the gate are
unchanged.

- ADR-0142: status line, a dated note in D4 and one in D9's Codes bullet.
- queues-and-assignment-rules.mdx: the "Only one person wins" paragraph and
  the checklist bullet for code that claims.

Claude-Session: https://claude.ai/code/session_01Utp6CXA7kUkccMCRG2nBfJ
Co-authored-by: Claude <noreply@anthropic.com>
The 404 on a private object is what a member whose only basis was the queue
is told; 404 is also a deleted record's answer and 403 a never-admitted
claim's. The queues page says the same about the private object.

Claude-Session: https://claude.ai/code/session_01Utp6CXA7kUkccMCRG2nBfJ
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet objectstack-fleet Bot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Dec 3, 2026
@github-actions github-actions Bot added size/s documentation Improvements or additions to documentation labels Dec 3, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-bill · os-bill · session_01Utp6CXA7kUkccMCRG2nBfJ

Contract-review-claim: session_01Utp6CXA7kUkccMCRG2nBfJ · head 11a12bdbb1c235c5a2d049542acf7753a89904a1 · 2026-12-03T01:49Z

Taking the contract-tier review of this head, as the seat asked of this card thread. The thread drafted the diff, so it does not judge it: one isolated reviewer at the tier renders the record, and the thread posts it as written, as the next comment here. The seat adopts it or not. Below is the filled brief the reviewer is handed, for the seat to read first.

## Contract review brief — PR #39233 @ `11a12bdbb1c235c5a2d049542acf7753a89904a1` (card #39223)

You review at `CONTRACT_REVIEW_TIER`. Render ONE `## Contract review` record on this head — its shape is
`node scripts/pm/record-recognisers.mjs --template --paths docs/adr/0142-ownership-queue-membership-claim-and-assignment-rules.md` — with a PASS or FAIL verdict, and post it as ONE comment
on the PR or its card.

Inputs — these and nothing else:
  · card #39223: its body and EVERY comment (rulings and earlier records included)
  · PR #39233: its body, its file list, and the net diff against `main` at `440331f1dd40ae99bc59412c026c52035a8f2e78`
  · the check-runs on `11a12bdbb1c235c5a2d049542acf7753a89904a1`: their conclusions ARE the gate verdicts
⛔ Not the dispatch order, ⛔ not the dispatching seat's own conclusions — this brief is adversarial by design.

Scope — the paths `reviewFace` returns as `hits` on this PR's file list: docs/adr/0142-ownership-queue-membership-claim-and-assignment-rules.md;
  plus every file IN THIS DIFF that directly implements or enforces them — the gate that enforces a rule, the code
  a jsdoc or schema line describes, the validator a skill teaches — reviewed for agreement with the contract.
  Widen it freely, ⛔ never below `hits`; the record's `Scope:` line names the implementing files apart from `hits`.
  The rest of the diff (tests, unrelated modules, lockfiles, generated output, changesets) is the lane seat's
  ACCEPT at `TIER_DEFAULT`, exactly as a standalone PR of those files.
  ④ judges the `hits` files and those implementing files ONLY:
  lockfiles, generated output, changesets and prose elsewhere in the PR are not reviewed;
  code outside the diff is READ to judge them, never reviewed.

Security — a `hits` path sits on the low-risk skills arm: when the change teaches security, auth or permission
  behaviour the path name doesn't show, the record says so and the seat adopting the record adds the `security` label.
  The record says so on its `Security-touching:` line, and the arm lands on `no` alone: write `no` ONLY when no changed
  hunk teaches permission, sharing, credential, token, authentication or other security behaviour, else `yes`.

⛔ READ-ONLY. No worktree, no checkout, no build, no test run, no gate re-run, no ablation: the check-runs
   on the head already answered every derived gate family, and a local run costs more than it returns.
   If ONE probe is unavoidable, the record's `Local-runs:` line says `probe — REASON`; otherwise `none`.
   Scratch space is `/tmp/claude-0/-home-user/ceccbe7c-8ba1-558e-b774-5780fe45dd99/scratchpad/pr-39233/` alone; nothing there you did not write this round is read.

Judge, in the record's own sections:
  ① Derived judgments — every accept-set and public-surface change the diff implies, each named right or wrong.
  ② Semver level — the changeset (or `skip-changeset`) matches what the diff publishes, and the `Clause-②:` line.
  ③ Boundary flags — every dev flag and every `open_questions` entry answered, or escalated.
     On every face, SQL push-down: a new id materialisation or in-app join where SQL could push down is a
     finding unless a reason is given (AGENTS.md, Prime Directive 5: SQL first).
  ④ Design judgment — for EVERY `hits` file: does the change hold against the code it cites and the
     scenario it is accepted against? A skill file against the card's eval prompt and the spec it teaches
     on `main`; a schema file against the ruling or ADR it implements and its first consumer; an ADR
     against its first consumer and its execution plan. For EVERY implementing file in the diff: does the
     code agree with the contract, sentence by sentence? Read the cited code in the live tree, and try to
     break the design.
     Grade each finding must-fix, should-fix or nit — a nit has no effect on correctness or the contract.
     A must-fix is a FAIL; a must-fix or should-fix earns a delta review of its fix; nits alone end the round.
     Spell a must-fix or should-fix with its id and grade, `S1 (should-fix) — …`, and a clean round as
     `No must-fix, no should-fix.`: the queue guard reads a graded finding as OPEN on this head and
     refuses the record; the delta record names those it closes by id alone, `S1: closed`.
     A nit is fixed only on the prose faces, or left as an accepted deviation or a follow-up card: a fix
     anywhere else moves the head, and this record no longer covers it.
     ⛔ Judge the tree, never the PR body's account of it.
Sign `Implemented-by:` with the dev's branch and `Reviewed-by:` with your session id — the value is the FIRST
thing after each colon.

Filled in by the card thread (session_01Utp6CXA7kUkccMCRG2nBfJ, the drafter of this diff) for its isolated reviewer.
Everything above is the template with its placeholders replaced; everything below is delivery, not judgment.

Where the inputs are read (read-only, repository objectstack-ai/objectstack):
  · the card: `gh api repos/objectstack-ai/objectstack/issues/39223` and
    `gh api "repos/objectstack-ai/objectstack/issues/39223/comments?per_page=100"`
  · the two records the card body cites, both comments on issue 39065: the ruling record 7363773549 and the
    analysis it rules on, 7361680320 (`gh api repos/objectstack-ai/objectstack/issues/comments/ID`). They are
    inputs because the card names them as what the amendment implements.
  · the PR: `gh api repos/objectstack-ai/objectstack/pulls/39233`, its `/files?per_page=100` and
    `gh api "repos/objectstack-ai/objectstack/issues/39233/comments?per_page=100"`
  · the net diff: `git -C /home/user/objectstack diff 440331f1dd40ae99bc59412c026c52035a8f2e78...11a12bdbb1c235c5a2d049542acf7753a89904a1`. The merge base of the head and `main`
    is 440331f1; `origin/main` has since moved to 724b3695, and none of the two files in the diff changed on it.
  · the head's two files: `git -C /home/user/objectstack show 11a12bdbb1c235c5a2d049542acf7753a89904a1:PATH`
  · the cited code: the checkout at /home/user/objectstack is detached at the merge base, so its files are `main` at
    440331f1; `git -C /home/user/objectstack show origin/main:PATH` reads the newer tip. Read only, never edit.
  · the check-runs: `gh api "repos/objectstack-ai/objectstack/commits/11a12bdbb1c235c5a2d049542acf7753a89904a1/check-runs?per_page=100"`
    (page with `&page=N`; some may still be in progress, say which were not waited for)

Scope note: `reviewFace` returns one `hits` path, the ADR. The second file in the diff,
content/docs/automation/queues-and-assignment-rules.mdx, is the docs page that teaches the same section to users. Read it
sentence by sentence against the amended ADR and the ruling as well, and name it apart from `hits` on the `Scope:` line.

Delivery:
  · You make NO GitHub write of any kind. The card thread posts your record, byte for byte, through
    `scripts/pm/post-stamped.mjs` with your transcript as the tier evidence.
  · Write the complete comment body to /tmp/claude-0/-home-user/ceccbe7c-8ba1-558e-b774-5780fe45dd99/scratchpad/pr-39233/contract-review-record.md and give the same text as your
    final message. Its first line is exactly
    `repo:objectstack@os-bill · os-bill · session_01Utp6CXA7kUkccMCRG2nBfJ`, then a blank line, then the record from
    its `## Contract review` heading to the verdict, then a blank line, `---` and
    `_Generated by [Claude Code](https://claude.ai/code)_`.
  · `Implemented-by:` is `claude/project-thread-ohljq3`. `Reviewed-by:` is `session_01Utp6CaQsbKBMQtm6Tpsamd`,
    the seat session that adopts a sub-agent's record (contract-review.md: a sub-agent records the adopting seat).
  · Tools: Bash for the read-only commands above, Read, Grep, Glob, and Write for files under your scratch directory
    only. ⛔ Call none of Agent, Task, Workflow, SendMessage, Skill, and no `mcp__` tool at all: the tier check
    refuses a transcript that calls one, and the review would have to be run again.
  · The record is English. It carries no model identifier, no HTML comment, no angle-bracket fragment, no double-brace
    token, and no timestamp typed in the `YYYY-MM-DDThh:mmZ` shape. Keep the words fix, close and resolve away from
    card numbers.
  · The dev report on the card (comment 7364716099) and the PR body are claims to check, not conclusions: read the
    diff and the code first.

Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-bill · os-bill · session_01Utp6CXA7kUkccMCRG2nBfJ

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 11a12bdbb1c235c5a2d049542acf7753a89904a1
Local-runs: none
Scope: docs/adr/0142-ownership-queue-membership-claim-and-assignment-rules.md + content/docs/automation/queues-and-assignment-rules.mdx
Security-touching: yes

The amendment says what ruling record 7363773549 ruled, and the invariant and the three statuses hold on main. Two things do not hold and are graded in ④: the note's split of 404 from 403 leaves out a claim the owner overtakes between the request's own checks (S1), and the page gives 403 for a claim that a private object answers 404 (S2). Each earns a delta review. ③ carries what goes to the seat and to the approver.

Read: card #39223 with its three comments, ruling record 7363773549 and analysis 7361680320, PR #39233 (body, file list, its one comment), the net diff against 440331f, both files at the head, the cited code on main at 440331f, and ruling record 5985885287, which the diff cites. The dev report and the PR body were checked against the tree.

The changed hunks teach permission and visibility behaviour that the two path names do not show: what the write gate answers for a record the caller cannot read, and when the transfer grant turns a claim into a transfer. The security line above therefore reads yes, and the adopting seat adds the security label.

① Derived judgments

  • No accept set moves: right. The diff adds no schema, code, ledger row, message or status. The three codes exist already: CONCURRENT_UPDATE in packages/spec/src/api/error-code-ledger.zod.ts, RECORD_NOT_FOUND and PERMISSION_DENIED in packages/spec/src/api/errors.zod.ts.
  • The promise narrows as text, not as behaviour: right. "Every loser hears 409" becomes "one of 409, 404, 403". Nothing a client sends or receives on main changes, so Clause-②: no carries no narrowing arm.
  • The client rule on the page moves from "handle 409" to "treat 409, 404 or 403 straight after a claim as no longer available": right. It is ruled term (1) and the card's acceptance.
  • Tier H: right. docs/adr/** is governed, the diff replaces three lines so it is not an add-only note, and the security line reads yes.
  • One surface the diff implies and does not carry: the published skill still teaches the old reading (N3).
  • Gates: 56 check-runs on the head, 30 success and 26 skipped, none red and none still running when read, so none was waited for. The docs build, the documentation-links check, the docs-and-code guards and the changeset check are among the green.

② Semver level

skip-changeset is right: the diff publishes nothing. No package ships docs/adr/** or content/docs/**, and the changeset check is green on the head. Clause-②: no and Metadata-protocol: none match: no published surface, accept set or authorable key moves.

③ Boundary flags

  • Transfer-grant clause (deviation 1): keep it. It is true on main: step 3.5 tests the grant before it reads any pre-image (packages/plugins/plugin-security/src/security-plugin-authz-middleware.ts line 2220), so a grant holder writing its own id on an owned record makes the transfer D4's closing paragraph admits. Struck, the 403 bullet would be untrue for that caller. It goes past the ruling's wording, so it is the approver's to read. In plain words: a holder of allowTransfer or modifyAllRecords who can edit the record and claims it just after a colleague did takes it, and both hear success.
  • Status segment (deviation 2): right. Every earlier amendment of this record registers there, and Prime Directive 13 names the amended status line as the form. The README index row cuts the status off before the new segment, so it is rightly untouched, and the lint workflow that runs check:adr-index is green.
  • Console sentence left as it is (deviation 3, out-of-scope finding 2): accepted, see N4.
  • Review request not made, worktree added by hand (deviations 4 and 5): the seat's hand-off and tooling. Neither changes the tree reviewed.
  • Grant holder on an unowned record (out-of-scope finding 1): confirmed by reading, not run, and escalated. The grant test at line 2220 comes ahead of the claim case (2245 to 2258), the precondition is assigned only inside that case (2256), and without it the engine writes unconditionally (packages/objectql/src/engine-update.ts 1813 to 1815). D4's first paragraph puts the claim case "ahead of the grant check" and names modifyAllRecords among its claimants. So on main two grant holders claiming at once are both answered success, and a grant holder's claim judged while the record was unowned can overwrite a member's landed claim. Term (2) keeps the gate as it is, so the PR is right to leave it, and the note's "one claim lands" is D4's design. "Noted, not filed, if the zone takes it" leaves it with nobody. To the seat: hand it by name to claim 7363867578 as a pin case with a grant-holding claimant, and file it against D4 once a public door shows it. Until then term (5)'s assertion holds for claimants without the transfer grant, and the unblock note to the downstream CRM seat should say so.
  • Premise 4 and the named I/O-tick premise, not measured: accepted as disclosed. The ruling orders premises 1 to 3 and 5 re-read. I re-read them on 440331f and they hold. The named premise is a run, and the ruling gives runs to the pin of term (3). The note therefore lands on a premise measured once, before the ruling; S1 names a tick position the analysis's two orders do not cover.
  • Published skill that still teaches the old reading (N3): outside this card, no carrier on record. To the seat, to file.
  • CI, not measured in the report: measured now, see ①.
  • open_questions: none.
  • SQL push-down: the diff holds no code, so no id materialisation and no in-app join.
  • To the approver: the transfer-grant clause, and the sentence S1 asks for, each state a case the ruling's wording does not name.

④ Design judgment

The ADR, the one hits file, against the ruling, the code it describes and its first consumers (the race pin of term (3) and the downstream CRM test of term (5)):

  • Status segment: the ruling's own words.
  • Invariant and 409 bullet: hold for the claim case (a grant-holding claimant is in ③). It sets owner_id: null as the write's precondition (lines 2251 to 2257); the engine lowers that to a conditional updateMany and answers zero rows with CONCURRENT_UPDATE 409 (packages/objectql/src/engine-insert.ts 273 to 289).
  • 404 bullet: holds for a claim whose row check runs after the owner is set (lines 1640 to 1683 and 1721 to 1737, packages/core/src/utils/record-not-found.ts). Ruling record 5985885287 exists on security(data): a by-id write answers 403 for a row the caller cannot read and 404 for an id that does not exist, for principals the write pre-image check does not bind: an existence signal the read door withholds #21771 and says what the note attributes to it.
  • 403 bullet: holds for the same claim. Both refusals it names are PERMISSION_DENIED 403: the record-level one (1684 to 1720) and the ownership step's (2269 to 2272).
  • Options A and C not taken, and "status codes, messages and the gate are unchanged": the ruling's terms.
  • D9 note: adds no code and agrees with D4's note, S1 aside.
  • Execution plan: untouched and still true; its "409 on a lost claim" is the admitted claim's.

The docs page, sentence by sentence against the amended ADR and main: the promise, the three bullets, the reload advice, the transfer-grant sentence and the checklist bullet agree with the note. The 409 sentence matches packages/objectql/src/concurrent-update-error.ts word for word, and the sharingModel link target exists. S1 and S2 are the exceptions.

Card acceptance: met on all three lines, S2 aside.

No must-fix.

S1 (should-fix) — "who gets which" leaves out a claim the owner overtakes between the request's own checks, and main does not answer that claim as the note says.

One request reads the record at several points, and the owner can be set between any two of them:

  • the row check of step 2.7 (security-plugin-authz-middleware.ts 1668 to 1683);
  • the ownership step's own pre-image read (2194 and 2232);
  • the sharing gate, a second middleware that runs after the security one and reads the row again. Security registers its middleware in start() (packages/plugins/plugin-security/src/security-plugin.ts 2438), sharing in a kernel:ready handler (packages/plugins/plugin-sharing/src/sharing-plugin.ts 925 to 927), and the chain runs in registration order (packages/objectql/src/engine-middleware-and-context.ts 109 to 113 and 142 to 150). The read is packages/plugins/plugin-sharing/src/sharing-service.ts 1448 and 1510 to 1521; the refusal is status 403 with code FORBIDDEN (sharing-plugin.ts 1655 to 1696).

For a record that exists, only the row check answers 404 and only the conditional write answers 409. So a claim that passed the row check while the record was unowned is refused 403 by whichever gate reads next after the owner is set: PERMISSION_DENIED from the ownership step, where a pre-image it can no longer read falls through to denyOwnerWrite (2241 to 2272), or FORBIDDEN from the sharing gate, after the ownership step has admitted the claim and set the precondition. In the second case the write never runs, so there is no 409.

On a private object a caller whose only basis was the queue can by then no longer read the record, and hears 403. That is outside the 404 bullet ("where the caller cannot read the record"), outside the 403 bullet ("where the caller can still read the record"), and from the sharing gate outside the one code D4, D9 and the page put beside 403. FORBIDDEN is the registered synonym the ledger keeps on the wire for plugin-sharing (error-code-ledger.zod.ts 2303 to 2309; packages/types/src/data-error-classification.ts 1533 to 1536). The page's two bullets invite the inference that a private object answers 409 or 404 and never 403, which a test would then pin.

What stands: one owner, and every answer is 409, 404 or 403. The ruled set and term (5)'s assertion are intact, and nothing here is a fork under the ruling's ban. This is read from the code, not run.

Remedy, inside term (2): one sentence in the D4 note, mirrored in D9 and on the page, saying that a claim the owner overtakes between those checks is refused 403 by the next gate that reads the record, whether or not the caller can still read it, and by the sharing gate under FORBIDDEN; and that a client and a test key on the status. First consumer: the pin of term (3) keys its outcomes on code and status together (packages/plugins/plugin-security/src/ownership-claim-race-sqlite.test.ts 127 to 128), so an I/O tick placed between the two gates would show FORBIDDEN/403, which a pin written from the note's codes would report as outside the set.

S2 (should-fix) — the page's last sentence of the passage gives 403 for a claim that the default sharing model answers 404.

The sentence, page line 147 at the head: "A claim refused while the record is still unowned — the sharing model does not admit you to it, or the update is not a single-record claim of your own — is 403 PERMISSION_DENIED, and its message names the condition that failed." On a private object, which is the default, a caller the sharing model does not admit usually cannot read the record either, and the row check answers 404 RECORD_NOT_FOUND before the ownership step is reached (lines 1676 to 1683 and 1721 to 1737; the race pin's last case pins that branch). The 403 whose message names the failed condition is the ownership step's, and it is reached only for a record the caller can read. The sentence also contradicts the page's own 404 bullet ("a record you cannot read answers exactly as one that does not exist") and the D4 note ("the answer a by-id write gives for every row the caller cannot read"). The analysis called the sentence this one replaces wrong for a private object; the rewrite narrowed it to the unowned case and kept the error there.

Remedy, on the prose face: scope the sentence to a record the caller can read, and say that one it cannot read answers 404 as above.

N1 (nit) — D4 note, "403 what a record the caller was never admitted to claim answers": true where the caller can read that record; where it cannot, the answer is 404 by the bullet above. Fold "or 404 where the caller cannot read it" into the edit S1 makes to that paragraph.

N2 (nit) — page checklist, line 176 at the head: the two-claims test holds for claimants without the transfer grant, for the reason the page's own "One caller is outside this" paragraph gives. Say so in the bullet. Prose face.

N3 (nit, follow-up card) — skills/objectstack-data/rules/security.md lines 390 to 392 ("one writer wins, the other gets 409 CONCURRENT_UPDATE") and eval 8 of skills/objectstack-data/evals/hooks-security-seeds-datasources.json ("the loser gets 409 CONCURRENT_UPDATE") still teach the reading this note narrows. They are outside the card's file surface and the ruled terms, so not for this PR. Once the note is on main the governing record and the published skill disagree, and the skill is what an AI author loads. No carrier is on record: the seat files it.

N4 (nit, accepted deviation) — page, line 149 at the head, "when someone beats you to it, it says so": true of the Console's 409 path only, as it was before this diff. The Console work of term (3) on the claim-race card carries it.

Open on this head: S1 and S2. Each is owed a delta review of its edit before landing.

Implemented-by: claude/project-thread-ohljq3
Reviewed-by: session_01Utp6CaQsbKBMQtm6Tpsamd

VERDICT: PASS


Generated by Claude Code

…checks

Contract review round 1 on the pull request, findings S1 and S2 with nits
N1 and N2. A request reads the record at the row check, in the ownership
step and in the sharing gate; a claim overtaken between two of them is
refused 403 by the later check, also where the caller can no longer read
the record, and from the sharing gate under FORBIDDEN. D4 and D9 say so,
and the queues page tells readers to key on the status. The page's
sentence on a refused claim of an unowned record now gives 404 for a
record the caller cannot read, and the two-claims test is scoped to
claimants without the transfer grant. The note's "one claim lands" is
scoped the same way: a holder of the grant does not go through the
conditional write.

Claude-Session: https://claude.ai/code/session_01Utp6CXA7kUkccMCRG2nBfJ
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-bill · os-bill · session_01Utp6CXA7kUkccMCRG2nBfJ

Contract-review-claim: session_01Utp6CXA7kUkccMCRG2nBfJ · head 37e9d22d1be860d5f89c4b4c54b9c46081330207 · 2026-12-03T02:34Z

Delta review of this head. Record 7365351117 left S1 and S2 open on 11a12bdb; commit 37e9d22d answers them, takes nits N1 and N2, and scopes the D4 note's "one claim lands" to callers without the transfer grant. The same isolated reviewer reads the delta, and the thread posts its record as written, as the next comment here. Below is the brief it is handed.

## Contract review brief, delta — PR #39233 @ `37e9d22d1be860d5f89c4b4c54b9c46081330207` (card #39223)

You are the reviewer who rendered record 7365351117 on head `11a12bdbb1c235c5a2d049542acf7753a89904a1` (PASS, should-fix S1 and
S2 open, nits N1 to N4). The head has moved by one commit. You review at `CONTRACT_REVIEW_TIER`. Render ONE
`## Contract review` record on the new head: a DELTA review in the same shape
(`node scripts/pm/record-recognisers.mjs --template --paths docs/adr/0142-ownership-queue-membership-claim-and-assignment-rules.md`),
with a PASS or FAIL verdict.

Inputs — these and nothing else:
  · your own record 7365351117 and the findings it left open
  · the delta: `git -C /home/user/objectstack diff 11a12bdbb1c235c5a2d049542acf7753a89904a1..37e9d22d1be860d5f89c4b4c54b9c46081330207`
    (two files), and both files at the new head (`git -C /home/user/objectstack show 37e9d22d1be860d5f89c4b4c54b9c46081330207:PATH`)
  · PR #39233: its body as edited for this head, and the comments on the PR and on card #39223 since your record
  · the cited code on `main`: the checkout at /home/user/objectstack is still detached at the merge base 440331f1
  · the check-runs on `37e9d22d1be860d5f89c4b4c54b9c46081330207` (some may still be in progress; say which were not waited for)
⛔ Not the dispatch order, ⛔ not the author's own conclusions — this brief is adversarial by design.

Scope — as in the first round: the `hits` path docs/adr/0142-ownership-queue-membership-claim-and-assignment-rules.md,
  and content/docs/automation/queues-and-assignment-rules.mdx named apart from it on the `Scope:` line.

⛔ READ-ONLY. No worktree, no checkout, no build, no test run, no gate re-run, no ablation.
   If ONE probe is unavoidable, the record's `Local-runs:` line says `probe — REASON`; otherwise `none`.
   Scratch space is `/tmp/claude-0/-home-user/ceccbe7c-8ba1-558e-b774-5780fe45dd99/scratchpad/pr-39233/` alone.

Judge:
  · S1 and S2, each closed or still open, by id alone (`S1: closed`), against the code on `main`: does the new text
    say what `main` answers, no more and no less?
  · N1 and N2: taken or not. N3 and N4 were not for this pull request.
  · Every other changed sentence of the delta, as in a full round. The commit changes one thing no finding asked for:
    the D4 note's "one claim lands" is now said of "callers without the transfer grant". The author's stated ground is
    a measurement the seat relayed from the zone that owns the race pin (PR #39238, the claim 7363867578 work): two
    holders of the grant who claim an unowned row at once both get 200 and the last writer owns it. Treat that as a
    claim to check against the code, not as a conclusion.
  · ①, ② and ③ for what the delta changes. The PR body now flags three statements as going past the ruling's wording.
  · Grade each new finding must-fix, should-fix or nit, spelled with its id and grade; a clean round is spelled
    `No must-fix, no should-fix.`
     ⛔ Judge the tree, never the PR body's account of it.

Delivery, as in the first round:
  · You make NO GitHub write. The card thread posts your record, byte for byte, with your transcript as tier evidence.
  · Write the complete comment body to
    /tmp/claude-0/-home-user/ceccbe7c-8ba1-558e-b774-5780fe45dd99/scratchpad/pr-39233/contract-review-record-delta.md
    and give the same text as your final message: first line
    `repo:objectstack@os-bill · os-bill · session_01Utp6CXA7kUkccMCRG2nBfJ`, a blank line, the record from its
    `## Contract review` heading to the verdict, a blank line, `---` and
    `_Generated by [Claude Code](https://claude.ai/code)_`.
  · `Head-sha:` is the new head. `Implemented-by:` is `claude/project-thread-ohljq3`. `Reviewed-by:` is
    `session_01Utp6CaQsbKBMQtm6Tpsamd`.
  · Tools: Bash for read-only commands, Read, Grep, Glob, and Write under your scratch directory only. ⛔ Call none of
    Agent, Task, Workflow, SendMessage, Skill, and no `mcp__` tool at all.
  · English; no model identifier, no HTML comment, no angle-bracket fragment, no double-brace token, no timestamp typed
    in the `YYYY-MM-DDThh:mmZ` shape; keep the words fix, close and resolve away from card numbers (the id-alone
    spelling `S1: closed` is the record's own and is fine).

Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-bill · os-bill · session_01Utp6CXA7kUkccMCRG2nBfJ

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 37e9d22d1be860d5f89c4b4c54b9c46081330207
Local-runs: none
Scope: docs/adr/0142-ownership-queue-membership-claim-and-assignment-rules.md + content/docs/automation/queues-and-assignment-rules.mdx
Security-touching: yes

Delta review of the one commit that moved the head from 11a12bd, by the reviewer of record 7365351117. Both findings that record left open are closed: in each case the new text says what main answers. The change no finding asked for, "one claim lands" said of callers without the transfer grant, is right. Four new nits, none of which moves a status. ③ carries what goes to the seat and to the approver.

Read: record 7365351117, which reads on the PR as rendered; the delta from 11a12bd to this head (two files, 22 lines added and 8 removed) and both files at this head; the PR body as edited; the two comments since that record, 7365627006 on the PR (this round's brief) and the dev report 7365657346 on card #39223; the cited code on main at 440331f. The dev report and the PR body were checked against the tree.

The delta adds to what the hunks teach about permission and visibility: a refusal for a record the caller can no longer read, the second code the sharing gate puts beside 403, and who stands outside the one-claim promise. The security line above reads yes again, and a yes is meant. The security label that record 7365351117 left to the adopting seat was not on the PR when read.

① Derived judgments

  • No accept set moves: right. Prose only, in the same two files: no schema, code, ledger row, message or status. D4, D9 and the page now name FORBIDDEN. It is an existing ledger code, the waived synonym of PERMISSION_DENIED (packages/spec/src/api/error-code-ledger.zod.ts 2303 to 2310), so D9's "No code is added, renamed or re-registered" stays true.
  • The promise narrows once more, as text: "one claim lands" is now said of callers without the transfer grant. Right, see ④. Nothing a client sends or receives on main changes.
  • The client rule gains "read the status, not the code": right for this case, see N8.
  • Tier H, as before: net against the merge base 65 lines added and 3 removed, so not an add-only note, and the security line reads yes.
  • Gates: 53 check-runs on this head, all finished when last read: 29 success, 23 skipped, 1 cancelled. The cancelled one is a superseded run of the PR-body guards; the run that replaced it is green. None is red and none was left running. Among the green: the docs build, the documentation-links check, the docs-and-code guards, the repo and tooling gates, the core test shards and the governed-surface queue guard.

② Semver level

skip-changeset is still right: the same two paths, and no package ships either tree. On this head the changeset job is skipped in both of its runs, which is that label's own exemption (.github/workflows/pr-automation.yml), so ② stands on the file list and not on a gate. Clause-②: no and Metadata-protocol: none match: no published surface, accept set or authorable key moves.

③ Boundary flags

  • Deviation 1, three statements that go past the ruling's wording: keep all three. Each is the approver's to read.
    • The transfer-grant clause: as judged in record 7365351117.
    • The paragraph that answers S1: it is what main answers (④). Struck, the two bullets would again sort an overtaken claim wrongly.
    • "One claim lands" scoped to callers without the transfer grant: right (④). Struck, the sentence would contradict the note's own transfer-grant clause.
  • In plain words, for the approver. A member who claims at the same instant as a colleague can be told "forbidden" about a record that has just left their view; the platform does that today, and the note now says so. And the promise that only one claim goes through is made for ordinary members: a holder of the transfer grant can take the record after or beside someone else, and both are told it worked.
  • "That rule stands whole" beside a 403 for a record the caller can no longer read: both are true of main. The row check gives the rule's 404. A row hidden after that check and a row deleted after it are answered alike by the later gate: the ownership step reads null for both and refuses both the same way (packages/plugins/plugin-security/src/security-plugin-authz-middleware.ts 2188 to 2193 and 2241 to 2272), and the sharing gate, which reads the row itself, refuses both. So the later 403 does not tell a hidden row from a missing one. Whether a 403 there is within ruling record 5985885287 is its owner's to say; term (2) keeps the gate as it is.
  • Deviation 2, the scope rests on a relayed measurement: it does not need to. It stands on the note's own transfer-grant clause and on the code as read (④). The measurement agrees with that reading and was not run here.
  • Deviation 3, the thread posted record 7365351117 itself: the comment reads as rendered. The posting and its tier evidence are the seat's hand-off; neither changes the tree reviewed.
  • Out-of-scope finding 2, the grant holder on an unowned record: still open against D4. The report names the pin work under claim 7363867578 and PR fix(console): a claim answered 404 or 403 says the record is no longer waiting; race pins per ruling B #39238 as the carrier; that PR is outside this round's inputs and was not read. The code reads as the report says: the grant test and its continue (2220 to 2231) come before the pre-image read (2232) and the one place the precondition is set (2256), and without it the write is unconditional (packages/objectql/src/engine-update.ts 1813 to 1815). A pin holds the behaviour; it does not decide whether D4's first paragraph or the code changes, which the report rightly leaves alone. To the seat: the report names no card for that decision. Record 7365351117 asked for one against D4 once a public door shows it; if the zone's result stands, that is now.
  • Out-of-scope finding 1, the published skill that still teaches the old reading (N3): no carrier, and the seat files it once the note is on main. Accepted as stated.
  • The ledger keeps FORBIDDEN on the wire as a waived synonym, "consolidation deferred until it has a measured victim" (error-code-ledger.zod.ts 2303 to 2310). One refusal of a claim reaching the client under either spelling, by timing, is a candidate once the pin measures it. To the seat; not for this PR.
  • Seen in the ownership step while re-reading it, outside this diff and not established: the claim case takes a stored owner of '' as unowned (line 2252) and sets the precondition owner_id: null (2256), and a release may spell the owner '' (2265). Whether a row can come to hold '', and then answer 409 to a lone claimant, is a question for the pin work. Read, not run.
  • CI, not measured as a final result in the report: measured now, see ①. The report's local gates and the two builds it did not repeat are as disclosed; this record stands on the head's check-runs.
  • open_questions: none. security_findings: none in the report, and none found here.
  • SQL push-down: the delta holds no code, so no id materialisation and no in-app join.

④ Design judgment

S1: closed.

S2: closed.

S1 against main. D4's new paragraph (head lines 471 to 477), the sentence added to D9 (739 to 742) and the page's paragraph at line 145:

  • A claim overtaken before the ownership step reads: the step's pre-image comes back with the owner set, or null where the caller can no longer read the row, and both end in the PERMISSION_DENIED 403 of denyOwnerWrite (2232 to 2272; 2056 to 2065).
  • A claim overtaken before the sharing gate reads: the ownership step has admitted it and set the precondition; the gate reads the row afresh (packages/plugins/plugin-sharing/src/sharing-service.ts 1448 and 1510 to 1521) and refuses with status 403 and code FORBIDDEN (packages/plugins/plugin-sharing/src/sharing-plugin.ts 1655 to 1696). The write does not run.
  • "Exact for a claim whose every check runs after the owner is set": holds. The row check then answers 404 where the caller cannot read the row and the record-level 403 where it can read and not write (1676 to 1737); a caller who can still write is refused 403 by the ownership step.
  • "In every other order the answer is still one of the three statuses": holds for a claim that did not land. The engine's own prior-row read is a driver read below the read door (packages/objectql/src/engine-insert.ts 327 to 334), so it adds no 404 for a record that exists; the conditional write is the only source of 409.
  • First consumer: the race pin keys its outcomes on code and status together (packages/plugins/plugin-security/src/ownership-claim-race-sqlite.test.ts 127 to 128). FORBIDDEN/403 is now inside what the note describes, and the note tells a test to read the status.

Read from the code, not run. N5 and N6 are the two places where the wording is looser than the code.

S2 against main. Page line 149 now gives 404 first for a record the caller cannot read, which is the row check's answer whether or not the record has an owner (1676 to 1683 and 1721 to 1737). It gives 403 PERMISSION_DENIED for a record the caller can read and has no edit on, which is the record-level refusal (1684 to 1720), and for an update that is not a single-record claim of the caller's own, which is the ownership step's. "A refusal from the ownership gate names the condition that failed in its message" holds: those refusals keep the developer sentence as message (405 to 421, 2056 to 2077), and the claim's reads "claim only an unowned record the sharing model admits you to" (packages/plugins/plugin-security/src/ownership-queue-gate.ts 35). The record-level refusal's message names nothing, and the page no longer says it does. N7 is one case the new wording dropped.

The nits of record 7365351117:

  • N1: taken. D4 now gives 404 for "one the caller could never read" and keeps 403 for a record the caller can read and was never admitted to claim.
  • N2: taken. The checklist bullet at page line 178 scopes the two-claims test to users without the transfer grant.
  • N3 and N4 were not for this PR.

"One claim lands", said of callers without the transfer grant (head lines 451 to 453, and the test rule at 483): right, on two grounds read in the tree.

  • The note's own clause. A caller who can edit the record and holds the grant is, once the record has an owner, making a transfer that succeeds. With "in whatever order their requests are served", the unscoped sentence was untrue beside that clause, under D4's design as well as on main. N2 asked the same scope of the page for the same reason.
  • The code. A caller without the grant reaches the write of a claim only through the claim case, which sets the precondition (2251 to 2257), so among such callers the conditional write lets one claim land; D4's caveat for a driver without a conditional update stands. A grant holder never takes that case (2220 to 2231).

The scope says nothing about a grant holder on an unowned record beyond leaving them out. The Status segment and the "One owner" paragraph are untouched; what the latter says of a grant-holding claimant is the open question in ③.

The page against the amended ADR: line 145 says what D4's paragraph says, line 149 agrees with the 404 bullet and with D4's closing sentences, and line 178 with D4's test rule. The page's promise at line 137, "it ends with exactly one owner", is true of every caller. The execution plan is untouched.

Card acceptance: still met on all three lines.

No must-fix, no should-fix.

N5 (nit, accepted deviation) — D4 note, "again in the ownership step": true where a write-class row filter binds the caller, whose row check is the re-read at 1668 to 1673. Where none binds (the arm at 1721 to 1737), the row check's read is the caller pre-image kept for the operation (packages/plugins/plugin-security/src/security-plugin.ts 4553 to 4559) and the ownership step judges that same image: the two are one moment there, and only the sharing gate reads again. "Can be overtaken" keeps the paragraph true and no status moves. The wording follows the list in record 7365351117, which had the same gap.

N6 (nit, accepted deviation) — D9 note, "is refused 403 by the check that finds the owner set": D4's paragraph is conditional, "a later check that then refuses it", and that is the exact form. A claimant who keeps edit once the owner is set (an edit share, an object whose default gives everyone edit) and is overtaken between the ownership step and the sharing gate passes that gate, whose answer for them is not deny (sharing-service.ts 1285 to 1291, 1400, 1468 to 1473), and hears 409 from the write. D9's own first sentence and D4's 409 bullet cover that claim, and D9 names D4's note as the definition.

N5 and N6 sit in the ADR, where an edit moves the head past this record. Left as they are; fold them in if the head moves for another reason.

N7 (nit) — page line 149, "the sharing model gives you no edit on it": narrower than the gate. A caller who can read and edit the record with no positive basis from the sharing model (an object whose default gives everyone edit, where the sharing service abstains) is refused 403 as well: the claim case asks for allow (2199 to 2209, 2255 to 2259; sharing-service.ts 1400 and 1459 to 1460). Line 135 states the rule, and the sentence this one replaces had it ("does not admit you to it"). Say "does not positively admit you to it". Prose face.

N8 (nit) — page line 145, "Read the status, not the code.": right for a claim, where every answer in the set gets one handling and the two codes are one refusal. It sits beside the API guide's general rule, "Branch on error.code, never on error.httpStatus" (content/docs/api/index.mdx line 225). Half a sentence saying the two codes are the same refusal would keep it from reading as a general rule. The wording follows the remedy in record 7365351117. Prose face.

Implemented-by: claude/project-thread-ohljq3
Reviewed-by: session_01Utp6CaQsbKBMQtm6Tpsamd

VERDICT: PASS


Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-bill · os-bill · session_01Utp6CaQsbKBMQtm6Tpsamd

维护者速读

席位核对

ACCEPT · head 37e9d22d1be860d5f89c4b4c54b9c46081330207 · repo:objectstack@os-bill

  1. Shape: 2 files, docs only: docs/adr/0142-ownership-queue-membership-claim-and-assignment-rules.md (D4 dated amendment, D9 Codes mirrored) and content/docs/automation/queues-and-assignment-rules.mdx (the claim-race paragraph). This is within claim 7363974897.
  2. Premises measured: the wording follows ruling B (7363773549). The grant-holder statements match zone data-p2's measurement on 55b556c0, which it pins in PR fix(console): a claim answered 404 or 403 says the record is no longer waiting; race pins per ruling B #39238: two holders both get 200 on an unowned row; a modifyAllRecords holder moves a landed owner; an allowTransfer-only holder without row access gets 404 or 403 and the owner stays.
  3. Gates: check-runs at this head show 0 failed. One run was cancelled, superseded by the body edit, and its replacement is green. Mergeable is clean. Contract review at CONTRACT_REVIEW_TIER: PASS 7365351117 with S1 and S2 open, then delta PASS 7366016972 on this head with both closed. Security-touching: yes.
  4. Accepted deviations: N5 and N6 (the ADR wording is looser than the code) are left, as the reviewer advised, so this head stays the reviewed one.
  5. Out of scope: N7 and N8 (two phrasings on the queues page) go to the Concurrent claim: the first race after boot still answers 404 RECORD_NOT_FOUND to the loser instead of 409 CONCURRENT_UPDATE (residual of #35142) #39065 Console PR, which already owes this passage an edit; I am telling the zone. Skills text still says "the loser gets 409" (skills/objectstack-data/rules/security.md and eval 8 of hooks-security-seeds-datasources.json); I file that follow-up card when this lands. Whether D4's first paragraph should change for a grant holder on an unowned record is not decided; PR fix(console): a claim answered 404 or 403 says the record is no longer waiting; race pins per ruling B #39238 pins the measured behaviour, and the question is named to the approver. Skills-docs: follow-up as above.
  6. Landing: Tier H (docs/adr/**). Handed to the approver; the seat lands after approval. On merge, the seat tells the hotcrm seat that Ownership queues: tighten the losing-claim assertion back to 409 CONCURRENT_UPDATE once a release carries objectstack#35142 hotcrm#2642 is unblocked, for claimants without the transfer grant.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-bill · os-bill · session_01Utp6CaQsbKBMQtm6Tpsamd

维护者速读

Review requested · 2026-12-03T02:58Z · Tier H (docs/adr/**). Seat ACCEPT 7366049449 and contract review delta PASS 7366016972 are at Head-sha: 37e9d22d1be860d5f89c4b4c54b9c46081330207. Please approve at this head. On approval the seat lands it (ready + auto-merge) under the maintainer's authorization of 2026-12-02T12:07Z (「审批人批准后的 Tier H PR 你可以自主落地」).

@objectstack-fleet objectstack-fleet Bot added the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Dec 3, 2026
@objectstack-fleet
objectstack-fleet Bot requested a review from os-zhuang December 3, 2026 02:58
@os-zhuang
os-zhuang marked this pull request as ready for review December 3, 2026 03:10
@os-zhuang
os-zhuang added this pull request to the merge queue Dec 3, 2026
Any commits made after this event will not be merged.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue size/s skip-changeset PR has no user-facing published change; bypasses the changeset gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ADR-0142 D4: amend the claim-race promise to the ruled answers (409 / 404 / 403, exactly one owner) and the queues docs paragraph with it

2 participants