← Model losses

Head-to-head comparison

xai / grok-4.7-efficient / xhigh / xhigh effort preferred over xai / grok-4.7-efficient / 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

Design ownership of non-safety-critical scheduled jobs across three regions. Networks partition, clocks skew, region workers pause and resume, and job execution can trigger irreversible external API side effects without idempotency support. Define authoritative lease epochs, fencing limits, quorum behavior, degraded availability, ambiguous effect handling, manual reconciliation and auditability. Explain which guarantees are impossible and give partition/crash/rejoin acceptance traces without claiming exactly-once effects.

Give one coherent design with explicit requirements, assumptions and alternatives, state/invariant/transaction details appropriate to the stated scope, and measurable pass/fail acceptance checks. Do not invent benchmark measurements, provider costs, source inspection, executed tests or objective passes. Every contributor must independently answer the complete identical question; there are no separate roles, files or tool evidence.

xai / grok-4.7-efficient / xhigh / xhigh effort answer

The design below is fail-closed epoch leasing with a quorum-committed pre-effect barrier and ambiguity quarantine. It is reasoning from the problem statement only. No system was inspected, and nothing here was executed.

## 1. Design

**Recommendation:** For each scheduled occurrence, a 3-region quorum is the only authority that may grant a monotonic lease epoch. A worker may transmit the irreversible call only after that epoch’s pre-effect record has committed. If the process may already have put bytes on the wire and the success ack is missing, the occurrence is quarantined. No later epoch is granted until a human certifies no effect. Delay is accepted. Automatic duplicate dispatch is not.

**Confidence:** Medium-high on the protocol invariants under crash faults and partitions. Low on fit to any existing scheduler or API, because no source, API contract, or store was provided.

### Requirements

1. Identity of an occurrence is `(job_id, nominal_slot)`, not “whichever region clock fired first.”
2. At most one epoch may be authorized to dispatch that occurrence, and at most one automatic dispatch may be attempted, unless a human later certifies that no effect happened.
3. A minority partition must not grant, renew, or dispatch.
4. Wall-clock skew must not create, extend, or transfer execution rights.
5. Pause, crash, lost ack, or lease expiry after a possible send must not be treated as “safe to retry.”
6. Every grant, fence, dispatch authorization, outcome, and human close is append-only auditable.
7. Without quorum, new execution stops. Stalling is acceptable because the jobs are non-safety-critical.
8. The design must not be described as exactly-once, effectively-once, or duplicate-free in the external system.

### Assumptions

- Three regions, crash faults only. A buggy or Byzantine worker can still call the API; fencing does not restrain the external service.
- A majority store can commit compare-and-swap transitions (Raft or equivalent). The log is the authority.
- The external API has no idempotency key, no fence-token check, and no reliable “did this occurrence already happen?” query. A success response is evidence only of a response, not of uniqueness.
- Operators can sometimes determine the external outcome out of band, and can act on a quorum-committed reconciliation.
- Clock skew is assumed bounded by an operator parameter `ε`. That bound is an assumption, not a measurement.
- “Non-safety-critical” is interpreted as “stall and repair by hand,” not “duplicates are cheap.” If product owners prefer duplicates over delay, this design is the wrong one.

### Authoritative lease epoch

An epoch is `(occurrence_id, fence)`, where `fence` is a quorum-assigned integer that only increases. The holder is `(region, worker_generation)`. A paused process keeps its old generation; a restarted worker must CAS a new generation before it can act. In-memory lease state is never authority.

Lease lifetime is a committed record plus renewals, not a local timer. The holder may continue only while it holds a fresh quorum renew ack for that same fence. A fast local clock cannot extend a lease. A slow local clock may only cause an early abort, which is safe.

### Fencing limits

These are operator parameters, not measured values: lease `TTL`, renew period `Tr`, assumed skew `ε`, dispatch budget `Dmax`, local freshness `Tf`.

