Skip to content

Commit 05ae041

Browse files
committed
docs(adr): ADR-0142 — apply the delta review's round-6 nit
D9 says the PR adds CONCURRENT_UPDATE's objectql ledger row; Context §1 names both doors that compare the version, updateData and deleteData. Claude-Session: https://claude.ai/code/session_017BFhbTnbbHcXkSnMss2btn Co-authored-by: Claude <noreply@anthropic.com>
1 parent e765768 commit 05ae041

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

‎docs/adr/0142-ownership-queue-membership-claim-and-assignment-rules.md‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,8 @@ Every shipped driver therefore answers it, and the contract still allows a drive
203203
conditional-update contract already: `PATCH` and `DELETE` take an opt-in `If-Match` header or `expectedVersion` token
204204
(`packages/spec/src/api/protocol.zod.ts`, `packages/rest/src/crud-routes.ts`) and answer **409 `CONCURRENT_UPDATE`** when
205205
it differs from the row's `updated_at` (`packages/metadata-protocol/src/protocol.ts#ConcurrentUpdateError`) — compared in
206-
`updateData` over the existence probe, before `engine.update`, so it is compare-then-write, not atomic.
206+
`updateData` (over the existence probe, before `engine.update`) and in `deleteData` (`assertVersionMatch`, reading the row
207+
itself), so it is compare-then-write, not atomic.
207208

208209
### 2. The pull — HotCRM at `8f52859`
209210

@@ -573,7 +574,9 @@ at merge (the card's own words; HotCRM `AGENTS.md` rule 2: *merged is not availa
573574
words co-exist as `sys_team` and `team` do.
574575
- **Codes** (ADR-0112 D1, D3 — registered in the ledger by the PR): `PERMISSION_DENIED` 403 for a refused claim, release,
575576
move or supplied queue; `CONCURRENT_UPDATE` 409 for a lost claim race — the ledger's existing code for a write another
576-
writer beat, so the verb carries one 409, not two (ADR-0112 D1); one new code, `QUEUE_NOT_FOUND` 422, only for a
577+
writer beat, so the verb carries one 409, not two (ADR-0112 D1); the ledger is keyed by the stamping package, and the
578+
PR adds the row under `@objectstack/objectql`, where the claim's 409 is raised; one new code, `QUEUE_NOT_FOUND` 422,
579+
only for a
577580
caller-supplied `queue` that resolves nowhere in the row's organization. A rule's unresolved target is never a refusal
578581
(D5). D3's registration refusal is thrown at `registerObject`, a door Studio and the metadata API reach at request
579582
time, so it carries the ADR-0112 envelope the registry's other field refusals carry — `INVALID_METADATA`, 422, as
@@ -734,7 +737,7 @@ objection names the number.
734737
16. **The by-id write precondition (`expect`) is engine-internal — set by the gate for a claim and by the assignment seam
735738
for the cursor, reachable from no data door — and the data API's existing optimistic concurrency stays where it is.**
736739
`PATCH` and `DELETE` already take `If-Match` / `expectedVersion` and answer 409 `CONCURRENT_UPDATE`, compared in
737-
`updateData` before `engine.update` (Context §1): compare-then-write. The alternative lowers that check onto the same
740+
`updateData` / `deleteData` before the engine write (Context §1): compare-then-write. The alternative lowers that check onto the same
738741
precondition (`expect: { updated_at: <token> }`), making today's optimistic concurrency atomic for every client
739742
already sending the token; its cost is moving the comparison into the write while preserving what the protocol
740743
layer settles around it — the probe-first ordering (404 before 409), the token normalisation, and the conflict's

0 commit comments

Comments
 (0)