harness: post-#2145 the alive-runs fetch is the claim path's dominant cost — actions/tasks answers in 11-15s against a 20s cap (rc 28 red run 59381), and the 16s walk-admission cliff still launders [] (the last #1425 leg) #2150
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Matou/idss#2150
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found by the healer on run 59381 (
swarm (bens-mac-04), signaturef99e8b1c38d7, 2026-11-04T04:10:55Z).The fault that red the tick
rc 28 is curl's
--max-time.claim_alive_runs(.sandcastle/claim-lib.sh:123) readsactions/tasks?limit=100&page=1underCLAIM_ALIVE_MAX_TIME(20s,claim-next-task.sh:76) withCLAIM_ALIVE_RETRIES=0in-sandbox, so one read over 20sexits 28. The script behaved exactly as designed (#1425 loud arm, no claim posted) —
the bug is the sizing underneath it, not the loudness.
Why #2145 moved the bottleneck onto this leg
389dfd1bcut the in-sandbox lister to a singleGET /issues/<n>. Measured live frombens-mac-04, 2026-11-03 23:1x local:
GET /issues/2123(the #2145 fast path)GET /actions/tasks?limit=100&page=1So the lister is ~2s and the alive fetch is now the dominant cost on the 30s
prompt-expansion path, at 11–15s against its 20s cap. The 04:10 excursion past 20s is a
hot-fleet tick (runs.json: 4 hosts, ~50 runs in 45 min), not an outage — 59383/59385
succeeded either side of it.
The real defect: a 16s cliff that launders
[](the last #1425 leg)Walk admission is
CLAIM_CANDIDATE_CALLS(5) x CLAIM_CALL_FLOOR(2) <= CLAIM_NEXT_DEADLINE(26) - SECONDS,i.e. the walk admits nothing once the clock passes 16s. Three regimes:
claim-next-task.sh:236emits[]at exit 0. That[]renders as an emptyready-tasks block, which a worker's Done check reads as "nothing to do" — fail-closed
at the script, fail-OPEN at the surface that matters. This is precisely the shape
#1425 forbids and #2145 closed on the other two legs (rc 124, alive-fault).
With alive measured at 11–15s, the silent middle regime is routinely reachable. Reproduced
against the test fakes (clock spent before the walk, 1-element queue):
Two worker logs in this run's window show that surface live — an empty ready-tasks block
while the lister itself still returned a task (
20261103-215024: "it returned task #2129";20261103-210914: same shape) — while 8 tickets wereready-for-agentat 04:04:02.Why the healer did not repair it
ticking every ~1-2 min that converts routine slow-forge ticks into REDs and risks a
heal storm. That trade-off is a ruling, not a knob.
CLAIM_ALIVE_MAX_TIMEeats the walk's room and REDson the library's hard 30s; lowering
limit=100risks an alive run falling off the page,which breaks arbitration into a double-claim.
30s budget, where it already builds the fleet view) mirror the alive-runs snapshot in as
a host-signal. That needs a ruling first:
claim-lib.sh:34-38rests on the snapshotbeing "only seconds stale", and a host-mirrored one is minutes stale, which is exactly
the double-claim the janitor cannot catch.
Asks
claim-lib.shstaleness invariant, and if so with what freshness bound?
Follow-up of #2145 (closed). Evidence:
/tmp/matou-heal-Matou-idss.VIKrM7(
run-verdict.txt,job-log.txt,worker-logs.txt,worker-logs-older.txt,runs.json).Healer, run 59175 (
swarm (elitebook-03), signature2196e4460dad, 2026-11-04T04:25:57Z) — the other leg went over too, and this ticket's ~2s premise for it no longer holds.This tick REDed on the lister leg, not the alive leg:
Same loud arm
389dfd1badded, working as designed. But this ticket (and #2149) both rest onGET /issues/<n>being ~1.7–2.6s, so the lister was taken to be ~2s and the whole budget argument hangs off that. Re-probed from elitebook-03, same token, 2026-11-04 04:30–04:37 UTC — ~15 min after this ticket's table was measured:GET /issues/2129(the #2145 fast path)GET /issues/2123GET /issues/2129/dependencies?limit=50GET /issues?...labels=ready-for-agent&limit=50(pre-#2145 page)GET /actions/tasks?limit=1GET /actions/tasks?limit=5GET /actions/tasks?limit=100-m 60, twiceGET /actions/runs?limit=1-m 45/api/v1/version, forge root (controls)Ran the fast-path lister end-to-end host-side with
SWARM_FLEET_PICK_SIGNALnaming #2129: rc=0 in 15s. The fast path fires correctly and still cannot fitCLAIM_LISTER_MAX_TIME=12, because its own two sequential reads (/issues/<n>+/issues/<n>/dependencies) are 10–18s at this latency. So both legs of the claim path are now over their caps, and the swarm can claim nothing on any tick.Two things this adds to the asks above:
/issues/<n>ranged 1.7s → 13.0s inside 20 minutes for a 3.3 KB payload, so sizing any in-sandbox leg against a measured p95 is a treadmill — which argues for the host-mirror shape (3) on both legs, not just alive-runs.actions/tasksnow costs ~1s per returned row (limit=1 → 9.4s, limit=5 → 14.3s, limit=100 → no answer in 60s). That is a per-row server-side cost, so option (b) "droplimitto 20–30" buys ~20s, not a fit — and it still carries the double-claim risk (b) already names.No repair attempted:
list-ready-tasks.sh,claim-next-task.shandclaim-lib.share all factory-vendored (FACTORY_MANIFEST13, 14, 40),CLAIM_LISTER_MAX_TIMEandCLAIM_NEXT_DEADLINEappear nowhere in.forgejo/,run-swarm.sh,main.mtsorenv-allowlist-lib.sh, and the ruling this needs is the one already asked for above.Separately worth a human eye: the underlying degradation is forge-side and getting worse, and it is not this host — elitebook-03 carries only
forgejo-runner-swarm.service(load 2.93/8 cores, 45 G free, mem fine,host.txt). The/actions/*per-row cost points at theaction_task/action_runtables; cf. the 27-run concurrency pileup in GOTCHAS #406 and #2073 (bulk transfer degraded server-side).Evidence:
/tmp/matou-heal-Matou-idss.S1Tia3(run-verdict.txt,job-log.txt,worker-logs.txt,api-timing.txt—api_http=000,api_curl_exit=28,host.txt). Run: https://git.matou.nz/Matou/idss/actions/runs/59175Recurrence #3, and a measured fix that dissolves both asks
Healer, run 59423 (
swarm (matou-workstation), same signaturef99e8b1c38d7,2026-11-04T05:43:49Z) — the identical rc 28 on the alive-runs leg. Third on this
signature after #2149 (run 59171) and this ticket (run 59381), ~90 min apart.
The endpoint has got dearer again. 5 live samples from matou-dev-server-01,
2026-11-04 05:47 UTC, against
$FORGEJO_API/actions/tasks?limit=100&page=1:So the 20s cap no longer straddles the tail — it straddles the median. This is
not a hot-fleet excursion any more; roughly half of all ticks now RED.
The cost is per-ROW, and the page is 95% dead rows
Same host, same minute:
?limit=10&page=1?limit=20&page=1?limit=30&page=1?limit=100&page=1?status=running&status=waiting&limit=100&page=1The forge honours a server-side
statusfilter on this endpoint, and repeatedstatus=is a UNION, not a last-wins (probed:status=running&status=successreturns both;
status=waitingalone is valid and returned 0 rows; an unknown valueis an HTTP 400, which
curl -sfsurfaces as a loud rc 22, never a silent empty).running/waitingare exactly whatclaim_alive_runs' jq already selects, sothis only moves the filter to the side of the wire that can do it cheaply. Proven
output-identical against the live forge at 05:52 UTC:
and the fixed function run 3x in-sandbox-shaped (
CLAIM_API_MAX_TIME=20,CLAIM_ALIVE_RETRIES=0): rc 0 in 4.3s / 1.8s / 1.8s.This answers ask (3) by removing it
table because the fresh read could not fit the budget. At 2–4s it fits with ~6x
headroom, so
claim-lib.sh:34-38's "only seconds stale" invariant stays intact andthe double-claim risk is never taken on.
2–4s the clock rarely reaches the 16s admission cliff at all, so the silent middle
regime becomes genuinely rare rather than routine. The arm is still asymmetric with
its two siblings and still worth your ruling — but it is no longer load-bearing.
limitworry in "Why the healer did not repair it" (2) inverts. Note theforge caps the page at 50 regardless of
limit=100. Today those 50 slots are spenton mostly-finished runs, so a live run can already be pushed off page 1 — the
exact arbitration break that paragraph feared. Filtered, all 50 slots are live rows.
The filter makes the page strictly safer, not riskier.
The patch (verified, not landed)
.sandcastle/claim-lib.sh:123— one line:Keep the jq status test as the fail-safe for a forge that ignores the parameter (it
then returns the old full page — slow, but correct). Needs with it:
tests/claim-lib-test.shT2: the paged-URL assertion, plus a ratchet that thestatus=narrowing is on the URL — if it comes off, the read goes straight backover the cap and the swarm REDs on forge latency alone.
tests/actions-endpoint-test.shheader prose: "tasksanswered in under a second"(2026-08-22) is stale;
page=1is still necessary and no longer sufficient.claim-next-task.sh'sCLAIM_ALIVE_MAX_TIMEcomment, which still justifies 20sagainst the 8.5–12.2s samples of 2026-09-03.
Written and green in the heal clone:
claim-lib-test.shpass=85 fail=0,actions-endpoint-test.shpass=5 fail=0, plusclaim-next-task-test.sh45,schedule-backstop-test.sh22,scheduler-canary-test.sh14,heal-lib-test.sh26.Why the healer did not land it
All four files are FACTORY_MANIFEST paths, so under ADR 0180 the fix belongs in
Matou/dev-factorywith a FACTORY_REF bump here — the same route #2145 itself took.Verified, not assumed:
check-harness-drift.shagainst the edited clone reportscheck-harness-drift: FAILED — vendored factory copies drifted, which pre-push gate 1turns into a DRIFT_BLOCK. A healer push to
mainwould be refused, and if forcedthrough would be reverted by the next re-vendor. Beside #2147.
Left
ready-for-humandeliberately — the asks above are yours to close, and I willnot flip a human gate. If you accept the filter, this is a knob-free, output-identical
one-liner an agent can land via dev-factory without either ruling.
Evidence:
/tmp/matou-heal-Matou-idss.fHOSgl(run-verdict.txt,job-log.txt,worker-logs.txt,runs.json,api-timing.txt).Cross-ref from the healer (run 59463): this ticket reasons from "the lister is ~2s", which holds only while the #2145 fleet-pick fast path fires. On a tick with no fleet view no pick signal is written, the lister falls back to the full page, and that path measures 19.6s / 28.3s against
CLAIM_LISTER_MAX_TIME=12— a certain rc 124. Filed as #2151 with the measurements; the walk-admission cliff this ticket describes is unchanged by it.