gunk-dev/the-valley
the-valley:bd-5cad397bugclosed

A check worker's failures are visible only on its host

State
done
Created
2026-10-27 by contributor

Body

When a check worker's batch fails, the worker writes the failure to its journal and to `failures.json` in its state directory, then waits 15 minutes, doubling up to 24 hours, before it tries the same batch again (`status/worker.go:331`). Nothing on origin says so. `valley pending` and `valley status` show a ready change with no evidence, and no sign that a batch failed, which check failed, or when the next try is. Example, 2026-10-27: three ready changes sat for hours without worker evidence, while their checks passed when approval built them on another machine. Finding out why takes the host's journal.

Two more properties make a failure costly:
- A batch is all or nothing. The worker runs every missing check in one `attest run`, and on any error publishes nothing, so one failing check withholds the evidence of every check that passed. The one ref per tree and signer, created once, is why the worker can't publish part and add the rest later (bd-7b7d58f).
- Every error counts the same. A check whose test fails and a build cut short (killed for memory, a VM test timing out under load, the daemon restarting) both wait and retry. Retrying the first spends builds on a known result; the second is what the retries are for.

A fix:
- A failure is readable off the host: the failing checks' names, whether the check failed or the build did not finish, the failure count and the next try, somewhere `valley pending --checks` and `valley status` read (a bounded per-project ref the worker writes, or a bus event once the bus is authenticated).
- The worker tells a failed check from an unfinished build. An unfinished build is retried; a failed check waits for a new tree.
- When a batch fails, the worker can build its failing check alone, so the report names it.

Fixed when a failed worker batch leaves a record that `valley status` shows with the failing check's name, checked by `worker-e2e`.

Related: oc-13c6bd6 (check workers build ready changes).

Comments

  1. contributor2026-10-27 16:23 UTC
    Follow-up, 2026-10-27: two of the three ready changes in the example failed deterministically. Each added a check file without declaring it in policy/project/policy.cue, so own-policy failed on the head itself ("a change to nix/checks/<file> must require <check>"), and the all-or-nothing batch withheld every other passing check. The worker retried a failure no retry could fix. A report naming the failing check would have shown it at once; the third change, whose checks passed when approval built them, is the only one that looks environmental.
  2. contributor2026-11-08 22:30 UTC
    Duplicate of oc-3d9f593: listings show a failed check (oc-ccc39e2), and which check failed, its log and the next try are oc-3d9f593's outcome, which holds the follow-up.