- Require `TTL >= 3*Tr + 2*ε` so one lost renew and skew do not look like a second owner.
- Dispatch is allowed only when all of the following hold: applied log shows this holder and fence; pre-effect for this fence is committed; no local send record exists yet; last renew ack is younger than `Tf`; remaining committed window is greater than `Dmax`.
- If remaining window is too small, do not send. Renew or release.
- Fence expiry stops a worker from starting a call. It does not recall a call already sent. The external API will not see the fence.
- After pre-effect commit, a superseded or expired epoch is not reassigned. It becomes ambiguous.

### Quorum and degraded availability

`N=3`, grant/renew/pre-effect/outcome/reconcile require 2. One region down: the other two may still lease. A singleton partition: no grant, no renew, no dispatch. Total partition: no new calls; occurrences stay pending or, if pre-effect already committed, ambiguous.

A holder that loses quorum stops starting calls immediately. It does not wait out a local TTL if renew has failed. If it had not committed pre-effect, a later majority may expire and reassign that fence. If pre-effect had committed, the majority already sees it and must not reassign.

Reachability does not override quorum. A region that can reach the API but not a majority still must not call. Before pre-effect, a holder that cannot reach the API releases the lease so another region may take it. After pre-effect, it cannot hand off.

### State, invariants, transactions

States: `PENDING`, `LEASED`, `ATTEMPTING`, `DONE_ACK`, `FAILED_NO_EFFECT`, `AMBIGUOUS`, `RECONCILED_EFFECT`, `RECONCILED_NO_EFFECT`, `WAIVED`.

Invariants:

- One row per `(job_id, nominal_slot)`, inserted idempotently.
- `fence` never decreases. At most one `PRE_EFFECT` exists until a human sets `RECONCILED_NO_EFFECT`.
- `DONE_ACK` is allowed only for the fence that committed pre-effect, and only as an observation of an ack, including a late ack after rejoin.
- Automatic transition back to leasable requires `FAILED_NO_EFFECT` or human `RECONCILED_NO_EFFECT`.
- `ATTEMPTING` and `AMBIGUOUS` are not leasable.

Transactions, each a quorum CAS:

1. **Grant.** From `PENDING` or `RECONCILED_NO_EFFECT`, if fence is the expected value: increment fence, set `LEASED`, holder, generation, leader-time expiry. Append audit.
2. **Renew.** Same fence and holder only. Extends committed expiry. Rejected if fenced or expired.
3. **Pre-effect.** From `LEASED`, same fence and holder, window still covers `Dmax`: set `ATTEMPTING`. This commit is the point of no automatic return.
4. **Local send barrier.** After applying pre-effect, the holder durably records `SEND_STARTED` locally, then transmits once. Crash before that local record, with local disk intact and this generation the only sender: may commit `FAILED_NO_EFFECT`. Crash after it, lost disk, lost ack, or pause across the send: `AMBIGUOUS`.
5. **Ack.** Same fence, from `ATTEMPTING`: `DONE_ACK` plus response digest. A late ack after expiry attaches to that same fence; it is not permission to send again.
6. **Expire without pre-effect.** Majority may fence and return the occurrence to leasable.
7. **Expire or suspect with pre-effect.** Majority sets `AMBIGUOUS`. No new fence is granted.

Grant is refused until nominal slot time is reached on the quorum leader’s clock, minus `ε`. Early regional clocks cannot open the slot. Late clocks only delay proposals.

### Ambiguous effects

Ambiguous means: pre-effect committed, or local send may have started, and no trustworthy terminal observation exists. Timeouts, partitions, pauses, and crashes are the same state. The system does not guess. It does not start a compensating call. It alerts and waits.

`FAILED_NO_EFFECT` is narrow. “The API timed out” is not in it. “TCP connected” is not in it. Only a holder that still owns the fence and can show it did not start the send may use it. If that proof is gone, the state is ambiguous.

### Manual reconciliation and audit

The decision log is the audit log. Each entry has occurrence, fence, from/to state, actor, consensus index, leader time, local time, and reason. Human time and leader time may disagree; the index is the order.

An operator closes `AMBIGUOUS` with exactly one quorum entry: effect observed, no effect observed, or waived. Each carries operator id, ticket id, and an evidence note. Effect or waive is terminal. No-effect sets a retry bit and allows a later grant to take a new fence. The gap between automatic quarantine and human close must remain visible. There is no silent auto-close.

