docs/spec/implementation/requirements/approver-02.md
Requirements
Section titled “Requirements”The Approver — requirements, continued (part 2 of 2; 51–55: Fleet-level invariants (the pager)…)
Section titled “The Approver — requirements, continued (part 2 of 2; 51–55: Fleet-level invariants (the pager)…)”-
Fleet-level invariants (the pager). Issue #1126’s own four-week incident table named fourteen fleet-wide failures, none surfaced by a pipeline-filed ticket: the silent ones sat four days to a month while the repair loop that does escalate closes what it catches at a 2.0 h median. Ten of the fourteen turned out to be one-line invariants once named, and every one of those ten is a fact already readable from what every node replicates — the union fleet log, every peer’s heartbeat, this node’s own doctor verdict.
lib/pager.shis where that reading happens.pager_register KEY EVAL_FN REMEDY_CLASS REMEDY_ARGbuilds a registry —PAGER_KEYS(the keys in registration order) and the associativePAGER_EVAL_FN/PAGER_EVAL_EVENTS/PAGER_REMEDY_CLASS/PAGER_REMEDY_ARG/PAGER_MIN_FIRING_MINUTES_OVERRIDE, shell arrays rather than a config file, so a repository’s ownscripts/publish-dashboard.shdecides at source time which invariants exist. EVAL_FN is a pure function,EVAL_FN FLEET_NODES_JSON UNION_LOG_FILE, printing one line —{firing, evidence}, plus an optionalnodesarray the dashboard’s own node-card badge reads — with one documented exception (page-outlived-item, below) that reads GitHub directly rather than a replicated fact, since an issue’s own terminal state is not something any heartbeat carries. UNION_LOG_FILE is the union reduced to the event types the key’s registration declares —pager_declare_events KEY [EVENT...], called afterpager_register(which clears any earlier declaration for the key, since a declaration describes the EVAL_FN registered with it), records them inPAGER_EVAL_EVENTS, and_pager_evaluate_onekeeps the lines of the union carrying"event":"<type>"for each declared type (union_prefilter,lib/union-stream.sh) into a file under the Publisher’s working set, passes that file, and removes it after. A key declared with no types receives an empty file; a key with no declaration receives the whole union; a prefilter that fails leaves the whole union in place. The remedy variables below (PAGER_REMEDY_UNION_LOG_FILE) keep the whole union. Every built-in invariant is declared (pager_register_builtin_invariants);test/union-stream.test.shchecks each built-in EVAL_FN’s program, with the bodies of the helpers it reads through, against its declaration, andtest/pager-invariants.test.shchecks that each built-in’s verdict over the reduced fixture equals its verdict over the whole one. REMEDY_CLASS is one ofpipeline-act(REMEDY_ARG names a shell function,REMEDY_ARG KEY EVIDENCE, run before filing — it performs the fix directly, never asking, and its one-line return value is recorded in the issue body),config-lever(REMEDY_ARG is prose; the tracking issue is filed alongside a second, separatepw::decisionrecord through the same filed-closed-immediately conventioncreate_decision_log_issue(requirement 36a) uses, so a config-lever remedy inherits #937’s veto window — reopen the decision record to veto), orowner-only(REMEDY_ARG is prose naming what the owner must decide; the tracking issue is assigned toenabler_assignee, the load-bearing half that excludes it from theissuessource, requirement 16.4, exactly as an ordinary Enabler escalation). Every tracking issue’s own body also carries a link to that KEY’s entry indocs/reference/reasons.md(issue #2098), built byreason_code_url(lib/reason-url.sh, sourced bylib/pager.shitself).pager_evaluateruns every registered invariant once, fromscripts/publish-dashboard.sh’s ownWITH_GITHUBtick of the Publisher (docs/spec/dashboard/publisher.md’s “The Publisher” section) — the point where this node’s own union log and every peer’s heartbeat have already converged for this tick, and the one tick allowed to touch GitHub at all. Exactly one node evaluates a given invariant in a given five-minute window: a claim on<key>__<window>(windowthe epoch second divided by 300) throughlib/claim.sh’sclaim file pager <key>__<window>— the same pseudo-slug pattern the Enabler’s ownclaims/enabler/claims use (requirement 35c) — so a claim lost or unreachable skips this node’s own evaluation for the window rather than risk two nodes filing the same invariant twice.An invariant’s lifecycle is event-sourced over the union log, transition-only on the same terms requirement 2.7’s crash-loop escalation and #937’s decision log already settled — a firing invariant re-evaluated every five minutes writes nothing new — via four event names:
pager-candidate {key, first_seen}the first evaluation seen firing;pager-candidate-cleared {key}a candidate that stopped firing beforepager_min_firing_minuteselapsed, never having been filed, so nothing to retract, only a reset;pager-fired {key, first_seen, evidence, issue_number, issue_url, remedy_class, nodes}once the hysteresis threshold is reached and the tracking issue is filed;pager-cleared {key, cleared_at, evidence}once a fired invariant evaluates clear and its issue is closed.pager_state_for/pager_last_eventderive the current state (clear/candidate/fired) purely from the latest of these four for a key, on the same no-state-file termstoken_expiry_escalated_for(acceptance check 2m) already uses for a single-shot escalation — any node, in any window, agrees with every other about what has already happened.pager_file/pager_closeare the filing and auto-close primitives. Every firing invariant that reaches the hysteresis threshold gets one issue per key, inpager_repo(empty falls back tocrash_loop_repo; both empty disables filing — invariants still evaluate andpager_filestill logspager-fired, withissue_number/issue_urlnull, so the transition still reaches the dashboard and the key can still return toclearlater; nothing is filed on GitHub and nothing is assigned), carrying the fixedpw::pagerlabel (lib/labels.sh’sescalationandtargetrole catalogues — both, so thattarget’s own MODEfullreconcile does not delete it out from under this framework in a repository holding both roles, whichpager_repo’s fallback tocrash_loop_repomakes ordinary; see requirement 6a — fixed for the identical reasonpw::decisionis: a renamed label would silently stop being found by this framework’s own dedup and auto-close search), deduped on the item referencepager:<key>the waycreate_escalation_issuededupes — a body-contains-item-ref search, never a second index — though on the bare reference rather than requirement 36a’s backtick-delimited token, these bodies carrying aref: <item>footer of their own rather than anItem: `<item>`one.The label is ensured in
pager_repoon the create path, and only there, exactly ascreate_escalation_issuedoes it (requirement 6a’slabels_reconcile_role, theescalationrole) and for the reason that function states: an escalation repository is by construction not one any cycle otherwise touches, so its labels have nowhere else to be created. Here the label is load-bearing rather than cosmetic — both the dedup above and the auto-close below find a page by it — so a page filed through the retry-without-label fallback would be re-filed on every later fire and never auto-closed, leaving on the owner’s open list precisely the stale page this requirement exists to prevent. Both dedup searches and the auto-close search state--limit 200rather than inheritinggh’s undeclared default of 30, onlib/tech-debt-file.sh’s ownTECHDEBT_DEDUP_LIST_LIMITreasoning: a truncated listing is indistinguishable from a complete one, and the direction of harm is a duplicate filed against an issue the dedup could not see.pager_closecloses it with a one-line comment naming that the fact cleared, onapprover_escalation_retire’s own established pattern (requirement 8f’s #1215 retirement), and logspager-clearedregardless of whether an open issue was actually found to close — a human who already closed it by hand, or a webhook-only filing that never became a real issue, must still let the key return toclear. Deliberately independent oflib/enabler.sh: itscreate_escalation_issue/create_decision_log_issueread cycle-scoped globals (cycle_dir,enabler_assignee,node_name,cycle_id) that exist only insideagent-cycle.sh’s own per-item cycle, which the Publisher never runs as —lib/pager.shmirrors their dedup search, their retry-without-label, andescalation_webhook_notify’s webhook fallback, parameterised, rather than reaching into a stage it is not.Configuration:
pager_enabled(defaulttrue) gates evaluation outright — the first boolean-typed key in this schema, needed because unlikecrash_loop_repo’s own empty-disables convention, an invariant’s fired/cleared transitions are worth having on the dashboard even with nopager_repoconfigured to file into, sopager_repoempty cannot double as this framework’s off switch the way it does for crash-loop escalation.pager_repo(default empty, falls back tocrash_loop_repo) andpager_min_firing_minutes(default 15) are described above.Two invariants ship with the framework (
lib/pager-invariants.sh), chosen to exercise the whole of it:verdict-unanimous(pipeline-act). Fires when every active node (.stale | not; fewer than two active nodes can never be “unanimous”) reports the identical failing verdict at once — the #1071 signature, where all four nodes readupdater: stuckbecause the reader’s rule was wrong, not because every node had independently failed the same way at the same instant. Checks, first hit wins: astage_healthstagefailingon every active node (stage_health.stagesfolds into every heartbeat already, requirement 2.8),updater.status == "stuck"on every active node (requirement 2.6), ordoctor.verdict == "fail"on every active node — the last of these needed a heartbeat change of its own:.doctor-status.json’s{timestamp, verdict}now folds intoheartbeat.jsonasdoctor, the same waystage_health‘s does, since this invariant is the first reader anywhere that needs a peer’s doctor verdict rather than only this node’s own. Since agent-ops#1397 a boundedfailsfolds in beside them — the first three entries, each truncated to 200 characters — and the doctor branch’s evidence names the entries common to every active node (at most two), so the page says which check failed rather than only that one did; nodes failing genuinely different checks, or a peer still publishing the older shape, yield no such clause rather than a wrong one, and thestage_health/updaterbranches’ evidence is unchanged. Bounding is the point:warns/skipsremain unbounded diagnostic prose with no off-node reader andtoken_expiryhas no reader off the node holding the credential, so those three stay local, and the whole fleet re-fetches this file everyschedule.state_sync_fetch_minutes.publish-dashboard.shprojects this node’s own fleet row identically, so every row in the fleet answers to one shape. Its pipeline-act remedy files apw::type:tech-debtissue against this pipeline’s own repository (the reader lives here, never in a target repo), never asking.page-outlived-item(pipeline-act). Fires when any open issue carryingenabler_escalation_labelorpw::pagerinpager_repois outlived for either of two independent reasons, checked in this order. First, the page’s ownref: pager:<key>footer line (pager_file’s own format,lib/pager.sh) names an invariant key absent from the current registry (pager_registered_keys) — a key renamed or retired out from under an open page, which the framework’s own key-equality clear logic can never match with apager-clearedevent again (agent-ops#2575:fit-ladder-pinnedwas renamed tocoordinator-fit-ladder-pinned, leaving #2372 permanently un-clearable). This check runs first and, when it matches, retires the page on that basis alone, without also running the item-concluded check below — the two are independent reasons a page can be outlived. Only a page carrying aref: pager:line can match it at all; an Enabler escalation page’s own footer names an item, not an invariant key, and never matches. Otherwise, links a PR or issue that has already gone terminal — merged, closed. The page’s own item is resolved from its body’s ownItem:· repo`` footer line (every Enabler escalation carries one) when present — settling both the item and whether it is a PR or an issue, via a gh api repos/<repo>/issues/<n>lookup on the shared issues/pulls numbering space’s ownpull_requestkey — so that a PR the body’s prose merely cites as context can never be read as the page’s own item. Only a page with no footer line falls back to scanning the body for the firstgithub.com/…/issues/<n>orgithub.com/…/pull/<n>URL it names, issue URLs checked ahead of pull-request ones. “Or” is a union of two listings, one per label, merged and deduped on the issue number, becausegh issue list’s own--label "a,b"is an intersection — it filters for issues carrying every name given — and no page ever carries both, so a single comma-joined listing would be empty in every real case and leave this invariant permanently clear. The one documented exception to “pure over replicated facts”: an issue’s own live state is the fact in question, so its EVAL_FN reads GitHub directly, throughPAGER_EVAL_REPO/PAGER_EVAL_ESCALATION_LABEL, plain shell variablespager_evaluatesets before calling it — deliberately not threaded through EVAL_FN’s own two-argument contract, so an ordinary invariant’s signature never has to know these exist. Its pipeline-act remedy closes every outlived page it finds, generalising #1215’sapprover_escalation_retirefrom the single adjudication page to every page this framework or the Enabler files — a page closed for the orphaned-key reason (agent-ops#2575) gets a comment naming the dead key rather than an item state, re-deriving the orphaned/concluded listing fresh from a newgh issue listrather than parsing EVIDENCE’s own prose, exactly as every other page in the remedy still does against its own item’s live GitHub state.
Issue #1282 (part 3c of #1126’s own findings) adds five more — fleet liveness from a peer’s vantage, the class where every signal a node emitted was one it also consumed, so only another node evaluating it can catch the gap. All five are
owner-only: none has a fix a pipeline could perform on its own behalf, unlikeverdict-unanimous’s tech-debt filing.pager_registergains a fifth, optional argument,MIN_FIRING_MINUTES_OVERRIDE— when non-empty,_pager_evaluate_oneuses it instead ofpager_evaluate’s ownMIN_FIRING_MINUTESfor that key alone (lib/pager.sh’sPAGER_MIN_FIRING_MINUTES_OVERRIDE), and an omitted one (every call site before #1282) falls through unchanged.pager_evaluatealso gains five trailing, optional parameters —CYCLE_INTERVAL_MINUTES,NODE_STALE_AFTER_MINUTES,UPDATER_STUCK_AFTER_MINUTES,DASHBOARD_FETCH_SECONDS,REVIEW_UNION_LOG_FILE— which_pager_evaluate_onesets asPAGER_EVAL_CYCLE_INTERVAL_MINUTESand four siblings, the identical plain-variable exceptionPAGER_EVAL_REPOalready established: none of these thresholds (or, forreview-pipeline-failing, the review-log union path) is a fact either of EVAL_FN’s own two arguments carries, an omitted one is empty, and every EVAL_FN below treats an empty threshold as “never fire” rather than guessing at a default.-
firing-missed(owner-only). Fires when an active node’s newest evidence of its scheduler firing — acycle-startor acycle-skipped(the implementation union log;acquire_locklogscycle-skippedonly when it found the lock held by another live pid, itself proof the scheduler ticked on schedule and deferred correctly) — is older than 2×schedule.cycle_interval_minuteswhile it holds no lock — the signature of supercronic dropping a firing outright (#1287 records the gap from the inside: nocycle-start, nocycle-skipped, nothing inlog.jsonlat all), as distinct from a cycle that is simply still running, or a long cycle whose scheduler keeps ticking (and skipping) around it. The nodes judged are the cycling ones: the row’s heartbeat is fresh and its publishedroleis not a standby’s. Freshness alone is not enough, and the role is compared normalised — lowercased, whitespace stripped, requirement 2.4’s own reading, sinceAGENT_OPS_ROLE=Activeruns unattended cycles and must not read as a standby to a peer. Both publishers of that field normalise it before it travels (requirement 2.5), so the comparison is over a value the fleet agrees on; a node running an image older than that still has its raw value read the same way here. A standby is exempt outright, not given a wider window: requirement 2.4 makes a standby tick exit before the lock, the log and the cycle directory, so it writes neither acycle-startnor acycle-skipped, the union log carries no evidence of its scheduler in either direction, and the newest cycle event it holds for that node is from before the node was demoted — any finite multiple of the interval would eventually page on it (#1686: ockham-2, whose last cycle ran on 2026-09-16, was paged repeatedly over the following days, #1768 at 7,970 minutes).The exemption’s cost is stated rather than hidden: a standby whose scheduler alone has stopped is invisible to this invariant until it is promoted, and
node-staledoes not cover it — that reads the heartbeat, whichscripts/state-sync.sh pushwrites from its own crontab line, so a node that has lost itsagent-cycle.shline and nothing else keeps publishing and looks healthy. Closing that gap means giving a standby tick a trace to be judged by, which moves requirement 2.4’s own ordering; #1788 carries it.A row whose
roleis absent, empty orunknownis judged exactly as it was before #1686: the exemption asks for positive evidence that a node is standing by, andunknown— whatscripts/publish-dashboard.shwrites for a peer whose heartbeat carries no role, and what either publisher writes for a process that was handed none — is not a node saying so. This is the one place the fleet’s record and requirement 2.4’s guard resolve silence in opposite directions, and deliberately: the guard answers “may this node spend?”, where silence must mean no; the record answers “what is this node running as?”, where silence must mean nothing at all, because astandbyinvented from an unset variable would retire a real page (requirement 2.5).Promotion is the edge a role alone cannot see. A node whose role turns
activehas a newest cycle event as old as its demotion, so the fact is true the instant the promotion publishes and stays true until the node’s first tick, which is up to a whole interval away. Nothing is filed on it: this key registers a per-key filing window ofschedule.cycle_interval_minutesplus fifteen minutes for replication (MIN_FIRING_MINUTES_OVERRIDE, the same mechanismnode-staleuses), so the promoted node’s firstcycle-startclears the candidate before a page is written, while a scheduler that has really dropped a firing holds the fact across the window and is filed as before. Demotion is the mirror image: demoting a node the fleet was paging for closes its page as cleared, because the fleet has stopped expecting cycles from it — the evidence stays in the closed issue, and #1788 is what would let the fault go on being noticed.lock.jsonis never published (scripts/state-sync.shexcludes it), so “holds no lock” is derived purely from the union log: grouping a node’s own cycle-start/cycle-end/cycle-skipped events by thecycleid they share, any group whosecycle-starthas no matchingcycle-endis evidence the lock is held — whatever the node’s newest event happens to be, so a long legitimate cycle is never mistaken for a missed one, and a chained continuation’s owncycle-start/cycle-skipped/cycle-endbecoming the node’s newest events never hides an older cycle that still holds the lock (agent-ops#1412: a second cycle chaining in while a first one is still running writes exactly that shape within a second or two of the first). A lock-contentioncycle-skipped— one whose owndetailnames a pid holding the lock (acquire_lock’s own log format) — is not lock evidence: its own holder logs acycle-startfirst, so while that start is unmatched the skip changes nothing, and once the holder has ended the skip only claims a lock nobody holds — in every band the clause could apply it was either redundant or actively suppressive, delaying a genuine missed-firing page by up to the staleness bound below (agent-ops#2441). That samedetailtest still excludes a lock-contention tick from the cycle-duration histogram described below, which is a separate question from whether the lock is held. Unmatched-start evidence is trusted only while it is younger than a four-hour bound — the same defaultlock_stale_afterdocuments elsewhere for how long a legitimate cycle may hold the lock — because a container recreation leaves its lastcycle-startpermanently unmatched, and nothing will ever write that cycle an end: trusting an unmatched start indefinitely would read a stale orphan as a lock held forever and silence a genuine missed firing on exactly the node this invariant exists to catch (agent-ops#1412’s own 2026-10-15 follow-up, which found such an orphan on three fleet nodes). Staleness itself is measured from the newer of the node’s lastcycle-startand lastcycle-skipped, not fromcycle-startalone, so a cycle that outlasts 2× the interval while its scheduler keeps ticking (and correctly skipping, because the earlier cycle still holds the lock) never crosses the age threshold either — only silence on both counts does (#1312’s review of #1282 caught a trailingcycle-skippedinverting “holds no lock” into a false positive; the fixture attest/pager-invariants.test.sh’sn5reproduces and covers it).schedule.cycle_interval_minutesis fleet-wide config, identical on every node that reads it including the evaluating one, so no peer- specific threshold needs to travel at all. The threshold is that bare interval, not requirement 1d’s worst-case gap: an installation that restrictsschedule.cycle_hoursorschedule.excluded_minutesgoes longer between firings than twice the interval by design, and this invariant would read the quiet stretch as a dropped firing. The shipped configuration restricts neither, where the two quantities coincide; #1314 carries the derivation, which needscadence_gaps(requirement 1b) to surface a gap it currently only consumes. Evidence carries each firing node’s own recent cycle-duration histogram (up to five completed cycles, matched by thecycleid every start/end pair shares, excluding any cycle whose own group also carries a lock-contentioncycle-skipped— one whosedetailnames the pid holding the lock: such a tick’s start/skip/end triple completes in about a second, and counting it alongside real cycles would read as a run of near-zero-minute entries — the all-zero histogram agent-ops#1412 found paging two mid-cycle nodes on 2026-10-15. The test is on thatdetailrather than on anycycle-skippedin the group because requirement 11a’s overrun-slot skips (reason: "overlap") are logged by the long cycle itself, before its owncycle-endand so under its owncycleid, so a group-wide exclusion would drop every cycle that outran a schedule slot — precisely the durations this histogram exists to show) — the acceptance’s own “file, with the node’s cycle-duration histogram”. A firing node whose own lastcycle-startis unmatched but too old to trust (past the bound above) has that attempt’s own age named in the evidence alongside the histogram, rather than silently dropped. -
node-stale(owner-only). Fires when a node’sheartbeat_age_s(fleet_publication_status, requirement 2.5, carried by every row including this node’s own) exceeds 2×node_stale_after_minutes— past the dashboard’s own.stalebadge (1×) and into the 2026-08-08 both-laptop-nodes signature, four days nobody was looking at a page nobody had. Files only afterpager_stale_file_after_minutes(default 180 min), its ownMIN_FIRING_MINUTES_OVERRIDE: the underlying fact is already slow-forming, so filing waits far longer than the framework’s blip-sized default. Once #1279’s notification channel lands, this class of page reaches it automatically (notify_events’ own default already namespager) — today it is filed only. -
updater-stuck(owner-only). Fires when any live node’supdater.status == "stuck"for over 2×updater_stuck_after_minutes— live, meaning a fresh heartbeat, whatever the node’s role: the updater runs from a crontab line of its own on every node, and a standby whose image has stopped rolling is a standby that cannot safely be promoted..updater.seconds(lib/updater-health.sh’supdater_status) already carries the streak’s own elapsed time, recomputed fresh on every heartbeat write, so this reads it directly rather than re-deriving an age from the union log the wayfiring-missedhas to for a fact that is never published at all. -
review-pipeline-failing(owner-only). Fires when any node’s streak of failed review runs (review-log.jsonl, fleet-replicated likelog.jsonl—scripts/state-sync.shdoes not exclude it) reaches 3 with no completed review between. A run — grouped by thereviewidreview-cycle.sh’s ownlog_eventstamps on every line — rather than a bare event, becausereview-endis written by that script’scleanup()EXIT trap on every run whatever happened, and both of its ordinaryreview-attempt-failedsites return success, so a run that just failed still reportsreview-endwithexit_code: 0; a reader resetting on that would reset on the very run it was counting and could never reach 3 at one repository per run. So, per run: anyreview-attempt-failedincrements; none, plus areview-stage-end, resets; neither — a stand-down, a skip, nothing due — leaves the streak untouched, since such a run carries no information about the pipeline’s health in either direction. That last case is the indistinguishability agent-ops#996 names, refused here rather than guessed at. 3 is not schema-backed, mirroringlib/stage-health.sh’s own un-schema-backedTHRESHOLDdefault for the identical reason it states: this class has not yet seen a real incident to tune the number against. (stage_health_ verdictsitself counts non-zerostage-endevents and never countsattempt-failedtoward its streak — the threshold is shared, the reduction is this invariant’s own, because the two pipelines record a failed attempt differently.) This invariant is the fleet-vantage reader of the same factdocs/spec/review/requirements.mdR19 publishes per node asreview_stage_health(agent-ops#996): R19 states the verdict where a human or the dashboard can read it, this invariant reduces the fleet’s replicatedreview-log.jsonlunion and files a page when nobody is reading — the two are complementary rather than redundant, and its evidence names the verdict it is the alarm for. -
dashboard-unreadable(owner-only). Fires when a row’sdashboard_fetch: {seconds, parsed}field — a fact no node can observe about itself — names a fetch slower thanpager_dashboard_fetch_seconds(default 30 s) or one that failed to parse. This field is the contract #1283’s own viewer-vantage probe is expected to fold intofleet_nodes_jsonthe same waydoctorwas folded in forverdict-unanimous(#1278); until #1283 lands and populates it, every row’sdashboard_fetchis absent and this invariant never fires — the same null-until-populated conventiondoctor/updater/stage_healthalready use for a peer row built from a heartbeat that predates the check, never a false negative from a producer that does not exist yet.
Configuration for the five:
pager_stale_file_after_minutes(default 180 min,node-stale’s own filing-hysteresis override) andpager_dashboard_fetch_seconds(default 30 s,dashboard-unreadable’s fetch-time tolerance) are new;firing-missed,updater-stuckandreview-pipeline-failingreuseschedule.cycle_interval_minutes,updater_stuck_after_minutesand a fixed, un-schema-backed 3 respectively, needing no key of their own.Issue #1281 (part 3b of #1126’s own findings) adds seven more — the selection and ledger class: the fleet-wide starvation/wedging class of #1128/#1136/#1163/#1165, this time read from the Co-Ordinator’s own selection/fit machinery and from the block/escalation ledger rather than a peer’s liveness signals.
pager_evaluategains three more trailing, optional parameters —IDLE_CYCLES,REPAIR_RATE_PERCENT,ESCALATION_BURST— set asPAGER_EVAL_IDLE_CYCLESand two siblings, the identical plain-variable exceptionPAGER_EVAL_REPO/PAGER_EVAL_CYCLE_ INTERVAL_MINUTESalready established.pager_fileadditionally setsPAGER_REMEDY_LOG_FILE,PAGER_REMEDY_UNION_LOG_FILE,PAGER_REMEDY_ NODEandPAGER_REMEDY_CYCLEbefore calling a pipeline-act REMEDY_ARG — the identical documented exception asPAGER_REMEDY_REPO, needed here becauseblocked-label-orphaned,claim-unreconciledanddigest-truncated’s own remedies re-derive their candidate set from the union log or log a new union-log event of their own, neither of whichREMEDY_ARG KEY EVIDENCE’s own two-argument contract carries.-
idle-with-demand(owner-only). Fires when a cycling node’s (firing-missed’s own reading: a fresh heartbeat and a publishedrolethat is not a standby’s) lastpager_idle_cycles(default 6) cycles all ended in stateidle-with-demand(D21,lib/node-time-state.sh) with a cause other thanback-pressure— a deliberate throttle, not a symptom, and the one exclusion the issue’s own list (usage-limit, disk/memory, unauthorized, a fleet/kill-switch’s owndown, back-pressure) names that the D21 state vocabulary does not already separate into a different state on its own: every other named exclusion already logsexternally-blockedordowninstead ofidle-with-demand. A cycle is read from its own lastnode-stateevent, grouped by thecycleid every one of them carries, becausenode-stateis emitted several times per cycle —overheadunconditionally at the top of every cycle that takes the lock, and one transition perstage-start— so onlyfinalize_node_state_for_cycle, logged once at the very end ofcleanup, says how a cycle ended; a window over raw events would demand a run of consecutiveidle-with-demandevents no cycling node can produce, and would never fire at all. A tick that skipped contributes nothing (acycle-skippedcallssuppress_node_state_transitionsand logs nonode-state), which is the wanted answer: deferring to a cycle already running is not a cycle that ended idle. The role test is #1686’s, for the same fault one invariant along and in a sharper form: a node demoted mid-streak keeps publishing a fresh heartbeat while requirement 2.4 stops its ticks, and wherefiring-missedneeds time to pass before its window is wrong, this one needs none — no further cycle will ever break the streak its last cycles left behind. Fewer thanpager_idle_cyclescycles for a node decides nothing — “last N cycles” cannot be confirmed from an incomplete window. Caught: the 2026-09-04 fleet-wide stand-down (#1163/#1165) and the 2026-08-31 starvation (#1128). Evidence embeds the node’s own most recentnone-selected.reasonandcoordinator-input-fitteddetail — the two facts a diagnosis starts from, per the issue’s own acceptance — though neither is load-bearing for the firing decision itself. -
coordinator-fit-ladder-pinned(owner-only). Fires when a node’scoordinator-input-fittedevents (lib/coordinator-input.sh,agent-cycle.sh) in the trailing 24h have all run out of prose to shed and are dropping whole entries — rung 11 or tighter, the first of the 10 entry caps that follow the 10 prose tiers (COORDINATOR_INPUT_TIERS+ 1, a fixed constant of the ladder rather than a field either array carries) — withentries_dropped > 0. A node with no fitted cycle at all in the window contributes nothing. The segment, not its last notch: #1128/#1136’s own evidence ispoetic-1pinned at the loosest entry cap (rung 9 of the eight-tier ladder of the day) dropping 48–68 entries in 149 of 150 fitted cycles since 2026-09-04, so a test for the last notch alone would miss the incident this invariant is built from. The two clauses nearly coincide by construction:coordinator_apply_rung’s own entry cap is a no-op while it is null, which is every prose rung, soentries_dropped > 0is unreachable above rung 11 — the rung floor states in the ladder’s own vocabulary what the drop count would otherwise leave implied. A node whose every fitted cycle sits on the identity-only rung 10 dropping nothing — the ordinary shape agent-ops#1379 made of a ~300-entry backlog — is not pinned. -
work-order-repaired-rate(owner-only). Fires when the fleet-wide count ofwork-order-repairedevents (agent-cycle.sh, #821 — a work order composed from trimmed input) in the trailing 24h exceedspager_repair_rate_percent(default 20) percent of that same window’sselectioncount. A window with zero selections decides nothing. Retire this invariant once #769’s part (b) lands and #1156 removes the gate this rate reads — the issue’s own instruction, recorded here since a requirement, unlike an issue comment, is what this repository’s own conventions treat as the durable copy. -
blocked-label-orphaned(pipeline-act). Fires when a liveblocked:needs-refinement/blockedlabel carries no open block behind it — eitherlib/refinement.sh’s ownown-label-actionhistory shows anaddwith no laterremove(refinement_blocked_label_stale, pure over the union log), or a live GitHub read (scoped to every repo this pipeline’s own history has ever applied theneeds-refinementblock kind or ablocked/blocked: <reason>label to, never an arbitrary configured-repo list) finds one history alone cannot prove ours (refinement_blocked_label_orphaned, requirement 38b, #816). Caught: #816 — twelve issues unselectable for five days after being unblocked. The remedy calls the identicalrefinement_label_remove/label_own_action_fieldsrequirement 38b’s own release path already uses, never a reimplementation, loggingown-label-actionon success; a removal that succeeds clears on this invariant’s own next evaluation (the label is gone), so only a removal that keeps failing stays filed — “the invariant files only if the removal fails,” in a framework that always records a pipeline-act attempt (this requirement’s own remedy-class table). A removal that fails instead logslabel-remove-failed(requirement 33,label_remove_failure_fields, agent-ops#2232), carryinggh’s own exit code and stderr text for that attempt — captured throughrefinement_label_remove‘s optionalSTDERR_VARcapture — so a genuinely stuck removal (the label missing from the repository itself) can be told apart from a stale/racing read instead of only incrementing a failure counter. A repo named only by a historic union-log event resolves throughconfig_repo_slug_aliases’{old_slug: current_slug}map (built fromPAGER_EVAL_REPOS_JSON, the dashboard’s ownreposconfig) before the liveghread, beforerefinement_blocked_label_orphaned, and before the remedy’s ownrefinement_label_removecall — the same resolution requirement 34’s set/clear match already applies (agent-ops#2359), extended here (agent-ops#2466) to the one invariant that was reading a repo straight off historic events and feeding it to a live write: a repository renamed since the block was recorded would otherwise read and write against its old slug forever, which a GitHub repo-transfer redirect serves for the read but not for the write. The resolved candidates are de-duplicated, on both the live-read and the stale-retry side: a renamed repo whose history names both its old and its current slug resolves to one repo twice, and each live listing is read, each hit counted, and each removal written and logged exactly once per repo and label rather than once per slug the history recorded.The same map (#2140) also resolves the two
lib/refinement.shfunctions’ own internal comparisons, not merely their output slug:refinement_blocked_label_stale’s own pairing groups eachown-label-actionevent by its canonical repo before matching anaddagainst a laterremove, so a label applied under a pre-rename slug and released under the current one actually pairs — the gap a resolved-output-only fix cannot close, since the two events would otherwise stay in separate groups and the retry would keep re-removing an already-absent label forever.refinement_blocked_label_orphanedresolves both its open-block-set comparison and its ownattempt-failedhistory read (latest_attempt_failed) the same way, closing the live-read half’s matching over-removal: a block still open under a repo’s pre-rename slug now still shields a live label the caller reads under the current one. Both functions default their alias argument to{}(every repo resolves to itself), a strict extension with no behaviour change where noprevious_slugsis configured. -
claim-unreconciled(pipeline-act). Fires when anenabler-examinedevent whoseoutcomeis the Enabler’s own escalate verdict (lib/enabler.sh:outcome="$verdict", never reassigned on the path that actually files) in the trailing 24h carries noescalated/tech-debt-filedevent for the same repo, item and cycle. Caught: #815 — #640 sat blocked five days on a claim an adjudication pass had cancelled; this invariant catches the same signature recurring by a different route (a crash between the claim and its own reconciliation, or an engagement that never reached it). The remedy re-checks live — never parsing EVIDENCE’s own prose, onpager_remedy_page_outlived_item’s own terms — and, for any claim still unreconciled, posts one correction comment on the item’s own thread, mirroring (never calling —escalation_thread_reconcilereads cycle-scoped globals this framework’s process does not have, this requirement’s own header) the #815 correction-comment pattern, over the identical window its own EVAL_FN read. Both are windowed, and a ledger reader has to be:log.jsonlis never rotated, so an unwindowed reading would fire on #815’s own original incident — still in this fleet’s history — could never clear (a fact derived from immutable history stays true for ever, sopager_closewould never run), and would comment on items settled months ago. -
escalation-burst(owner-only). Fires when the fleet-wide count ofescalatedevents in the trailing 24h exceedspager_escalation_burst(default 10), or the same re-flag reason — the triggeringattempt-failed’s owndetail/unblock_condition, fingerprinted withescalation_autonomy_decide_reason_key(lib/escalation-autonomy.sh, requirement 36d’s own per-reason bound, reused rather than duplicated) — pages the same item twice inside that same 24h, regardless of the count threshold. Both halves are windowed, the re-flag half forclaim-unreconciled’s own reason (an unrotated union log would leave the 2026-08-28 burst below firing this for ever, unclearably) and because the window bounds the per-escalation fingerprinting this half performs on a path that runs every five minutes. Theattempt-failedhalf is not windowed: it is read only to name the reason behind an escalation already inside the window, and the re-flag it names may be a little older than the page it caused. Caught: 2026-08-28 (#933–#938; 55% mechanical, from three unfixed bugs). Evidence carries the reason histogram. -
digest-truncated(pipeline-act). Fires when a repo’s most recentsource-state-digestevent (lib/candidate-gather.sh, logged alongsidegather_source_state’s own already-fetched counts — no extraghcall on that cheap per-cycle path) still claimingok: trueundercounts a live total this invariant fetches itself via GitHub’s search API, once per evaluation window rather than once per node per cycle. That live query carries acreated:<=<ts>qualifier bound to the matched digest event’s ownts(everylog_eventwrite already carries one), rather than reading an unbounded “right now” total — without the bound, a repo that creates issues/PRs quickly (this pipeline’s own traffic, several per cycle) under-reads its own live total against a digest only a few minutes old, which is drift, not truncation (#1348). Caught: #1165 — requirement 34i read absence- from-digest as “closed” and false-cleared every block older than the newest hundred; #1165 already fixed the root cause (api_json_paged’s own full pagination inscripts/gather-source- state.sh), so this invariant is a regression watchdog for the same signature recurring. The remedy logs adigest-truncation-vetoevent for the affected repo(s) (parsed from EVIDENCE’s own repo tokens);lib/candidate-gather.shchecks for one still active (within a trailing 24h) immediately after its owngather_source_statecall and forces that cycle’s digestok: falsewhen it finds one, sowork_gone_clearances’s ownok == truegate — “unknown decides nothing” — refuses to act on that repo’s absence for the vetoed cycle, exactly the issue’s own remedy text (“refuse to act on absence for that cycle, then file”).
Configuration for the seven:
pager_idle_cycles(default 6),pager_repair_rate_percent(default 20) andpager_escalation_burst(default 10) are new;blocked-label-orphaned,claim-unreconciledanddigest-truncatedread no new configuration of their own, only the union log and (for the latter two) a live GitHub read.Issue #1280 (part 3a of #1126’s own findings) adds three more — landing and approval: the class where a pull request sits ready, or a whole repository stops landing, with nothing any existing invariant reads catching it, because the facts live in the Landing Gate’s own refusal path (
lib/landing.sh) and the Approver’s own unreviewed-trigger memory (requirement 46) rather than a node’s liveness or the Co-Ordinator’s own selection machinery.pager_evaluategains four more trailing, optional parameters —REPOS_JSON,PR_LABEL,APPROVER_UNREVIEWED_ENGAGE_AFTER_HOURS,LANDING_ARMED_WITHIN_DAYS— set asPAGER_EVAL_REPOS_JSONand three siblings, the identical plain-variable exceptionPAGER_EVAL_REPO/PAGER_EVAL_CYCLE_INTERVAL_ MINUTESalready established.PAGER_EVAL_REPOS_JSONcarries each configured repository’sslug, its ownprevious_slugs(whatblocked-label-orphanedabove builds its alias map from;[]for a repository that has never been renamed) and its own configuredmerge_autonomylevel (a repository’s own override, else the fleet-wide default) — never the live effective level, the identical D18 WI-6 approximationconfig_json’s own back-pressure card already makes, since a per-repository merge-budget- freeze read is a cost neither this invariant nor that card pays on every evaluation.landing-never-armed(pipeline-act). Fires when a repository configured at merge_autonomyagent-merges-routineor above logged at least one countablelanding-refusedevent in the trailingpager_landing_armed_within_days(default 7) window but nolanding-armedevent in that same window. Caught: #718 — agent-ops sat atagent-merges-routinefrom 2026-08-18 with 115landing-refusedand zero armings for six days, becauselanding_protected_paths_hit’sgh api … -FPOSTed and 404’d on every call. Thelanding-refusedgate is deliberate, never “nolanding-armedevent” alone: a repository with nothing ready to land in the window is not this incident, and would otherwise fire on every quiet repository at this level, forever. “Countable” (issue #1992) discounts exactly one thing: aprotected-path-cooloffrefusal (lib/landing.shgate 4.5) whose own cool-off window —approved_atpluslanding_cool_off_hours, both parsed back out of the refusal’s ownreasontext — had not yet elapsed as of that refusal’s own loggedts, never the evaluation’s own “now” (a window judged against “now” would make every cool-off refusal look stuck once enough wall-clock time passes, however early the pull request actually merged); a repository whose every in-window refusal was logged while its own cool-off was still open is waiting exactly as configured, not failing, while one carrying a refusal whose owntspostdates its stated window (or that carries any other class) still fires. No other class is excluded wholesale:ineligible/autonomy-level/kill-switchall still count on their own, since doing otherwise would also hide a non-critical-tier gate 4.5 refusal (classprotected-path-tier) or a tier-read gap that never self-corrects. Evidence embeds each firing repository’s own refusal-class histogram, grouped on eachlanding-refusedevent’s ownclassfield (never areasonparse, which cannot tell a class prefix from an embeddedpr_url’s own scheme colon — TD-PPagop-26082502), and states “(the #718 signature)” only when that histogram actually contains classunknown— #718 was a live GitHub read failing closed, a fact only that class asserts, so a firing made entirely of deterministic classes gets the histogram and no false diagnosis. The pipeline-act remedy files apw::type:tech-debtissue against this pipeline’s own repository (the reader,lib/landing.sh, lives here, never in a target repo), naming the histogram and, on the same condition as the evidence, the #718 diagnosis, onverdict-unanimous’s own terms.landing-refused-unknown(pipeline-act). Fires whenlanding-refusedevents of classunknown(lib/landing.sh’s ownunknown:<reason>vocabulary — the fail-closed answerlanding_eligible/landing_protected_path_controls_okgive when a live GitHub read could not even be attempted, never a deterministicineligible) make up at least half of a trailing-24h window’slanding-refusedevents, fleet-wide, with at least five. Caught: the same #718 incident (72 of 115). The fraction and the floor are fixed, un-schema-backed constants,review-pipeline-failing’s own precedent above, for the identical reason it states: this class has not yet seen a second incident to tune them against. The pipeline-act remedy files apw::type:tech-debtissue on the identical termslanding-never-armed’s own remedy uses — the two invariants share one root cause class, and often fire together for the same incident.pr-unreviewed(pipeline-act). Fires when at least one ready, non-draft,pr_labelpull request, older thanapprover_unreviewed_engage_after_hours(requirement 46’s own cutoff, reused rather than duplicated), carries no standing review at all (GitHub’s ownreviewDecision, read once per candidate repository’s owngh pr listcall — a superset of “no standing App review” specific enough in practice, since a third party reviewing an autonomous pipeline’s own pull request ahead of the Approver is not the ordinary case this invariant needs to rule out, and costs no further per-pull-request API call the way a live per-pull-request read would), noapprover-verdict, no warning naming it and noapprover-unreviewed-engagedevent at all — never merely stale, the total silence of requirement 46’s own unreviewed trigger (#890) never having run for this pull request even once. A cutoff that fails to produce a usable value — a schema-illegalapprover_unreviewed_engage_after_hours(e.g."2h"), rejected by_pager_pr_unreviewed_candidates’s own upstream numeric-format guard before it ever reaches_pager_ready_pr_candidates, or a schema-legal but extreme one that reaches_pager_ready_pr_candidatesand overflowsstrftimethere — logs its ownwarningeither way (namingapprover_unreviewed_engage_after_hours, the raw value and whichever of the two functions rejected it) and never fires, rather than being silently indistinguishable from an empty backlog. Of the two, only the second is reachable from the pipeline’s own evaluation site:scripts/publish-dashboard.shsubstitutes the schema default (2) for a configured value failing that same numeric-format regex before it passes one at all, so the guard in_pager_pr_unreviewed_candidatesstates the function’s own contract for a caller that passes the configured value through unchanged, and a schema-illegal key evaluates this invariant at the substituted default rather than disabling it. Caught: PR #1059, stranded when the kill-switch read failed closed with no log line (#1081) — exactly the silent skip this invariant is built to notice from outside the sweep that skipped. The pipeline-act remedy logs the identicalapprover-unreviewed-engagedevent requirement 46’s own sweep would (result: "unavailable", truthful — this framework has no clone or model credential with which to post a real review itself, the host-independence this issue’s own compatibility note requires) for every candidate found. Logging it is the “enqueue” half of the issue’s own remedy text: it starts the escalate clock_approver_restale_sweep_reporeads (approver_unreviewed_prior_engagement) for a pull request that clock had never started for at all, so the very next ordinary sweep — any node, its own next cycle, needing no signal from here to run — either posts a real review or, onceapprover_restale_escalate_after_hourspasses from this logged engagement, escalates toenabler_assigneeitself: the “file if a second window passes” half of the issue’s own remedy text, performed by the sweep this remedy hands the baton to rather than reimplemented here.
Configuration for the three:
pager_landing_armed_within_days(default 7 days) is new;landing-refused-unknownreads no new configuration of its own (fixed constants only);pr-unreviewedreusespr_labelandapprover_unreviewed_engage_after_hours, needing no key of their own. All three read the union log and the forge alone — never a clone, never a host — the compatibility this issue’s own acceptance names for the orchestrated-container target.Issue #2277 adds one more, promoted from a finding the Pipeline Monitor restated across two reports (
monitor_promote_after’s own threshold for turning a repeat finding into a deterministic invariant rather than a recurring issue):gather-claimed-degraded(pipeline-act). Fires when aguard-degradedevent (agent-cycle.sh’sguard_warn) names agather_claimed:<repo>site whosedetailcarries jq’s ownstartswith() requires string inputstext, in the trailing 24h — windowed onescalation-burst’s own terms, since the union log is never rotated and an unwindowed reading could never clear. This signature is deterministic rather than a statistical burst, so no tunable threshold gates it: one matching event in the window is enough to fire. Caught: #2277 itself —gather_claimed’s (lib/candidate-select.sh) consumption ofdo_branches()’s (lib/claim.sh) owngh api --paginate --slurp --jqresult, an array of per-page arrays rather than the flat array of branch-name strings its own comment promises, sostartswith()throws on the non-string per-page element unconditionally oncebranch_prefixis non-empty — independent of whether the repo holds any real claim branches, which is why it fired even on a repo with zero issues and zero open pull requests. The pipeline-act remedy files apw::type:tech-debtissue against this pipeline’s own repository (the reader lives here, never in a target repo), naming the root cause above, onverdict-unanimous’s own terms. No new configuration: the invariant reads the union log alone.Issue #2698 adds one more, giving a live node’s memory-cgroup verdict the paging path #1569/#1579 went without: that saga’s own resolution took five autonomous investigations escalating to the owner, over roughly nine days, before a human was paged directly — the designed blocked-item fallback working, but far slower than firing on the verdict itself would have:
memory-cgroup(owner-only). Fires when any live node’sdoctor.memory_cgroup—scripts/doctor.sh’s hourly unattended pass,lib/memory.sh’s ownmemory_cgroup_verdict, now published in the heartbeat’sdoctorobject alongsidetimestamp/verdict/fails(scripts/state-sync.sh, additive) — readslivelocked, or readsunboundedand the siblingdoctor.memory_cgroup_acceptedflag is nottrue.bounded/unconfirmed/unlimited/absent never fire it: the first two are already reclaimed or uncapped, andunconfirmedis a measurement gap rather than a known-bad configuration. The remedy is owner-only because fixing it is a host-configuration change — settingmemory.highon the node’s own parent cgroup, exactly what #1579 did — never one this pipeline can perform on its own behalf. No new configuration: the invariant readsfleet_nodes_jsonalone, declared with no event types, onnode-stale/updater-stuck’s own terms.Issue #2885 adds the
doctor.memory_cgroup_acceptedflag itself: a standing owner decision (#2861) to keep an unbounded cgroup on this fleet’s VM nodes otherwise had no way to retire this very page, since nothing short of changing the cgroup clears anunbounded/livelockedreading on its own.AGENT_OPS_MEMORY_CGROUP_ACCEPTED(.env, never written by any pipeline stage) names the one value the owner accepts;lib/memory.sh’smemory_cgroup_accepted_verdictsets the flag only while the setting readsunboundedand the live verdict matches it, so a node whose verdict later changes is judged afresh, and never forlivelocked, whichdoctor.shwarns about instead of honouring. This changes no configuration or event declaration of the invariant itself — only whatpager_eval_memory_cgroup’s own predicate now excludes.Issues #2779/#2528 both describe the same shape going undetected for weeks on the viewer-vantage probe (
docs/reference/host-facts-schema.md‘sviewer_probe): every node’s probe of every target failed identically, indistinguishable from a legitimate but unlucky result since nothing compared one node’s reading against its peers’. Issue #2781 addsverdict-unanimous’s own shape for that field:viewer-probe-unanimous(pipeline-act). Fires when every live node’s embedded host-facts record — a fleet row’shostkey (scripts/publish-dashboard.sh) — has a non-null, non-emptyviewer_probeobject (a top-level sibling field of that record, not nested under the record’s own, differently-shapedhostsub-object of disk/mem facts, so the path read is.host.viewer_probe, never the bare.viewer_probe) whose every entry reads.ok == false. A node whose.hostis null (the collector hasn’t run, or hasn’t replicated here yet) or whoseviewer_probeobject is empty does not count as “all failing” by vacuous truth — it fails that node’s own all-false test exactly as an absent.doctor/.stage_healthfailsverdict-unanimous’s own per-node test, which is enough to keep the fleet-wideallfrom firing without a separate missing-data branch. The pipeline-act remedy reusespager_remedy_verdict_unanimousunchanged — it is already generic over KEY/EVIDENCE and files apw::type:tech-debtissue against this pipeline’s own repository, the reader living here (lib/stage-health.sh/lib/updater-health.sh/scripts/doctor.sh’s own rules being the thing most likely wrong), never in a target repo. No new configuration: the invariant readsfleet_nodes_jsonalone, declared with no event types, onverdict-unanimous’s own terms.docs/spec/dashboard/publisher.md’s “The Publisher” section documents the evaluation site and theWITH_GITHUB-not-merely-FULLgate; its own page-rendering section documents thepager-firingbanner and node-card badge this requirement’snodesfield feeds. -
Landing-refusal pre-fetch (issue #979). Requirement 8d gate 4 (
_landing_stage_attempt,lib/landing.sh) refuses to arm a pull request over an unreconciled human comment (reconciliation-unanswered:) or an unreadable comment-reconciliation read (reconciliation-unreadable:) — correctly, since it is the human veto D18 promises — but that refusal by itself is a dead end:scripts/gather-review-feedback.sh’s own candidate rule cannot see it (no formalCHANGES_REQUESTED, no draft flip), andscripts/gather-abandoned-drafts.shonly ever sees drafts, while the pull request stays Ready. Before this requirement, the only trace was onelanding-refusedlog line per cycle that nothing read back into work, andscripts/sweep-human-visibility.sh’s own idle nudge (requirement 38c) told the assignee the pull request “is waiting on a merge click” — true of every other approved, green, mergeable pull request, false of this one.scripts/gather-landing-refusals.sh(gather_landing_refusals,lib/candidate-select.sh) is the route back: for a repo whosesourceslistslanding-refusals, it lists that repo’s own open, non-draftpr_labelpull requests and, for each, reads the fleet-wide union log’s most recentlanding-refusedevent for that pull request (lib/landing.sh’slanding_latest_refusal_reason, the sameLOG_FILEconventionlanding_retry_tieralready established — a peer node’s own cycle may have logged the refusal this node must still see). A pull request is a candidate iff that event’sreasonbeginsreconciliation-unanswered:orreconciliation-unreadable:andlib/reconciliation-gate.sh’s ownreconciliation_unreconciled_comments(unbounded, the identical call gate 4 itself makes), asked fresh right now, still reports at least one unreconciled human comment — the “answered clause” every finishing source needs (scripts/gather- dequeued.sh’s own header), since the old log event never disappears once the Implementer’s<!-- agent-ops:reconciles comment=<id> -->reply clears it. Reading the logged refusal rather than recomputing gate 4’s own reconciliation check independently is deliberate: gate 4 only ever reaches that check once every gate before it — approval, no formalCHANGES_REQUESTED, a green required-check list — has already passed, so this source stays complementary toreview-feedbackrather than duplicating it for a pull request review-feedback already covers for a different reason._reconciliation_gate_comments(lib/reconciliation-gate.sh) carries awhofield (the comment author’s login) alongside its existingid/at/body/botfields, and_reconciliation_gate_unreconciledfactors the “unreconciled” testreconciliation_gateitself reports asdirtyinto its own function, returning{id, at, author, body}per unreconciled comment (requirement 34a: one definition per rule) — the structured shapereconciliation_unreconciled_comments(a new public entry point, unbounded NOT_AFTER) exposes for a caller needing the comment’s own text rather than a permalink string.reconciliation_gateitself is unchanged in every observable respect: it calls the same shared helper internally and still reportsclean/dirty<TAB>reason/unknown<TAB>reasonexactly as before.The candidate ref is
pr-<n>-landing-refusal-<ids>, where<ids>is the sorted, hyphen-joined set of currently-unreconciled comment ids — not the pull request alone — on the same “an item recorded blocked stays blocked until something clears it” reasoning every sibling finishing source’s own scoped ref follows (scripts/gather-dequeued.sh’s header): answering one comment, or a fresh comment arriving, changes the set and mints a candidate no old block or void covers, while an unchanged set keeps the same ref and stays correctly blocked or claimed. The candidate carriesrefused_at/reason(the logged event),comments(the structured array) andbody(every unreconciled comment rendered verbatim, oldest first, the waygather-review-feedback.shassembles review text) — the Implementer’s brief is the comment prose itself, never a summary of it.Wired into the ordinary pre-fetch machinery exactly as
review-feedback/merge-conflicts/dequeuedare: gated onsourcesnaminglanding-refusals, folded into the “expensive” per-cycle band (lib/ expensive-gather-cache.sh) alongside its eight siblings,emit_first_seenand claim exclusion (exclude_claimed_prs/exclude_claimed_items) applied identically, and carried on the Co-Ordinator’s own runtime input as each repo entry’slanding_refusalsarray. The selection side is wired to match, band for band, with the same six lists every other pre-fetched source appears in: requirement 3c/3u’s blocked-and-void second pass (lib/eligibility.sh’s own band loop), requirement 3x’s eligible-set denominator (coordinator_eligible_items), requirement 17h’s compose (CANDIDATE_ENTRY_LOOKUP_JQ/CANDIDATE_TEMPLATE_JQ, whoseacceptancefor this source is to answer every unreconciled comment and cite each with its own<!-- agent-ops:reconciles comment=<id> -->line), requirement 3v’s deterministic fallback (fallback_select_candidate, ranked immediately afterdequeued), and requirement 39a’s own Refiner candidate walk (refiner_candidate_items,lib/refinement.sh), which reaches this band like any other so arefinement_policyset for it can actually be satisfied — andPREFLIGHT_EXISTING_BRANCH_SOURCES(requirement 34m), which this source joins as a fifth member because its branch and pull request predate the claim — and, for the same reason and necessarily together with it, requirement 17’s own claim dispatch (agent-cycle.sh), where this source takes the file claim keyed on its item ref and the PR-keyedpr-<n>claim beside it, never a branch claim: a branch claim here would mintagent/pr-<n>-landing-refusal-<ids>fresh off the default branch and overwrite the candidate’s ownbranchwith it, so the Implementer would push to a branch the refused pull request does not track and the<!-- agent-ops:reconciles comment=<id> -->line that clears gate 4 would never reach it. Two more inputs outside that six-list set also carrylanding_refusals, for reasons requirement 3b and 34k’s own text already give in general:lib/noop-skip.sh’s no-op fingerprint (requirement 3b) hashes it verbatim, on the identical reasoningdequeuedalready established there — gate 4’s own refusal moves nothing else the fingerprint samples, so leaving this source out of it would be the exact silent stall that file’s own header warns against, for the one source whose entire purpose is giving a refusal a route back to work; andscripts/close-void-github-items.sh’s pull-request-close exclusion (requirement 34k) treatspr-<n>-landing-refusal-<ids>exactly as it treats-conflict-/-dequeued-, since a landing-refusals void makes the identical claim (the refusal is gone, not the pull request). Deliberately not folded into requirement 2.2a’s four-source back-pressure/drain finishing set, nor into the claim-pattern and void-corroboration parity the other four finishing sources share (lib/drain.sh,lib/claim.sh,lib/void- guard.sh) — extending those is a separate policy question (whether this source alone should keep back-pressure from tripping, or a drain from reaching rest) this issue’s own refined scope did not ask for, tracked instead as its own deferred item.scripts/sweep-human-visibility.sh’s idle nudge (requirement 38c) takes an optional fourth argument, the fleet-wide union log; when a pull request’s most recentlanding-refusedevent readsreconciliation-unanswered:/reconciliation-unreadable:and a fresh live check still confirms at least one unreconciled comment, the nudge names that reason instead of “waiting on a merge click” — the same marker-based once-per-state suppression as before,<!-- agent-ops:human-nudge -->, so the fix changes the wording a human sees, not how often they see it.lib/standdown.sh’s own call site passesunion_logalongside the existingcycle_id/node_namearguments. -
Resource usage and budgets, self-measured (D14, issue #606). #755 gave every container a
mem_limit/cpusceiling (this file’s own “Every container carries a resource ceiling” design decision, above) and requirement 2.0g checks the declared sum against the host, but neither measures what a container actually uses, and neither says anything about disk or bandwidth at all — the two budgets D14 also names that Compose and this kernel cannot enforce (the same design decision’s own paragraph). This requirement is the measured, reported half: a baseline for all four resources, budgets stated inconfig.jsonrather than only in a compose comment, actuals published per node and per container, and a container or volume over budget made a reportable condition — the “Done when” the issue’s own specification (2026-08-21, adjudicated adequate the same day) sets out.What is measured, and from where.
lib/resource-usage.shreads this container’s own cgroup and/proc/net/devdirectly — self-measurement, not the host-facts collector’s Docker-socket vantage (scripts/collect-host-facts.sh, requirement 2.0g’s own source): every container that vantage could reach either already has amem_limit/cpusceiling from #755 (the enforcement half) or is out of scope for self-measurement here regardless (tailscale/watchtowerrun no agent-ops script to self-measure from;egress-proxy/collector/reconcilerare deferred, agent-ops#1563). In scope:scheduler,dashboardanddashboard-local— the three services that run this image — plus theworkspace_root/state_dirvolumes they mount.resource_cgroup_versionreadsROOT/cgroup.controllers(v2) orROOT/memory/memory.usage_in_bytes(v1) to tell the two cgroup layouts apart — the fleet is not uniform, one node presents v1 and its siblings v2 — and every read below takes that layout as an argument rather than assuming one, returning empty, never a fabricated0, off an"unknown"layout or a missing file.resource_memory_current_bytesreadsmemory.current(v2) ormemory/memory.usage_in_bytes(v1);resource_cpu_usage_nanosreadscpu.stat’susage_usec(v2, scaled to nanoseconds) orcpuacct/cpuacct.usage(v1, already nanoseconds) — both cumulative counters since the cgroup was created, never a rate by themselves.resource_net_bytessums every non-loopback interface’srx/txbyte counters from/proc/net/dev(not namespaced away from this container — reading it from inside answers for this container’s own interface, unlike/proc/meminfo, which requirement 2.0f’s own header already establishes reads the host’s figures because memory accounting is not namespaced the same way).resource_disk_usage_bytesisdu -sbon a volume path.Deltas, never absolutes, for CPU and bandwidth.
resource_cpu_coresandresource_rate_per_houreach take two samples — a value and a Unix-epoch timestamp, taken and cached a tick apart — and refuse to report a rate when the later value is smaller than the earlier one: a container recreation resets both counters to zero, and reporting the negative delta a naive subtraction would produce is worse than reporting nothing, the same “no evidence is not evidence” disciplinelib/host-budget.sh’s own unknown-ceiling exclusion already holds. Memory and disk are read as instantaneous values, not deltas — a cgroup’smemory.currentand a volume’sdutotal are already the figure a budget compares against, not a counter to difference.The collector, its cadence, and what it writes.
scripts/collect-resource-usage.shis one sample tick: it readsAGENT_OPS_SERVICE(or--service) to know which container it is running in, tags every sample and every disk reading with that name — the same keyconfig.json’sresources.containers/resources.volumesbudgets are read back under — computes this tick’scpu_cores/net_rx_bytes_per_hour/net_tx_bytes_per_houragainst the previous tick’s cached cumulative reading (state_dir/.resource-usage-state.json, one small JSON object keyed by service name), appends a sample line tostate_dir/.resource-samples.jsonl, and prunes anything older thanresources.sample_retention_hours(default 48) on every tick unless called with--no-prune. Disk is sampled far less often — aduon a multi-GB tree is not the cheap read a cgroup file is — throttled separately toresources.disk_sample_interval_minutes(default 60) via a marker in the same state file, and only for a volume this container actually has mounted (-dchecked beforedu). Both files are guarded withflock(the same ledger-append idiomlib/gh-shim.shalready uses) becausestate_diris a volumescheduleranddashboard/dashboard-localmount in common on a node running both, so two containers can tick inside the same window.Runs every
schedule.resource_sample_minutesminutes (default 5) fromscheduler’s own crontab line (deploy/docker/crontab.tmpl);dashboard/dashboard-localrun no crontab at all (serve-dashboard.shexecs the HTTP server as the container’s own process), so that script starts a small background loop — gated onAGENT_OPS_SERVICEbeing set, so a human running it on a laptop to browse the dashboard never spawns one — calling the same collector on the same interval before its ownexec, detached from the shell’s job table so theexec(which replaces the process image, not the backgrounded job) leaves it running. The loop lives exactly as long as the server:execkeeps the shell’s pid, so the loop polls that pid every ten seconds and exits when it is gone, rather than sleeping the whole interval and running for ever after a server killed by anything but the container stopping (six such orphans on poetic-2’s scheduler on 2026-09-15, two per run oftest/dashboard-exposure.test.sh, which starts the script inside the scheduler and kills it; that test now unsetsAGENT_OPS_SERVICEfor the spawn, since the bind address it checks has nothing to do with sampling).The report.
resource_budget_report(lib/resource-usage.sh) is the pure derivationscripts/resource-budget-report.shwraps for standalone use andscripts/state-sync.sh/scripts/doctor.sh/scripts/publish-dashboard.shcall directly: given the sample text and a window-start bound, it groups byserviceand byvolume, and for every numeric field prints{latest, median, p95}(nearest-rank — the value at indexfloor(p * (n-1))of the sorted sample array, not interpolated, so a reader can point at the one real sample that produced the figure) forcpu_cores/memory_bytes/net_rx_bytes_per_hour/net_tx_bytes_per_hourper container, and{latest, growth_bytes_per_day}(a straight line between the window’s oldest and newest disk sample — never a regression, since disk is sampled hourly at most and two points is the ordinary case) fordisk_bytesper volume. A line that is not valid JSON, or parses to something other than an object, is skipped rather than failing the whole report, the same disciplinetest/pickup-metrics.test.shalready exercises forlog.jsonl; an empty or entirely-unparseable input degrades to{"containers":{},"volumes":{},"sample_count":0, "window_start":null}, never a jq failure — the same “always one valid object” contractlib/metering.sh’s ownmetering_fieldsholds for a missing stage envelope.Budgets, in versioned configuration.
config.schema.json’sresourceskey states them:resources.containers.<AGENT_OPS_SERVICE>(cpu_cores,memory_bytes,bandwidth_bytes_per_hour) andresources.volumes.<name>(disk_bytes), for exactly the three containers and two volumes this requirement measures.containers.*.cpu_cores/containers.*.memory_bytesdefault to the same figuresdeploy/docker/compose.yaml’s owncpus/mem_limitalready ship (2.0/1536m forscheduler, 1.0/512m fordashboardanddashboard-local) — the read side of a budget the compose file already enforces, not a second enforcement path, and keeping the two in step across an edit is a human responsibility today (D16’s own control-plane migration, when it comes, is what removes the duplication by generating both from one source).containers.*.bandwidth_bytes_per_hourand everyvolumes.*.disk_bytesare provisional: neither resource had ever been measured before this requirement, so both ship generously above what a quiet node is expected to use, meant to be tightened oncescripts/resource-budget-report.shhas real fleet windows to set them from — a config edit, per the issue’s own reinterpreted acceptance criterion, never a re-implementation.Published per node and per container.
scripts/state-sync.shfoldsresource_budget_report’s own output intoheartbeat.json’sresourcesfield, overresources.report_window_hours(default 24) — a summary, never a series, the same “latest plus the window’s p95” shape the issue’s own specification asks for and the same reasoningstage_health/compose_reconcilealready give for what travels in a heartbeat versus what stays a raw local file (.resource-samples.jsonl/.resource-usage-state.json, both excluded from state-sync’s replication — a raw sample is this node’s own forensics, never a fact a peer would read).scripts/publish- dashboard.shreads the identical field from a peer’s heartbeat, and recomputes the identical report live for this node’s own row (the same “self is read live, a peer is read from its heartbeat” split every other per-node fact on the page already holds) —docs/spec/dashboard/publisher.mddocuments the resultingresource budgetbadge.A breach is a reportable condition.
resource_budget_breaches(lib/resource-usage.sh) isscripts/doctor.sh’s “Resource budgets” comparison, factored out of that section exactly aslib/host-budget.shis factored out of its own host-budget section (requirement 2.0g) — given the report and the configured budgets, it prints one entry per breach (windowed p95 for CPU/memory/bandwidth, latest for disk, an unbudgeted or unmeasured resource contributing nothing) rather than a verdict, so a caller decides what to do with each.doctor.shwarns one line per entry, naming the container or volume, the resource, the measured figure and the configured budget — never silent, and never only something a human reading a graph would notice. Skips cleanly, the same “no evidence, not a failure” posture requirement 2.0g’s own host-budget section already takes on an unwritten host-facts record, when.resource-samples.jsonldoes not exist yet or carries no samples inside the window.dashboard/index.html’sresourcesLineapplies the identical rule — windowed p95 for CPU/memory/bandwidth, latest for disk, an unbudgeted or unmeasured resource contributing nothing — but cannot share the function: it is JavaScript running in a browser over the payload, with no route to a bash library, the same constraint every other badge on that page already works under. What the two genuinely share is their input,resource_budget_report’s own output shape, identical whether a row’sresourcesfield was recomputed live for this node or carried in a peer’s heartbeat. The duplication is therefore real and is kept in step by hand:resource_budget_breaches’s own at/under/over-the-line boundary test (acceptance check 55) is what pins the rule, and a change to either side has to be made to both.Tests.
test/resource-usage.test.shcoverslib/resource-usage.shdirectly: the collector’s arithmetic against canned cgroup v1 and v2 fixtures and a canned/proc/net/dev, the delta/rate guards (a fresh baseline, a recreated container), the report’s derivation from a canned sample set (latest/median/p95, disk growth, a malformed line skipped), the unknown-layout degradation, andresource_budget_breaches’s own comparison at, just under and just over the line — the boundaryscripts/doctor.shcalls directly anddashboard/index.html’sresourcesLinere-states in JavaScript, pinned here so the rule both sides implement has one authoritative test.test/collect-resource-usage.test.shcovers the collector script end-to-end against fixture cgroup/proc files — two ticks, five minutes apart, producing the expected delta, and a baseline-reset on a simulated container recreation — the disk-sampling throttle, two services sharing onestate_dirwithout clobbering each other’s cached baseline, and the prune (--no-pruneversus the default).test/resource-budget-report.test.shcovers the thin script wrapper: config-resolvedstate_dir/window versus the--state-dir/--window-hoursoverrides, and the clean empty-report degradation on a missing config or an unwritten samples file.test/config-schema.test.shcovers the reportable half — whatscripts/doctor.sh’s own “Resource budgets” section prints over a breach, an all-clear, an unwritten samples file and a window with nothing in it — because that is where this repository’sdoctor.sh --offlineassertions live rather than intest/doctor.test.sh, whose own header records why.