run-swarm: a failed ready-list read dies with a blank task log, and reds a tick that had no work #157

Closed
opened 2026-09-21 03:38:01 +00:00 by ben · 0 comments
Owner

Filed from the consumer side: Matou/matou-app #442 ("run-swarm exits 1 with no message right after policy: LANDING=pr MERGE_AUTHORITY=human", ~2% of swarm ticks, healer signature 7f647f2d78ed). The diagnosis and a tested patch have sat on that ticket since 2026-09-06, parked because run-swarm.sh is vendored and cannot be edited in the consumer. Bringing it here, where it belongs.

What happens today

run-swarm.sh:

if ! schedule_list_ready_or_verdict "$ready_file"; then rm -f "$ready_file"; exit 1; fi

When the ready-list read fails after list-ready-tasks.sh has exhausted its own retries — a transient forge 5xx or timeout — the run dies with a bare exit 1. Two consequences:

  1. The task log is blank. The cause lands in the on-disk verdict, the runlog and swarm.db — all on the HOST. The Garage actions_log an operator reads off a red tick gets nothing between the policy: line and RUN exit status 1. The healer keyed that empty log to one signature and silenced it, so every recurrence went invisible — and any GENUINE red that later collapses onto the same blank-log signature is silenced with it.
  2. It reds a tick that had nothing to do. A transient forge blip is not work this host can do; the 30-minute cron backstops it. Reddening is strictly worse than standing down.

#142 (d32621a) improved the wording inside the verdict — the cause is now observed (http=NNN) rather than guessed. It did not touch either consequence above: the log is still blank and the tick still reds.

Proposed fix (from the consumer's patch, adapted to current main)

  1. In on_exit, when the exit code is non-zero, print ONE stderr line naming the stage, the reason and the captured error, so the cause is legible from the task log alone.
  2. At the ready-list call site, stand down clean on a failed read: say so on stderr, set SWARM_EXIT_REASON=list-ready-transient, and exit 0. A persistent outage then idles every tick loudly instead of reddening silently.

Point 2 is the behaviour change worth a second opinion: it converts one class of red into a clean no-op tick. The argument for it is that the run genuinely had no work and no fault of its own — the same posture as the existing zero-ready-tasks path. The argument against is that a forge outage becomes invisible in the red/green signal, which is why point 1 (the loud stderr line) should land with it, not instead of it.

Refs matou-app#442, #142 (the verdict-wording half), #1424 (the notify guard, same "informational failure must not red a run with work" shape).

Filed from the consumer side: `Matou/matou-app` #442 ("run-swarm exits 1 with no message right after `policy: LANDING=pr MERGE_AUTHORITY=human`", ~2% of swarm ticks, healer signature `7f647f2d78ed`). The diagnosis and a tested patch have sat on that ticket since 2026-09-06, parked because `run-swarm.sh` is vendored and cannot be edited in the consumer. Bringing it here, where it belongs. ## What happens today `run-swarm.sh`: ```sh if ! schedule_list_ready_or_verdict "$ready_file"; then rm -f "$ready_file"; exit 1; fi ``` When the ready-list read fails after `list-ready-tasks.sh` has exhausted its own retries — a transient forge 5xx or timeout — the run dies with a bare `exit 1`. Two consequences: 1. **The task log is blank.** The cause lands in the on-disk verdict, the runlog and swarm.db — all on the HOST. The Garage `actions_log` an operator reads off a red tick gets nothing between the `policy:` line and `RUN exit status 1`. The healer keyed that empty log to one signature and silenced it, so every recurrence went invisible — and any GENUINE red that later collapses onto the same blank-log signature is silenced with it. 2. **It reds a tick that had nothing to do.** A transient forge blip is not work this host can do; the 30-minute cron backstops it. Reddening is strictly worse than standing down. #142 (`d32621a`) improved the wording *inside* the verdict — the cause is now observed (`http=NNN`) rather than guessed. It did not touch either consequence above: the log is still blank and the tick still reds. ## Proposed fix (from the consumer's patch, adapted to current `main`) 1. In `on_exit`, when the exit code is non-zero, print ONE stderr line naming the stage, the reason and the captured error, so the cause is legible from the task log alone. 2. At the ready-list call site, stand down **clean** on a failed read: say so on stderr, set `SWARM_EXIT_REASON=list-ready-transient`, and `exit 0`. A persistent outage then idles every tick loudly instead of reddening silently. Point 2 is the behaviour change worth a second opinion: it converts one class of red into a clean no-op tick. The argument for it is that the run genuinely had no work and no fault of its own — the same posture as the existing zero-ready-tasks path. The argument against is that a forge outage becomes invisible in the red/green signal, which is why point 1 (the loud stderr line) should land with it, not instead of it. Refs matou-app#442, #142 (the verdict-wording half), #1424 (the notify guard, same "informational failure must not red a run with work" shape).
ben closed this issue 2026-09-21 04:31:44 +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/dev-factory#157
No description provided.