You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
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
On the pin @objectstack/* 19.0.0-next.3, take two queue members on the full HotCRM stack (hotcrm a10f192) who each claim the same case at once through real ObjectQL updates.
First concurrent claim in a fresh process: the loser gets 404 RECORD_NOT_FOUND ("Record ID not found in crm_case"). This happened in 7 of 7 isolated processes.
Every later round in the same process: the loser gets 409 CONCURRENT_UPDATE ("The record was taken: another user changed it first…"). This happened in 24 of 24 rounds.
Running the whole file, where earlier cases warm the process: 409 in 8 of 8 rounds.
ADR-0142 D4 and content/docs/automation/queues-and-assignment-rules.mdx:137 promise 409 to every loser. The platform's own ownership-claim-race-sqlite.test.ts passes 25 of 25 on a minimal stack, so it does not catch this cold-start case.
Reproduce
On hotcrm a10f192 with the 19.0.0-next.3 pin:
pnpm exec vitest run test/ownership-queues.test.ts -t 'concurrent claims'
Log each loser's code and status. Round 0 gets 404; rounds 1 and later get 409.
Likely mechanism (not proven)
On a cold first request, the loser's authorization pre-read still runs after the winner has committed. By then the row is out of the loser's sight, so it answers 404 before the version check can answer 409.
Effect on HotCRM
hotcrm#2642 cannot tighten its assertion back to 409-only. A tightened assertion would depend on test order: it would pass in the full file and fail when the test runs alone. The card goes back on hold, Blocked-by: this card.
Self-audit (execution-duties 自分诊 ③): triage first touch 7337930739 (triage@os-warren, area:data · Bug · p2) is on this card; card-pick.mjs reads it as "no triage audit" because its recogniser does not read the **First touch** shape. Route and grade unchanged.
Claim: PM loop round 1
Session: session_01Utp6CYUove7YBXgHy4iEsr
Account: os-bill
Branch: claude/issue-39065-cold-claim-409
Worktree: objectstack-issue-39065
Domain: domain:server
Seat: repo:objectstack@os-bill
Area: data-p2 (zone of seat repo:objectstack@os-bill, intake area:data p1/p2)
File surface: packages/plugins/plugin-security/src/security-plugin-authz-middleware.ts, packages/objectql/src/engine-top-level.ts, packages/objectql/src/concurrent-update-error.ts, and a new test file named for this card beside ownership-claim-race-sqlite.test.ts (reason: the card's unproven mechanism is the loser's authorization pre-read answering 404 before the version check answers 409; the dev measures which of these files owns it before writing) (stop on breach; explain in the report)
Container & model: M, mode:subagent, model: default — dispatch-gates --tier: "The tier stays below the ceiling: with no mandate the PM picks floor or default per card", effort: high
Clause-②: no
Metadata-protocol: none
Responsibility: plugin-security / objectql in this repo: the loser of a cold-process concurrent claim gets 404 RECORD_NOT_FOUND where ADR-0142 D4 promises 409 CONCURRENT_UPDATE | #35142 / PR #35165 fixed the warm case only; no path covers the first race after boot | every app using queue claims (HotCRM measured 7/7 cold processes)
Thread-read: 7337930739
Premise: holds (filer's measurement on the 19.0.0-next.3 pin, 7/7 cold processes; mechanism unproven) — the dev re-measures on origin/main before writing code; no reproduction ⇒ premise_still_valid: false, no PR
Pre-claim lane: domain:server (paths above are plugin-security and objectql, both server packages)
Pre-claim deps: no Blocked-by: on the card; #35165 merged
Prior rulings read: check-prior-rulings.mjs --card 39065 on the two source paths: 26 hit lines (25 in the authz middleware, 1 in concurrent-update-error.ts), none rules on the 404-vs-409 order of a concurrent loser; ADR-0142 D4 (409 to every loser) is the governing text
Serial constraints cleared: check-handover.mjs --inflight on these paths: no readable in-flight surface meets them; none else
Intake: area:data p2, on the maintainer's word 「再开 专区 处理 area:ux area:data p1 p2」 (2026-12-02T22:22Z).
{
"issue": 39065,
"status": "needs_decision",
"branch": "claude/issue-39065-cold-claim-409",
"pr": null,
"head_sha": "755299f4ca9edda94d2a7a5d4a5521e07119ef3f",
"session": "session_01Utp6CYUove7YBXgHy4iEsr",
"premise_still_valid": true,
"summary": "The 404 reproduces on origin/main 9a13387d, but the cause is not a code path that behaves differently when cold. It is scheduling. Fresh bootStack per case, the real SecurityPlugin and sharing, a declared queue whose members are a position, a metadata beforeUpdate hook, engine-level claims: round 0 of every fresh boot answers the loser RECORD_NOT_FOUND/404 under private (4/4 boots) and PERMISSION_DENIED/403 under public_read (4/4). Rounds 1 and 2 answer 409. Without the hook it is the same (4/4 cold 404), so the unit shape is not the cause. Measured cause: on the first request, the permission-set resolution (resolvePermissionSetsForContextUnmemoized, then reportUngrantedNamesakeSets, then the catalog's resolveReference for the namesake and baseline names everyone, org_member and the position name, then MetadataManager.loaderSlotsNamed, then FilesystemLoader.load) misses the loader's caches and waits on real fs.access I/O. Whichever claimant's I/O callback runs first then runs its whole write, gate, BEGIN, conditional update and COMMIT, as one microtask run on the synchronous sql.js driver. The other claimant's I/O callback cannot fire until that run ends, so its step-2.7 pre-image re-read comes after the commit. It sees a row it can no longer read (404) or a row owned by someone else (403). Control: warming those three FilesystemLoader lookups before round 0 turns the cold round into 409 (12/12 rounds over 4 boots). Generalization: the warm 409 depends on both claims running in lockstep, which happens only when the request path does no I/O. One real I/O tick (a failed fs.access) at the head of one claimant's update chain on the platform's own minimal stack (ownership-claim-race-sqlite.test.ts) turns 5 of its 5 cells red, 25/25 rounds each (404 under private, 403 under public_read). Through the REST door (PATCH /data/OBJECT/ID) on bootStack, the loser gets 404 in every round, warm ones too (12/12): request A runs from its session read to its COMMIT before request B reads its session. So the loser is answered whatever a later request gets whenever its gate runs after the winner's commit, and on any networked database that order is the normal one. By the dispatch's own line (409 only for a loser admitted before the winner's commit, with the gate as the admission), the cold loser was not admitted before the commit. Keeping ADR-0142 D4's promise for it means admitting at an earlier point (request arrival or the door) or narrowing the promise. Both are contract decisions the code cannot settle, so nothing was written to the product files and no PR was opened. The evidence probes are pushed to the branch (wip commit 755299f4, not for merge).",
"tests": "All on origin/main 9a13387d plus probes only (no product diff). (1) packages/verify/src/zz-explore-39065.test.ts (pushed at 755299f4), fresh bootStack per case, no warm-up, 3 rounds per boot, loser outcomes per round. engine/beforeUpdate/private: boots 0-3 each [ok|RECORD_NOT_FOUND/404, ok|CONCURRENT_UPDATE/409, ok|CONCURRENT_UPDATE/409]. engine/beforeUpdate/public_read: boots 0-3 each [ok|PERMISSION_DENIED/403, 409, 409]. engine/no hook/private: boots 0-3 each [404, 409, 409]. rest/beforeUpdate/private: boots 0-3 each [404, 404, 404]. With CQX_PREWARM=everyone,org_member,cqx_agent (a getDiagnosed of each before round 0), engine/beforeUpdate/private: boots 0-3 each [409, 409, 409]. Trace (CQX_TRACE, CQX_SECTRACE, CQX_MDTRACE), cold round: both claimants enter authzMiddleware together. One claimant's MetadataManager.loaderSlotsNamed(permission,everyone), then FilesystemLoader.load(permission,everyone), stays pending across the other's BEGIN ... update ... where owner_id is null ... COMMIT, then returns, and its pre-image findOne answers 404. Warm round: both claimants' queries interleave, BEGIN A ... COMMIT A, BEGIN B ... ROLLBACK B, which is 409. (2) packages/plugins/plugin-security/src/zz-iotick-39065.test.ts (pushed): a copy of ownership-claim-race-sqlite.test.ts with one fs.access('/nonexistent') awaited at the head of claimant B's update chain. Tests 5 failed, 2 passed (7). The failed cells read expected { 'RECORD_NOT_FOUND/404': 25 } to deeply equal { 'CONCURRENT_UPDATE/409': 25 } (private) and expected { 'PERMISSION_DENIED/403': 25 } ... (public_read). The unmodified ownership-claim-race-sqlite.test.ts on main: Tests 7 passed (7). No ablation: no tested behaviour was changed.",
"gates": "NOT MEASURED: dispatch-gates family set, reason: needs_decision, no product diff and no PR. The only commit (755299f4) adds two zz-prefixed probe test files that are not meant to merge. Local runs, each through os-verify-lock with exit codes read from the VERDICT line: the build of the plugin-security, runtime and verify upstream closure (OS_SKIP_DTS=1) gave command-exit 0, twice. vitest ownership-claim-race-sqlite.test.ts gave command-exit 0 (7/7). zz-iotick-39065 gave command-exit 1 (5 red, the expected probe result). The zz-explore runs gave exit 0 (the probe asserts only the round count and logs outcomes). The four-arm batch was sequenced with ';' and its verdict is batch-last-exit 0, not a whole-command verdict. Its readings are the logged outcome lines quoted in tests. No CI check-runs exist (no PR).",
"line_budget": "n/a: no product lines changed",
"deviations": [
"Probe files on the branch are outside the dispatch's file surface (packages/verify/src/zz-explore-39065.test.ts and packages/plugins/plugin-security/src/zz-iotick-39065.test.ts). They are evidence only, pushed so the work does not live only in this container, and they must not reach a PR. The branch must be reset, or the files deleted, before implementation.",
"The measured cause (FilesystemLoader cold misses on the request path, in packages/metadata, and the namesake report in plugin-security's security-plugin-permission-sets.ts) lies outside the dispatch's file surface. No edit was made there.",
"The dispatch carried no decision axes and pasted none from pm-dispatch. The options below give cost, effort and leak per option without a self-drafted axis set. The seat may re-frame them on its axes."
],
"files_changed": [
"packages/verify/src/zz-explore-39065.test.ts (probe, not for merge)",
"packages/plugins/plugin-security/src/zz-iotick-39065.test.ts (probe, not for merge)"
],
"mcp_calls": "0",
"api_writes": "1 — POST /repos/objectstack-ai/objectstack/issues/39065/comments (this os-dev-report, via post-stamped). git push x2 (empty-branch probe, evidence commit) are not REST writes.",
"classifier_refusals": [],
"open_questions": [
{
"question": "ADR-0142 D4 promises 409 CONCURRENT_UPDATE to every loser of a concurrent claim. Measured: a loser gets 409 only when its authorization gate reads the record before the winner commits. Any I/O on the loser's request path ahead of the gate (cold metadata loaders; at the REST door, the session read on every request) moves its gate after the commit, and it then gets 404 (private) or 403 (public_read), the answer a later request gets. Where does a claim count as admitted?",
"options": [
"A — Admit at request arrival. For a claim-shaped by-id update (payload owner_id = the caller, scalar), when step 2.7 or 3.5 would refuse, answer 409 only if the row's owner moved from empty to another user AFTER this request arrived and the caller is admitted to the row with owner_id empty (a member of its unchanged queue, an edit share, or modifyAllRecords). Cost: an arrival instant on the execution context (a spec contract change, ExecutionContext) and a per-row record of when ownership last moved and from what (a new stamp column or a field-history read on every refused claim). The leak is bounded to rows claimed while the request was in flight. Effort: L. Spans spec, objectql and plugin-security.",
"B — Narrow the promise to what the code can keep. 409 goes to a loser whose gate reads the record before the winner commits. A loser whose gate runs after the commit gets the later-request answer (404 under private, 403 under public_read), and the Console Claim affordance treats a 404 or 403 straight after a claim as 'no longer available, reload'. Cost: an ADR-0142 D4 amendment (Tier H), the docs line at queues-and-assignment-rules.mdx:137, the Console copy, and HotCRM's assertion accepting 409 or 404, which HotCRM declined to do on its own while the contract says 409. No leak. Effort: S.",
"C — Re-ask on refusal, with no arrival check. When the gate hides or refuses a claim-shaped write, answer 409 if the row now has an owner and the caller would be admitted to it with owner_id empty. Cost: discloses that a row exists to a queue member who could never read it (a row assigned with its queue kept, or claimed long before the request). That breaks the dispatch's no-widening line. Effort: M. Not recommended.",
"D — Narrow the window only. Take cold I/O off the request path: warm or single-flight FilesystemLoader misses, or keep the namesake report off the request path. Measured: the cold engine round becomes 409 (12/12 with the three lookups pre-warmed). The REST door stays 404 in every round (12/12, warm), and so does any networked database. Cost: edits in packages/metadata and plugin-security's permission-sets module, both outside this card's surface. The promise stays false. Effort: S-M. Fits only as a separate performance card beside A or B."
],
"recommendation": "B, because the code cannot decide 'admitted before the winner's commit' at any point earlier than the gate without a new contract (A needs an arrival instant on ExecutionContext and an ownership-history read). It is also the only option that keeps the dispatch's no-widening line with no new surface. A is the option that keeps D4 as written, if the maintainer wants the promise kept. D is a worthwhile separate card either way (cold-request latency) but fixes neither the REST door nor networked stores."
}
],
"security_findings": "none",
"out_of_scope_findings": [
"carrier: this card, noted, not filed: the REST door answers the loser 404 in every round, warm included (12/12 on bootStack with sql.js), because request A runs from its session read to COMMIT before request B reads its session. Same defect family as this card; the decision above covers it.",
"carrier: none, noted, not filed (class: observation, no contract broken): FilesystemLoader resolves a missing name with one fs.access per resolvable extension on the request path, uncached until the first miss, which makes the first authenticated write after boot pay disk I/O inside permission resolution. Dedupe words: FilesystemLoader cold miss, reportUngrantedNamesakeSets, first request latency, loaderSlotsNamed."
]
}
Release: claim 7360762354 (session_01Utp6CYUove7YBXgHy4iEsr, repo:objectstack@os-bill) · to the decision inbox. L1 of the no-PR report 7361376821: premise holds, the fix is a contract choice.
Readings (report 7361376821, measured on origin/main9a13387)
Fresh bootStack per case, real SecurityPlugin and sharing: round 0 loser RECORD_NOT_FOUND/404 under private (4/4 boots), PERMISSION_DENIED/403 under public_read (4/4); rounds 1–2 answer 409. Pre-warming the three FilesystemLoader lookups turns round 0 into 409 (12/12).
One awaited I/O tick at the head of one claimant's update chain turns 5/5 cells of ownership-claim-race-sqlite.test.ts red (25/25 rounds each).
Through the REST door (PATCH /data/OBJECT/ID) the loser gets 404 in every round, warm included (12/12).
Governing text: ADR-0142 D4 and content/docs/automation/queues-and-assignment-rules.mdx:137 (409 to every loser).
Branch claude/issue-39065-cold-claim-409 @ 755299f holds probe files only (zz- prefixed, not for merge); it is reset before any implementation.
pm:dispatched → needs-user-decision, assignee cleared, in this stroke.
不定会怎样:下游 CRM 的并发认领测试继续挂起无法收紧,文档继续承诺一个网页接口上兑现不了的回答,照文档写应用的人和 AI 会继续写出只在单机测试里能通过的认领逻辑。
Served-tier: CONTRACT_REVIEW_TIER
Analysed-by: sub-agent of session_01Utp6CYA8GqMqt51qoMXZpQ
Background
Two queue members claim the same waiting record. Exactly one becomes the owner in every measured run; the data is never wrong. The open point is only what the loser is told. The dev measured (report 7361376821) that the loser hears "taken" (409) only when its permission check read the record before the winner's write committed. If its check runs after the commit, it is answered as any later visitor would be: "not found" (404) where the object is private, "denied" (403) where it is publicly readable. The report measured that a cold process and every request through the HTTP door put the loser's check after the commit, and argues that a networked database will do the same (argued, not measured).
This is the second visit. #35142 (closed by PR #35165) treated the same symptom as a regression and restored the ordering inside one process. Its pin test is engine-level only; no record read for this analysis shows the HTTP door answering 409 after that fix.
Governing text
The written contract says two things, and a late claim fits both.
ADR-0142 D4, "One owner" (grep -n "zero rows answer" docs/adr/0142-*.md → line 443): the write is conditional on the owner still being empty, "so two callers claiming at once produce exactly one owner", and a conditional write that matches "zero rows answer 409 CONCURRENT_UPDATE".
ADR-0142, Codes paragraph (grep -n "lost claim race" docs/adr/0142-*.md → line 685): "CONCURRENT_UPDATE 409 for a lost claim race". This is stated as an outcome, not as a mechanism. The first draft of this analysis did not cite it.
ADR-0142 D4, closing paragraph (grep -n "The refusals stay" docs/adr/0142-*.md → line 461): a claim the gate does not admit stays PERMISSION_DENIED (403), message "claim only an unowned record the sharing model admits you to". So a claim on a record that already has an owner is, by the same ADR, a 403.
content/docs/automation/queues-and-assignment-rules.mdx:137 (grep -n "The loser gets" content/docs/automation/queues-and-assignment-rules.mdx): "two people claiming at once produce exactly one owner. The loser gets 409 CONCURRENT_UPDATE … Any other refusal is 403 PERMISSION_DENIED". The second sentence is also wrong today for a private object, where the answer is 404.
The platform's own race pin (grep -n "never as forbidden" packages/plugins/plugin-security/src/ownership-claim-race-sqlite.test.ts → line 177): a claim on a row owned by someone else that the caller cannot read "answers as not found, never as forbidden".
No packages/spec schema says who receives 409 on a claim; the code CONCURRENT_UPDATE is in the error ledger and stays (grep -n "CONCURRENT_UPDATE" packages/spec/src/api/error-code-ledger.zod.ts → lines 745, 902 and 1384 register the code, and none of them speaks of claims). The ADR does not define "at once" or "lost race". It promises 409 for a lost race and 403 for a claim on an owned record, and a claim whose check runs just after the winner's commit is both. The existing texts cannot settle it, which is why this is a decision and not a bug.
It is fair to say the project has so far read the text as "every loser gets 409": #35142 was filed, graded and fixed as a bug on that reading, and the race pin's header says the loser is "never 'not found' and never 'forbidden' because it lost a race". Option B therefore narrows a promise as the project has read it. It is not a pure wording fix, and the first draft's sentence "the mechanism is the promise" was too generous to B.
Option A changes the protocol (a new field on the execution context; a per-row record of ownership moves). Option B changes no schema; it amends the ADR and the docs. Options C and E change what the permission gate answers.
Premises (read on origin/main53ca731; each with its re-check)
The gate admits a claim only when the record it reads under the caller's own sight is unowned, and only then arms the conditional write. grep -n "CLAIM — an unowned record" packages/plugins/plugin-security/src/security-plugin-authz-middleware.ts → line 2245. Run and read for this analysis: holds (lines 2194-2195 and 2251-2259).
A claim on a record that already has an owner does not reach that branch for an ordinary member. The earlier row check answers first: 404 if the caller cannot read the row (lines 1675-1682 of the same file), 403 if the caller can read but not edit it (lines 1684-1714). Read for this analysis: holds. This is why a click from a stale page gets 404 or 403 with no code change (options B and D), and under A by A's own definition (the owner moved before the request arrived, so A's condition for 409 is false).
The Console re-reads the record after any claim answer and, for an answer that is not 409, shows the server's own sentence. grep -n "detail.claimFailed" ui/packages/app-shell/src/views/RecordDetailView.tsx → line 2610; the re-read is line 2615. Run and read: holds. The 404 sentence is "This record does not exist, or you do not have access to it." as quoted in 18.6.0 regression: the loser of two concurrent updates on SQLite gets 404 RECORD_NOT_FOUND instead of 409 CONCURRENT_UPDATE #35142; the string was found in packages/spec/src/system/operation-message.ts, but the Console was not run for this analysis.
Ordering is the cause; the HTTP door answers 404 in every round (12/12); one I/O tick turns five of the race pin's cells red (25/25 rounds each); pre-warming three lookups turns the cold round back to 409 (12/12). Not re-run for this analysis; all from report 7361376821 (probe branch claude/issue-39065-cold-claim-409 @ 755299f). Re-check: pnpm --filter @objectstack/plugin-security exec vitest run src/zz-iotick-39065.test.ts on that branch.
A claim leaves the record's home queue set, and a member can create an owned record that names a home queue. Read for this analysis: ui/packages/plugin-detail/src/queueClaim.ts lines 180-183, and the gate's insert branch at lines 2130-2137. This is what makes option C's disclosure real (see C below).
No premise failed. Two statements of the first draft were corrected: the line reference (441 → 443) and the reading of D4 (see Protocol statement).
The question
When two people reach for the same waiting record, which of them is owed the sentence "someone took it first", and what is the other one told?
Options × real cost × workload
A to D are the dev report's options. E was found in this analysis and is not measured.
What is done
What the customer sees
Workload
A · admit at arrival
Stamp each request's arrival time on the execution context; keep, per row, when its owner last moved and from what (a stamp column, or a field-history read on each refused claim, per the report); when the gate would refuse a claim, answer 409 if the owner moved from empty after this request arrived and the caller would have been admitted to the row while it was unowned.
A loser whose request was already in flight hears "taken". A click on a page that went stale two seconds ago still hears "not found" or "denied". For the length of a request, the server confirms a record the caller can no longer read (the report: "leak bounded to rows claimed while the request was in flight").
server + spec · the report sizes it L across spec, the engine and the security plugin · no landed precedent, so no PR count is claimed
B · define the promise
ADR-0142 gains a dated note: 409 goes to a claim whose check saw the record unowned and whose write then found it taken; a claim whose check runs after the owner is set gets the answer any request gets at that moment (404 if the caller cannot read the record, 403 if it can). The docs paragraph is rewritten. The Console shows one sentence for 404 and 403 on a claim and reloads. The race pin asserts "one owner; loser answered from the set", with an I/O-tick case and an HTTP-door case.
Every loser and every stale click reads one plain sentence and sees the refreshed record. An API client reads 409, 404 or 403 and treats all three as "not yours, move on". Which of the three arrives depends on timing.
ADR (Tier H) + ui + server test · 2 PRs · precedent for the test half: PR #35165, +222/−5, 3 files (read from the PR)
C · re-ask on refusal
After a refusal of a claim, read the row again above the caller's sight and answer 409 if it now has an owner and the caller would have been admitted to it unowned.
Every loser hears "taken", stale clicks included: one answer, the same on every run. A member of a record's home queue who holds its id learns that it exists and has an owner, including a record they were never able to read (premise 5).
server · the report sizes it M · no precedent
D · warm the cold path
Take the cold file reads off the first request.
The first request after a restart is faster and, in an embedded single-process setup, answers 409 (report: 12/12). The HTTP door is unchanged (report: 404 in 12/12).
server · the report sizes it S-M · no precedent
E · "taken" wherever the caller can see it
B, plus: when the caller can read the row and it has another owner, a claim answers 409 where it answers 403 today.
On publicly readable objects every loser hears "taken", and nothing is disclosed (the caller can read the owner anyway). On private objects the same as B.
server, inside the general row check that runs before the ownership gate · not sized · no precedent
What each option means in business terms
A: a ticket counter that timestamps everyone who joined the line and, after the last ticket is gone, tells exactly those who were already in line "you just missed it" while telling the next walk-in "we have nothing".
B: the counter tells you what you are allowed to know at the moment you reach the window: "taken" if you were watching it go, otherwise "nothing here for you"; the screen above the counter then shows the current board.
C: the counter confirms to any member of the team a ticket belongs to that the ticket exists and has been taken, even one that was never on that member's board.
D: opening the counter faster in the morning. It is a speed improvement, not an answer to the question.
E: B, plus the counter says "taken" about any ticket that is on public display anyway.
Four axes
Long-term soundness (weighted at least half). The end state to design for is a call-centre or service-desk app on a networked database with several server processes, where dozens of agents work one queue and AI-written automations claim work too. Two written rules meet on this card: "the loser of a claim race gets 409" and "a record you cannot read does not exist for you". Under a private sharing model a claimed record leaves the other members' sight at once (ADR-0142 D3), so for a loser whose check runs after the commit the two rules cannot both hold. The options differ in which rule gives way.
B keeps the visibility rule whole and scopes the 409 to those who saw the record unowned. The resulting rule is the ordinary optimistic-concurrency one: a conflict is reported to a writer that held the earlier state, and everyone else is answered from the current state. HTTP conditional requests work this way. So, as far as recalled and not verified against vendor documentation, does the second agent's Accept on a queue case in Salesforce (an access error, not a "taken" notice). B adds no special case, no clock and no column.
A keeps the 409 for in-flight losers by opening the visibility rule for the length of a request. It pays with a time comparison inside the permission gate (an arrival instant taken on one server against an ownership stamp written by another, in a window of milliseconds), a context field every data door must fill, a per-row ownership record, and a question the claim branch as read asks nowhere today: "would this caller have been admitted to a state of the row that no longer exists". After all that the stale click is still 404 or 403, so the Console and every client need B's handling as well.
D leaves both rules as they are and the promise false on the HTTP door.
E removes the one place where B's answer depends on timing with no visibility reason behind it (publicly readable objects). It does so by adding a claim-shaped exception to the general row check that every write passes.
B is the only option that ends with fewer special cases than today. Its real long-term cost is that the answer a loser receives depends on timing, which clients must be told plainly.
Real business pull. Who meets this today: the downstream CRM's concurrency test (blocked, per the card), and any agent on a busy queue. In a working queue the common loser is not the millisecond tie but the agent who clicks Claim on a page a colleague emptied seconds ago; that is a judgement about queue work, not a measurement. On a private object that click is answered 404 under A, B, D and E alike, and today the Console shows it as a missing-record error (premise 3). The measured pull is for an honest written rule that the downstream test can pin, and for a clear sentence in the Console. No card or customer asks for telling in-flight losers apart from late arrivals (A), and the one measured deployment is a private object, where E changes nothing.
Guarding against AI mistakes. The present docs sentence teaches an AI author to assert "409" in an app test and to branch only on 409 in a custom claim button. That code passes on an embedded single-process test and fails over HTTP, quietly: the user of the generated button sees a generic error. This is how the downstream test broke. B writes down the closed set (409, 404 and 403 all mean "not yours; reload or move on") and one invariant to assert (exactly one owner), so a generated test fails loudly only when a second owner appears. A keeps the simple sentence but makes it true only inside a window the author cannot see or reproduce in a test. C is the strongest on this axis alone (one answer), which is the honest argument for it. B's weak point is that 404 also means "deleted" and 403 also means "never admitted"; a client cannot tell these from a lost race, and for a claim it does not need to.
Startup focus. B declares nothing new: no key, no column, no gate. A declares a context field and an ownership record that every future data door and driver must honour. C and E each add a rule to the permission gate. D is separate performance work.
① Long-term soundness: B keeps the "unreadable means nonexistent" rule whole and adds no special case; A opens that rule for a time window and adds a clock comparison, a context field and a per-row record to the gate; C gives the rule up for home-queue members; E adds a claim exception to the general row check; D leaves the promise false over HTTP.
② Business pull: measured pull is the blocked downstream test (dev report) and the Console's missing-record message on a late claim; zero pull for telling in-flight losers from late arrivals, and zero for publicly readable objects.
③ AI-mistake guard: B documents the closed answer set and the one-owner invariant, so a generated test fails loudly on a second owner only; A keeps a sentence that stays false for late arrivals; C alone gives one answer, at the cost of the disclosure.
④ No sprawl: B declares nothing; A declares one context field and one ownership record for good; C and E each add a gate rule; no option adds a CI gate.
Prior rulings read: "concurrent claim" 409 (issue search) → 29 hits, 3 on topic (#35142 closed by PR #35165, #35188 closed as its duplicate, this card); ADR-0142 D4, its Codes paragraph and merge questions 6 and 16, plus #21771 (title and the gate's citation only); thread: none.
Recommendation
B. On the long-term axis alone: answer a claim from what the caller may see of the record when its check runs, keep "unreadable means nonexistent" without exception, write the three answers and the one-owner invariant into the ADR and the docs, and give the Console one sentence for every way of not getting the record.
On the rule that a contract must not bend to the implementation: B is recommended because the 409 promise, read as "every loser", collides with another written and pinned contract (the visibility ruling), not because the code finds it hard. Every option that keeps "every loser" on a private object breaks that ruling, A for a time window and C always. Where no such collision exists (publicly readable objects), B does leave a timing-dependent 403 that only the implementation explains. E is the repair for that; it is not recommended now because nothing pulls it and it adds a gate exception.
Not A: the largest and most permanent cost (protocol field, per-row record, clocks compared inside the permission gate), it still opens the visibility rule, and the stale click still needs B's Console and client handling. No customer-visible difference was found that would pay for it. The workload gap against B is large (the report: L against S), but the readings on the first axis are not close, so the gap is not what decides.
Not C: it lets a home-queue member who holds a record id confirm a record they may not read. The disclosure is narrow and C is the simplest contract for clients, but it reverses a pinned security answer. That call is the maintainer's and is not recommended here.
Not D as the answer: a worthwhile speed-up of the first request after a restart, as its own low-priority card. It changes nothing over HTTP.
Not E now: zero pull, and a new exception in the row check every write passes. File it only when a deployment with a publicly readable queue object asks.
Self-check: on ① alone the choice is B; do ②③④ flip it: no.
Confidence gaps. (a) The project has read D4 as "every loser gets 409" before (#35142, the race pin's header). If the maintainer holds that reading as the contract, B is a narrowing, and A is the only option that keeps most of the promise without C's standing disclosure. This analysis recommends B because of the collision with the visibility ruling, and says so openly. (b) "A networked database makes the late order the normal one" is the dev's argument and was not measured on one; the HTTP-door measurement (12/12) is on the embedded SQL driver. (c) All measurements in premise 4 are the dev's, not re-run for this analysis. (d) The vendor comparison is from recall. (e) That stale clicks outnumber same-instant ties is a judgement about queue work, not a count. (f) The sizes of A, C and D are the dev's letters; no precedent exists and no PR count is claimed for them.
After the ruling (if B)
One Tier H PR: a dated amendment note in ADR-0142 D4 and in its Codes paragraph (line 685) stating the three answers, who gets which, and that "exactly one owner" is the invariant; the docs paragraph at queues-and-assignment-rules.mdx:137 rewritten to match, including that a private object answers 404. Status codes, messages and the gate are unchanged.
One PR for the Console and the pin: a claim answered 404 or 403 shows one sentence ("This record is no longer waiting to be claimed.") and reloads, as the 409 path already does; the wording does not say "someone claimed it", because a 404 can also be a deleted record. The race pin's header is corrected, and the pin gains an I/O-tick case and an HTTP-door case that assert one owner and a loser answered from the set. The probe branch is reset first.
The downstream CRM card is unblocked once the note lands: its assertion becomes "exactly one owner; each loser answered 409, 404 or 403", which is then the contract, not a workaround.
The seat files one low-priority performance card for the cold first-request file reads (option D). It blocks nothing.
Option E is not filed. It is recorded here so that a later request from a deployment with a publicly readable queue object has a starting point.
If A instead: the seat files a spec card for the context field and the ownership record first, and this card waits on it. If C: it goes to the security lane before any code, with the visibility ruling (#21771) named as the text being amended.
Ruled: 2026-12-03T00:56Z · option B — define the promise. 409 CONCURRENT_UPDATE goes to a claim whose check saw the record unowned and whose write then found it taken. A claim whose check runs after the owner is set gets the answer any request gets at that moment: 404 if the caller cannot read the record, 403 if it can. "Exactly one owner" is the invariant. No arrival-time admission (option A), no re-ask on refusal (option C).
Authority: Bill (os-bill), one decision card in the project app, answered at 2026-12-03T00:55Z. Card 「定一下:同时认领时,没抢到的人该被告知什么?」, option verbatim 「B 把承诺写准」 (its text on the card: 「抢先提示只给检查时还看得到记录的人,晚一步的按不存在或无权限回答;控制台统一提示并刷新。约 2 个 PR。」). The card was put to him with the analysis in comment 7361680320 on this card, recommendation B, and with the note that B narrows the earlier "every loser gets 409" reading.
Ruled terms. (1) One Tier H PR: a dated amendment note in ADR-0142 D4 and in its Codes paragraph stating the three answers, who gets which, and the one-owner invariant; the docs paragraph rewritten to match, including that a private object answers 404. (2) Status codes, messages and the ownership gate are unchanged; no spec schema, context field or column is added. (3) One PR for the Console and the pin: a claim answered 404 or 403 shows one sentence ("This record is no longer waiting to be claimed.", with its translations) and reloads as the 409 path does; the wording does not say someone claimed it, because a 404 can also be a deleted record. The race pin's header is corrected and the pin gains an I/O-tick case and an HTTP-door case asserting one owner and a loser answered from the set 409, 404, 403. (4) The probe branch claude/issue-39065-cold-claim-409 is reset before any implementation; its two zz- probe files reach no PR. (5) The downstream CRM card (Ownership queues: tighten the losing-claim assertion back to 409 CONCURRENT_UPDATE once a release carries objectstack#35142 hotcrm#2642) is unblocked once the ADR note is on main: its assertion becomes "exactly one owner; each loser answered 409, 404 or 403".
Premise clause. The dev re-runs premises 1 to 3 and 5 of comment 7361680320 before writing. Named, falsifiable premise: with one I/O tick ahead of one claimant, every round still ends with exactly one owner and the loser answered from the set. Ban: if any round shows two owners, or a loser answered outside the set, the dev reports a fork; no fallback to option A or C and no change to the gate's answers.
Not ruled here: option D (cold first-request file reads), which the seat files as its own low-priority performance card and which blocks nothing; option E (409 wherever the caller can read the row), recorded in the analysis and not filed.
State: this write moves the card needs-user-decision → pm:queue, no assignee.
Claim: PM loop round 2
Session: session_01Utp6CYUove7YBXgHy4iEsr
Account: os-bill
Branch: claude/issue-39065-cold-claim-409
Worktree: objectstack-issue-39065
Domain: domain:ui
Seat: repo:objectstack@os-bill
Area: data-p2 (zone of seat repo:objectstack@os-bill, intake area:data p1/p2)
File surface: ui/packages/plugin-detail/src/queueClaim.ts and the plugin-detail translation bundle files the new sentence needs (reason: ruled term (3), the Console sentence on a 404 or 403 straight after a claim, reloading as the 409 path does), packages/plugins/plugin-security/src/ownership-claim-race-sqlite.test.ts (reason: ruled term (3), header corrected, an I/O-tick case), one new test file named for this card for the HTTP-door case (where the dev finds the REST harness), one changeset (stop on breach; explain in the report)
Container & model: M, mode:subagent, model: default — dispatch-gates --tier: "The tier stays below the ceiling: with no mandate the PM picks floor or default per card", effort: high
Clause-②: no
Metadata-protocol: none
Responsibility: plugin-detail (Console) and plugin-security pins in this repo: a claim loser whose check runs after the winner's commit gets 404 or 403 and the Console shows a raw refusal | ruling 7363773549 option B defines the three answers; the 409 path already reloads | every queue member claiming in the Console
Ruling-ref: 7363773549
Thread-read: 7363773549
Premise: corrected 7363773549 — the card's "409 to every loser" premise is replaced by ruling B; the dev re-runs premises 1 to 3 and 5 of analysis 7361680320 before writing, and reports a fork if any round shows two owners or a loser answered outside {409, 404, 403}
Pre-claim lane: domain:ui for the Console file; the race pin is a plugin-security test (server); one PR as ruled
Pre-claim deps: no Blocked-by: on this card; ruled term (1), the Tier H ADR-0142 D4 note and the docs paragraph, is carried by #39223 (seat-routed, not this zone); ruled term (4), the probe branch is reset to origin/main before any implementation (its two zz- probe files reach no PR)
Prior rulings read: ruling 7363773549 (option B) binds; the #21771 visibility ruling ("a row the caller cannot READ is a row that does not exist") stands whole; ADR-0142 D4 is amended by #39223, not here
Serial constraints cleared: check-handover.mjs --inflight on ui/packages/plugin-detail/src/queueClaim.ts and the race test: only this zone's own #38517 directory claim meets packages/plugins/plugin-security/src/; PR #39216 does not touch the race test file (its file list read); none else
Intake: area:data p2, on the maintainer's word 「再开 专区 处理 area:ux area:data p1 p2」 (2026-12-02T22:22Z).
{
"issue": 39065,
"status": "done",
"branch": "claude/issue-39065-cold-claim-409",
"pr": "https://github.com/objectstack-ai/objectstack/pull/39238",
"pr_number": 39238,
"head_sha": "55b556c019be7ca7c136b21d79fb693e28c2b95b",
"session": "session_01Utp6CYUove7YBXgHy4iEsr",
"premise_still_valid": true,
"summary": "Ruled term (3) of ruling B (7363773549). Console: claimQueuedRecord reports a 404 or 403 as outcome 'unavailable'; RecordDetailView.handleClaim shows 'This record is no longer waiting to be claimed.' (detail.claimUnavailable, 11 locales) and re-reads the record, as the 409 path does. Race pin header corrected per ruling B, plus two I/O-tick cells (private, public_read) asserting exactly one owner and a loser from {409,404,403}. New packages/verify/src/claim-race-http-door-39065.test.ts runs concurrent PATCH /data/OBJECT/ID on a booted stack, same invariant. Measured: one I/O tick ahead, every round one owner (private loser 404 25/25; public_read 403 25/25); HTTP door private 404 4/4, public_read 403 4/4. PM assumption falsified: the 409 toast and reload live in ui/packages/app-shell/src/views/RecordDetailView.tsx and the claim sentences in ui/packages/i18n/src/locales/*.ts. The dev's relay pr_create was refused by the auto-mode classifier; the maintainer approved opening it on the zone decision card (2026-12-03T02:18Z) and the zone opened it from the dev's prepared action file.",
"tests": "Red first at 784f5b55: queueClaim-25769.test.tsx 3 failed / 13 passed; after fix with all-locales-key-parity 65/65 passed. Ablation of the 404/403 'unavailable' line: 3 failed; restored blob == HEAD. ownership-claim-race-sqlite.test.ts 9/9; claim-race-http-door-39065.test.ts 2/2 (24 s wall on a shared box).",
"gates": "dispatch-gates --ran at 55b556c01: 75 derived, 73 run (all exit 0), 2 NOT-MEASURED (check:dual-build-cjs-loads, check:i18n: prerequisite not met), 0 UNRUN. Type-check plugin-detail, i18n, plugin-security, verify exit 0; app-shell type-check NOT MEASURED (unbuilt closure, 386 TS2307 cascade errors, none at edited lines). CI to come on the PR.",
"line_budget": "+301/-10 over 17 files; product lines: queueClaim.ts, 4 lines in RecordDetailView.tsx, 11 locale lines; rest tests and changeset",
"deviations": [
"Relay pr_create refused by the classifier in the dev's session; opened by the zone after the maintainer's approval.",
"File surface: ui/packages/app-shell/src/views/RecordDetailView.tsx, ui/packages/i18n/src/locales/*.ts (11), packages/verify/src/claim-race-http-door-39065.test.ts, ui/packages/plugin-detail/src/queueClaim-25769.test.tsx (the bare-403 'other refusal' pin now uses 400 VALIDATION_FAILED) — claim amended.",
"ui/AGENTS.md #2 docs update not done: content/docs/** is carried by #39223 (ruled term 1)."
],
"declarations": "Clause-②: no · Metadata-protocol: none · Ruling-ref: 7363773549 · Skills-docs: follow-up owed — skills/objectstack-data/rules/security.md, skills/objectstack-data/evals/hooks-security-seeds-datasources.json · changeset patch: @object-ui/plugin-detail, @object-ui/i18n",
"open_questions": [],
"security_findings": "none",
"out_of_scope_findings": [
"carrier #39223: the published skill security.md and its eval still teach '409 only' for the claim loser; skills follow-up owed."
]
}
Claim amendment (claim 7363867578): File surface adds ui/packages/app-shell/src/views/RecordDetailView.tsx (the only consumer of claimQueuedRecord, where the 409 toast and reload live), ui/packages/i18n/src/locales/*.ts (11 locales, key detail.claimUnavailable; plugin-detail has no bundle of its own), ui/packages/plugin-detail/src/queueClaim-25769.test.tsx and packages/verify/src/claim-race-http-door-39065.test.ts (the REST harness lives in verify). Reason: the order's assumption that the sentence lives in plugin-detail was falsified by the dev.
PR #39238 was opened by the zone after the maintainer approved it on the zone decision card (tapped 2026-12-03T02:18Z); the dev's own relay pr_create had been refused by the auto-mode classifier.
Activity
objectstack-fleet commentedon Dec 2, 2026
triage@os-warren · os-warren · session_01JQwxbZzZ2f5mzcvJbRrRNZ
First touch · 2026-12-02T07:13Z
定级:
area:data · Bug · p2 · 进程启动后第一次并发认领,输家拿到 404 而不是承诺的 409(#35142 残留)· HotCRM 7/7 冷进程复现area:datadomain:serverpriority:p2、类型 Bug,进pm:queue。来源 Ownership queues: tighten the losing-claim assertion back to 409 CONCURRENT_UPDATE once a release carries objectstack#35142 hotcrm#2642。objectstack-fleet commentedon Dec 2, 2026
repo:objectstack@os-bill · os-bill · session_01Utp6CYUove7YBXgHy4iEsr
Self-audit (execution-duties 自分诊 ③): triage first touch 7337930739 (triage@os-warren,
area:data · Bug · p2) is on this card;card-pick.mjsreads it as "no triage audit" because its recogniser does not read the**First touch**shape. Route and grade unchanged.Claim: PM loop round 1
Session:
session_01Utp6CYUove7YBXgHy4iEsrAccount:
os-billBranch:
claude/issue-39065-cold-claim-409Worktree:
objectstack-issue-39065Domain:
domain:serverSeat:
repo:objectstack@os-billArea:
data-p2(zone of seat repo:objectstack@os-bill, intake area:data p1/p2)File surface:
packages/plugins/plugin-security/src/security-plugin-authz-middleware.ts,packages/objectql/src/engine-top-level.ts,packages/objectql/src/concurrent-update-error.ts, and a new test file named for this card besideownership-claim-race-sqlite.test.ts(reason: the card's unproven mechanism is the loser's authorization pre-read answering 404 before the version check answers 409; the dev measures which of these files owns it before writing) (stop on breach; explain in the report)Container & model:
M,mode:subagent,model: default — dispatch-gates --tier: "The tier stays below the ceiling: with no mandate the PM picks floor or default per card",effort: highClause-②: no
Metadata-protocol: none
Responsibility:
plugin-security / objectql in this repo: the loser of a cold-process concurrent claim gets 404 RECORD_NOT_FOUND where ADR-0142 D4 promises 409 CONCURRENT_UPDATE | #35142 / PR #35165 fixed the warm case only; no path covers the first race after boot | every app using queue claims (HotCRM measured 7/7 cold processes)Thread-read: 7337930739
Premise: holds (filer's measurement on the 19.0.0-next.3 pin, 7/7 cold processes; mechanism unproven) — the dev re-measures on
origin/mainbefore writing code; no reproduction ⇒premise_still_valid: false, no PRPre-claim lane:
domain:server(paths above are plugin-security and objectql, both server packages)Pre-claim deps: no
Blocked-by:on the card; #35165 mergedPrior rulings read:
check-prior-rulings.mjs --card 39065on the two source paths: 26 hit lines (25 in the authz middleware, 1 in concurrent-update-error.ts), none rules on the 404-vs-409 order of a concurrent loser; ADR-0142 D4 (409 to every loser) is the governing textSerial constraints cleared:
check-handover.mjs --inflighton these paths: no readable in-flight surface meets them; none elseIntake: area:data p2, on the maintainer's word 「再开 专区 处理 area:ux area:data p1 p2」 (2026-12-02T22:22Z).
objectstack-fleet commentedon Dec 2, 2026
repo:objectstack@os-bill · os-bill · session_01Utp6CYUove7YBXgHy4iEsr
os-dev-report
{ "issue": 39065, "status": "needs_decision", "branch": "claude/issue-39065-cold-claim-409", "pr": null, "head_sha": "755299f4ca9edda94d2a7a5d4a5521e07119ef3f", "session": "session_01Utp6CYUove7YBXgHy4iEsr", "premise_still_valid": true, "summary": "The 404 reproduces on origin/main 9a13387d, but the cause is not a code path that behaves differently when cold. It is scheduling. Fresh bootStack per case, the real SecurityPlugin and sharing, a declared queue whose members are a position, a metadata beforeUpdate hook, engine-level claims: round 0 of every fresh boot answers the loser RECORD_NOT_FOUND/404 under private (4/4 boots) and PERMISSION_DENIED/403 under public_read (4/4). Rounds 1 and 2 answer 409. Without the hook it is the same (4/4 cold 404), so the unit shape is not the cause. Measured cause: on the first request, the permission-set resolution (resolvePermissionSetsForContextUnmemoized, then reportUngrantedNamesakeSets, then the catalog's resolveReference for the namesake and baseline names everyone, org_member and the position name, then MetadataManager.loaderSlotsNamed, then FilesystemLoader.load) misses the loader's caches and waits on real fs.access I/O. Whichever claimant's I/O callback runs first then runs its whole write, gate, BEGIN, conditional update and COMMIT, as one microtask run on the synchronous sql.js driver. The other claimant's I/O callback cannot fire until that run ends, so its step-2.7 pre-image re-read comes after the commit. It sees a row it can no longer read (404) or a row owned by someone else (403). Control: warming those three FilesystemLoader lookups before round 0 turns the cold round into 409 (12/12 rounds over 4 boots). Generalization: the warm 409 depends on both claims running in lockstep, which happens only when the request path does no I/O. One real I/O tick (a failed fs.access) at the head of one claimant's update chain on the platform's own minimal stack (ownership-claim-race-sqlite.test.ts) turns 5 of its 5 cells red, 25/25 rounds each (404 under private, 403 under public_read). Through the REST door (PATCH /data/OBJECT/ID) on bootStack, the loser gets 404 in every round, warm ones too (12/12): request A runs from its session read to its COMMIT before request B reads its session. So the loser is answered whatever a later request gets whenever its gate runs after the winner's commit, and on any networked database that order is the normal one. By the dispatch's own line (409 only for a loser admitted before the winner's commit, with the gate as the admission), the cold loser was not admitted before the commit. Keeping ADR-0142 D4's promise for it means admitting at an earlier point (request arrival or the door) or narrowing the promise. Both are contract decisions the code cannot settle, so nothing was written to the product files and no PR was opened. The evidence probes are pushed to the branch (wip commit 755299f4, not for merge).", "tests": "All on origin/main 9a13387d plus probes only (no product diff). (1) packages/verify/src/zz-explore-39065.test.ts (pushed at 755299f4), fresh bootStack per case, no warm-up, 3 rounds per boot, loser outcomes per round. engine/beforeUpdate/private: boots 0-3 each [ok|RECORD_NOT_FOUND/404, ok|CONCURRENT_UPDATE/409, ok|CONCURRENT_UPDATE/409]. engine/beforeUpdate/public_read: boots 0-3 each [ok|PERMISSION_DENIED/403, 409, 409]. engine/no hook/private: boots 0-3 each [404, 409, 409]. rest/beforeUpdate/private: boots 0-3 each [404, 404, 404]. With CQX_PREWARM=everyone,org_member,cqx_agent (a getDiagnosed of each before round 0), engine/beforeUpdate/private: boots 0-3 each [409, 409, 409]. Trace (CQX_TRACE, CQX_SECTRACE, CQX_MDTRACE), cold round: both claimants enter authzMiddleware together. One claimant's MetadataManager.loaderSlotsNamed(permission,everyone), then FilesystemLoader.load(permission,everyone), stays pending across the other's BEGIN ... update ... where owner_id is null ... COMMIT, then returns, and its pre-image findOne answers 404. Warm round: both claimants' queries interleave, BEGIN A ... COMMIT A, BEGIN B ... ROLLBACK B, which is 409. (2) packages/plugins/plugin-security/src/zz-iotick-39065.test.ts (pushed): a copy of ownership-claim-race-sqlite.test.ts with one fs.access('/nonexistent') awaited at the head of claimant B's update chain. Tests 5 failed, 2 passed (7). The failed cells read expected { 'RECORD_NOT_FOUND/404': 25 } to deeply equal { 'CONCURRENT_UPDATE/409': 25 } (private) and expected { 'PERMISSION_DENIED/403': 25 } ... (public_read). The unmodified ownership-claim-race-sqlite.test.ts on main: Tests 7 passed (7). No ablation: no tested behaviour was changed.", "gates": "NOT MEASURED: dispatch-gates family set, reason: needs_decision, no product diff and no PR. The only commit (755299f4) adds two zz-prefixed probe test files that are not meant to merge. Local runs, each through os-verify-lock with exit codes read from the VERDICT line: the build of the plugin-security, runtime and verify upstream closure (OS_SKIP_DTS=1) gave command-exit 0, twice. vitest ownership-claim-race-sqlite.test.ts gave command-exit 0 (7/7). zz-iotick-39065 gave command-exit 1 (5 red, the expected probe result). The zz-explore runs gave exit 0 (the probe asserts only the round count and logs outcomes). The four-arm batch was sequenced with ';' and its verdict is batch-last-exit 0, not a whole-command verdict. Its readings are the logged outcome lines quoted in tests. No CI check-runs exist (no PR).", "line_budget": "n/a: no product lines changed", "deviations": [ "Probe files on the branch are outside the dispatch's file surface (packages/verify/src/zz-explore-39065.test.ts and packages/plugins/plugin-security/src/zz-iotick-39065.test.ts). They are evidence only, pushed so the work does not live only in this container, and they must not reach a PR. The branch must be reset, or the files deleted, before implementation.", "The measured cause (FilesystemLoader cold misses on the request path, in packages/metadata, and the namesake report in plugin-security's security-plugin-permission-sets.ts) lies outside the dispatch's file surface. No edit was made there.", "The dispatch carried no decision axes and pasted none from pm-dispatch. The options below give cost, effort and leak per option without a self-drafted axis set. The seat may re-frame them on its axes." ], "files_changed": [ "packages/verify/src/zz-explore-39065.test.ts (probe, not for merge)", "packages/plugins/plugin-security/src/zz-iotick-39065.test.ts (probe, not for merge)" ], "mcp_calls": "0", "api_writes": "1 — POST /repos/objectstack-ai/objectstack/issues/39065/comments (this os-dev-report, via post-stamped). git push x2 (empty-branch probe, evidence commit) are not REST writes.", "classifier_refusals": [], "open_questions": [ { "question": "ADR-0142 D4 promises 409 CONCURRENT_UPDATE to every loser of a concurrent claim. Measured: a loser gets 409 only when its authorization gate reads the record before the winner commits. Any I/O on the loser's request path ahead of the gate (cold metadata loaders; at the REST door, the session read on every request) moves its gate after the commit, and it then gets 404 (private) or 403 (public_read), the answer a later request gets. Where does a claim count as admitted?", "options": [ "A — Admit at request arrival. For a claim-shaped by-id update (payload owner_id = the caller, scalar), when step 2.7 or 3.5 would refuse, answer 409 only if the row's owner moved from empty to another user AFTER this request arrived and the caller is admitted to the row with owner_id empty (a member of its unchanged queue, an edit share, or modifyAllRecords). Cost: an arrival instant on the execution context (a spec contract change, ExecutionContext) and a per-row record of when ownership last moved and from what (a new stamp column or a field-history read on every refused claim). The leak is bounded to rows claimed while the request was in flight. Effort: L. Spans spec, objectql and plugin-security.", "B — Narrow the promise to what the code can keep. 409 goes to a loser whose gate reads the record before the winner commits. A loser whose gate runs after the commit gets the later-request answer (404 under private, 403 under public_read), and the Console Claim affordance treats a 404 or 403 straight after a claim as 'no longer available, reload'. Cost: an ADR-0142 D4 amendment (Tier H), the docs line at queues-and-assignment-rules.mdx:137, the Console copy, and HotCRM's assertion accepting 409 or 404, which HotCRM declined to do on its own while the contract says 409. No leak. Effort: S.", "C — Re-ask on refusal, with no arrival check. When the gate hides or refuses a claim-shaped write, answer 409 if the row now has an owner and the caller would be admitted to it with owner_id empty. Cost: discloses that a row exists to a queue member who could never read it (a row assigned with its queue kept, or claimed long before the request). That breaks the dispatch's no-widening line. Effort: M. Not recommended.", "D — Narrow the window only. Take cold I/O off the request path: warm or single-flight FilesystemLoader misses, or keep the namesake report off the request path. Measured: the cold engine round becomes 409 (12/12 with the three lookups pre-warmed). The REST door stays 404 in every round (12/12, warm), and so does any networked database. Cost: edits in packages/metadata and plugin-security's permission-sets module, both outside this card's surface. The promise stays false. Effort: S-M. Fits only as a separate performance card beside A or B." ], "recommendation": "B, because the code cannot decide 'admitted before the winner's commit' at any point earlier than the gate without a new contract (A needs an arrival instant on ExecutionContext and an ownership-history read). It is also the only option that keeps the dispatch's no-widening line with no new surface. A is the option that keeps D4 as written, if the maintainer wants the promise kept. D is a worthwhile separate card either way (cold-request latency) but fixes neither the REST door nor networked stores." } ], "security_findings": "none", "out_of_scope_findings": [ "carrier: this card, noted, not filed: the REST door answers the loser 404 in every round, warm included (12/12 on bootStack with sql.js), because request A runs from its session read to COMMIT before request B reads its session. Same defect family as this card; the decision above covers it.", "carrier: none, noted, not filed (class: observation, no contract broken): FilesystemLoader resolves a missing name with one fs.access per resolvable extension on the request path, uncached until the first miss, which makes the first authenticated write after boot pay disk I/O inside permission resolution. Dedupe words: FilesystemLoader cold miss, reportUngrantedNamesakeSets, first request latency, loaderSlotsNamed." ] }objectstack-fleet commentedon Dec 2, 2026
repo:objectstack@os-bill · os-bill · session_01Utp6CYUove7YBXgHy4iEsr
Release: claim 7360762354 (
session_01Utp6CYUove7YBXgHy4iEsr,repo:objectstack@os-bill) · to the decision inbox. L1 of the no-PR report 7361376821: premise holds, the fix is a contract choice.维护者速读
Readings (report 7361376821, measured on
origin/main9a13387)bootStackper case, real SecurityPlugin and sharing: round 0 loserRECORD_NOT_FOUND/404 underprivate(4/4 boots),PERMISSION_DENIED/403 underpublic_read(4/4); rounds 1–2 answer 409. Pre-warming the threeFilesystemLoaderlookups turns round 0 into 409 (12/12).ownership-claim-race-sqlite.test.tsred (25/25 rounds each).PATCH /data/OBJECT/ID) the loser gets 404 in every round, warm included (12/12).content/docs/automation/queues-and-assignment-rules.mdx:137(409 to every loser).claude/issue-39065-cold-claim-409@ 755299f holds probe files only (zz-prefixed, not for merge); it is reset before any implementation.pm:dispatched→needs-user-decision, assignee cleared, in this stroke.objectstack-fleet commentedon Dec 2, 2026
repo:objectstack@os-bill · os-bill · session_01Utp6CYA8GqMqt51qoMXZpQ
Decision analysis · 2026-12-02T23:10Z · for the release 7361410364 and the os-dev report 7361376821.
维护者速读
Served-tier: CONTRACT_REVIEW_TIER
Analysed-by: sub-agent of session_01Utp6CYA8GqMqt51qoMXZpQ
Background
Two queue members claim the same waiting record. Exactly one becomes the owner in every measured run; the data is never wrong. The open point is only what the loser is told. The dev measured (report 7361376821) that the loser hears "taken" (409) only when its permission check read the record before the winner's write committed. If its check runs after the commit, it is answered as any later visitor would be: "not found" (404) where the object is private, "denied" (403) where it is publicly readable. The report measured that a cold process and every request through the HTTP door put the loser's check after the commit, and argues that a networked database will do the same (argued, not measured).
This is the second visit. #35142 (closed by PR #35165) treated the same symptom as a regression and restored the ordering inside one process. Its pin test is engine-level only; no record read for this analysis shows the HTTP door answering 409 after that fix.
Governing text
The written contract says two things, and a late claim fits both.
grep -n "zero rows answer" docs/adr/0142-*.md→ line 443): the write is conditional on the owner still being empty, "so two callers claiming at once produce exactly one owner", and a conditional write that matches "zero rows answer 409CONCURRENT_UPDATE".grep -n "lost claim race" docs/adr/0142-*.md→ line 685): "CONCURRENT_UPDATE409 for a lost claim race". This is stated as an outcome, not as a mechanism. The first draft of this analysis did not cite it.grep -n "The refusals stay" docs/adr/0142-*.md→ line 461): a claim the gate does not admit staysPERMISSION_DENIED(403), message "claim only an unowned record the sharing model admits you to". So a claim on a record that already has an owner is, by the same ADR, a 403.content/docs/automation/queues-and-assignment-rules.mdx:137(grep -n "The loser gets" content/docs/automation/queues-and-assignment-rules.mdx): "two people claiming at once produce exactly one owner. The loser gets409 CONCURRENT_UPDATE… Any other refusal is403 PERMISSION_DENIED". The second sentence is also wrong today for a private object, where the answer is 404.grep -n "Ruling A on the write doors" packages/plugins/plugin-security/src/security-plugin-authz-middleware.ts→ line 1640; card 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, a closed security card about by-id writes revealing whether a hidden record exists): "a row the caller cannot READ is a row that does not exist." ADR-0142 D3 adds that a queue record is "gone the instant a claim lands" for the other members.grep -n "never as forbidden" packages/plugins/plugin-security/src/ownership-claim-race-sqlite.test.ts→ line 177): a claim on a row owned by someone else that the caller cannot read "answers as not found, never as forbidden".grep -n "Tier H" AGENTS.md→ line 276):docs/adr/**is Tier H.Protocol statement
No
packages/specschema says who receives 409 on a claim; the codeCONCURRENT_UPDATEis in the error ledger and stays (grep -n "CONCURRENT_UPDATE" packages/spec/src/api/error-code-ledger.zod.ts→ lines 745, 902 and 1384 register the code, and none of them speaks of claims). The ADR does not define "at once" or "lost race". It promises 409 for a lost race and 403 for a claim on an owned record, and a claim whose check runs just after the winner's commit is both. The existing texts cannot settle it, which is why this is a decision and not a bug.It is fair to say the project has so far read the text as "every loser gets 409": #35142 was filed, graded and fixed as a bug on that reading, and the race pin's header says the loser is "never 'not found' and never 'forbidden' because it lost a race". Option B therefore narrows a promise as the project has read it. It is not a pure wording fix, and the first draft's sentence "the mechanism is the promise" was too generous to B.
Option A changes the protocol (a new field on the execution context; a per-row record of ownership moves). Option B changes no schema; it amends the ADR and the docs. Options C and E change what the permission gate answers.
Premises (read on
origin/main53ca731; each with its re-check)grep -n "CLAIM — an unowned record" packages/plugins/plugin-security/src/security-plugin-authz-middleware.ts→ line 2245. Run and read for this analysis: holds (lines 2194-2195 and 2251-2259).grep -n "detail.claimFailed" ui/packages/app-shell/src/views/RecordDetailView.tsx→ line 2610; the re-read is line 2615. Run and read: holds. The 404 sentence is "This record does not exist, or you do not have access to it." as quoted in 18.6.0 regression: the loser of two concurrent updates on SQLite gets 404 RECORD_NOT_FOUND instead of 409 CONCURRENT_UPDATE #35142; the string was found inpackages/spec/src/system/operation-message.ts, but the Console was not run for this analysis.claude/issue-39065-cold-claim-409@ 755299f). Re-check:pnpm --filter @objectstack/plugin-security exec vitest run src/zz-iotick-39065.test.tson that branch.ui/packages/plugin-detail/src/queueClaim.tslines 180-183, and the gate's insert branch at lines 2130-2137. This is what makes option C's disclosure real (see C below).No premise failed. Two statements of the first draft were corrected: the line reference (441 → 443) and the reading of D4 (see Protocol statement).
The question
When two people reach for the same waiting record, which of them is owed the sentence "someone took it first", and what is the other one told?
Options × real cost × workload
A to D are the dev report's options. E was found in this analysis and is not measured.
What each option means in business terms
Four axes
Long-term soundness (weighted at least half). The end state to design for is a call-centre or service-desk app on a networked database with several server processes, where dozens of agents work one queue and AI-written automations claim work too. Two written rules meet on this card: "the loser of a claim race gets 409" and "a record you cannot read does not exist for you". Under a private sharing model a claimed record leaves the other members' sight at once (ADR-0142 D3), so for a loser whose check runs after the commit the two rules cannot both hold. The options differ in which rule gives way.
B is the only option that ends with fewer special cases than today. Its real long-term cost is that the answer a loser receives depends on timing, which clients must be told plainly.
Real business pull. Who meets this today: the downstream CRM's concurrency test (blocked, per the card), and any agent on a busy queue. In a working queue the common loser is not the millisecond tie but the agent who clicks Claim on a page a colleague emptied seconds ago; that is a judgement about queue work, not a measurement. On a private object that click is answered 404 under A, B, D and E alike, and today the Console shows it as a missing-record error (premise 3). The measured pull is for an honest written rule that the downstream test can pin, and for a clear sentence in the Console. No card or customer asks for telling in-flight losers apart from late arrivals (A), and the one measured deployment is a private object, where E changes nothing.
Guarding against AI mistakes. The present docs sentence teaches an AI author to assert "409" in an app test and to branch only on 409 in a custom claim button. That code passes on an embedded single-process test and fails over HTTP, quietly: the user of the generated button sees a generic error. This is how the downstream test broke. B writes down the closed set (409, 404 and 403 all mean "not yours; reload or move on") and one invariant to assert (exactly one owner), so a generated test fails loudly only when a second owner appears. A keeps the simple sentence but makes it true only inside a window the author cannot see or reproduce in a test. C is the strongest on this axis alone (one answer), which is the honest argument for it. B's weak point is that 404 also means "deleted" and 403 also means "never admitted"; a client cannot tell these from a lost race, and for a claim it does not need to.
Startup focus. B declares nothing new: no key, no column, no gate. A declares a context field and an ownership record that every future data door and driver must honour. C and E each add a rule to the permission gate. D is separate performance work.
Prior rulings read: "concurrent claim" 409 (issue search) → 29 hits, 3 on topic (#35142 closed by PR #35165, #35188 closed as its duplicate, this card); ADR-0142 D4, its Codes paragraph and merge questions 6 and 16, plus #21771 (title and the gate's citation only); thread: none.
Recommendation
B. On the long-term axis alone: answer a claim from what the caller may see of the record when its check runs, keep "unreadable means nonexistent" without exception, write the three answers and the one-owner invariant into the ADR and the docs, and give the Console one sentence for every way of not getting the record.
On the rule that a contract must not bend to the implementation: B is recommended because the 409 promise, read as "every loser", collides with another written and pinned contract (the visibility ruling), not because the code finds it hard. Every option that keeps "every loser" on a private object breaks that ruling, A for a time window and C always. Where no such collision exists (publicly readable objects), B does leave a timing-dependent 403 that only the implementation explains. E is the repair for that; it is not recommended now because nothing pulls it and it adds a gate exception.
Self-check: on ① alone the choice is B; do ②③④ flip it: no.
Confidence gaps. (a) The project has read D4 as "every loser gets 409" before (#35142, the race pin's header). If the maintainer holds that reading as the contract, B is a narrowing, and A is the only option that keeps most of the promise without C's standing disclosure. This analysis recommends B because of the collision with the visibility ruling, and says so openly. (b) "A networked database makes the late order the normal one" is the dev's argument and was not measured on one; the HTTP-door measurement (12/12) is on the embedded SQL driver. (c) All measurements in premise 4 are the dev's, not re-run for this analysis. (d) The vendor comparison is from recall. (e) That stale clicks outnumber same-instant ties is a judgement about queue work, not a count. (f) The sizes of A, C and D are the dev's letters; no precedent exists and no PR count is claimed for them.
After the ruling (if B)
queues-and-assignment-rules.mdx:137rewritten to match, including that a private object answers 404. Status codes, messages and the gate are unchanged.If A instead: the seat files a spec card for the context field and the ownership record first, and this card waits on it. If C: it goes to the security lane before any code, with the visibility ruling (#21771) named as the text being amended.
Related: #35142, PR #35165, #35188, #21771, objectstack-ai/hotcrm#2642.
objectstack-fleet commentedon Dec 3, 2026
repo:objectstack@os-bill · os-bill · session_01Utp6CYA8GqMqt51qoMXZpQ
Ruled: 2026-12-03T00:56Z · option B — define the promise.
409 CONCURRENT_UPDATEgoes to a claim whose check saw the record unowned and whose write then found it taken. A claim whose check runs after the owner is set gets the answer any request gets at that moment: 404 if the caller cannot read the record, 403 if it can. "Exactly one owner" is the invariant. No arrival-time admission (option A), no re-ask on refusal (option C).CONCURRENT_UPDATE409 for a lost claim race"), which this ruling amends;content/docs/automation/queues-and-assignment-rules.mdx:137; the visibility ruling the gate cites from 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 ("a row the caller cannot READ is a row that does not exist"), which stands whole; AGENTS.md Prime Directive feat: Comprehensive CRM example demonstrating all ObjectStack protocol features #14 (docs/adr/**is Tier H).claude/issue-39065-cold-claim-409is reset before any implementation; its twozz-probe files reach no PR. (5) The downstream CRM card (Ownership queues: tighten the losing-claim assertion back to 409 CONCURRENT_UPDATE once a release carries objectstack#35142 hotcrm#2642) is unblocked once the ADR note is onmain: its assertion becomes "exactly one owner; each loser answered 409, 404 or 403".needs-user-decision→pm:queue, no assignee.objectstack-fleet commentedon Dec 3, 2026
repo:objectstack@os-bill · os-bill · session_01Utp6CYUove7YBXgHy4iEsr
Claim: PM loop round 2
Session:
session_01Utp6CYUove7YBXgHy4iEsrAccount:
os-billBranch:
claude/issue-39065-cold-claim-409Worktree:
objectstack-issue-39065Domain:
domain:uiSeat:
repo:objectstack@os-billArea:
data-p2(zone of seat repo:objectstack@os-bill, intake area:data p1/p2)File surface:
ui/packages/plugin-detail/src/queueClaim.tsand the plugin-detail translation bundle files the new sentence needs (reason: ruled term (3), the Console sentence on a 404 or 403 straight after a claim, reloading as the 409 path does),packages/plugins/plugin-security/src/ownership-claim-race-sqlite.test.ts(reason: ruled term (3), header corrected, an I/O-tick case), one new test file named for this card for the HTTP-door case (where the dev finds the REST harness), one changeset (stop on breach; explain in the report)Container & model:
M,mode:subagent,model: default — dispatch-gates --tier: "The tier stays below the ceiling: with no mandate the PM picks floor or default per card",effort: highClause-②: no
Metadata-protocol: none
Responsibility:
plugin-detail (Console) and plugin-security pins in this repo: a claim loser whose check runs after the winner's commit gets 404 or 403 and the Console shows a raw refusal | ruling 7363773549 option B defines the three answers; the 409 path already reloads | every queue member claiming in the ConsoleRuling-ref: 7363773549
Thread-read: 7363773549
Premise: corrected 7363773549 — the card's "409 to every loser" premise is replaced by ruling B; the dev re-runs premises 1 to 3 and 5 of analysis 7361680320 before writing, and reports a fork if any round shows two owners or a loser answered outside {409, 404, 403}
Pre-claim lane:
domain:uifor the Console file; the race pin is a plugin-security test (server); one PR as ruledPre-claim deps: no
Blocked-by:on this card; ruled term (1), the Tier H ADR-0142 D4 note and the docs paragraph, is carried by #39223 (seat-routed, not this zone); ruled term (4), the probe branch is reset toorigin/mainbefore any implementation (its twozz-probe files reach no PR)Prior rulings read: ruling 7363773549 (option B) binds; the #21771 visibility ruling ("a row the caller cannot READ is a row that does not exist") stands whole; ADR-0142 D4 is amended by #39223, not here
Serial constraints cleared:
check-handover.mjs --inflightonui/packages/plugin-detail/src/queueClaim.tsand the race test: only this zone's own #38517 directory claim meetspackages/plugins/plugin-security/src/; PR #39216 does not touch the race test file (its file list read); none elseIntake: area:data p2, on the maintainer's word 「再开 专区 处理 area:ux area:data p1 p2」 (2026-12-02T22:22Z).
objectstack-fleet commentedon Dec 3, 2026
repo:objectstack@os-bill · os-bill · session_01Utp6CYUove7YBXgHy4iEsr
os-dev-report
{ "issue": 39065, "status": "done", "branch": "claude/issue-39065-cold-claim-409", "pr": "https://github.com/objectstack-ai/objectstack/pull/39238", "pr_number": 39238, "head_sha": "55b556c019be7ca7c136b21d79fb693e28c2b95b", "session": "session_01Utp6CYUove7YBXgHy4iEsr", "premise_still_valid": true, "summary": "Ruled term (3) of ruling B (7363773549). Console: claimQueuedRecord reports a 404 or 403 as outcome 'unavailable'; RecordDetailView.handleClaim shows 'This record is no longer waiting to be claimed.' (detail.claimUnavailable, 11 locales) and re-reads the record, as the 409 path does. Race pin header corrected per ruling B, plus two I/O-tick cells (private, public_read) asserting exactly one owner and a loser from {409,404,403}. New packages/verify/src/claim-race-http-door-39065.test.ts runs concurrent PATCH /data/OBJECT/ID on a booted stack, same invariant. Measured: one I/O tick ahead, every round one owner (private loser 404 25/25; public_read 403 25/25); HTTP door private 404 4/4, public_read 403 4/4. PM assumption falsified: the 409 toast and reload live in ui/packages/app-shell/src/views/RecordDetailView.tsx and the claim sentences in ui/packages/i18n/src/locales/*.ts. The dev's relay pr_create was refused by the auto-mode classifier; the maintainer approved opening it on the zone decision card (2026-12-03T02:18Z) and the zone opened it from the dev's prepared action file.", "tests": "Red first at 784f5b55: queueClaim-25769.test.tsx 3 failed / 13 passed; after fix with all-locales-key-parity 65/65 passed. Ablation of the 404/403 'unavailable' line: 3 failed; restored blob == HEAD. ownership-claim-race-sqlite.test.ts 9/9; claim-race-http-door-39065.test.ts 2/2 (24 s wall on a shared box).", "gates": "dispatch-gates --ran at 55b556c01: 75 derived, 73 run (all exit 0), 2 NOT-MEASURED (check:dual-build-cjs-loads, check:i18n: prerequisite not met), 0 UNRUN. Type-check plugin-detail, i18n, plugin-security, verify exit 0; app-shell type-check NOT MEASURED (unbuilt closure, 386 TS2307 cascade errors, none at edited lines). CI to come on the PR.", "line_budget": "+301/-10 over 17 files; product lines: queueClaim.ts, 4 lines in RecordDetailView.tsx, 11 locale lines; rest tests and changeset", "deviations": [ "Relay pr_create refused by the classifier in the dev's session; opened by the zone after the maintainer's approval.", "File surface: ui/packages/app-shell/src/views/RecordDetailView.tsx, ui/packages/i18n/src/locales/*.ts (11), packages/verify/src/claim-race-http-door-39065.test.ts, ui/packages/plugin-detail/src/queueClaim-25769.test.tsx (the bare-403 'other refusal' pin now uses 400 VALIDATION_FAILED) — claim amended.", "ui/AGENTS.md #2 docs update not done: content/docs/** is carried by #39223 (ruled term 1)." ], "declarations": "Clause-②: no · Metadata-protocol: none · Ruling-ref: 7363773549 · Skills-docs: follow-up owed — skills/objectstack-data/rules/security.md, skills/objectstack-data/evals/hooks-security-seeds-datasources.json · changeset patch: @object-ui/plugin-detail, @object-ui/i18n", "open_questions": [], "security_findings": "none", "out_of_scope_findings": [ "carrier #39223: the published skill security.md and its eval still teach '409 only' for the claim loser; skills follow-up owed." ] }objectstack-fleet commentedon Dec 3, 2026
repo:objectstack@os-bill · os-bill · session_01Utp6CYUove7YBXgHy4iEsr
Claim amendment (claim 7363867578): File surface adds
ui/packages/app-shell/src/views/RecordDetailView.tsx(the only consumer of claimQueuedRecord, where the 409 toast and reload live),ui/packages/i18n/src/locales/*.ts(11 locales, keydetail.claimUnavailable; plugin-detail has no bundle of its own),ui/packages/plugin-detail/src/queueClaim-25769.test.tsxandpackages/verify/src/claim-race-http-door-39065.test.ts(the REST harness lives in verify). Reason: the order's assumption that the sentence lives in plugin-detail was falsified by the dev.PR #39238 was opened by the zone after the maintainer approved it on the zone decision card (tapped 2026-12-03T02:18Z); the dev's own relay pr_create had been refused by the auto-mode classifier.