claude-code-cli / claude-sonnet-5-5 / low / low effort preferred over claude-code-cli / claude-haiku-5-5 / medium / medium effort · close win.
Primary judge: Sol 6.1, requested Low. Effective provider effort and internal attempts were not verified. A close win is still a scored preference; it does not establish a material defect.
Reviewed public evidence
Task goal
Read-only architecture analysis. A worker receives an at-leastonce queue message, performs a durable side effect, then acknowledges. It can crash after the effect and before the ACK. The producer assigns a stable operation ID and the effect store supports conditional inserts. Design the smallest reliable execution contract, including duplicate handling, successful and failed acknowledgment ordering, and user-visible completion. Explain why acknowledging first or generating a fresh ID on retry fails. No tools or executed-test claims. Three numbered items, under180words.
claude-code-cli / claude-sonnet-5-5 / low / low effort answer
1. **Contract:** The producer assigns a stable `opId` and the worker uses it as the effect key. The worker runs one conditional insert, `INSERT effect(opId, result) IF NOT EXISTS`, which commits the effect and its completion record atomically. If the insert succeeds, the worker ACKs. If it reports the key already exists, the effect was already applied by an earlier attempt, so the worker skips the effect, reads the stored result, and ACKs. The insert is the single source of truth for "done", and duplicates are harmless no-ops.
2. **Ordering:**
- **Success:** effect committed or found, then ACK.
- **Failure:** on a transient error or crash, do not ACK or insert. The broker redelivers, and the same `opId` makes the retry safe. For a permanent failure, record a terminal failure under the same `opId` (or dead-letter the message), then ACK.
- **User-visible completion:** derive it from the effect record, not from the ACK. Show "done" only once the `opId` row exists. A crash between effect and ACK then leaves the user correctly seeing "done", and the redelivery just ACKs.
3. **Why the alternatives fail:**
- **ACK first:** a crash after the ACK and before the effect loses the work permanently. The broker believes it is done, and nothing is durable. This gives at-most-once delivery.
- **Fresh ID per retry:** the conditional insert cannot recognize the earlier attempt, so the effect is applied twice. Dedup needs an ID that is the same across attempts.
claude-code-cli / claude-haiku-5-5 / medium / medium effort answer
1. **Execution contract.** The worker conditionally inserts `{opId, PENDING, leaseToken, leaseExpiry}`, performs the effect, conditionally marks the record `DONE` with its result, and only then ACKs. On conflict: `DONE` means ACK and skip; a live `PENDING` lease means no ACK, so the message is redelivered later; an expired lease means conditionally reclaim with a new token and retry. Permanent failure means conditionally mark `FAILED` with a reason, then ACK. Transient failure means no ACK.
2. **Why the alternatives fail.** ACKing before the effect turns a crash into permanent loss (at-most-once). A fresh ID on retry passes every conditional insert, so the effect runs again. Only the producer's stable `opId` deduplicates.
3. **User-visible completion.** Show "complete" only after the `DONE` record is committed and read by `opId`, never on ACK or on the effect call returning. Show `PENDING` as in progress and `FAILED` with its reason. Confidence is moderate: exactly-once requires the effect and the record to share a durability domain, or the target to honor `opId` as an idempotency key. The packet doesn't specify either, nor the queue's lease semantics.Primary judge's stated reason
Prefer A for avoiding B's separate effect-to-DONE crash window and unnecessary lease machinery in the central execution design. This is a weak preference, not a proven material quality gap: B expressly identifies the missing reliability condition and handles terminal status more clearly, while A's completion wording is ambiguous for failed operations.
This reason is the judge's assessment. No independent factual-defect finding is asserted by this record.
Battle wave: 5445eeb0-b4b5-4bfd-a365-2ddf55296fda. Pair: brp1_bdd4fc7908fb7922f5c2215f5caed5168946d94a842a89d7d7e179ff37112bd3. A separate independent review is required before calling a concern a verified factual defect. Judge disagreement is not recorded here.