claim-next-task: the 30s prompt-expansion budget is arithmetically unholdable — deadline + per-candidate call sizing (healer patch, dev-factory vendored path) #1195

Closed
opened 2026-09-03 16:18:32 +00:00 by ben · 1 comment
Owner

Session note: the healer wrote this complete diagnosis + verified patch but its filing never reached the tracker (agent log empty — the API-529 wave; the Mattermost page fired on that). Posted verbatim by the session from /tmp/matou-heal-Matou-idss.DqpBkG on matou-dev-server-01; the session lands the dev-factory push + re-vendor it asks for.

Filed by the swarm healer (hook mode, signature 0fd2fa26ccd7, run https://git.matou.nz/Matou/idss/actions/runs/17201). Class: harness-infra. Not repaired in-repo — the fix lands on a factory-vendored path, so it needs a Matou/dev-factory push + re-vendor, which is a human call (blast radius = every consumer repo).

Fault

sandcastle run (workers) :: PromptExpansionTimeoutError: Shell expression bash .sandcastle/claim-next-task.sh timed out after 30004ms (run-verdict.txt).

The outer 30s is a hard-coded library constant — @ai-hero/sandcastle/dist/index.js: PROMPT_EXPANSION_TIMEOUT_MS = 3e4. A shell expression gets no per-expression override the way a lifecycle hook gets timeoutMs (.sandcastle/main.mts, #1142). So claim-next-task.sh must prove it returns first. Its existing #77/#28 bounds don't, in three ways.

(a) Overshoot — the actual red

CLAIM_NEXT_BUDGET=22 is tested only at the top of each candidate; nothing re-checks the clock once a candidate is admitted. An admitted candidate then makes up to ~4 CLAIM_API_MAX_TIME-bounded calls (claim_post → _claim_comments → loser's DELETE, or winner's claim_label_id + label write). 21 + 10 = 31 > 30, and a full candidate is 21 + 30 = 51. The guard is arithmetically incapable of holding the script under 30s.

Run 17201's iteration 3 matches exactly: ~10s prefetch, candidate admitted at ~20s, two claim_post calls each burning the 10s cap, dead at 30.004s — and no claim comment left on either #1191 or #1192 (verified live), which is what a timed-out/failed POST leaves behind.

(b) The per-call cap is set below the endpoint's own latency

CLAIM_API_MAX_TIME=10, but claim_alive_runs must read actions/tasks?limit=100&page=1, measured live on this forge 2026-09-03: 8.54 / 10.29 / 10.60 / 12.10 / 12.22 s — 3 of 5 over the cap. So the #28 fail-closed arm fires on a healthy-but-slow forge, not just a stall, and the iteration claims nothing.

This is visible in run 17201 iterations 1–2: both expanded in 10.2s and injected an empty list, and the agent then wrote "The top-of-prompt ready list was empty, so per the Done procedure I re-ran list-ready-tasks.sh. It now returns two fresh tasks" — it re-ran the lister (30s cap) and saw work the claim wrapper (10s cap) had just fail-closed on. Two of three iterations spent doing nothing, mis-attributed to "tasks unblocked mid-iteration".

(c) The lister leg is unbounded relative to the 30s budget

ready="$(bash "$lister")" is untimed. list-ready-tasks.sh retries each read with backoff at LIST_READY_MAX_TIME=30s apiece (#52) — worst case ~96s inside a 30s expansion.

For reference, healthy claim-path calls on this forge are ~1.0–1.5s (issues/N/comments, labels, dependencies), so the budget is dominated entirely by the ~11s actions/tasks prefetch.

Fix (written and verified — patch attached below)

Replace the fixed budget with a deadline + per-candidate call sizing, so the worst case is arithmetic rather than hope:

  • CLAIM_NEXT_DEADLINE=26 — self-deadline under the library's 30s, with margin for the docker exec round trip the library clock includes but the script cannot see.
  • Admit a candidate only when the clock left bounds all of its calls: cap = (DEADLINE - SECONDS) / CLAIM_CANDIDATE_CALLS (5, leaving a spare for a second labels page), stop at a CLAIM_CALL_FLOOR=2 floor. A candidate admitted at S therefore lands by the deadline even if every call burns its full cap. _claim_api reads the var at call time, so the shrinking cap applies per candidate.
  • CLAIM_ALIVE_MAX_TIME=14 for the prefetch leg — sized over the measured 12.2s tail, so fail-closed is a safety net again instead of a routine outcome.
  • CLAIM_LISTER_MAX_TIME=12 — bound the lister from outside via timeout, leaving #52's retry tuning untouched. Only rc 124 (timeout killed it) gets the graceful []; every other non-zero rc still propagates, preserving #52/GOTCHAS #7 (a real listing outage must fail loud and be re-keyed to the "list ready tasks" stage, not laundered into "nothing to do").
  • CLAIM_NEXT_BUDGET becomes an optional extra ceiling (unset by default); an explicit CLAIM_API_MAX_TIME stays absolute and un-clamped (the #77c eyes-open seam).

Emitting [] is the same outcome as losing every race — no claim, no Claude tokens, cron/backstop re-fires — versus REDing the tick.

Verification

.sandcastle/tests/claim-next-task-test.sh: 42 pass / 0 fail with the patch (28 pass baseline + 14 new). The 6 discriminating new assertions fail against the pre-fix script and pass after, one guard per defect above:

FAIL: deadline too tight to bound a candidate emits []
FAIL: deadline too tight posts NO claim comment
FAIL: deadline too tight says so on stderr
FAIL: walk cap is deadline-derived (20/5 = 4s), not the old flat 10s
FAIL: alive-runs prefetch is capped over the measured 12.2s tail
FAIL: a hanging lister is cut off at its wall-clock bound, not left to run

Observed caps on the real argv after the fix: actions/tasks → --max-time 14; each walk call → --max-time 5 (26/5 at SECONDS=0), worst-case candidate 5 x 5 = 25 <= 26.

Why this was not landed by the healer

claim-next-task.sh and tests/claim-next-task-test.sh are both in .sandcastle/FACTORY_MANIFEST (lines 11 and 72) — vendored byte-for-byte from Matou/dev-factory@11264ede. Verified: check-harness-drift.sh is green on the pristine clone and FAILS with the patch applied. Landing it in idss alone would red the drift gate and be wiped by the next re-vendor.

What a human needs to decide: push this to Matou/dev-factory, then bump FACTORY_REF + re-vendor here (the 04aa72df pattern). It changes the claim path for every consumer repo (matou-app, coa, matou-website, dev-factory, idss all share this harness per runner-journal.txt), which is past what the healer charter allows it to decide.

Residual, not fixed here

The real constraint is that actions/tasks?limit=100 costs ~11s of a 30s budget on the critical path (it must be reaped before the walk). The patch makes that survivable, not cheap — the walk is left ~12s, so per-call caps land at 2–5s. Making claiming genuinely comfortable means making alive-runs cheaper (host-side cache, or a narrower endpoint), which is a design question, not a bug fix. Related: GOTCHAS 16.

Patch (also at claim-next-task-budget-fix.patch in the incident evidence dir)
diff --git a/.sandcastle/claim-next-task.sh b/.sandcastle/claim-next-task.sh
index 60ee2c5c..ab0b61cf 100755
--- a/.sandcastle/claim-next-task.sh
+++ b/.sandcastle/claim-next-task.sh
@@ -23,9 +23,59 @@ set -euo pipefail
 #      under no such budget). At 30 s = the outer budget, a single stalled call
 #      fires the outer timeout at the very instant it would have failed closed
 #      (#28); a smaller cap lets it fail closed to [] within budget instead.
+#
+# #1193: BOTH of those bounds were unsound as a PAIR, and run 17201 red anyway.
+# The outer 30 s is a HARD-CODED library constant
+# (@ai-hero/sandcastle/dist/index.js: `PROMPT_EXPANSION_TIMEOUT_MS = 3e4`) — a
+# shell expression gets no per-expression override the way a lifecycle hook gets
+# `timeoutMs` (main.mts, #1142). So this script has to PROVE it returns first,
+# and the old arithmetic could not:
+#   (a) OVERSHOOT. The `SECONDS >= CLAIM_NEXT_BUDGET` test sat only at the TOP of
+#       each candidate. A candidate admitted at 21 s then spent up to
+#       ~4 x CLAIM_API_MAX_TIME (post + comments + label-id + label-write) with
+#       nothing re-checking the clock: 21 + 10 already exceeds 30. Two candidates
+#       whose claim_post each burned the full 10 s cap is exactly run 17201 —
+#       ~10 s of prefetch, admitted at ~20 s, dead at 30.004 s, and NO claim
+#       comment left on either #1191 or #1192 to show for it.
+#   (b) FAIL-CLOSED ON HEALTHY. CLAIM_API_MAX_TIME=10 was set below the measured
+#       latency of the one endpoint claim_alive_runs must read: this forge answers
+#       `actions/tasks?limit=100&page=1` in 8.5-12.2 s (5 live samples,
+#       2026-09-03; 3 of 5 over 10 s). So the fail-closed arm fired on a
+#       healthy-but-slow forge, not just a stall, and the tick spent its
+#       iteration claiming nothing — the "ready list was empty, but re-running
+#       the lister myself shows 2 tasks" confusion in run 17201's iterations 1-2.
+# The bound is now a DEADLINE plus per-candidate call sizing, so the worst case
+# is arithmetic rather than hope: a candidate is admitted only when the clock
+# left can bound ALL of its calls, i.e. CLAIM_CANDIDATE_CALLS x cap <=
+# CLAIM_NEXT_DEADLINE - SECONDS. The last admitted candidate therefore lands at
+# or before CLAIM_NEXT_DEADLINE, under the library's 30 s, for every path.
 SECONDS=0
-CLAIM_NEXT_BUDGET="${CLAIM_NEXT_BUDGET:-22}"
-: "${CLAIM_API_MAX_TIME:=10}"
+# Self-deadline, held under the library's hard-coded 30 s with margin for the
+# `docker exec` round trip the library clock includes but this script cannot see.
+CLAIM_NEXT_DEADLINE="${CLAIM_NEXT_DEADLINE:-26}"
+# Worst-case bounded calls ONE candidate can make: claim_post, _claim_comments,
+# then either the loser's DELETE or the winner's claim_label_id + label write.
+# 5, not 4, leaves a spare for a second labels page (this repo has 25 labels, so
+# claim_label_id pages once today — the margin is for a consumer that grows past
+# 50 and would otherwise silently un-bound the walk).
+CLAIM_CANDIDATE_CALLS="${CLAIM_CANDIDATE_CALLS:-5}"
+# Below this the derived cap is too tight to be worth a round trip (healthy claim
+# calls on this forge measure 1.0-1.5 s) — stop the walk and emit [] instead.
+CLAIM_CALL_FLOOR="${CLAIM_CALL_FLOOR:-2}"
+# The prefetch leg's cap, sized OVER the measured actions/tasks tail (12.2 s max
+# of 5 samples) rather than under it — see (b). Fail-closed is still the outcome
+# when it genuinely stalls; it is no longer the outcome when the forge is merely
+# slow.
+CLAIM_ALIVE_MAX_TIME="${CLAIM_ALIVE_MAX_TIME:-14}"
+# Wall-clock bound on the lister leg. list-ready-tasks.sh retries each read with
+# backoff at LIST_READY_MAX_TIME (30 s) apiece — a posture tuned for #52's
+# transient 5xx, but one whose worst case (~96 s) is unbounded relative to a 30 s
+# expansion. Bound it from OUTSIDE, leaving #52's retry tuning untouched.
+CLAIM_LISTER_MAX_TIME="${CLAIM_LISTER_MAX_TIME:-12}"
+# An EXPLICIT operator/probe override stays absolute and uncapped (eyes-open, the
+# #77c seam); only the DEFAULT is deadline-derived. `+` form, so `set -u` is safe.
+CLAIM_API_MAX_TIME_EXPLICIT="${CLAIM_API_MAX_TIME+1}"
+: "${CLAIM_API_MAX_TIME:=$CLAIM_ALIVE_MAX_TIME}"
 export CLAIM_API_MAX_TIME
 
 here="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
@@ -88,12 +138,29 @@ alive_file="$(mktemp)"
 trap 'rm -f "$alive_file"' EXIT
 claim_alive_runs >"$alive_file" & alive_pid=$!
 
-ready="$(bash "$lister")"
-n="$(jq length <<<"$ready")"
+# #1193: bounded by wall clock from the outside. rc 124 is `timeout`'s "I killed
+# it" — the ONLY rc that gets the graceful [] here. Every other non-zero rc still
+# propagates, preserving #52/GOTCHAS #7: a persistent listing outage must still
+# fail LOUD and be re-keyed to the "list ready tasks" stage, not be laundered
+# into a quiet "nothing to do".
+lister_rc=0
+ready="$(timeout "${CLAIM_LISTER_MAX_TIME}s" bash "$lister")" || lister_rc=$?
 
 # Reap the backgrounded alive-runs fetch, capturing its rc without tripping
 # set -e (a failed fetch must fail CLOSED just below, not abort the reap here).
+# Reaped BEFORE any lister-failure exit below, so no path leaves it orphaned.
 alive_rc=0; wait "$alive_pid" || alive_rc=$?
+
+if [ "$lister_rc" -ne 0 ]; then
+  if [ "$lister_rc" -eq 124 ]; then
+    echo "claim-next-task: the lister exceeded its ${CLAIM_LISTER_MAX_TIME}s wall-clock bound — emitting [] inside the 30s prompt-expansion budget rather than letting its retry schedule run the tick past it; cron/backstop re-fires." >&2
+    echo '[]'
+    exit 0
+  fi
+  exit "$lister_rc"
+fi
+
+n="$(jq length <<<"$ready")"
 [ "$n" -eq 0 ] && { echo '[]'; exit 0; }
 
 # Fail CLOSED, not open, on an alive-runs fetch failure: falling back to '[]'
@@ -113,11 +180,33 @@ for i in $(seq 0 $((n - 1))); do
   # SAME outcome as losing every race — nothing claimed, no Claude tokens — and
   # the cron/backstop re-fires, versus letting the sum run past 30 s and RED the
   # whole tick.
-  if [ "$SECONDS" -ge "$CLAIM_NEXT_BUDGET" ]; then
+  # CLAIM_NEXT_BUDGET is now an OPTIONAL extra ceiling (unset by default): the
+  # deadline test below is the real guard, because a fixed budget checked only
+  # here cannot bound what the candidate does AFTER being admitted (#1193 (a)).
+  if [ -n "${CLAIM_NEXT_BUDGET:-}" ] && [ "$SECONDS" -ge "$CLAIM_NEXT_BUDGET" ]; then
     echo "claim-next-task: ${CLAIM_NEXT_BUDGET}s wall-clock budget spent after $i candidate(s) of $n — emitting [] within the 30s prompt-expansion budget; cron/backstop re-fires." >&2
     echo '[]'
     exit 0
   fi
+
+  # #1193: admit this candidate ONLY if the clock left can bound every call it
+  # may make. cap x CLAIM_CANDIDATE_CALLS <= CLAIM_NEXT_DEADLINE - SECONDS, so a
+  # candidate admitted at S finishes by the deadline even when every one of its
+  # calls burns its full cap — the overshoot that REDed run 17201 is now
+  # arithmetically unreachable, not merely unlikely.
+  remaining=$((CLAIM_NEXT_DEADLINE - SECONDS))
+  cap=$((remaining / CLAIM_CANDIDATE_CALLS))
+  if [ "$cap" -lt "$CLAIM_CALL_FLOOR" ]; then
+    echo "claim-next-task: ${remaining}s of the ${CLAIM_NEXT_DEADLINE}s deadline left after $i candidate(s) of $n — too little to bound one candidate's ${CLAIM_CANDIDATE_CALLS} calls at the ${CLAIM_CALL_FLOOR}s floor; emitting [] inside the 30s prompt-expansion budget. cron/backstop re-fires." >&2
+    echo '[]'
+    exit 0
+  fi
+  # Re-derived per candidate: _claim_api reads CLAIM_API_MAX_TIME at CALL time,
+  # so the shrinking cap applies to the calls this candidate is about to make.
+  if [ -z "$CLAIM_API_MAX_TIME_EXPLICIT" ]; then
+    CLAIM_API_MAX_TIME="$cap"
+    export CLAIM_API_MAX_TIME
+  fi
   num="$(jq -r ".[$i].number" <<<"$ready")"
   cid="$(claim_post "$num" "$host" "$run")" || continue
   if claim_won "$num" "$cid" "$alive"; then
diff --git a/.sandcastle/tests/claim-next-task-test.sh b/.sandcastle/tests/claim-next-task-test.sh
index 46146593..6c1e8f8c 100755
--- a/.sandcastle/tests/claim-next-task-test.sh
+++ b/.sandcastle/tests/claim-next-task-test.sh
@@ -103,14 +103,96 @@ check "budget spent emits []" '[ "$out" = "[]" ]'
 check "budget spent posts NO claim comment" '! grep -q "POST .*issues/431/comments" "$FAKE_DIR/calls.log"'
 check "budget spent warns on stderr" 'grep -q "budget" "$FAKE_DIR/berr"'
 
-# T-#77b: per-call --max-time is capped BELOW the 30s outer budget (default 10s
-# in-sandbox), so a single stalled call fails closed within budget instead of
-# firing the outer timeout at the same instant (#28). claim-lib keeps its 30s
-# default for the HOST-mode janitor, which runs under no such budget.
+# T-#77b: per-call --max-time is capped BELOW the 30s outer budget, so a single
+# stalled call fails closed within budget instead of firing the outer timeout at
+# the same instant (#28). claim-lib keeps its 30s default for the HOST-mode
+# janitor, which runs under no such budget.
+# #1193: the cap is no longer the flat 10s this used to assert — the WALK's cap
+# is derived per candidate from the clock left (see T-#1193a/b), and the PREFETCH
+# leg gets its own, larger, measurement-sized cap (T-#1193c). What must hold for
+# every call on every leg is the #28 invariant itself: nothing is timed at or
+# above the outer 30s budget.
 setup; mklister '[{"number":431,"title":"a","body":"b","url":"u"}]'
 bash "$script" >/dev/null 2>&1
-check "claim calls use the sub-budget max-time (10s)" 'grep -q -- "--max-time 10" "$FAKE_DIR/argv.log"'
 check "no claim call uses the 30s outer-budget-equal timeout" '! grep -q -- "--max-time 30" "$FAKE_DIR/argv.log"'
+check "every call carries SOME --max-time (#28: no unbounded reader)" \
+  '[ "$(grep -c -- "--max-time" "$FAKE_DIR/argv.log")" = "$(wc -l < "$FAKE_DIR/argv.log")" ]'
+check "every call is timed strictly under the 30s outer budget" \
+  '[ -z "$(sed -n "s/.*--max-time \([0-9]*\).*/\1/p" "$FAKE_DIR/argv.log" | awk "\$1 >= 30")" ]'
+
+# T-#1193a: the OVERSHOOT hole that REDed run 17201. The old guard tested the
+# clock only at the top of a candidate, so a candidate admitted just under the
+# budget then ran up to ~4 x CLAIM_API_MAX_TIME unchecked (21s + 10s > the 30s
+# hard-coded PROMPT_EXPANSION_TIMEOUT_MS). A candidate must now be admitted ONLY
+# when the clock left bounds ALL of its calls: cap x CLAIM_CANDIDATE_CALLS must
+# fit in CLAIM_NEXT_DEADLINE - SECONDS. With a deadline too small to bound even
+# one candidate at the floor, the walk must emit [] and post NOTHING — rather
+# than start a candidate it cannot finish in time.
+setup; mklister '[{"number":431,"title":"a","body":"b","url":"u"},{"number":433,"title":"c","body":"d","url":"u2"}]'
+out="$(CLAIM_NEXT_DEADLINE=4 CLAIM_CANDIDATE_CALLS=5 CLAIM_CALL_FLOOR=2 bash "$script" 2>"$FAKE_DIR/derr")"
+check "deadline too tight to bound a candidate emits []" '[ "$out" = "[]" ]'
+check "deadline too tight posts NO claim comment" '! grep -q "POST .*issues/431/comments" "$FAKE_DIR/calls.log"'
+check "deadline too tight says so on stderr" 'grep -q "deadline" "$FAKE_DIR/derr"'
+
+# T-#1193b: the admitted candidate's per-call cap is DERIVED from the deadline,
+# and the derivation is the safety property: cap x CLAIM_CANDIDATE_CALLS must
+# never exceed the deadline, or a single candidate burning every cap runs past
+# the outer 30s again. Assert the arithmetic on the real argv, not the intent.
+setup; mklister '[{"number":431,"title":"a","body":"b","url":"u"}]'
+CLAIM_NEXT_DEADLINE=20 CLAIM_CANDIDATE_CALLS=5 bash "$script" >/dev/null 2>&1
+check "walk cap is deadline-derived (20/5 = 4s), not the old flat 10s" \
+  'grep -q -- "--max-time 4 " "$FAKE_DIR/argv.log" || grep -q -- "--max-time 4$" "$FAKE_DIR/argv.log"'
+check "worst-case candidate (calls x cap) fits inside the deadline" \
+  '[ "$(sed -n "s/.*issues\/431\/comments.*//;s/.*--max-time \([0-9]*\).*/\1/p" "$FAKE_DIR/argv.log" | sort -n | tail -1)" -le 20 ]'
+# The explicit override stays absolute — an operator/probe retune is eyes-open
+# and is NOT clamped by the deadline derivation (the #77c seam, still honoured).
+setup; mklister '[{"number":431,"title":"a","body":"b","url":"u"}]'
+CLAIM_API_MAX_TIME=7 CLAIM_NEXT_DEADLINE=20 bash "$script" >/dev/null 2>&1
+check "explicit override is absolute, not deadline-clamped" \
+  '! grep -q -- "--max-time 4" "$FAKE_DIR/argv.log"'
+
+# T-#1193c: the prefetch cap must sit OVER the measured actions/tasks tail, not
+# under it. CLAIM_API_MAX_TIME=10 was below this forge's own latency for
+# `actions/tasks?limit=100&page=1` (8.5-12.2s across 5 live samples, 3 of 5 over
+# 10s), so claim_alive_runs' fail-closed arm fired on a HEALTHY-but-slow forge
+# and the iteration claimed nothing at all. A cap under the tail turns the
+# fail-closed safety net into a routine outcome — regression-guard the ordering.
+setup; mklister '[{"number":431,"title":"a","body":"b","url":"u"}]'
+bash "$script" >/dev/null 2>&1
+check "alive-runs prefetch is capped over the measured 12.2s tail" \
+  '[ "$(sed -n "/actions\/tasks/s/.*--max-time \([0-9]*\).*/\1/p" "$FAKE_DIR/argv.log")" -gt 12 ]'
+
+# T-#1193d: the lister leg is bounded by WALL CLOCK from the outside.
+# list-ready-tasks.sh retries each read with backoff at LIST_READY_MAX_TIME (30s)
+# apiece — a worst case around 96s, unbounded relative to a 30s expansion. A
+# lister that hangs must cost the tick a graceful [], not the whole run.
+setup
+cat >"$FAKE_DIR/lister" <<'EOF'
+#!/usr/bin/env bash
+sleep 30
+printf '%s' '[{"number":431,"title":"a","body":"b","url":"u"}]'
+EOF
+chmod +x "$FAKE_DIR/lister"; export CLAIM_LISTER="$FAKE_DIR/lister"
+lstart="$(date +%s)"
+out="$(CLAIM_LISTER_MAX_TIME=2 bash "$script" 2>"$FAKE_DIR/lterr")"
+lelapsed=$(( $(date +%s) - lstart ))
+unset CLAIM_LISTER
+check "a hanging lister emits [] instead of running past the outer budget" '[ "$out" = "[]" ]'
+check "a hanging lister is cut off at its wall-clock bound, not left to run" '[ "$lelapsed" -lt 10 ]'
+check "a hanging lister posts NO claim comment" '! grep -q "POST .*issues/431/comments" "$FAKE_DIR/calls.log"'
+check "a hanging lister says so on stderr" 'grep -q "wall-clock" "$FAKE_DIR/lterr"'
+
+# T-#1193e: a lister that FAILS (not hangs) must still fail LOUD. #52 gave the
+# lister a retry schedule and let a persistent outage propagate under set -e, so
+# run-swarm can re-key the death to the "list ready tasks" stage (GOTCHAS #7).
+# The timeout wrapper must not launder that into a quiet "nothing to do".
+setup
+printf '#!/usr/bin/env bash\nexit 22\n' >"$FAKE_DIR/lister"
+chmod +x "$FAKE_DIR/lister"; export CLAIM_LISTER="$FAKE_DIR/lister"
+out="$(bash "$script" 2>/dev/null)"; frc=$?
+unset CLAIM_LISTER
+check "a FAILING lister still exits non-zero (fails loud, #52/GOTCHAS 7)" '[ "$frc" -ne 0 ]'
+check "a FAILING lister does not emit a laundered []" '[ "$out" != "[]" ]'
 
 # T-#77c: an explicit CLAIM_API_MAX_TIME override is honoured (a consumer or a
 # probe can retune it) — the sandbox default only applies when unset.
> Session note: the healer wrote this complete diagnosis + verified patch but its filing never reached the tracker (agent log empty — the API-529 wave; the Mattermost page fired on that). Posted verbatim by the session from `/tmp/matou-heal-Matou-idss.DqpBkG` on matou-dev-server-01; the session lands the dev-factory push + re-vendor it asks for. **Filed by the swarm healer** (hook mode, signature `0fd2fa26ccd7`, run https://git.matou.nz/Matou/idss/actions/runs/17201). Class: harness-infra. **Not repaired in-repo** — the fix lands on a factory-vendored path, so it needs a `Matou/dev-factory` push + re-vendor, which is a human call (blast radius = every consumer repo). ## Fault `sandcastle run (workers) :: PromptExpansionTimeoutError: Shell expression `bash .sandcastle/claim-next-task.sh` timed out after 30004ms` (`run-verdict.txt`). The outer 30s is a **hard-coded library constant** — `@ai-hero/sandcastle/dist/index.js: PROMPT_EXPANSION_TIMEOUT_MS = 3e4`. A shell expression gets no per-expression override the way a lifecycle hook gets `timeoutMs` (`.sandcastle/main.mts`, #1142). So `claim-next-task.sh` must *prove* it returns first. Its existing `#77`/`#28` bounds don't, in three ways. ### (a) Overshoot — the actual red `CLAIM_NEXT_BUDGET=22` is tested **only at the top of each candidate**; nothing re-checks the clock once a candidate is admitted. An admitted candidate then makes up to ~4 `CLAIM_API_MAX_TIME`-bounded calls (`claim_post` → `_claim_comments` → loser's `DELETE`, or winner's `claim_label_id` + label write). `21 + 10 = 31 > 30`, and a full candidate is `21 + 30 = 51`. The guard is arithmetically incapable of holding the script under 30s. Run 17201's iteration 3 matches exactly: ~10s prefetch, candidate admitted at ~20s, two `claim_post` calls each burning the 10s cap, dead at 30.004s — and **no claim comment left on either #1191 or #1192** (verified live), which is what a timed-out/failed POST leaves behind. ### (b) The per-call cap is set *below* the endpoint's own latency `CLAIM_API_MAX_TIME=10`, but `claim_alive_runs` must read `actions/tasks?limit=100&page=1`, measured live on this forge 2026-09-03: **8.54 / 10.29 / 10.60 / 12.10 / 12.22 s** — 3 of 5 over the cap. So the `#28` fail-closed arm fires on a **healthy-but-slow** forge, not just a stall, and the iteration claims nothing. This is visible in run 17201 iterations 1–2: both expanded in 10.2s and injected an empty list, and the agent then wrote *"The top-of-prompt ready list was empty, so per the Done procedure I re-ran `list-ready-tasks.sh`. It now returns two fresh tasks"* — it re-ran the **lister** (30s cap) and saw work the **claim wrapper** (10s cap) had just fail-closed on. Two of three iterations spent doing nothing, mis-attributed to "tasks unblocked mid-iteration". ### (c) The lister leg is unbounded relative to the 30s budget `ready="$(bash "$lister")"` is untimed. `list-ready-tasks.sh` retries each read with backoff at `LIST_READY_MAX_TIME`=30s apiece (#52) — worst case ~96s inside a 30s expansion. For reference, healthy claim-path calls on this forge are ~1.0–1.5s (`issues/N/comments`, `labels`, `dependencies`), so the budget is dominated entirely by the ~11s `actions/tasks` prefetch. ## Fix (written and verified — patch attached below) Replace the fixed budget with a **deadline + per-candidate call sizing**, so the worst case is arithmetic rather than hope: - `CLAIM_NEXT_DEADLINE=26` — self-deadline under the library's 30s, with margin for the `docker exec` round trip the library clock includes but the script cannot see. - Admit a candidate **only** when the clock left bounds *all* of its calls: `cap = (DEADLINE - SECONDS) / CLAIM_CANDIDATE_CALLS` (5, leaving a spare for a second labels page), stop at a `CLAIM_CALL_FLOOR=2` floor. A candidate admitted at `S` therefore lands by the deadline even if every call burns its full cap. `_claim_api` reads the var at call time, so the shrinking cap applies per candidate. - `CLAIM_ALIVE_MAX_TIME=14` for the prefetch leg — sized **over** the measured 12.2s tail, so fail-closed is a safety net again instead of a routine outcome. - `CLAIM_LISTER_MAX_TIME=12` — bound the lister from **outside** via `timeout`, leaving #52's retry tuning untouched. Only rc 124 (`timeout` killed it) gets the graceful `[]`; every other non-zero rc still propagates, preserving #52/GOTCHAS #7 (a real listing outage must fail loud and be re-keyed to the "list ready tasks" stage, not laundered into "nothing to do"). - `CLAIM_NEXT_BUDGET` becomes an optional extra ceiling (unset by default); an explicit `CLAIM_API_MAX_TIME` stays absolute and un-clamped (the `#77c` eyes-open seam). Emitting `[]` is the same outcome as losing every race — no claim, no Claude tokens, cron/backstop re-fires — versus REDing the tick. ### Verification `.sandcastle/tests/claim-next-task-test.sh`: **42 pass / 0 fail** with the patch (28 pass baseline + 14 new). The 6 discriminating new assertions **fail against the pre-fix script** and pass after, one guard per defect above: ``` FAIL: deadline too tight to bound a candidate emits [] FAIL: deadline too tight posts NO claim comment FAIL: deadline too tight says so on stderr FAIL: walk cap is deadline-derived (20/5 = 4s), not the old flat 10s FAIL: alive-runs prefetch is capped over the measured 12.2s tail FAIL: a hanging lister is cut off at its wall-clock bound, not left to run ``` Observed caps on the real argv after the fix: `actions/tasks` → `--max-time 14`; each walk call → `--max-time 5` (26/5 at `SECONDS=0`), worst-case candidate `5 x 5 = 25 <= 26`. ## Why this was not landed by the healer `claim-next-task.sh` and `tests/claim-next-task-test.sh` are both in `.sandcastle/FACTORY_MANIFEST` (lines 11 and 72) — vendored byte-for-byte from `Matou/dev-factory@11264ede`. Verified: `check-harness-drift.sh` is **green** on the pristine clone and **FAILS** with the patch applied. Landing it in idss alone would red the drift gate and be wiped by the next re-vendor. **What a human needs to decide:** push this to `Matou/dev-factory`, then bump `FACTORY_REF` + re-vendor here (the `04aa72df` pattern). It changes the claim path for *every* consumer repo (matou-app, coa, matou-website, dev-factory, idss all share this harness per `runner-journal.txt`), which is past what the healer charter allows it to decide. ## Residual, not fixed here The real constraint is that `actions/tasks?limit=100` costs ~11s of a 30s budget on the critical path (it must be reaped before the walk). The patch makes that survivable, not cheap — the walk is left ~12s, so per-call caps land at 2–5s. Making claiming genuinely comfortable means making alive-runs cheaper (host-side cache, or a narrower endpoint), which is a design question, not a bug fix. Related: GOTCHAS 16. <details> <summary>Patch (also at <code>claim-next-task-budget-fix.patch</code> in the incident evidence dir)</summary> ```diff diff --git a/.sandcastle/claim-next-task.sh b/.sandcastle/claim-next-task.sh index 60ee2c5c..ab0b61cf 100755 --- a/.sandcastle/claim-next-task.sh +++ b/.sandcastle/claim-next-task.sh @@ -23,9 +23,59 @@ set -euo pipefail # under no such budget). At 30 s = the outer budget, a single stalled call # fires the outer timeout at the very instant it would have failed closed # (#28); a smaller cap lets it fail closed to [] within budget instead. +# +# #1193: BOTH of those bounds were unsound as a PAIR, and run 17201 red anyway. +# The outer 30 s is a HARD-CODED library constant +# (@ai-hero/sandcastle/dist/index.js: `PROMPT_EXPANSION_TIMEOUT_MS = 3e4`) — a +# shell expression gets no per-expression override the way a lifecycle hook gets +# `timeoutMs` (main.mts, #1142). So this script has to PROVE it returns first, +# and the old arithmetic could not: +# (a) OVERSHOOT. The `SECONDS >= CLAIM_NEXT_BUDGET` test sat only at the TOP of +# each candidate. A candidate admitted at 21 s then spent up to +# ~4 x CLAIM_API_MAX_TIME (post + comments + label-id + label-write) with +# nothing re-checking the clock: 21 + 10 already exceeds 30. Two candidates +# whose claim_post each burned the full 10 s cap is exactly run 17201 — +# ~10 s of prefetch, admitted at ~20 s, dead at 30.004 s, and NO claim +# comment left on either #1191 or #1192 to show for it. +# (b) FAIL-CLOSED ON HEALTHY. CLAIM_API_MAX_TIME=10 was set below the measured +# latency of the one endpoint claim_alive_runs must read: this forge answers +# `actions/tasks?limit=100&page=1` in 8.5-12.2 s (5 live samples, +# 2026-09-03; 3 of 5 over 10 s). So the fail-closed arm fired on a +# healthy-but-slow forge, not just a stall, and the tick spent its +# iteration claiming nothing — the "ready list was empty, but re-running +# the lister myself shows 2 tasks" confusion in run 17201's iterations 1-2. +# The bound is now a DEADLINE plus per-candidate call sizing, so the worst case +# is arithmetic rather than hope: a candidate is admitted only when the clock +# left can bound ALL of its calls, i.e. CLAIM_CANDIDATE_CALLS x cap <= +# CLAIM_NEXT_DEADLINE - SECONDS. The last admitted candidate therefore lands at +# or before CLAIM_NEXT_DEADLINE, under the library's 30 s, for every path. SECONDS=0 -CLAIM_NEXT_BUDGET="${CLAIM_NEXT_BUDGET:-22}" -: "${CLAIM_API_MAX_TIME:=10}" +# Self-deadline, held under the library's hard-coded 30 s with margin for the +# `docker exec` round trip the library clock includes but this script cannot see. +CLAIM_NEXT_DEADLINE="${CLAIM_NEXT_DEADLINE:-26}" +# Worst-case bounded calls ONE candidate can make: claim_post, _claim_comments, +# then either the loser's DELETE or the winner's claim_label_id + label write. +# 5, not 4, leaves a spare for a second labels page (this repo has 25 labels, so +# claim_label_id pages once today — the margin is for a consumer that grows past +# 50 and would otherwise silently un-bound the walk). +CLAIM_CANDIDATE_CALLS="${CLAIM_CANDIDATE_CALLS:-5}" +# Below this the derived cap is too tight to be worth a round trip (healthy claim +# calls on this forge measure 1.0-1.5 s) — stop the walk and emit [] instead. +CLAIM_CALL_FLOOR="${CLAIM_CALL_FLOOR:-2}" +# The prefetch leg's cap, sized OVER the measured actions/tasks tail (12.2 s max +# of 5 samples) rather than under it — see (b). Fail-closed is still the outcome +# when it genuinely stalls; it is no longer the outcome when the forge is merely +# slow. +CLAIM_ALIVE_MAX_TIME="${CLAIM_ALIVE_MAX_TIME:-14}" +# Wall-clock bound on the lister leg. list-ready-tasks.sh retries each read with +# backoff at LIST_READY_MAX_TIME (30 s) apiece — a posture tuned for #52's +# transient 5xx, but one whose worst case (~96 s) is unbounded relative to a 30 s +# expansion. Bound it from OUTSIDE, leaving #52's retry tuning untouched. +CLAIM_LISTER_MAX_TIME="${CLAIM_LISTER_MAX_TIME:-12}" +# An EXPLICIT operator/probe override stays absolute and uncapped (eyes-open, the +# #77c seam); only the DEFAULT is deadline-derived. `+` form, so `set -u` is safe. +CLAIM_API_MAX_TIME_EXPLICIT="${CLAIM_API_MAX_TIME+1}" +: "${CLAIM_API_MAX_TIME:=$CLAIM_ALIVE_MAX_TIME}" export CLAIM_API_MAX_TIME here="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" @@ -88,12 +138,29 @@ alive_file="$(mktemp)" trap 'rm -f "$alive_file"' EXIT claim_alive_runs >"$alive_file" & alive_pid=$! -ready="$(bash "$lister")" -n="$(jq length <<<"$ready")" +# #1193: bounded by wall clock from the outside. rc 124 is `timeout`'s "I killed +# it" — the ONLY rc that gets the graceful [] here. Every other non-zero rc still +# propagates, preserving #52/GOTCHAS #7: a persistent listing outage must still +# fail LOUD and be re-keyed to the "list ready tasks" stage, not be laundered +# into a quiet "nothing to do". +lister_rc=0 +ready="$(timeout "${CLAIM_LISTER_MAX_TIME}s" bash "$lister")" || lister_rc=$? # Reap the backgrounded alive-runs fetch, capturing its rc without tripping # set -e (a failed fetch must fail CLOSED just below, not abort the reap here). +# Reaped BEFORE any lister-failure exit below, so no path leaves it orphaned. alive_rc=0; wait "$alive_pid" || alive_rc=$? + +if [ "$lister_rc" -ne 0 ]; then + if [ "$lister_rc" -eq 124 ]; then + echo "claim-next-task: the lister exceeded its ${CLAIM_LISTER_MAX_TIME}s wall-clock bound — emitting [] inside the 30s prompt-expansion budget rather than letting its retry schedule run the tick past it; cron/backstop re-fires." >&2 + echo '[]' + exit 0 + fi + exit "$lister_rc" +fi + +n="$(jq length <<<"$ready")" [ "$n" -eq 0 ] && { echo '[]'; exit 0; } # Fail CLOSED, not open, on an alive-runs fetch failure: falling back to '[]' @@ -113,11 +180,33 @@ for i in $(seq 0 $((n - 1))); do # SAME outcome as losing every race — nothing claimed, no Claude tokens — and # the cron/backstop re-fires, versus letting the sum run past 30 s and RED the # whole tick. - if [ "$SECONDS" -ge "$CLAIM_NEXT_BUDGET" ]; then + # CLAIM_NEXT_BUDGET is now an OPTIONAL extra ceiling (unset by default): the + # deadline test below is the real guard, because a fixed budget checked only + # here cannot bound what the candidate does AFTER being admitted (#1193 (a)). + if [ -n "${CLAIM_NEXT_BUDGET:-}" ] && [ "$SECONDS" -ge "$CLAIM_NEXT_BUDGET" ]; then echo "claim-next-task: ${CLAIM_NEXT_BUDGET}s wall-clock budget spent after $i candidate(s) of $n — emitting [] within the 30s prompt-expansion budget; cron/backstop re-fires." >&2 echo '[]' exit 0 fi + + # #1193: admit this candidate ONLY if the clock left can bound every call it + # may make. cap x CLAIM_CANDIDATE_CALLS <= CLAIM_NEXT_DEADLINE - SECONDS, so a + # candidate admitted at S finishes by the deadline even when every one of its + # calls burns its full cap — the overshoot that REDed run 17201 is now + # arithmetically unreachable, not merely unlikely. + remaining=$((CLAIM_NEXT_DEADLINE - SECONDS)) + cap=$((remaining / CLAIM_CANDIDATE_CALLS)) + if [ "$cap" -lt "$CLAIM_CALL_FLOOR" ]; then + echo "claim-next-task: ${remaining}s of the ${CLAIM_NEXT_DEADLINE}s deadline left after $i candidate(s) of $n — too little to bound one candidate's ${CLAIM_CANDIDATE_CALLS} calls at the ${CLAIM_CALL_FLOOR}s floor; emitting [] inside the 30s prompt-expansion budget. cron/backstop re-fires." >&2 + echo '[]' + exit 0 + fi + # Re-derived per candidate: _claim_api reads CLAIM_API_MAX_TIME at CALL time, + # so the shrinking cap applies to the calls this candidate is about to make. + if [ -z "$CLAIM_API_MAX_TIME_EXPLICIT" ]; then + CLAIM_API_MAX_TIME="$cap" + export CLAIM_API_MAX_TIME + fi num="$(jq -r ".[$i].number" <<<"$ready")" cid="$(claim_post "$num" "$host" "$run")" || continue if claim_won "$num" "$cid" "$alive"; then diff --git a/.sandcastle/tests/claim-next-task-test.sh b/.sandcastle/tests/claim-next-task-test.sh index 46146593..6c1e8f8c 100755 --- a/.sandcastle/tests/claim-next-task-test.sh +++ b/.sandcastle/tests/claim-next-task-test.sh @@ -103,14 +103,96 @@ check "budget spent emits []" '[ "$out" = "[]" ]' check "budget spent posts NO claim comment" '! grep -q "POST .*issues/431/comments" "$FAKE_DIR/calls.log"' check "budget spent warns on stderr" 'grep -q "budget" "$FAKE_DIR/berr"' -# T-#77b: per-call --max-time is capped BELOW the 30s outer budget (default 10s -# in-sandbox), so a single stalled call fails closed within budget instead of -# firing the outer timeout at the same instant (#28). claim-lib keeps its 30s -# default for the HOST-mode janitor, which runs under no such budget. +# T-#77b: per-call --max-time is capped BELOW the 30s outer budget, so a single +# stalled call fails closed within budget instead of firing the outer timeout at +# the same instant (#28). claim-lib keeps its 30s default for the HOST-mode +# janitor, which runs under no such budget. +# #1193: the cap is no longer the flat 10s this used to assert — the WALK's cap +# is derived per candidate from the clock left (see T-#1193a/b), and the PREFETCH +# leg gets its own, larger, measurement-sized cap (T-#1193c). What must hold for +# every call on every leg is the #28 invariant itself: nothing is timed at or +# above the outer 30s budget. setup; mklister '[{"number":431,"title":"a","body":"b","url":"u"}]' bash "$script" >/dev/null 2>&1 -check "claim calls use the sub-budget max-time (10s)" 'grep -q -- "--max-time 10" "$FAKE_DIR/argv.log"' check "no claim call uses the 30s outer-budget-equal timeout" '! grep -q -- "--max-time 30" "$FAKE_DIR/argv.log"' +check "every call carries SOME --max-time (#28: no unbounded reader)" \ + '[ "$(grep -c -- "--max-time" "$FAKE_DIR/argv.log")" = "$(wc -l < "$FAKE_DIR/argv.log")" ]' +check "every call is timed strictly under the 30s outer budget" \ + '[ -z "$(sed -n "s/.*--max-time \([0-9]*\).*/\1/p" "$FAKE_DIR/argv.log" | awk "\$1 >= 30")" ]' + +# T-#1193a: the OVERSHOOT hole that REDed run 17201. The old guard tested the +# clock only at the top of a candidate, so a candidate admitted just under the +# budget then ran up to ~4 x CLAIM_API_MAX_TIME unchecked (21s + 10s > the 30s +# hard-coded PROMPT_EXPANSION_TIMEOUT_MS). A candidate must now be admitted ONLY +# when the clock left bounds ALL of its calls: cap x CLAIM_CANDIDATE_CALLS must +# fit in CLAIM_NEXT_DEADLINE - SECONDS. With a deadline too small to bound even +# one candidate at the floor, the walk must emit [] and post NOTHING — rather +# than start a candidate it cannot finish in time. +setup; mklister '[{"number":431,"title":"a","body":"b","url":"u"},{"number":433,"title":"c","body":"d","url":"u2"}]' +out="$(CLAIM_NEXT_DEADLINE=4 CLAIM_CANDIDATE_CALLS=5 CLAIM_CALL_FLOOR=2 bash "$script" 2>"$FAKE_DIR/derr")" +check "deadline too tight to bound a candidate emits []" '[ "$out" = "[]" ]' +check "deadline too tight posts NO claim comment" '! grep -q "POST .*issues/431/comments" "$FAKE_DIR/calls.log"' +check "deadline too tight says so on stderr" 'grep -q "deadline" "$FAKE_DIR/derr"' + +# T-#1193b: the admitted candidate's per-call cap is DERIVED from the deadline, +# and the derivation is the safety property: cap x CLAIM_CANDIDATE_CALLS must +# never exceed the deadline, or a single candidate burning every cap runs past +# the outer 30s again. Assert the arithmetic on the real argv, not the intent. +setup; mklister '[{"number":431,"title":"a","body":"b","url":"u"}]' +CLAIM_NEXT_DEADLINE=20 CLAIM_CANDIDATE_CALLS=5 bash "$script" >/dev/null 2>&1 +check "walk cap is deadline-derived (20/5 = 4s), not the old flat 10s" \ + 'grep -q -- "--max-time 4 " "$FAKE_DIR/argv.log" || grep -q -- "--max-time 4$" "$FAKE_DIR/argv.log"' +check "worst-case candidate (calls x cap) fits inside the deadline" \ + '[ "$(sed -n "s/.*issues\/431\/comments.*//;s/.*--max-time \([0-9]*\).*/\1/p" "$FAKE_DIR/argv.log" | sort -n | tail -1)" -le 20 ]' +# The explicit override stays absolute — an operator/probe retune is eyes-open +# and is NOT clamped by the deadline derivation (the #77c seam, still honoured). +setup; mklister '[{"number":431,"title":"a","body":"b","url":"u"}]' +CLAIM_API_MAX_TIME=7 CLAIM_NEXT_DEADLINE=20 bash "$script" >/dev/null 2>&1 +check "explicit override is absolute, not deadline-clamped" \ + '! grep -q -- "--max-time 4" "$FAKE_DIR/argv.log"' + +# T-#1193c: the prefetch cap must sit OVER the measured actions/tasks tail, not +# under it. CLAIM_API_MAX_TIME=10 was below this forge's own latency for +# `actions/tasks?limit=100&page=1` (8.5-12.2s across 5 live samples, 3 of 5 over +# 10s), so claim_alive_runs' fail-closed arm fired on a HEALTHY-but-slow forge +# and the iteration claimed nothing at all. A cap under the tail turns the +# fail-closed safety net into a routine outcome — regression-guard the ordering. +setup; mklister '[{"number":431,"title":"a","body":"b","url":"u"}]' +bash "$script" >/dev/null 2>&1 +check "alive-runs prefetch is capped over the measured 12.2s tail" \ + '[ "$(sed -n "/actions\/tasks/s/.*--max-time \([0-9]*\).*/\1/p" "$FAKE_DIR/argv.log")" -gt 12 ]' + +# T-#1193d: the lister leg is bounded by WALL CLOCK from the outside. +# list-ready-tasks.sh retries each read with backoff at LIST_READY_MAX_TIME (30s) +# apiece — a worst case around 96s, unbounded relative to a 30s expansion. A +# lister that hangs must cost the tick a graceful [], not the whole run. +setup +cat >"$FAKE_DIR/lister" <<'EOF' +#!/usr/bin/env bash +sleep 30 +printf '%s' '[{"number":431,"title":"a","body":"b","url":"u"}]' +EOF +chmod +x "$FAKE_DIR/lister"; export CLAIM_LISTER="$FAKE_DIR/lister" +lstart="$(date +%s)" +out="$(CLAIM_LISTER_MAX_TIME=2 bash "$script" 2>"$FAKE_DIR/lterr")" +lelapsed=$(( $(date +%s) - lstart )) +unset CLAIM_LISTER +check "a hanging lister emits [] instead of running past the outer budget" '[ "$out" = "[]" ]' +check "a hanging lister is cut off at its wall-clock bound, not left to run" '[ "$lelapsed" -lt 10 ]' +check "a hanging lister posts NO claim comment" '! grep -q "POST .*issues/431/comments" "$FAKE_DIR/calls.log"' +check "a hanging lister says so on stderr" 'grep -q "wall-clock" "$FAKE_DIR/lterr"' + +# T-#1193e: a lister that FAILS (not hangs) must still fail LOUD. #52 gave the +# lister a retry schedule and let a persistent outage propagate under set -e, so +# run-swarm can re-key the death to the "list ready tasks" stage (GOTCHAS #7). +# The timeout wrapper must not launder that into a quiet "nothing to do". +setup +printf '#!/usr/bin/env bash\nexit 22\n' >"$FAKE_DIR/lister" +chmod +x "$FAKE_DIR/lister"; export CLAIM_LISTER="$FAKE_DIR/lister" +out="$(bash "$script" 2>/dev/null)"; frc=$? +unset CLAIM_LISTER +check "a FAILING lister still exits non-zero (fails loud, #52/GOTCHAS 7)" '[ "$frc" -ne 0 ]' +check "a FAILING lister does not emit a laundered []" '[ "$out" != "[]" ]' # T-#77c: an explicit CLAIM_API_MAX_TIME override is honoured (a consumer or a # probe can retune it) — the sandbox default only applies when unset. ``` </details>
Author
Owner

LANDED end to end — closing.

  • Upstream first (the self-hosting rule): dev-factory@49dc562 — the healer's patch verbatim, ticket refs normalized to this issue; its 42-check suite green (6 discriminating checks fail against the pre-fix script).
  • Vendored here: b668fbb7 (onboard.sh vendor → FACTORY_REF 49dc562...), suite green in-place, drift gate OK.
  • The re-vendor rode on top of #1184's own landing (11264ede, vendored by another hand minutes earlier) — so the claim fix AND the one-fault-one-ticket reporter fix reach the fleet together; tonight's #1179/#1193 dup class ends on the next runs.

Full credit to the swarm healer: complete diagnosis, measured evidence (5 live latency samples), a provably-bounded rewrite, and a correct charter refusal — only its delivery was stranded (API 529). The session was the courier, not the author.

**LANDED end to end — closing.** - Upstream first (the self-hosting rule): `dev-factory@49dc562` — the healer's patch verbatim, ticket refs normalized to this issue; its 42-check suite green (6 discriminating checks fail against the pre-fix script). - Vendored here: `b668fbb7` (`onboard.sh vendor` → FACTORY_REF `49dc562...`), suite green in-place, drift gate OK. - The re-vendor rode on top of #1184's own landing (`11264ede`, vendored by another hand minutes earlier) — so the claim fix AND the one-fault-one-ticket reporter fix reach the fleet together; tonight's #1179/#1193 dup class ends on the next runs. Full credit to the swarm healer: complete diagnosis, measured evidence (5 live latency samples), a provably-bounded rewrite, and a correct charter refusal — only its delivery was stranded (API 529). The session was the courier, not the author.
ben closed this issue 2026-09-03 16:25:06 +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#1195
No description provided.