claim-next-task: SWARM_RUN_ID:-0 fallback silently defeats arbitration for manual runs #468

Closed
opened 2026-08-12 14:44:10 +00:00 by ben · 1 comment
Owner

From the 2026-08-12 final whole-branch review (finding I-3); upgrades the Task-4 deferred "run_number=0 collision" note. Protected path (.sandcastle) — human/controller change, not a swarm-worker ticket.

Problem: .sandcastle/claim-next-task.sh line ~22: run="${SWARM_RUN_ID:-0}". A manual invocation without SWARM_RUN_ID posts claims naming run 0, which no alive-runs list ever contains — every other host's arbitration treats the claim as dead and claims straight over it, and the next janitor sweep deletes the manual claim comment + agent-working label outright. The operator believes they hold a claim; the pool behaves as if they don't. Worse than the spec's accepted "manual sessions don't claim" risk, because invoking the machinery produces a claim that LOOKS protective and isn't.

Fix: fail loud — when SWARM_RUN_ID is unset or 0, print a warning to stderr and either refuse to claim (emit [], exit 0) or require an explicit override env (e.g. SWARM_CLAIM_FORCE=1). Add a fake-forge test. Sync to matou-app via the #250 harness manifest.

From the 2026-08-12 final whole-branch review (finding I-3); upgrades the Task-4 deferred "run_number=0 collision" note. Protected path (.sandcastle) — human/controller change, not a swarm-worker ticket. **Problem:** `.sandcastle/claim-next-task.sh` line ~22: `run="${SWARM_RUN_ID:-0}"`. A manual invocation without SWARM_RUN_ID posts claims naming run 0, which no alive-runs list ever contains — every other host's arbitration treats the claim as dead and claims straight over it, and the next janitor sweep deletes the manual claim comment + agent-working label outright. The operator believes they hold a claim; the pool behaves as if they don't. Worse than the spec's accepted "manual sessions don't claim" risk, because invoking the machinery produces a claim that LOOKS protective and isn't. **Fix:** fail loud — when SWARM_RUN_ID is unset or 0, print a warning to stderr and either refuse to claim (emit `[]`, exit 0) or require an explicit override env (e.g. SWARM_CLAIM_FORCE=1). Add a fake-forge test. Sync to matou-app via the #250 harness manifest.
Author
Owner

This was generated by AI during triage.

Triage: added the missing category label. This is a defect report (SWARM_RUN_ID:-0 fallback silently defeats claim arbitration on manual runs) — labelled bug. ready-for-human was already correctly applied (protected .sandcastle controller path); left as-is.

> *This was generated by AI during triage.* **Triage:** added the missing category label. This is a defect report (`SWARM_RUN_ID:-0` fallback silently defeats claim arbitration on manual runs) — labelled `bug`. `ready-for-human` was already correctly applied (protected `.sandcastle` controller path); left as-is.
ben closed this issue 2026-08-13 03:54:31 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/idss#468
No description provided.