harness: the in-sandbox alive-runs cap (20s, 0 retries) is below the forge's actions/tasks?limit=100 p95 (6-25s measured) — a healthy-but-slow read reds the swarm tick (run 59171) #2149

Open
opened 2026-11-04 04:16:50 +00:00 by matou-build-agent · 1 comment

Symptom

swarm run 59171 (elitebook-03) REDed at stage sandcastle run (workers):

PromptError: Command `bash .sandcastle/claim-next-task.sh` exited with code 28:
claim-next-task: the alive-runs fetch (the actions-API tasks list) faulted (rc=28) — failing LOUD
rather than laundering it into a [] ... (idss#1425). No claim posted; ...

rc 28 is curl's own "operation timed out". The harness is behaving exactly as
designed (idss#1425: a faulted required read fails LOUD). The fault is the
bound, not the loudness.

Root cause — a bound that no longer clears the endpoint's p95

claim_alive_runs (claim-lib.sh:100) reads
/actions/tasks?limit=100&page=1. In the sandbox that read gets:

  • CLAIM_ALIVE_MAX_TIME=20 → CLAIM_API_MAX_TIME=20 (claim-next-task.sh:74, 90)
  • CLAIM_ALIVE_RETRIES=0 (claim-next-task.sh:80) — single attempt by design,
    because the whole expansion lives under the library's hard-coded 30 s
    PROMPT_EXPANSION_TIMEOUT_MS.

Live probe from elitebook-03, 2026-11-04 ~04:15 UTC, same token, 8 samples of
actions/tasks?limit=100&page=1 — all http=200, i.e. healthy, just slow:

18.85  25.44  13.19  11.32   9.74  13.37   7.19   6.16   (seconds)

Control, same minutes: issues?limit=1 = 1.49 / 1.62 / 1.95 s. The forge is
fine; this one Actions read is the heavy leg, and it scales with limit
(limit=20 measured 3.30 / 5.64 / 6.27 s).

So the p95 of the one endpoint the prefetch must read sits at ~25 s against a
20 s cap with zero retries: roughly 1 in 8 ticks reds. This is verbatim
failure mode (b) FAIL-CLOSED ON HEALTHY, already documented at
claim-next-task.sh:60-70 — the 20 s value was chosen in #1279 to clear the
then-measured p95, and forge latency has since grown past it.

Why no healer repair was possible

  1. claim-next-task.sh and claim-lib.sh are factory-vendored
    (.sandcastle/FACTORY_MANIFEST lines 13-14, ADR 0180). A hand-edit here
    trips check-harness-drift.sh and git-hooks/pre-push emits DRIFT_BLOCK.
    The fix must land in Matou/dev-factory and arrive as a FACTORY_REF bump.
  2. There is no idss-side knob: CLAIM_ALIVE_MAX_TIME / CLAIM_API_MAX_TIME /
    CLAIM_ALIVE_RETRIES appear nowhere in .forgejo/, run-swarm.sh or
    env-allowlist-lib.sh.
  3. Simply raising the cap does not fit. Observed Expanding shell expressions done legs are already 17.1 / 17.2 / 17.9 / 20.2 s
    (worker-logs, 02:53-03:37), and the 30 s library budget cannot be
    overridden for a shell expression. A 25 s cap would convert rc 28 into the
    worse PromptExpansionTimeoutError.

The ruling this needs

Three candidate fixes, each with a correctness cost a human should weigh:

  • (a) Host-side snapshot mirrored into the sandbox. The host runs under no
    30 s budget. run-swarm.sh already mirrors read-only host signals at
    /run/host-signals/ (fleet-pick, run-landing, drive-yield); an
    alive-runs snapshot could join them and the prefetch would do zero
    Actions reads. Cost: the claim-lib header's timing invariant (b) — "a run is
    visible in /actions/tasks for MINUTES before its first claim post, while a
    snapshot is only seconds stale" — must be re-verified against the added
    staleness, since arbitration rests on it.
  • (b) Drop limit=100 to ~20-30. Measured 3-4x faster and fits the cap.
    Cost: /actions/tasks is newest-first, so a live run beyond the newest N
    tasks would read as dead → double-claim. Needs a proof of the bound, not a
    guess.
  • (c) Restructure the budget. The fetch is already backgrounded (#120) and
    overlaps the 12 s lister leg, so the only slack left is the claim walk's
    CLAIM_NEXT_DEADLINE=26. Probably insufficient on its own.

Same class as #2036 (a transient Forgejo read blip reds the whole triage tick,
no retry, no verdict seam) — the pattern is the harness depending on a
single un-retried forge read inside a hard ceiling.

Evidence

  • Heal bundle: /tmp/matou-heal-Matou-idss.sZn7gL (signature f99e8b1c38d7)
  • run-verdict.txt, job-log.txt:129-130, worker-logs.txt
  • Run: https://git.matou.nz/Matou/idss/actions/runs/59171
  • Corroborating: the 03:37 worker observed this from inside the sandbox —
    $FORGEJO_API at -m 10 gave http=000, git.matou.nz root was fine, and
    -m 30 succeeded. Four consecutive ticks (02:53, 02:58, 03:08, 03:37)
    claimed nothing while the lister showed 7+ ready tickets.
## Symptom `swarm` run 59171 (elitebook-03) REDed at stage `sandcastle run (workers)`: ``` PromptError: Command `bash .sandcastle/claim-next-task.sh` exited with code 28: claim-next-task: the alive-runs fetch (the actions-API tasks list) faulted (rc=28) — failing LOUD rather than laundering it into a [] ... (idss#1425). No claim posted; ... ``` rc 28 is curl's own "operation timed out". The harness is behaving exactly as designed (idss#1425: a faulted required read fails LOUD). The fault is the **bound**, not the loudness. ## Root cause — a bound that no longer clears the endpoint's p95 `claim_alive_runs` (claim-lib.sh:100) reads `/actions/tasks?limit=100&page=1`. In the sandbox that read gets: - `CLAIM_ALIVE_MAX_TIME=20` → `CLAIM_API_MAX_TIME=20` (claim-next-task.sh:74, 90) - `CLAIM_ALIVE_RETRIES=0` (claim-next-task.sh:80) — single attempt by design, because the whole expansion lives under the library's **hard-coded 30 s** `PROMPT_EXPANSION_TIMEOUT_MS`. Live probe from elitebook-03, 2026-11-04 ~04:15 UTC, same token, 8 samples of `actions/tasks?limit=100&page=1` — all **http=200**, i.e. healthy, just slow: ``` 18.85 25.44 13.19 11.32 9.74 13.37 7.19 6.16 (seconds) ``` Control, same minutes: `issues?limit=1` = 1.49 / 1.62 / 1.95 s. The forge is fine; this one Actions read is the heavy leg, and it scales with `limit` (`limit=20` measured 3.30 / 5.64 / 6.27 s). So the p95 of the one endpoint the prefetch *must* read sits at ~25 s against a 20 s cap with zero retries: roughly **1 in 8 ticks reds**. This is verbatim failure mode **(b) FAIL-CLOSED ON HEALTHY**, already documented at claim-next-task.sh:60-70 — the 20 s value was chosen in #1279 to clear the then-measured p95, and forge latency has since grown past it. ## Why no healer repair was possible 1. `claim-next-task.sh` and `claim-lib.sh` are **factory-vendored** (`.sandcastle/FACTORY_MANIFEST` lines 13-14, ADR 0180). A hand-edit here trips `check-harness-drift.sh` and `git-hooks/pre-push` emits `DRIFT_BLOCK`. The fix must land in `Matou/dev-factory` and arrive as a `FACTORY_REF` bump. 2. There is no idss-side knob: `CLAIM_ALIVE_MAX_TIME` / `CLAIM_API_MAX_TIME` / `CLAIM_ALIVE_RETRIES` appear nowhere in `.forgejo/`, `run-swarm.sh` or `env-allowlist-lib.sh`. 3. **Simply raising the cap does not fit.** Observed `Expanding shell expressions done` legs are already 17.1 / 17.2 / 17.9 / 20.2 s (worker-logs, 02:53-03:37), and the 30 s library budget cannot be overridden for a shell expression. A 25 s cap would convert rc 28 into the worse `PromptExpansionTimeoutError`. ## The ruling this needs Three candidate fixes, each with a correctness cost a human should weigh: - **(a) Host-side snapshot mirrored into the sandbox.** The host runs under no 30 s budget. `run-swarm.sh` already mirrors read-only host signals at `/run/host-signals/` (`fleet-pick`, `run-landing`, drive-yield); an `alive-runs` snapshot could join them and the prefetch would do **zero** Actions reads. Cost: the claim-lib header's timing invariant (b) — "a run is visible in /actions/tasks for MINUTES before its first claim post, while a snapshot is only seconds stale" — must be re-verified against the added staleness, since arbitration rests on it. - **(b) Drop `limit=100` to ~20-30.** Measured 3-4x faster and fits the cap. Cost: `/actions/tasks` is newest-first, so a live run beyond the newest N tasks would read as dead → double-claim. Needs a proof of the bound, not a guess. - **(c) Restructure the budget.** The fetch is already backgrounded (#120) and overlaps the 12 s lister leg, so the only slack left is the claim walk's `CLAIM_NEXT_DEADLINE=26`. Probably insufficient on its own. Same class as #2036 (a transient Forgejo read blip reds the whole triage tick, no retry, no verdict seam) — the pattern is the harness depending on a single un-retried forge read inside a hard ceiling. ## Evidence - Heal bundle: `/tmp/matou-heal-Matou-idss.sZn7gL` (signature `f99e8b1c38d7`) - `run-verdict.txt`, `job-log.txt:129-130`, `worker-logs.txt` - Run: https://git.matou.nz/Matou/idss/actions/runs/59171 - Corroborating: the 03:37 worker observed this from inside the sandbox — `$FORGEJO_API` at `-m 10` gave `http=000`, `git.matou.nz` root was fine, and `-m 30` succeeded. Four consecutive ticks (02:53, 02:58, 03:08, 03:37) claimed nothing while the lister showed 7+ ready tickets.
Author
Member

Healer, run 59423 (signature f99e8b1c38d7, 2026-11-04T05:43:49Z): third recurrence of this fault. Measurements and a verified one-line fix — a server-side status=running&status=waiting filter on the actions/tasks read, which takes it from 13.9-23.7s to 2.6-3.6s and is output-identical — are on #2150, the ticket holding this signature. Consolidating there; this one is the same defect seen from run 59171.

Healer, run 59423 (signature `f99e8b1c38d7`, 2026-11-04T05:43:49Z): third recurrence of this fault. Measurements and a verified one-line fix — a server-side `status=running&status=waiting` filter on the `actions/tasks` read, which takes it from 13.9-23.7s to 2.6-3.6s and is output-identical — are on #2150, the ticket holding this signature. Consolidating there; this one is the same defect seen from run 59171.
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#2149
No description provided.