### Guarantees that are impossible

- Exactly-once external effects. A crash or partition between send and ack cannot be distinguished from “never arrived” or “arrived and will complete later” (two generals). Leases do not cross that boundary.
- Recalling an in-flight call by incrementing a fence, unless the API itself enforces the token. It does not.
- Proving a dead worker did not send, if its disk or process state was lost after pre-effect.
- Progress during a quorum loss, while also preventing a minority from dispatching.
- Using wall clocks to order or own work across regions under skew.
- A bounded execution delay. Partition delay is unbounded by choice.
- Making `DONE_ACK` mean “the external world observed this once.” It means “this epoch observed one success response.”

What is possible: at most one quorum-authorized automatic attempt; no minority grant; ambiguity preserved instead of retried; every authorization and human override audited.

### Acceptance traces

These are pass/fail predicates on the log and on whether a worker transmitted. They were not run.

**Partition, no pre-effect.** R1 holds fence 7. R1 becomes a minority and its renew fails. Pass: R1 transmits nothing further; after expiry the majority may grant fence 8; the log shows fence 7 ended without `PRE_EFFECT`. Fail: any send from R1 after failed renew, or two `PRE_EFFECT` rows.

**Partition after pre-effect.** Fence 7’s pre-effect is committed, then R1 is isolated and may still be inside the call. Pass: majority sets `AMBIGUOUS` and grants no fence 8; R1 on rejoin may attach an ack to fence 7 only. Fail: a second grant, a second send, or an automatic move to `PENDING`.

**Crash before local send record.** Pass: recovery commits `FAILED_NO_EFFECT` or leaves it leasable after fence expiry, and a later epoch may run. Fail: recovery transmits again under the same fence.

**Crash or pause after send started, ack missing.** Pass: state becomes `AMBIGUOUS`; resumed worker does not transmit again; new generation is refused for that fence. Fail: resume retries the call, or a peer treats timeout as `FAILED_NO_EFFECT`.

**Clock jump.** One region’s clock jumps forward by more than `TTL`. Pass: it neither self-grants nor extends the committed expiry; dispatch still requires a fresh quorum renew. Fail: local time alone opens a slot or keeps a fence alive.

**Total partition, then rejoin.** Pass: zero new pre-effects during the split; on rejoin, a single majority history remains; stale renews for an old fence are rejected. Fail: two committed grants for the same occurrence, or a stale holder’s success path opening a new attempt.

**Human close.** Pass: `RECONCILED_NO_EFFECT` is the only path from `AMBIGUOUS` to a new fence, and the audit entry has a human actor. Fail: a timer, a worker vote, or a region rejoin clears ambiguity.

## 2. Alternatives discarded

- Active-passive VIP or “region with the newest timestamp wins”: split brain under partition and pause. No fence.
- At-least-once relay or outbox: durable intent only. Without an idempotent API it still duplicates.
- Two-phase commit with the API: the API is not a participant.
- CRDT ownership: concurrent owners under partition.
- Auto-retry on timeout: directly violates the irreversible-effect constraint.
- Human approval before every dispatch: safe but rejects the scheduling goal. Humans are reserved for ambiguity.
- Sticky home region with no failover: simpler and avoids cross-region lease races, but a home-region outage stalls its jobs even when another region has quorum and API reachability. Reasonable fallback if quorum operations are unavailable. It does not meet multi-region takeover.
- Invert the policy to at-least-once duplicates: coherent only if duplicate external effects are explicitly cheaper than delay. The problem statement does not say that.

## 3. Missing evidence

No scheduler, store, API, clock-sync, or operator workflow was in evidence. Consequences: `ε`, `TTL`, `Dmax`, and “definitive no-send” depend on an unstated runtime; a hidden idempotency key or effect query would allow a weaker quarantine; a Byzantine worker is outside this design; safety-critical jobs would need a different availability choice. Conclusions about an existing codebase would be unsupported.

## 4. Next useful action

