claim harness vs tracker latency — stale-claim sweeper, liveness ≠ tracker-slow, budgets sized to p95 (split from #1270 B) #1279
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Matou/idss#1279
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?
Why
Split from #1270 Part B on Ben's ruling (2026-09-06). On the #1235 archive drive (2026-09-05/06) the tracker cost more wall-clock than the model did: #1246 waited 80 min and #1247 nearly 3 h on claim churn alone. Companion: #1245 (reporter re-query by sig after a 503-after-store).
What is wrong
.sandcastle/claim-lib.sh:claim_alive_runs=actions/tasks?limit=100capped atCLAIM_ALIVE_MAX_TIME=14 s;CLAIM_NEXT_DEADLINE=26 s. A slow tracker (observed p95 well above 14 s on 09-05/06) reads as "run dead".swarm-claimcomment; that DELETE fails on the same slow tracker, so stale claim comments linger and starve the next claim (12 stale claims were hand-deleted on #1247 before a live claim won).Ask (two-way, ADR 0174)
run-swarm-verdicts.logcompletion: a claim whose run has a recorded verdict (or whose run id is absent fromactions/tasksacross N consecutive successful polls) is swept, not trusted.actions/taskspoll must back off and retry (bounded), never conclude the run is dead and drop the claim..sandcastle/tests/for each: stale sweep, slow-tracker retry, budget defaults.Protected path (
.sandcastle/**, #445) →ready-for-session. Independent of #1270 Part A and of #1280.Close-report — landed (agent, ADR 0174)
All four asks landed as two-way changes (revertible commits, proven by offline tests). Every changed file is vendored from
Matou/dev-factory(#445), so — exactly like sibling #1270 Part A — the fix landed upstream first and was re-vendored here.Commits
Matou/dev-factory@51c8dc6— the fix at source (root files).Matou/idss@d42da82d— FACTORY_REFcf2efb0→51c8dc6, re-vendored.sandcastle/**,STATUS.md.What landed (
.sandcastle/claim-lib.sh+ producers)Stale-claim sweeper keyed on
run-swarm-verdicts.log. Newclaim_run_terminal <run>reads the host-side verdict log; a claim whose run has a recorded terminal verdict is swept byjanitor_sweepwithout consulting the tracker — breaking the #1247 deadlock where every alive poll timed out and the old janitor (fail-closed) could sweep nothing, and 12 stale claims had to be hand-deleted. The verdict log now carries a trailingrun=<id>field (runlog_line, additive — pre-existing lines and callers that omit it stay byte-identical;run-swarm.sh/landing-lib.shstampSWARM_RUN_ID). The pre-mergepr-openedbreadcrumb (written while the run is still alive) is explicitly not terminal.Liveness ≠ tracker-slow. A timed-out/5xx
actions/taskspoll now backs off and retries (bounded —CLAIM_ALIVE_RETRIES/CLAIM_ALIVE_RETRY_SLEEP) instead of concluding "run dead": default 2 for the host janitor, 0 for the in-sandbox prefetch (bound by the 30 s prompt-expansion budget,idss#1195). Absence-based sweeps now requireCLAIM_ABSENCE_THRESHOLD(default 2) consecutive absent successful polls (file-backed streak) so one slow/partial-200 can't false-sweep a live run. Every fail-closed invariant preserved (review finding 1, #20, #28, #468): no verdict + no alive data ⇒ claim kept.Budgets sized to p95.
CLAIM_ALIVE_MAX_TIMEraised 14→20 s (over the observed p95 that tripped on 09-05/06, still under the 26 s deadline). All new constants are env-tunable with the measured defaults.Measurement, honestly: there is no dedicated claim-latency log on the host to compute an exact p95 from — the prior evidence was 5 hand-samples (8.5–12.2 s, 09-03). So the ticket's "measure from the claim log" is now enabled: opt-in
CLAIM_LATENCY_LOGrecords<epoch> dur=<n>s rc=<n>per read, so the next tuning measures from disk instead of guessing. 20 s is the defensible interim default.Proof (offline, no network —
.sandcastle/tests/)claim-lib-test.sh: 40→67 checks. New: verdict-log signals (terminal vspr-openedbreadcrumb, prefix-collision, missing log), retry recovery + bound + rc-nonzero-on-exhaustion, latency log (on/off/per-attempt), tracker-down sweep via verdict log (the #1247 case), absence threshold + streak reset, default constants.runlog-lib-test.sh: 9→11 groups (therun=field additive; no-id line unchanged).claim-next-task-test,landing-lib-test,schedule-lib-test,run-swarm-stages-test,check-harness-drift-test,session-runner-test,verify-lib-test,record-run-result-test,run-swarm-drive-yield-testall green; drift gate green.Independent of #1270 Part A and #1280. Companion #1245 already landed (
ffc95aed). Ruled by agent under ADR 0174 — veto anytime.