Scheduler-silence canary — a tested, alerting failure mode #269
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#269
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?
Question
Forgejo silently stops firing cron schedules / push events (recurring; only
schedule-backstop.shnotices today, and nothing tests it). Decide whether a scheduler heartbeat/canary becomes a tested, alerting failure mode of the pipeline — what emits the heartbeat, what watches it, where the alert lands.Parent
Wayfinder map — e2e testing: the product and the swarm pipeline
no-triageapplied: this is a wayfinder ticket (program-level scoping,docs/agents/issue-tracker.md"Wayfinding operations"), not a bug/enhancement report — it is worked one-per-session by/wayfinderand resolved by comment + close, not by the bug/enhancement + triage-state machine. Matches precedent from #7, #8, #9, #160, #265, which closed the same way without a triage-state label.waiting, oldest 23h; ci, healer, triage, resume-asks and broker-deploy are all starved #878waiting, oldest 23h; ci, healer, triage, resume-asks and broker-deploy are all starved #878Second real incident — 2026-08-26, #878. ~2,700 no-op
swarm.ymlruns (dev-factory #103'sissues:labeledloop) buried every other workflow for ~24 h;cionmaindid not run from 05:41Z to 22:03Z and nobody noticed because the swarm kept committing. Both incidents had the same signature: the oldestwaitingrun is hours old while runs keep being created. That is the assertion a canary needs — "oldestwaitingrun younger than N minutes, per repo" — and it is readable with the same tokenschedule-backstop.shalready holds (GET /repos/{r}/actions/runs?status=waiting&limit=1→total_count+created). Recommend promoting this out ofwayfinder:grilling; the shape is now clear enough to spec.Second real incident — promoting (added
priority)This canary's second live episode just landed as #878 (2026-08-26): 165 workflow runs sat
status=waiting, unclaimed, the oldest ~23h old —ciungated onmainfor ~14h, 26 healer reds uninvestigated, 38 unclaimedtriageruns so a new issue sat unlabelled and invisible. It was silent for the whole 23h because the swarm kept committing, and — the point for this ticket — because the only host-side watcher we have was deaf to it by design.The design constraint this incident sharpens
There are two silent-scheduler failure modes, and today's backstop only guards one:
runs?status=waitingactions/tasks(claimed jobs)schedule-backstop.shcounts awaitingrun as "already covered — don't pile on" (its #238 AC3 guard, correct for its own no-double-dispatch job). So with 165 waiting runs it skipped every workflow — the exact inverse of an alarm. The backstop watches "did a run get created"; the canary must watch "is the oldest un-terminal run fresh" — an orthogonal signal (max age of any run inwaiting), and it must never readwaiting` as healthy.Answers to this ticket's three open questions, from #878
runs?event=<e>&status=waiting, oldestcreated. (Always filter by event+status; the unfiltered list is tens of MB and times out.)backstop-tick.shevery 15m — the natural host for awaiting-age check that is a sibling to the backstop, not folded into its dispatch guard.ci.ymlalready posts to a Mattermost channel (MATTERMOST_URL) — a ready shout channel.Recovery, for the record
No runner needed re-registering by hand. #871's 2026-08-26T20:13Z
ci-re-register push revived claiming repo-wide (pool runner journal 1-2 lines/hr -> 327 at 20h); the backlog then drained via concurrency-cancel + resumed claims. The cure is the same push-workflow-files-to-re-register as the creation-drop lore.Captured as GOTCHAS #95 (recognition/response half) in
4a2a3200. The detection half is this ticket.waiting, oldest 23h; ci, healer, triage, resume-asks and broker-deploy are all starved #878Cross-link from #880 (closed as a duplicate of #878).
#880 proposed a detector phrased as: "main's head sha has a
cirun, or is younger than N minutes." Worth folding into this canary's design as a complementary assertion to the oldest-waiting-age one already recorded here — but with the #878/GOTCHAS #95 caveat baked in: which endpoint it reads decides whether it works.actions/tasks(CLAIMED jobs only) for a head-shaseamrun would have fired correctly during the 2026-08-26 outage — the run was created but never claimed, so it was absent fromtasks.actions/runs?event=push(ALL runs, incl.waiting) for the same head would have false-negatived — the run existed aswaiting, so "head has a ci run" was technically true the whole time it was silently ungated.So the head-sha assertion is only a valid liveness check against the CLAIMED view; against the runs view it must additionally assert the head's run is not merely
waiting. The oldest-waiting-age assertion is the orthogonal signal that catches the claiming/saturation mode directly. Both belong.RULED 2026-08-27 (Ben, direct — no wayfinder session needed; the two incidents made the shape concrete)
Yes — it becomes a tested, alerting failure mode. The three questions:
waiting-age (runs?event=<e>&status=waiting, filtered — never the unfiltered list) catches saturation/claiming (#878); (2) claimed-head-sha —main's head older than N min must have acitask inactions/tasks(the claimed view; therunsview false-negatives on awaitingrun, #880) — catches creation-drop (2026-07-28).schedule-backstop.sh, outside Forgejo's scheduler; never folded into the backstop's dispatch guard, whose "waiting= covered" is this alarm's inverse.ask-human.shcredentials, de-bounced, with arecoveredline.Execution ticket: dev-factory #105 (
ready-for-agent+priority) — canonical home is dev-factory per ADR 0180, beside the backstop it mirrors; offline test cases (a)–(e) spelled out there, runs incivia thescripts/tests/*.shsweep. This ticket closes when the FACTORY_REF bump vendors the canary into idss.Correction to the record above
"#871's re-register push revived claiming" is not what happened. Both runners' journals (workstation + elitebook-03) show continuous claiming all day — 660 dev-factory tasks/24 h on the workstation; the 327-at-20h figure is the storm being drained, not a revival. The queue cleared when Ben bulk-cancelled the no-op backlog (~21:50Z) after dev-factory #103 stopped minting it. So the recovery for the saturation mode is cancel + stop the minter; re-pushing workflow files is the creation-drop cure only. #105 carries this so the spec doesn't encode the wrong recovery for mode 2.
Re-armed
ready-for-agentin the 2026-08-27 sweep (Ben's ruling): two live incidents on record (2026-07-28 creation-drop; 2026-08-26 #878 claim-stall), GOTCHAS #95 names the shape — a host-crontab watcher besidefactory-cron/backstop-tick.shthat alerts the ci Mattermost channel when the oldestwaitingrun per repo is older than N minutes (plus #880's head-sha-has-no-claimed-run check). Detection half only; no code exists yet. Small, well-bounded, provable offline with a fake runs list.Blocked this run — the only residue is a protected-path vendor bump (filed #891)
Following Ben's 2026-08-27 ruling: the canary's execution ticket is
dev-factory #105, and #269 closes when the FACTORY_REF bump vendors the canary
into idss.
Verified this run:
8ea613a83809f15a59f191021a2a3061be16e4b4(current dev-factory
mainHEAD) addsscheduler-canary.sh,tests/scheduler-canary-test.sh, the per-repobackstop-tick/host-state-libwiring, and GOTCHAS 34. Both detection assertions (oldest-
waiting-age +claimed-head-sha) landed there, ratchet-exempted for the
status=waitingrunsread, offline cases (a)–(e) green.
.sandcastle/FACTORY_REF = e61aa00…, which predatesthe canary —
scheduler-canary.shdoes not exist at that ref, confirmed viathe dev-factory contents API.
So #269's stated closing condition — the FACTORY_REF bump vendoring the canary
into idss — is entirely a
.sandcastle/protected-path change (#445 /GOTCHAS 4). A Sandcastle agent cannot edit protected paths, so per ADR 0174 /
Rule 9 I filed the machinery change as #891 (
ready-for-session,priority): bumpFACTORY_REFe61aa00…→8ea613a…and re-vendorscheduler-canary.sh(+ its test) viaonboard.sh vendor.Re-arm path: #891's vendor lands the canary in idss → close #269. No idss
app-side or non-protected work remains for this ticket.
Labels swapped
ready-for-agent→agent-blocked; claim released.Close-report — stated closing condition met (ADR 0174 / Rule 3).
#269's parked closing condition was: "the canary's canonical home is dev-factory (ADR 0180 / #571), beside the
schedule-backstop.shit mirrors, and #269 closes when the FACTORY_REF bump vendors the canary into idss."That vendor-in has now landed under #891 (commit
52e92e7f): idss's factory pin is bumpede61aa00…→8ea613a…(dev-factory #105), andscheduler-canary.sh+tests/scheduler-canary-test.share now in idss's vendored set (.sandcastle/FACTORY_MANIFEST). The host crontab's per-repobackstop-tickdrives idss's own vendored canary (dev-factory #105 AC3).Proof carried on #891:
check-harness-drift.shbyte-clean against the new pin, andtests/scheduler-canary-test.shgreen — 10 scenarios, cases (a)–(e): the oldest-waiting-age saturation assertion and the claimed-head-shaungatedassertion (the #880 false-negative trap) both exercised, plus the API-down alarm.idss now detects the two live scheduler-silence incidents this ticket was filed against (2026-07-28 creation-drop; 2026-08-26 #878 claim-stall; GOTCHAS #95).
Ruled by agent under ADR 0174 — veto anytime. Closing #269.
Host half of AC3 done 2026-08-27 14:19Z. The vendor-in (#891) put the canary in the repo, but the workstation crontab was still driving the 2026-08-25 render of
factory-cron/backstop-tick.sh(zerocanaryreferences). Ran the sanctionedonboard.sh host-cron diff→installfrom/home/dev/swarm/Matou/dev-factory@66f4d36: crontab backed up tocron-backups/crontab-20260827T141902Z.txt, tick rewritten with per-repocanary()(+ the #83 ordering fix and the host-sampler line that was also pending). Proof the canary probes rather than skips: a by-hand run underbash -xhit all fourruns?event=…&status=waitingqueues,actions/tasks,branches/mainand theci.ymlpresence check, exit 0 (queue healthy → silent by design). Fires every 15 min from now.Host pick-up CHECKED 2026-08-27 15:50Z — it fires, and the first live tick found three faults (dev-factory #107,
ready-for-agent+priority). The workstation cron ran the canary at 14:45/15:00/15:15/15:30/15:45. (1) Assertion 2 matches taskname == "ci"but tasks are named by JOB (seam,workflow_id: ci.yml) →claimedis always 0 → a falseMatou-idss-ungatedat 15:15 for head2f077e23, whoseseamtask had succeeded at 14:50. (2) The rendered tick sources no host env, sonotify-mattermost.shhad no URL/channel/token and the canary discards its stderr → the alarm reached nobody and left no log line (Mattermost checked: noscheduler-canary:post). (3) matou-app / matou-website / dev-factory error every tick — no vendored copy at that path (dev-factory keeps its own at the repo root). Assertion 1 is correct and quiet. Under an exact cron env the script itself runs clean (exit 0) and itsrecoveredpath cleared the stale state. Net today: the canary is running but cannot yet alert — the whole point — until #107 lands and idss re-vendors.LIVE TEST GREEN 2026-08-27 19:17Z — the canary alerts end to end. dev-factory #107 landed (
cec8b3c), idss re-vendored to it,host-cron installre-rendered the workstation tick (now sourceshost-env.sh; unvendored repos log a one-line skip). Forced checks from the host against the REAL tracker, throwaway state dir: T1CANARY_MAX_UNGATED_MIN=0on head838d8c44→ SILENT (itsseamtask is claimed — theworkflow_idmatch counts a job-named task, the #107 fault is gone). T2CANARY_MAX_WAITING=0with 1pushrun waiting → Mattermost postscheduler-canary: Matou/idss SATURATED — 1 runs waiting (> 0) for event=push+ run URL + recovery line. T3 same again → de-bounced, no second post. T4 defaults →scheduler-canary: Matou/idss recovered — event=push waiting queue back within limits.Both posts read back from the channel via the posts API. Assertion 1, assertion 2, de-bounce, recovery and delivery are all proven on the live host. Nothing outstanding on this ticket.updates-open: the Updates surface's empty sections arrive as JSONnull, the screen reads.lengthoff one, and the whole P4b surface falls to the display-fault boundary #1630