Write the occurrence CAS table and the seven predicates above as an executable log checker against a fault-injected quorum prototype. Do not score a run as exactly-once, and do not treat a successful ack as proof that no duplicate effect occurred.

xai / grok-4.7-efficient / medium / medium effort answer

## 1. Design recommendation

**Conclusion:** Use a 3-region majority control plane as the only authority for job ownership, and treat external effects as at-most-one *automatic dispatch attempt per attempt generation*, not exactly-once. A quorum compare-and-swap into `DISPATCHING(epoch, generation)` is the fence. After that CAS, uncertainty is sticky: no second region, epoch, or rejoin may send again unless an operator commits “no effect.” This is the only coherent policy when the external API will not honor idempotency keys or fencing tokens.

**Confidence:** High on the impossibility and ownership rules. Medium on operational defaults (operator bias, lease margins), because no workload, RTT, or API contract was supplied. No source files were in scope; every external-API claim is conditional on the problem statement.

### Requirements

- R1. A job becomes runnable only when the control-plane clock says it is due. Region wall clocks must not gate execution.
- R2. At most one dispatch CAS may commit per `(job, attempt_generation)`.
- R3. A worker may send only after that CAS, only for the granted epoch, and only if a pre-send revalidation still shows that epoch and an unexpired lease with remaining send budget.
- R4. HTTP/client retries are forbidden. One send attempt.
- R5. Any crash, timeout, partition, or pause after the CAS and before a quorum-committed definite result leaves the job `AMBIGUOUS`. Automatic re-dispatch is forbidden.
- R6. Minority partitions cannot grant, renew, CAS, or decide. Quorum loss delays jobs. Delay is acceptable; a second send is not.
- R7. Resume after pause invalidates the lease even if the local monotonic clock did not advance.
- R8. Operator decisions are quorum-committed, attributed, and append-only. The UI must default to “assume effect possible,” never “retry.”
- R9. Do not claim exactly-once, automatic compensation, or a closed send-to-receive window.

### Assumptions

- Three regions; commit requires 2 of 3 linearizable replicas (Raft or equivalent). Workers are not replicas.
- Jobs are non-safety-critical: lateness and stuck ambiguous jobs are acceptable.
- The external API does not support idempotency keys, fencing tokens, or a reliable “did this happen?” query. If a later contract adds any of those, the ambiguous state can shrink; it is not assumed here.
- A definite application response is quorum-logged before it counts. A local 2xx that never reached the log is not knowledge.
- Operators exist. Wrong operator input can still duplicate effects; audit detects that, it does not prevent it.
- No numeric TTL, skew bound, or RTT is asserted. The implementation must *measure and reject* grants when observed RTT or replica-clock disagreement exceeds its configured budget. Those budgets are parameters, not results.

### Ownership, epochs, fencing limits

Authoritative state lives only in the quorum log. Region memory is a cache.

- `epoch` is a per-job monotonic integer. A grant commits `{job, epoch, holder, region, store_deadline}` before the worker may do anything else.
- Renew extends `store_deadline` only for the same epoch and holder.
- A new grant increments the epoch. Stale holders fail closed on renew, CAS, and pre-send revalidation.
- **Fence scope:** the control plane honors epochs. The external API does not. Fencing therefore limits who may *initiate* a send. It cannot recall bytes already on the wire, undo a paused process that already wrote the socket, or stop a delayed packet.
- **Lease scope:** usable send window is store TTL minus grant RTT minus a pause/skew margin minus a send budget. If the measured grant RTT already exceeds the budget, the worker discards the grant and does not CAS. Deadlines are store time plus local elapsed time since the grant ack, never civil clocks.
- **Pause:** `CLOCK_MONOTONIC` on common kernels does not advance across suspend, so a local lease timer is not proof. On any resume, watchdog gap, or failed revalidation, the lease is void. The worker must not send.

Irreducible window: revalidation succeeds, then the process pauses or the network delays the request until after lease expiry and after a *different* generation has been authorized. This design closes the second half by refusing a new generation without an operator “no effect” decision. It does not make the first packet’s arrival time zero.

### State machine and the only ownership transaction

