Queue, placement and seat contracts
These designs extend the queue, placement and agent contracts. Acceptance criteria below describe proposed improvements unless a source records a completed proof.
Claim, renewal and recovery
One successful conditional update can grant one holder at a time. It cannot prevent an expired worker from continuing to execute. Define the durable grant as task ID, lease epoch, authenticated worker instance, issue time and broker-authoritative deadline. Every lifecycle mutation must check the current epoch, holder and state. Increment the epoch on reassignment. Give a claim request a stable retry ID. Commit grant, receipt and event together; after an ambiguous response retrieve the committed receipt before seeking another grant.
For an external effect, keep a logical operation ID across lease epochs. Where the sink supports it, enforce fencing or idempotency at the sink. If an irreversible sink cannot prove whether an operation happened, park for reconciliation. Promotion of a Turso writer requires evidence that acknowledged grants survive failover. A replica that can serve reads is insufficient proof of write authority.
The intake lease has a different purpose from the general 45-minute default. Preserve intentional long execution while measuring abandonment delay. A successful early heartbeat must not shorten an active lease. Use a controlled clock to compare default renewal at minute five of a four-hour lease against its existing expiry. Test expiry, wrong holder and late completion separately. Queue reliability · Lease design
Repair and wake behavior
The six-queue census inspected 449 blocked or parked rows. Of 37 repairable candidates, the operator subsequently reported 37 successful writes. Six unrepairable rows, two concurrently moved rows and 404 schema-clean rows accounted for the rest of the census. The semantic packet-defect tags overlapped those classifications. Do not replay the dated drain. Census · Write ledger
The release code checked live holders, updated by task ID and status, then wrote an event in a separate execution. A concurrent edit keeping the same status could be overwritten. Repairing packet shape should preserve unrelated holds, unresolved dependencies and active claims. Proposed write boundary: verify row revision and quarantine provenance, recheck duplicates at the writer, perform the allowed field update and append its receipt inside one transaction. A rejected attempt must leave the row untouched. Reconcile audit events against the ledger before attributing any subsequent movement to repair. Atomic repair and independent holds · Inspected update
A wake has a cause. Time-based parks may expire at their timestamp. Task status, specific event, terminal task or human-answer conditions require the corresponding observation. Test the original double-serve against completed holders under equal and different keys, a valid timer wake, a deliberate override and cancelled or failed revival. Include an independent eligible task to catch a fix that suppresses all work. For scale, use isolated fixtures sampled from observed task/status distributions at 1× and 10× volume. Race 1, 8, 16 and 32 lanes on both one item and independent items. Record successful grants/s, attempts/s, deadline failures, wake lag, broker/tailnet latency, rows read/written and p50/p95/p99. Compare lost replies and restarts against durable grants. Production failover and the managed-database version of this experiment require explicit resource headroom. Fix
Placement policy
Cross-seat status retrieval from an empty local store was demonstrated with generation 6. The recorded status was dispatched. The provider run/attempt, terminal status, image used and billed minutes are independent receipts. A handle locates a session; access should require the reader’s repository grant. Bounded mirror failure must leave locally known, approved dispatch routes usable. Cross-seat proof
For each eligible surface, estimate time to finish using repo, command class, platform, image and verified cache affinity. Exclude unsupported visibility, platform, runner and quota modes before scoring. Count actual pool occupancy and pending reservations without double counting them. Treat macOS as a sublimit within the parent pool. A shared free-minute allowance needs atomic reservations or nonoverlapping seat allocations with expiry. Fall back to a known included route if the reservation authority is unavailable. Never infer free minutes from a successful workflow submission.
Use the same evaluator for explain and dispatch. Return input ages, exclusions, expected waits, cache savings, budget basis and tie-break. Stamp provider attempt and monotonic observation revision so a delayed running event cannot reverse completion. Distinguish the queue before assignment, provider wait, execution and result collection. Preserve stickiness while cache savings exceed predicted extra wait. Verify released decisions by replaying retained inputs and comparing outcomes by command class. Placement records
Enrolment, handoff and the shortlist
Maintain broker-bound seat identity, granted capabilities and policy revision separately from kind, display name, installation, boot ID, probe results and last seen. A shared service token establishes group membership; a verified per-seat principal is needed to enforce a per-seat permission. Enrolment retries for one installation should return the same seat. Alias collisions must preserve existing work. Keep first-claim lane registration and retain active-owner protection; a stale display name alone cannot hold a lane indefinitely. Test simultaneous claims using equal worker names and distinct authenticated instances.
Retain bridge, queue, GitHub and shell probes for ordinary enrolment. Add a metadata-only scoped check for roles needing secret access. A broker read, observed commit and successful bridge send each prove different facts. Record lifecycle events with a stable observation time and source. Test revocation on an older client at the broker.
For the shortlist, treat eight entries and a low-water mark of three as the control. Record task revision and timestamps at candidate observation, handout and claim. Separate already-dispositioned entries from races between handout and claim. In shadow evaluate host-local and per-seat lists on identical snapshots. Compare valid handouts per refresh, latency to claim, duplicate recommendations and depletion at peak load. Intake program
Bind a proposed single-use 15-minute handoff to sender, receiving seat, checkpoint digest and current lease. Redeem and transfer atomically, returning the previous result for a retry of the same operation. An expired offer preserves the original holder until ordinary lease policy applies. Keep grouping, reply threading, delivery and acceptance as distinct bridge fields. Retried delivery must not transfer a lease twice. Oracles include competing redemptions, late heartbeats, wrong recipient, expired offer, lost acknowledgement, and a duplicate notification after completion.