States: `PENDING`, `DISPATCHING`, `AMBIGUOUS`, `COMPLETE_EFFECT`, `COMPLETE_NO_EFFECT`, `ABANDONED`.

One quorum transaction, compare-and-swap:

- Preconditions: state `PENDING`, caller’s epoch is current, store now is before `store_deadline`, store now is at or after due time, generation matches.
- Effects: state becomes `DISPATCHING`, record holder, region, epoch, generation, payload hash.
- This CAS is the single automatic attempt. It is not a claim that the effect happened.

Subsequent transitions:

- Worker still alive, send flag never set, no async buffer: may CAS `DISPATCHING → PENDING` only with an explicit “send not started” attestation. This is an optimization, not a proof against kernel buffering. If that attestation is not trusted, leave it `AMBIGUOUS`.
- Request outcome quorum-logged as definite success, and the API contract means effect happened: `COMPLETE_EFFECT`.
- Anything else after CAS — timeout, crash, 5xx, ambiguous 4xx, partition, lost response: `AMBIGUOUS`.
- Operator `MARK_NO_EFFECT` increments generation and returns to `PENDING`. That is a new attempt, not a retry of the old one.
- Operator `MARK_EFFECT_OCCURRED` → `COMPLETE_EFFECT`. Operator `MARK_ABANDONED` is terminal. Compensation, if any, is out of band and logged, never automatic.

Invariant I1: for each `(job, generation)` at most one `DISPATCHING` CAS commits.  
Invariant I2: a newer epoch cannot CAS a job that is `DISPATCHING` or `AMBIGUOUS`. Ownership transfer is not permission to execute.  
Invariant I3: no CAS commits without a majority.  
Invariant I4: `AMBIGUOUS` is sticky until an operator record commits.  
Invariant I5: epoch numbers only increase; a rejoined holder of epoch `e` cannot act once the log shows `e' > e` or a deadline before store now.

### Quorum and degraded availability

| Condition | Ownership | Execution |
|---|---|---|
| All 3 up | Normal grants | Due `PENDING` jobs may CAS once |
| 1 region down or isolated | Other 2 are authoritative | Continues for `PENDING` jobs; isolated holder cannot renew and must stop |
| Holder partitioned with a live majority elsewhere | Majority may bump epoch for *new* grants only | Already `DISPATCHING`/`AMBIGUOUS` jobs stay frozen |
| No majority | No grants, renewals, CAS, or operator commits | No sends. Jobs become late. Alert. Not a failover to local execution |
| Worker paused | Lease void on resume | Must revalidate; stale epoch cannot send |

Degraded mode is “run late or not at all,” never “run on both sides.”

### Ambiguous effects, reconciliation, audit

Ambiguous means “the effect may have happened.” Recovery bias is do-not-send. The operator record must include actor, reason, prior state, epoch, generation, payload hash, and the evidence they used. Allowed commits: effect occurred, no effect (increments generation), abandon, or compensation noted externally. A generation increment without that commit is a defect.

Audit log is the quorum log itself, hash-chained: grant, renew, expire, epoch bump, CAS, dispatch attempt, result, ambiguous, operator decision. It records authorization and claims. It is not external truth.

### Impossible guarantees

- Exactly-once external effects under crash, pause, delay, or a client retry.
- A fence the external API will enforce.
- Safe automatic retry after timeout of a non-idempotent call.
- Distinguishing crash-before-send from crash-after-send once the CAS has committed, unless the worker is alive and its no-send attestation is accepted.
- Progress during quorum loss together with single-dispatch. Availability of execution is the sacrificed side.
- Operator infallibility. Audit makes a bad “no effect” mark visible; it does not make it harmless.
- Closing the gap between “revalidation returned” and “external API received the request.”

### Acceptance traces

Pass/fail is logical. No timings or measurements are claimed.

- **P1 partition of holder A from majority B+C.** A holds epoch 7. A must not send after its send budget is exhausted. B+C may grant epoch 8 only for `PENDING` jobs. A job already `DISPATCHING` under epoch 7 is not sendable by epoch 8. **Pass:** no second CAS. **Fail:** A sends after budget expiry, or B sends that job.
- **P2 partition before dispatch.** Job is `PENDING`. Only the majority can commit a grant/CAS. **Pass:** one CAS. **Fail:** both sides send.
- **Q1 no majority.** **Pass:** zero dispatch CAS commits. Lateness alone is not failure. **Fail:** any region sends from local state.
- **C1 crash after send, before result is logged.** **Pass:** rejoin leaves `AMBIGUOUS` and does not send. **Fail:** new owner sends.
- **C2 crash after CAS, before send.** Indistinguishable from C1. **Pass:** manual queue, no auto send. **Fail:** automatic retry. A false ambiguous is an accepted cost.
- **C3 crash before CAS.** **Pass:** job stays `PENDING`; a later holder may CAS once. **Fail:** two CAS commits for the same generation.
- **R1 stale rejoin.** A’s epoch 7 lease expired; log has moved on; job is `DISPATCHING` or `AMBIGUOUS`. **Pass:** A revalidates, aborts, does not send. **Fail:** A sends because local memory still says owner.
- **R2 pause across expiry with a frozen monotonic clock.** **Pass:** resume revalidates and is refused by the log. **Fail:** send proceeds on the local timer alone.
- **A1 operator `MARK_NO_EFFECT`.** **Pass:** one new generation, one new CAS, audit contains the operator commit. **Fail:** send without that commit, or two generations in `DISPATCHING`.
- **A2 operator `MARK_EFFECT_OCCURRED`.** **Pass:** terminal, no later CAS. **Fail:** any later automatic send.
- **A3 client retry enabled.** **Fail** even if all lease checks pass. One logical attempt that emits two HTTP tries is a broken fence.

## 2. Alternatives and discarded hypotheses

- **At-least-once outbox.** Rejected. An outbox reliably repeats the external call, which is the wrong direction without idempotency.
- **Active-active regions.** Rejected. Concurrent owners duplicate irreversible effects.
- **Lease without epoch, or wall-clock lease only.** Rejected. Pause, skew, and delayed rejoin can overlap two holders. Epoch plus pre-send revalidation is the minimum internal fence.
- **Fixed primary region with no majority failover.** Discarded as worse availability: one isolated primary stops the system even if the other two are healthy. Majority lease is the better alternative and still does not create exactly-once.
- **2PC with the external API.** Impossible. It is not a participant and does not lock.
- **“CAS rollback proves no effect.”** Likely false positive if the host, proxy, or kernel already transmitted. Treat that rollback as untrusted unless the process is alive and the no-send flag is explicit; otherwise stay ambiguous.
- **“HTTP 2xx in worker memory proves complete.”** False if the worker dies before the quorum log. Recovery must still treat the job as ambiguous and bias the operator toward effect-occurred.

## 3. Missing evidence and consequence

No API contract, query method, payload identity rule, RTT/skew envelope, or operator SLO was supplied. Consequence: definite no-effect responses cannot be enumerated; lease numbers must not be invented; a job with no external query can remain ambiguous indefinitely; duplicate effects remain possible if an operator, a client retry, or the irreducible delay window fires. Those are design bounds, not test results.

## 4. Next useful action

Write the quorum CAS and log schema for `PENDING → DISPATCHING` and the sticky `AMBIGUOUS` rule, including a pre-send revalidation that fails closed on resume, then review the ten traces above as specification checks. Do not add a retry path unless the external API gains a real idempotency or query contract.

Primary judge's stated reason

A's explicit occurrence key makes repeated scheduling and its audit boundaries easier to implement without confusing a new scheduled run with a reconciliation retry. This supports only a slight forced preference, not an established material quality difference; an independent review could reasonably favor B's more explicit client-retry safeguards.

This reason is the judge's assessment. No independent factual-defect finding is asserted by this record.

Battle wave: 4f1c6dfb-2901-4e06-85bf-7ed497044a25. Pair: brp1_80c9a04973fe920715598cc17e75c87c1807ba11e6a223779613dd3e6ca9ad15. A separate independent review is required before calling a concern a verified factual defect. Judge disagreement is not recorded here.