docs/spec/implementation/requirements/the-script-02.md
Requirements
Section titled “Requirements”The Script — requirements, continued (part 2 of 13; 2–2.3: Stand-down checks…)
Section titled “The Script — requirements, continued (part 2 of 13; 2–2.3: Stand-down checks…)”-
Stand-down checks. Each check logs its reason and exits cleanly:
Before check 0 below, and before every other check in this list: which GitHub credential this cycle would currently use is logged (
forge_auth_effective_gh_token, component 14h, D25/agent-ops#607 as amended by agent-ops#1021) — but, since agent-ops#1021, nothing here resolves or exports one. A forge authoring App installation token carries GitHub’s ~1 h lifetime, and a cycle routinely outlives that, so no single point in the process can resolve a credential once for its whole life without risking a stale one reaching whichever call comes after expiry. The credential is instead resolved on demand, per call, by the on-demand seam (component 22c): everyghinvocation reacheslib/gh-shim.sh’sghtransport shim, installed ahead of the real binary onPATH, before dispatch, and plaingitreaches the same shim through its own credential helper (deploy/docker/entrypoint.sh, component 7). Both mint only whenGH_TOKENis already empty — an explicitGH_TOKENalways passes through untouched, which is what keepslib/approver.sh’s ownGH_TOKEN="$(approver_token_get)" gh …posting as the Approver rather than being re-minted as the author. This step has no number of its own in the list below because it never itself stands the cycle down and changes nothing any check after it reads — it only logs which path 0b’s probe two steps later, and every later call in the process, would resolve through the seam. Unnumbered rather than “0aa” or similar, since renumbering 0a–0c would touch every cross-reference those letters already have elsewhere in this document. 0. GitHub API budget: before any other check, read the meter — thex-ratelimit-*headers of one meteredGET /metaforcore, and the GraphQLrateLimitobject forgraphql, assembled into one snapshot bygithub_limit_snapshot— and stand the cycle down when either metered pool is below its floor —corebelowgithub_min_core_budget, orgraphqlbelowgithub_min_graphql_budget. Either floor set to0turns that resource’s check off; both at0turns the check off entirely. Thestand-downevent carries the binding resource, its remaining points, andresume_at— which is GitHub’s own stated reset, never an estimate, so unlike a usage-limit stand-down (1b) nothing probes it and nothing needs to. When both pools are below their floors the one resetting later binds, so the stand-down covers both.First, because it is the cheapest check — two points, against the thousands every check below it can spend, 1b’s probe most literally. What it prevents is not a failed
ghcall but the cycle those calls sit inside. On 2026-08-12 an exhausted GraphQL budget read to the pipeline as a quiet GitHub: every gatherer degraded to[](the[]-on-error trap in the Gotchas table), the Co-Ordinator engaged on that digest and selected an item, the claim was taken, and the cycle died at the clone withGraphQL: API rate limit already exceeded. Everything before the clone was spent answering a question GitHub answers for free.A meter that cannot be read is not a stand-down. An unreadable meter is no evidence about the budget, and a node that cannot reach it could not have run a cycle anyway; whatever call meets the real fault will report it. Standing down here would give a network blip the same face as an exhausted account.
Not
GET /rate_limit(agent-ops#1087). That endpoint is exempt from the limits it reports, which made it the obvious probe; it is also, read cold, not a reading. On 2026-08-30 three metered calls seven seconds apart, each followed within the same second by the endpoint, showed the response headers draining the shared bucket (x-ratelimit-used92, 105, 118 against one fixed reset) while the endpoint’s body answeredused: 0, remaining: 5000every time with aresetexactly 3600 s from now, sliding with the clock — and the endpoint’s own headers said the same. It is intermittently right, and nothing in the answer says which kind it is. Read as the first call of every cycle, it answeredokthrough 95 recorded refusals in 48 hours. The headers on any metered response are computed on the request and describe the bucket GitHub enforces — the user’s aggregate, so the whole fleet’s, the publisher’s and the owner’s shell together, which makes this gate fleet-aware with no per-node arithmetic — and GraphQL’srateLimitobject is the same kind of reading for that pool. A body-shaped snapshot that carries the empty-window signature —remaining == limit, nothing used,resetwithinGITHUB_LIMIT_PRISTINE_SLACKseconds of now + 3600 — is classifiedunknown, neverok(github_limit_resource_pristine); one real pool beside such an answer is judged on the real one. A refused probe still answers with the headers, which is also how 0a’s wrapper reads a reset off the very refusal it is handling.GET /rate_limitremains what 0b’s credential probe and the token-expiry read use: both want the call’s status and headers, not its budget figures.0a. A refusal shorter than the cycle is waited out, not reported. The two GitHub limits divide by how far away their reset is, and this is the near half.
lib/github-limit.shdefines aghshell function that shadows the binary for every script sourcing it: a call GitHub refuses for rate reasons is retried once, after waiting until the stated reset (a primary limit) or a fixed short fallback (a secondary limit, for which GitHub states no reset anywhereghsurfaces). A wait longer thangithub_retry_max_wait_seconds, or than twice that across one process, is not taken at all — the cycle holds a lock and runs on acycle_interval_minutestick, so waiting out a primary limit inside one would collide with the next tick. That case belongs to 2.0, not here.The binary is reached with
command gh, so a test’sPATHstub is still what runs. A call invoked throughtimeout,envorxargsbypasses the wrapper, which is whyscripts/publish-dashboard.sh— every call of which is deliberately undertimeoutto hold the heartbeat’s window — is unaffected. stdout is buffered and emitted once the call is finished with, so a retriedgh api --paginatecannot emit its early pages twice.0b. GitHub credential check (agent-ops#691, TD-PPagop-26082306): the same free
/rate_limitcall classifies two permanent credential faults apart from every transient failure —github_auth_probe(lib/github-limit.sh) printsunauthorized, rather than folding either into 2.0’sunknown, for an HTTP 401 (GitHub read the request and rejected the credentials outright) and forghrefusing to send the request at all because it has no credentials —GH_TOKEN/GITHUB_TOKENunset or empty and nogh auth loginsession either. Both are permanent: no wait and no retry ever clears an expired, revoked or absent token. Checked unconditionally — not gated behindgithub_min_core_budget/github_min_graphql_budget, because a dead or missing token is worth catching even on a node that has turned the budget floor off, and the call costs nothing either way.On 2026-08-22 a node’s fine-grained PAT expired mid-day, and for the next ~3 hours every cycle ran a full Co-Ordinator engagement ($0.21, ~66 s, ~51k tokens) before every claim failed with
cause: "unreachable"and the cycle stood down reporting “GitHub could not be reached for any candidate — this is an outage, not contention” — five cycles, $1.05, for a token that was never going to start working again on its own, misclassified in the one way that sends nobody looking at it. TD-PPagop-26082306 is the same misclassification in a different shape: a token unset or dropped from the environment makesghfail locally with a “no authentication token / rungh auth login” message that matches neither the 401 pattern nor anything else, so it read asunreachabletoo and bought the same indefinite per-cycle spend. This check exists to stop paying for that discovery: it runs ahead of the Co-Ordinator (step 4), so anunauthorizedverdict stands the cycle down before any model runs — forGitHub authentication failed (HTTP 401) — GH_TOKEN is invalid or expiredwhen GitHub rejected a real token, or forGitHub authentication failed — no GH_TOKEN/GITHUB_TOKEN is set and gh has no stored credentialswhen there was no token to reject, the probe’s owndetail(leading “no token present” rather than an HTTP status) being what tells the two apart — and escalates throughcreate_escalation_issueincrash_loop_repo— labelledenabler_escalation_label, assignedenabler_assignee, item refauth-failure:<node>, titled and worded to match whichever of the two it is — the same duplicate-guarded route 1c’s usage-limit freeze and requirement 2.7’s crash loop already use, so a cycle that finds an open issue already naming this node does not file a second one. A failed filing logs awarningand retries next cycle, same as 1c.Deliberately not routed through
escalation_autonomy(D18, agent-ops#627): that ladder decides whether one specific escalation — an Enabler refinement-disagreement (requirement 36b) — is adjudicated once before reaching a human, and itsadjudicate-firstpath is itself a model engagement against GitHub. Routing a dead-credential escalation through it would spend exactly what this check exists to avoid, and there is no refinement disagreement here to adjudicate. Skipped entirely on--dry-runand whencrash_loop_repoorenabler_assigneeis unset, the same as 1c’s freeze escalation — the stand-down itself is unconditional, only the filing is gated.0c. Free disk space (requirement 2.0c, agent-ops#756; both directories, agent-ops#992; the threshold derived, agent-ops#904): free like 0 and 0b —
df -Pktouches no network and costs nothing, so it runs ahead of every check below that can spend, and reading the fleet’s own union log for the derivation below costs nothing further either, sinceunion_logis already a local, already-fetched snapshot by the time this runs (1a).scripts/doctor.sh(component 14) has readstate_dir’s andworkspace_root‘s free space and warned below a fixed 2 GiB since before this check existed, but that warning only ever reached a human runningdoctor.shby hand; the cycle itself wrote straight into whatever room was actually left. On the ockham laptop that ran short, a write truncated mid-flight left zero-length git objects in both nodes’state_dirmirrors, permanently disablinggit gc(#604), and left 4.2 GB of orphaned clones inworkspace_rootbehind it (#605) — starting work the host cannot finish is what made both possible, and this gate covers both directories the incident spanned.lib/disk-space.shreads and judges free space the one way bothdoctor.sh’s advisory warning and this gate use, so the two cannot silently disagree about what “low” means, nor about which directories that covers, nor about which bound governed:disk_space_free_kbreads a directory’s free KiB (empty, never0, whendfcannot read it — an unreadable meter is no evidence of a full disk, the same reasoning 0’s ownunknownrests on),disk_space_verdictcompares it against the effective threshold below (converted to KiB),disk_space_describerenders the one-line explanation both the stand-down event and the warning use verbatim, anddisk_space_same_filesystemreports whetherstate_dirandworkspace_rootshare a filesystem.The threshold this gate actually reads is not
min_free_workspace_bytesalone butdisk_space_effective_min_bytes’s derivation over it — a flat floor protects a fleet whose repositories stay far below it, but says nothing about one whose repository approaches or exceeds it, which is exactly the gap agent-ops#902 raised against #756’s own PR #782 and #904 was filed to close.disk_space_clone_footprint_bytes(du -sbthe clone directory, the same readingworkspace_orphans, lib/workspace.sh, already takes) is measured once every successfulclone_repocompletes — agent-cycle.sh’s own workspace step (6) and review-cycle.sh’s own — and logged as aclone-footprintevent,{repo, bytes}, against the cloned repository’s own slug. The review pipeline writes it to the sharedlog.jsonlrather than its ownreview-log.jsonl(docs/spec/review/requirements.mdR16’s second shared exception,limit-hitbeing the first), because this is where its reader is. The figure is never GitHub’s own reported repository size, which is the packed size, not what a clone occupies, and never a network call this gate would have to pay for.disk_space_largest_footprint, readingunion_logthe same “governing record off the fleet’s own union” shape requirement 2.1’slimit_union_recordalready uses, returns the single largestclone-footprintever recorded, fleet-wide, unfiltered by which repositories are configured now — a footprint from a repository since dropped only ever pushes the derived threshold higher, never lower, the safe direction to err in. Nor does it age: a footprint recorded long ago and never bettered still governs today, with no expiry pruning it out. Where this unfiltered, unaged read proves too conservative on an installation whose repositories have shrunk since setting the fleet’s largest recorded footprint,workspace_headroom_factorset to0is the operator’s own lever — distinct frommin_free_workspace_bytes’s own0below, it disables only the derivation, leaving the floor itself in force (agent-ops#1904, ratifying #904).disk_space_effective_min_bytesthen derivesmax(min_free_workspace_bytes, workspace_headroom_factor × that footprint):min_free_workspace_bytesis the floor under the derivation, never a ceiling, the same shapelock_stale_after(requirement 4f) and two of the three state-sync count keys (requirement 1d;state_local_streams_retainedis the exception) already use elsewhere. With no footprint ever recorded — a fleet’s first cycle, or a union log this node cannot read — the floor alone governs, failing in the same safe directiondisk_space_verdict’s own “unreadable is not low” already does.disk_space_governed_byreports which bound actually produced the effective threshold,"floor"or"derived", so astand-downevent ordoctor.shwarning can say so rather than only report a number a reader would have to re-derive to interpret.Where the two share a filesystem — the common case, one host directory holding both — the gate takes exactly one
dfreading and judges it once, precisely as it did before this covered two directories. Where they differ — the shippeddeploy/docker/compose.yamlmountsstate:andworkspaces:as two separate named volumes — the gate reads and judges each on its own (shared) effective threshold and stands the cycle down when either readslow; when both do, thestand-downevent names the one with less free space. An unreadabledfis “no evidence”, not a stand-down, for either directory.Below the threshold, the
stand-downevent’spathandfree_kbname the short directory (the shorter of the two when both are),causeisdisk-fullwhen that directory’s filesystem reports exactly zero KiB free, ordisk-lowfor any smaller shortfall — both cover the same gate, differing only in how far past the threshold the shortfall runs — andgoverned_byandmin_bytesname which bound produced the threshold and what it was, withrepoandfootprint_bytesadded whenevergoverned_byis"derived".min_free_workspace_bytesset to0turns the check off entirely for both directories, regardless of any footprint recorded — the same unconditional-off conventiongithub_min_core_budget/github_min_graphql_budgetuse. That off switch lives insidedisk_space_effective_min_bytesitself — a0floor derives0, whatever footprint it is handed — not only in this gate’s own short-circuit around the whole block, soscripts/doctor.sh, which has no such short-circuit, cannot end up warning about a threshold derived over a floor an operator has explicitly switched off.0d. The budget is recorded (agent-ops#1087).
github_budget_record(lib/github-limit.sh) takes a snapshot and logs it as agithub-budgetevent —{phase, stage?, readable, core: {limit, used, remaining, reset} | null, graphql: {…} | null, since_previous: {core, graphql, window_rolled}}— at three points:cycle-start, the very reading 0’s verdict then judges (recorded whether or not a floor is set, since the record is what D25’s “measured to bind” trigger reads);stage, after every model runrun_model_stage(lib/stage-run.sh) completes, naming the stage; andcycle-end, after the Enabler and the Refiner and before thecycle-endevent, but only for a cycle that took the opening reading — an ending that never read GitHub (the switch, requirement 2.3) must not start now.since_previousis the bucket’s movement since this process’s last reading: within one window the difference inused, across a roll (the tworesets differ) the new window’sused, flaggedwindow_rolledas the lower bound it is, andnullwhere either side lacks a figure or the count went backwards. A reading that cannot be taken is recordedreadable: false, never skipped, and never fails the cycle or the stage. Each reading costs two points; a cycle with three stages costs ten.What the movement is, and is not: while every node authenticates as one user (D25 unprovisioned) the headers describe the user’s aggregate, so a segment’s movement is the bucket’s — an upper bound on what the segment itself spent, exact only once identities are per node or a per-call ledger exists (agent-ops#1084).
scripts/github-budget-report.sh(component 22b) sums the events and says so in its preamble.0e. A
ghtransport shim makes REST reads conditional, serves last-known-good under a refusal, and ledgers every call (agent-ops#1084).since_previous’s own upper-bound caveat (0d, above) is because every node authenticates as one user and thex-ratelimit-*headers describe that shared bucket, not any one caller’s own spend — and because almost every GitHub read this fleet makes re-reads something a sibling node, or this same node’s own last cycle, already read minutes earlier: four nodes each gather every configured repository on a 15-minute tick, and GitHub’s own guidance is that a conditional request answered304does not count against the primary limit at all.scripts/gh-shim.sh(backed bylib/gh-shim.sh) is installed onPATHahead of the real binary (deploy/docker/Dockerfile) so everyghcall resolves to it first — this repository’s own scripts (throughcommand gh,lib/github-limit.sh’s own retry wrapper included) and a model-driven stage’s baregh …alike, which no library-level wrapper can reach.Only a plain
gh api <endpoint>GET is ever cached or conditioned: not a call whose method resolves to non-GET (an explicit-X/--method, or gh’s own default-to-POST when a body-supplying flag —-f/-F/--raw-field/--field/--input— is present with no override), not the literalgraphqlendpoint (always POST, never conditional), and not a call that already asks for-i/--includeitself — most notably 0’s owngithub_limit_snapshotprobe, whose entire job is reading the bucket’s live headers, so it must never be answered from a cache or a stale reading. Every one of those is passed to the real binary completely unmodified: same argv, same stdout, same stderr, same exit status. A--paginate/--slurpGET is conditioned too (agent-ops#1114), but not as a single request: a staleIf-None-Matchapplied uniformly to every page a--paginatecall fetches could 304 a later page whose content actually changed, sogh_shim_handle_paginatedrives the walk itself — one real-binary call per page, page 1 the caller’s own endpoint with a defaultper_page=100appended to its query string when neither it nor the caller’s own args already name one (mirroring the real binary’s own default for a paginated GET, so a walk that asks for no page size does not fall back to GitHub’s 30-item server default instead), and every later page the previous one’s ownLink: rel="next"URL, each conditioned on that page’s own storedETagand cached the same way an ordinaryreadis, but under a cache key of its own namespace: page 1’s per-page argv is byte-identical to the argv a caller running the same endpoint without--paginatesends, and an entry a plainreadwrote carries nonext, so sharing one entry between the two would have a later walk304on it, readnext: null, stop, and return page 1 alone as the whole merged document. A page is conditioned on its own storedETagonly when that page’s own last fetch found a further page (a non-nullstorednext); a page whose storednextisnullis always re-fetched in full, unconditioned, never servedIf-None-Match. This is because GitHub answers a conditional request with the validators alone and noLinkheader at all, so a304’d page can only ever continue the walk from its own already-storednext, never from a live header — were a page whose storednextisnullconditioned like any other, GitHub’s count-based pagination means an append-only collection’s final page can grow a real next page between walks while its own bytes, and so itsETag, stay identical: it would304, revealing nothing, and the walk would end on the stalenullforever, silently dropping everything appended since. The pages are reassembled to match the real binary’s own documented shape exactly, never reparsed:--slurpwraps every page’s own raw body as its own array element;-q/--jq/-t/--templatepresent re-runs that filter once per page in the real binary too, so every page’s own already-filtered body is concatenated in call order; otherwise every page’s body is expected to be a top-level JSON array, merged by splicing out each page’s own outer[/]and joining with,— the separator belonging to the element that follows, so a page that is itself an empty array, or whose inner bytes are whitespace only, contributes neither an element nor a comma, as GitHub serves an empty array for anyLink: rel="next"that outlived the items behind it, anextthe shim itself stored and walked on from a later304included. A page that does not fit — a status other than a cache-backed304or2xx, unparseable output, or (plain-array mode) a body that is not itself an array — abandons the walk before printing anything partial and falls back to one real-binary call with the caller’s own argv and--paginate/--slurpboth untouched (_gh_shim_paginate_legacy, this pathway’s entire behaviour before agent-ops#1114), which is also the only pathway a refusal is ever served last-known-good through (property 2, unchanged by this) — from the same whole-call cache entry a successful per-page walk also writes its merged result into. A write’s invalidation only ever reaches that whole-call entry and page 1’s own relative path, never a later page’s own absolute one, which costs at most one needless extra round trip on that page’s own next fetch, never a wrong answer, since a304still depends on GitHub’s ownETagmatch. The whole call is ledgeredhitwhen every page served from its own304andmisswhen at least one page needed a real fetch — the one ledger entry that says more than “a call happened”, surfacing the saving this closes agent-ops#1114 for inscripts/github-budget-report.sh’s own summary. A walk’s final page is never conditioned (acceptance check 2p, agent-ops#2183), so thehitbranch of this rule never currently obtains — every call that reaches a final page ledgersmisson that page’s own real fetch alone.No pathway ever reshapes what the real binary printed. A conditioned read is the only call whose argv the shim adds to at all; what it returns on stdout is byte-for-byte the body a plain call would have printed — the response body taken from past the header terminator by byte offset, never reassembled line by line, so a body carrying CRs or ending without a newline round-trips unchanged. Output the shim cannot parse into responses at all is passed through rather than dropped, with the real binary’s own exit status.
A cacheable GET is retried with the stored
ETagasIf-None-Match; a304is served from the cache with exit 0. A primary rate-limit403(github_limit_kind, reused from 0a’s own retry wrapper rather than re-implemented, so the two can never recognise a refusal differently) or a5xx, with a body cached withinPW_GH_STALE_CEILING_SECONDS(default 3600), is served last-known-good with aPW_GH_CACHE=stale age=<s>line on stderr and exitPW_GH_STALE_EXIT_CODE(default 0, so an ordinary reader degrades gracefully; a caller that must not act on stale data sets this to a distinguishable code). A successful write drops the cache entries for its own path and that path’s parent resource (a reviewPOSTto.../pulls/5/reviewsinvalidates both that listing and.../pulls/5itself) — a heuristic, not a semantic model of the API — and does so at a cost that does not depend on how many reads the node has cached: the cache is laid out ashttp-cache/<identity>/<sha256(path)[0:24]>/<key>.json, so a drop is the removal of the two directories the write names and never a scan that opens entries (agent-ops#1422).PW_GH_NO_CACHE=1opts one call out of all of this, still ledgered as a bypass.Every call is logged to
state_dir/gh-shim/ledger.ndjson—{ts, method, path, status, cache: hit|miss|stale|bypass, resource, used}— underflock, and a cacheable GET that yielded ratelimit headers updatesstate_dir/gh-shim/budget.json, keyed by identity —app-<app id>-<installation id>for a token the seam minted itself (requirement 2.0e’s owngh_shim_resolve_token, below), so the hourly rotation of an installation token keeps its cache and its budget reading, and a hash ofGH_TOKEN/GITHUB_TOKENfor every other credential, since the forge authoring App and the owner’s own PAT can legitimately see different data.PW_GH_STATE_DIRcarries the resolvedstate_dirto wherever the shim runs — bothagent-cycle.shandreview-cycle.shexport it once they computestate_dir, so every subprocess they fork, model-driven stages included, finds the same node’s state without needing config.json of its own.scripts/rotate-logs.shbounds the ledger’s size like the node’s other diagnostic logs (component 21);scripts/github-budget-report.sh(component 22b) sums it by cache outcome fleet-wide, the samestate_dir/peers unionlog.jsonlalready reads.0f. Free host memory (requirement 2.0f). Free, and for the same reason as 0c: reading
/proc/meminfotouches no network and costs nothing, so it runs ahead of every check below that can spend. 0c refuses to start a cycle into a host that has no room to finish it; this refuses to start one into a host that has no memory to run it, which until this check existed nothing did. On the ockham WSL2 host — a VM capped at 6 GiB, running two nodes whose cycles overlap for most of every hour — a cycle that started into no headroom pushed the VM into a Windows-backed swap file and stalled the whole machine; a git write truncated by that stall is what left the zero-length objects that permanently disabledgit gc(#604). A stand-down costs one cycle, and the freeze it avoids costs the host.lib/memory.shreads and judges free memory the one way bothdoctor.sh’s advisory warning (component 14) and this gate use, so the two cannot silently disagree about what “low” means:memory_available_kbreads the host’s available KiB (empty, never0, when/proc/meminfocannot be read — an unreadable meter is no evidence of an exhausted host, the same reasoning 0’s ownunknownrests on),memory_verdictcompares it againstmin_free_memory_bytes(converted to KiB), andmemory_describerenders the one-line explanation both the stand-down event and the warning use verbatim.Two deliberate choices about which meter. MemAvailable, not MemFree: the kernel’s own estimate of what an allocation can have without swapping, which counts reclaimable page cache as available — MemFree would read a host whose cache is doing its job as critically short and stand down every cycle on a healthy machine. And the host’s, not this cgroup’s:
/proc/meminfois not namespaced, so a container reads the real machine, which is the only figure that describes what a gate protecting the host must protect. The cgroup’s own accounting would describe this container alone and miss the peer node, the editor, and everything else sharing the machine.Below the floor, the
stand-downevent’scauseismemory-low, and it carries both the available and the total KiB so a reader can tell a small host from a busy one. There is nomemory-fullcounterpart to 0c’sdisk-full: a host at exactly zero available memory is not a distinct state worth naming, only a more extreme shortfall.min_free_memory_bytesset to0turns the check off, the same conventionmin_free_workspace_bytesandgithub_min_core_budget/github_min_graphql_budgetuse.What this check does not do is make the container give memory back. It cannot: Docker exposes no
memory.highsetting, and a container can read its own cgroup v2 files but never write them. What Compose can choose is the cgroup the container is created under, and a ceiling on that parent governs the container while outliving it — so the knob that stops a cgroup ratcheting up to its hard ceiling is set once, on a parent, rather than re-applied to each new container after every roll.AGENT_OPS_SCHEDULER_CGROUP_PARENTselects it andscripts/cgroup-parent-setup.shcreates it; both are documented indeploy/docker/compose.yaml. The parent is the mechanism precisely because it is not what gets recreated: a ceiling written onto the container itself is wiped by the nextup -d, watchtower roll or reboot, which on the measured fleet is a median of under an hour — and on asystemd-driver host by anysystemctl daemon-reload, on a live container, since systemd re-applies the properties a unit declares and adocker-<id>.scopedeclares none (TD-PPagop-26090401). A slice parent declaresMemoryHigh, so the same reload re-asserts it.What the pipeline contributes is still the detection —
memory_cgroup_verdict, reported bydoctor.sh(component 14) — and it draws the distinction the remedy turns on. A ceiling on the parent readsparentedand is[ ok ]; a ceiling on the container itself readsboundedand now warns, naming itself as something the next roll will remove, because a state that is correct today and gone by tomorrow is not a healthy one to report as such. The parent’s ceiling is not inferable from inside a cgroup namespace — the container’s ownmemory.highreadsmaxeither way — so it is bind-mounted read-only at/run/cgroup-parent/memory.high, defaulting to/dev/null, which reads as “no parent ceiling” rather than as a guess.A ceiling on the parent is not, by itself, enough:
memory.highonly throttles, and throttling that never disengages because nothing anywhere is a hard enough wall to reclaim past — or to kill — is a livelock, not a mitigation (agent-ops#1305).ockham-containerwedged 75 minutes in exactly this band:memory.currentsat above the parent’smemory.highand below both cgroups’memory.max, 2,788,595 throttle events accumulated at ~96/second, and every allocating task parked in uninterruptibleDstate —docker execinto the node included, which is what made the node undiagnosable remotely while it lasted.doctor.sh’s ownparentedverdict read this exact state as[ ok ]throughout, becauseparentedonly ever checked that the parent’smemory.highsat below the child’s ownmemory.max, never that the parent had amemory.maxof its own for the kernel to reclaim past.scripts/cgroup-parent-setup.shtherefore also sets the parent’smemory.max(--max, defaulting to the sum of what runs under it —1536m, matchingAGENT_OPS_SCHEDULER_MEMORY’s own default) andmemory.swap.max(--swap, defaulting to0— the incident also took 100% of host swap on a memory-capped WSL2 VM), and--checknow exits 2 for a parent whosememory.highis set but whosememory.maxis not. Two more mounts alongside/run/cgroup-parent/ memory.high—AGENT_OPS_SCHEDULER_CGROUP_MAXat/run/cgroup-parent/ memory.maxandAGENT_OPS_SCHEDULER_CGROUP_EVENTSat/run/cgroup-parent/memory.events, the same/dev/null-default idiom — letmemory_cgroup_verdictread the parent’s own hard ceiling and letdoctor.shread the parent’s raw throttle counter.memory_cgroup_verdictgains two verdicts from this:livelocked(a real parentmemory.highwith the parent’s ownmemory.maxeither left atmax, or a real number that is no higher than the child’s own — either way nothing the child can reach reclaims or kills before it, so throttling never disengages — warns, and is never[ ok ]) andunconfirmed(the same real parentmemory.high, but the parent’s ownmemory.maxwindow cannot be read — an un-migratedcompose.yaml, or a node not yet re-run throughcgroup-parent-setup.sh— warns rather than guessingparented, since a guess given as[ ok ]is exactly what left this incident’s node wedged for 75 minutes).parenteditself needs the parent’s ownmemory.maxto sit strictly above the child’s, not merely to exist: agent-ops#1620 measuredockham-containerlivelocked for most of 2026-09-16 with a real parentmemory.max(1536 MiB) coincident with the child’s own — a hard ceiling that exists but adds no headroom over one the child already has is inert in exactly the same way an unbounded parentmemory.maxis, because the kernel’s reclaim undermemory.highthrottles severely enough near a shared ceiling that the workload never makes enough progress to reach either kill point. Nor is amemory.maxstrictly above the child’s own enough by itself: agent-ops#1643 extrapolated from both incidents that the band is reachable whatever the parent’smemory.maxis, so a parentmemory.max(say 3072 MiB) genuinely above the child’s own (1536 MiB) would still livelock if the parent’smemory.high(say 768 MiB) sat far enough below the child’s ownmemory.max— more than ~25% — for the kernel’s reclaim undermemory.highto throttle too severely across that wide a band for the workload ever to make progress toward either kill point. The live discriminatorparentedneeds is therefore the throttle band’s width (the parent’smemory.highagainst the child’s ownmemory.max), not merely whether the parent’smemory.maxsits above the child’s — a narrow band, such as the interimockham-containerremedy’s own (parentmemory.high1400 MiB against amemory.maxof 1536 MiB, an ~8.9% gap), still readsparented.doctor.shadditionally reads the parent’smemory.eventshighcounter every run, persists one sample tostate_dir, and warns on any rising delta since the last one — a signal that needs no ceiling to be correctly configured first, so it still fires on alivelockedorunconfirmednode, which is the exact gap this incident fell through.The script refuses to run inside a container, and refuses on the
/.dockerenvsentinel (lib/compose-drift.sh’s own) rather than ondockerbeing absent fromPATH: that second test answered the question only while this image carried no Docker CLI, and it carries one now for thereconcilerservice (requirement 2.5a). Both checks stand, the sentinel first, because a CLI that resolves inside a container and then reaches no daemon fails several lines later as an unreadabledocker info— which reads like a broken host rather than a script run in the wrong place.On a
cgroupfshost the parent is a plain cgroup directory, andscripts/cgroup-parent-setup.shdelegates thememorycontroller down every ancestor of that directory — writing+memoryto eachcgroup.subtree_control— before it writes any ceiling. A cgroup’s interface files exist only because an ancestor delegated the controller, so without this the parent has nomemory.highto write to at all. It also removes any of the four interface paths it finds existing as a directory rather than a file, and reports doing so: Docker creates a missing bind source as a directory, and inside the cgroup filesystem a directory is a cgroup, so amemory.highthat is a directory occupies the name the controller must use and the real file can never appear there.Two invariants follow, and both are what make the failure recoverable rather than terminal. A run that cannot finish removes the parent it created, so there is no bare directory left for Docker to mount a cgroup over — a parent that already existed is never removed, since it may hold containers. And the reboot persistence on such a host is a generated script (
/usr/local/sbin/agent-ops-cgroup-parent-<name>.sh, rewritten on every run) that repeats those same steps in the same order, rather than a chain of&&-joined writes inline in a crontab entry: the inline form could not delegate, could not distinguish a missing file from a failed write, reported neither, and left exactly the directory Docker then poisoned (agent-ops#1347). Installing the hook replaces any earlier entry naming the same parent, so the old form does not survive an upgrade. (0i, below, reads the parent’s throttle rate — level-based ceilings alone do not catch a wedge in progress.)0g. Host budget (requirement 2.0g, agent-ops#757). Free, and for the same reason as 0c/0f immediately above: it reads a file already sitting in this node’s own
state_dir, no network call and no Docker socket of its own (the runtime deliberately holds neither, agent-ops#603 — see 0’s own header), so it runs in the same band. 0c and 0f each protect the host against this node’s own next cycle; neither says anything about the other containers sharing the same host. Per-container ceilings (D14, agent-ops#606) bound one container’s blast radius, but Docker reserves nothing, so the sum of every limit on a host may freely exceed it —deploy/docker/compose.yaml’s own “Resource ceilings (D14)” comment already does this arithmetic by hand for the two-nodes- one-host layout (“one tailnet node at 2.4 GiB plus one local node at 2.2 GiB leaves headroom for the VM itself”), and nothing before this requirement checked that the comment stayed correct. Measured on ockham 2026-08-24: six containers, none aware of any other, each believed it could take the whole 7.457 GiB VM, and the host froze repeatedly.The sum this requirement checks is computed and published by the host-facts collector (component from agent-ops#1283,
scripts/collect-host-facts.sh), not measured here:lib/host-facts.shnow also reads the host’s ownMemTotal(/proc/meminfo) and CPU count (theprocessorline count in/proc/cpuinfo— not namespaced, the same property 0f’s own header verifies for/proc/meminfo) intohost.mem_total_bytes/host.cpu_count, and the compose driver — the one driver with a Docker socket, and so the only one that can enumerate every container on the host, not only this compose project’s own three services — gains abudgetsection (docs/reference/host-facts-schema.md) summing every running container’s own declaredmemory.max_bytes/cpu.limit_nanosfromcontainers[](agent-ops#606’s own per-container actuals section) and reporting each dimension’s headroom alongside it, so the number is visible in the published record before anything binds on it, exactly as the issue’s own “Done when” asks.lib/host-budget.shis the one place this sum and its verdict are computed — the same “read and judge exactly one way” shapelib/disk-space.shandlib/memory.shalready hold, so a caller can never disagree with another about what “over budget” means. A container with no readable ceiling is excluded from the sum, not treated as0or as unbounded, and counted separately (mem_unknown_containers/cpu_unknown_containers) — the same “no evidence is not evidence” reasoning 0’s ownunknownand 0c/0f’s unreadable-meter branches already rest on: a sum that silently invented a number for an unmeasured container would be worse than one that says plainly it is a lower bound.Explicitly out of scope: the Kubernetes driver. The issue’s own “Why Kubernetes does not close this” section frames this requirement as a same-host, co-tenant problem — two Compose projects on one machine, neither aware of the other, with no control plane owning the sum — and a Kubernetes cluster’s
ResourceQuota/LimitRangealready assume the cluster owns the machine, which is a different problem this requirement does not attempt. Thebudgetkey is therefore absent outright under thekubernetesdriver, a driver-specific omission (docs/reference/host-facts-schema.md), not a degraded fact.This requirement’s own gate reads the just-published record from this node’s own
state_dir/host-facts/<node>.json— the same file 0f’s cgroup-parent detail anddoctor.sh’s Egress section already read — and is silently a no-op when that file does not exist yet (a fresh node whose collector has not completed a first pass), does not parse, or carries nobudgetsection (a Kubernetes node, or a record predating this requirement): the same “no evidence, no stand-down” reasoning 0c’s unreadabledfand 0f’s unreadable/proc/meminfoalready rest on. Where the record does carry abudget,host_budget_mem_verdict/host_budget_cpu_verdictcomparemem_declared_bytes/cpu_declared_nanosplus a configured reserve (host_budget_reserved_memory_bytes, default 512 MiB, the same figuremin_free_memory_bytesdefaults to;host_budget_reserved_cpus, default0— CPU is time-sliced and ordinary oversubscription is not itself a fault the way overcommitted memory is, so this dimension holds containers to the host’s own core count exactly rather than assuming a margin is wanted) againstmem_total_bytes/cpu_count * 1e9. Either dimension readingoveris an overcommit.Unlike 0c/0f, an overcommit does not stand the cycle down by itself:
host_budget_enforce(defaultfalse) gates it. Off, the check is a complete no-op inside this requirement — the sum is still published in the host-facts record regardless, so it is visible to a human (ordoctor.sh’s own advisory “Host budget” section, reading the same record through the samelib/host-budget.shfunctions) before anything binds on it — which is what “advisory-by-default” (the issue’s own words) means here: “an operator who knowingly overcommits a development box should be able to say so once” is exactly what leavinghost_budget_enforceat its default does, with no fight against this requirement required. On: an overcommit logs astand-downevent withcause: "host-overcommit"(one of the seventeen tokens in the closed cause vocabulary,docs/reference/flow-schema.md) whosereasoncarrieslib/host-budget.sh‘s ownhost_budget_describe— both dimensions’ arithmetic, the declared sum, the reserve, the host total, and the unknown-container counts, regardless of which dimension actually tripped — and the rawbudgetobject besides, so the event is never read as an assertion with no numbers behind it.Proof is
test/host-budget.test.sh(lib/host-budget.sh’s pure summation/verdict/describe functions, driven against fixturecontainers[]arrays including a declared sum that cannot fit a small host — proving the overcommit path without waiting for a real host to run out, per the issue’s own “Done when”) andtest/host-budget- wiring.test.sh(this requirement’s own block lifted out oflib/standdown.sh, the same splittest/disk-space[-wiring].test.shalready use for 0c).0h. Model credential check (agent-ops#2308): the Claude-credential analogue of 0b’s GitHub-credential check, for the same reason — the first thing that exercises
ANTHROPIC_API_KEY(or a subscription login) is otherwise the Co-Ordinator itself, after the GitHub gather (step 6), so a refused credential crash-loops every stage that follows it rather than being caught before any of them spend. On 2026-10-10 anANTHROPIC_API_KEYminted without a workspace scope crash-looped all four fleet nodes for eleven hours — every cycle ran its full GitHub gather, then was refused by the Co-Ordinator in about a second, three times per cycle — before a human traced the fault by hand, readingapi_messageoff anattempt-failedevent the log had carried the whole time.One invocation of
implementer_model_trivialwith 1b’s own trivial prompt ("Reply with the single word: ok"), through the samerun_model_stage(requirement 4d), judged bystage_api_refusal_class(requirement 4i, as amended by this same issue): arefusedverdict whose ownstage_api_refusaltoken isauthentication_failed,workspace_scope_refused, or a 4xxapi_error_<status>— a credential fault, never atransientone (a 5xx, an overload; 1’s own business, not this check’s) — stands the cycle down withstage_api_refusal_ message(already truncated to 600 bytes) as the reason, escalates throughcreate_escalation_issueincrash_loop_repo— labelledenabler_escalation_label, assignedenabler_assignee, item refcredential-refused:<node>, body quoting the API’s own message in a fenced block and naming the remedy (replace or removeANTHROPIC_API_KEYin.env, or complete the subscription login, thendocker compose up -d) — the same duplicate-guarded route 0b’s own check uses, and logsstand-downwithcause: "credential-refused"before exiting ahead of the gather.credential-refusedis the seventeenth token in the closedexternally-blockedcause vocabulary (lib/node-time-state.sh,docs/reference/flow-schema.md).It is not a stage — it logs no
stage-start, like 1b’s limit-probe and a<stage>-salvageresume — but it still spends real tokens, solib/standdown.shlogs its ownstage-end,stage: "credential-probe", carrying the same metering record requirement 33a describes for 1b’s limit-probe:lane,cost_usd,tokensand the rest, so this spend reaches the fleet-wide ledger the same way every other launch’s does, rather than only the dashboard’s own cost scan of the raw transcript.lib/stage-health.sh’s stage list does not namecredential-probe, so this carries no verdict risk for it.Gated, unlike 0b: a free
/rate_limitcall costs nothing, but this probe spends a fraction of a cent, so it runs only on the first cycle after this container started, or on any cycle whose own last probe here was itself refused or inconclusive (the state file’s own verdict left empty — atransient5xx/overload, or a crashed or timed-out launch, neither of which answered anything about the credential) — a healthy node therefore pays this once per container lifetime, and an unhealthy or not-yet-answered one keeps being caught cheaply rather than crash-looping again until its next restart. “Cheaply” is a money bound, not a latency one: atransient5xx/overload answers in about as long as the API takes to refuse, but a crashed or timed-out launch answers nothing until the probe’s own timeout elapses, so a boot whose probe keeps coming back inconclusive pays that timeout again every cycle for as long as it stays unresolved (agent-ops#2573). The probe’s timeout is 30 s, not 1b’s 180 s — nowhere near what a single-word trivial-model reply needs — precisely to keep that worst-case per-cycle cost small. “First cycle after this container started” is read from_updater_health_own_ started(lib/updater-health.sh) — this container’s own PID 1 start time, the same readingdeploy/docker/watchtower-pre-update.sh’s own roll ledger uses, and for the same reason: this node’s hostname alone survives a watchtower roll (agent-ops#1072), so only the kernel’s own process-start clock tells a fresh boot from a restart-in-place — cached in this node’s ownstate_dir, alongside the last probe’s own verdict, in a small record a cycle before the first-ever reading (the state file absent, or the reading itself unavailable) always treats as due a probe, rather than comparing two empty readings as unchanged.--dry-runnever probes, the same reasoning 1b’s own gate rests on: a cycle that promises to change nothing must not write a fresh escalation.It runs last of the 0 band rather than beside the 0b check it otherwise mirrors, because it is the only one of them that spends: 0c, 0f and 0g each run ahead of every check below them that can, and this one writes its probe transcript and its own state record into the very
state_dir0c exists to guard. Catching a refused credential one check sooner buys nothing; spending into a host 0c would have stood down costs what that band exists to prevent.Proof is
test/standdown-credential-preflight.test.sh(this requirement’s own block lifted out oflib/standdown.sh, the same techniquetest/auth-failure-wiring.test.shuses for 0b): a refused probe stands the cycle down, escalates once, and keeps probing (and escalating, through the same dedupcreate_escalation_issuealready guards) on a second cycle of the same still-refused container; anokprobe falls through to the rest of the cycle and is not probed again on a second cycle of the same healthy container, but is probed again after a fresh container start; atransientverdict stands nothing down, and is probed again on the next cycle rather than being read as a settled, healthy verdict — including the first cycle of a fresh container start, where the old container’s own"ok"verdict read from the state file is not carried onto the new one, so a new container’s inconclusive first probe cannot be mistaken for a verdict it never itself confirmed; arefusedverdict whose own token names something other than the credential (credit_exhausted, whichlib/substrate-grok-build.shsynthesises for a billing lapse) stands nothing down either, and files nothing; a container-start reading that is unavailable on every cycle probes on every cycle, rather than reading its own two empty records as unchanged;--dry-runmakes no call at all.Retirement (agent-ops#2414): when this node’s previous probe verdict was
refusedand the current probe gets a genuine clean reply —exit_code: 0andstage_api_refusal_classempty (neitherrefusednortransient, so neither a credential fault nor an inconclusive 5xx/overload) —credential_refused_retire_resolved(lib/enabler.sh) closes this node’s own opencredential-refused:<node>escalation, found the same waycreate_escalation_issue’s own duplicate guard finds it (escalation_issue_lookup, lib/escalation-lookup.sh, agent-ops#2670), with a comment naming this cycle and the probe’s own timestamp. Per node, never fleet-wide: the escalation is filed per node in the first place, so only that node’s own probe can speak to whether it has cleared, and a staggered fleet recovery is therefore not the hazard it is forcrash_loop_retire_resolved’s own fleet-wide run (agent-ops#2311) — a node whose probe never succeeds leaves its own escalation open regardless of what a sibling’s probe does.--dry-runcloses nothing, the same reasoning the probe’s own gate above rests on: a cycle that promises to change nothing must not close an escalation either.The retirement trigger (previous verdict
refused, current probe clean) is never consumed unconditionally (agent-ops#2511): the state file’s verdict only advances to"ok"when the close actually happened, mirroring the filing side’s own “will retry next cycle” ordering. Agh issue closefailure, or thegh issue listlookup insidecredential_refused_retire_resolveditself erroring — theghcall failing, or succeeding and returning a payloadjqcannot parse, which yields the same empty match a genuinely empty lookup does, so onlyjq’s own exit status tells the two apart (agent-ops#2554) — leaves the state verdict at"refused"so the probe gate re-probes and retries the close next cycle rather than forfeiting it for the container’s whole remaining lifetime. Each of the three is logged as its ownwarningevent, and the lookup distinguishes an error of either kind from a genuinely empty result rather than conflating the two. The same holds when the probe right after arefusedverdict comes backtransient(a 5xx) or crashes rather than clean: the state is left untouched rather than advanced to"ok", socred_prev_verdictstill readsrefusedon a later probe and a genuinely clean reply then still triggers retirement, instead of having already been read as a clean credential with nothing left to retire. Unlike an"ok"verdict,"refused"is carried across a fresh container start too — the one case this state deliberately survives a boot-id change (agent-ops#2554, review round 2) — because the escalation it names stays open regardless of which boot the container is on, so an inconclusive probe right after a restart must not reset it to empty either, or the eventual clean reply on the new container would find no"refused"left to retire.0i. Parent-cgroup memory throttle (requirement 2.0i, agent-ops#2469). Free, like 0c/0f/0g: every value read is bind-mounted read-only (0f’s
MEMORY_CGROUP_PARENT_*windows) or sits instate_dir. 0f reads the host’s MemAvailable on purpose, so it cannot see a node whose parent cgroup is throttling it undermemory.highwhile the host has memory free —doctor.sh’s ownmemory.eventswarning names the gap; nothing stood down on it before this.lib/memory.sh’smemory_cgroup_throttle_rate_per_mincomputes the parent’smemory.eventshighrise, events/minute, between two readings, kept in a gate-owned state file separate fromdoctor.sh’s own;memory_cgroup_throttle_verdictjudges it againstmax_cgroup_throttle_per_minute—throttlingabove,okat or below, empty (never a guess, as 0c/0f’s own unreadable-meter branches hold) with no parent window, no previous reading, or a0threshold.memory_cgroup_headroom_verdictadds an optionalnear-ceilingsignal whenmemory.currentsits withinmin_cgroup_headroom_bytesof the parent’smemory.high— off (0) by default, the rate alone having separated throttling from noise more cleanly on the incident this is built from. Either trips a stand-down, causememory-throttled;doctor.shreads the same threshold for its own warning.One
memory_throttle_checkfunction, at file scope so both call sites reach it however an earlier check exits, runs this band (beside 0f/0g) and again immediately before the Co-Ordinator engages (top of band 4) — the checkpoint that actually protects the stage, since the gather phase between the two routinely outlasts the window a band can open and close in. Either checkpoint leaves no claim held.A sustained band is a configuration fault, not a transient dip.
memory_throttle_escalate_after(per node) counts consecutive stand-downs; at the threshold,_memory_throttle_escalatefiles amemory-throttled:<node>issue naming thecgroup-parent-setup.shremedy (agent-ops#1639), dedup’d bycreate_escalation_issue.memory_throttle_retire_resolved(lib/enabler.sh) closes it on the first clean reading after, the per-node shape 0h’scredential_ refused_retire_resolveduses — an empty verdict moves neither the count nor the escalation. Filing and retirement skip under--dry-run; the stand-down does not.Configurable:
max_cgroup_throttle_per_minute(default 10,000/min),min_cgroup_headroom_bytes(default0),memory_throttle_ escalate_after(default 3). Either of the first two at0turns that half off; both off turns the whole check off.-
Usage-limit cooldown, scoped to the provider that hit it (issue #2135): every node shares one account per provider, so a limit any node hits stands every node down only for that provider. This check gates the Co-Ordinator against its own resolved provider (
check_provider); later re-checks cover the Implementer, Enabler and Refiner against theirs.The same signal arrives on two carriers, and the later
resume_atwins: the log union’s most recentlimit-hitforcheck_provider, as fresh as the last state-sync fetch, andfleet/limit.jsonnarrowed tocheck_provider, read live, letting a limit one node hit a minute ago stop this cycle now rather than a fetch interval from now. Both carriers fold in a wildcard bucket too — every pre-#2133limit-hitplus a wildcardlimit-cleared/escalation — so an old or fleet-wide record still governs every provider (limit_union_state_for/limit_flag_record_for). If the winningresume_atis still in the future, stand down. The flag is written by whichever node hits a limit (requirement 10’slimit_decidesuppliesresume_at/class/reset_known, the node’s name, its own provider and a timestamp), extend-only for that provider: a writer never shortens aresume_atalready applying to the same (or every) provider; a different provider’s freeze is replaced outright, since the flag holds one provider’s record at a time (fleet_limit_publish,lib/toggle.sh). The write is best-effort — on failure the node logs awarningand relies on the union to carry itslimit-hitto the fleet.Both carriers retire early — by 1b’s probe when
reset_knownis false, or by hand with--clear-limit [<provider>](requirement 12) — and both log alimit-clearedevent, carryingproviderwhen named (absent means every provider), which the union’s reduction treats as superseding every earlier hit in that bucket (lib/limit-detect.sh’slimit_union_record_for/limit_standdown_since/limit_union_state_for). The flag is always deleted outright: the probe’s retirement (1b) clears it, since it already carried that provider’s record; a hand--clear-limit <provider>deletes it only when the flag already names that provider, leaving a different or wildcard record untouched; with no provider it always deletes it.The reduction folds the union with
reduceover the tolerant raw-line event stream every union reader shares (union_events,lib/union-stream.sh:jq -nR, each line parsed on its own, malformed lines skipped, the reader holding one record at a time rather than the whole union). The stand-down reads the union once, withlimit_union_state_for, which answers the governing hit, the freeze’s start and thesinceof everylimit-freeze-escalatedevent from one pass, for this check and for 1c alike. A read that fails outright —jqkilled, or its input unreadable — exits non-zero, and the caller reports it rather than reading it as “no limit in force”: aguard-degradedevent (sitecycle:union_record) here, and the flag carrier then decides alone, exactly as when the union holds no live hit. A union the cycle could not build (requirement 2.5,union_build_ok) is treated the same way without being read.A stand-down must have an exit that does not depend on a cycle running: while it holds, no cycle can reach a success, so nothing inside the pipeline can clear it. Without
--clear-limitthe only exit wasresume_atpassing — and whenreset_knownis false that is an invented time, so a stand-down could outlive its limit by up toLIMIT_LONG_COOLDOWN_HOURSwith no way to say so. It did: a spend cap lifted on 2026-07-26 left the fleet down 22 further hours, and again on 2026-07-28, when a spend-cap message recording a 5-hour window stood the fleet down 24 hours over a limit that cleared within one. Requirement 1b is the automatic exit those incidents argue for;--clear-limitremains the manual override.The logged reason states whether
resume_atis a stated reset or an estimate, and--statusreports the stand-down alongside the switch. Both answer “why is nothing happening?”, and a status that knew only about the switch is how a stale cooldown went a day unexplained.Every
limit-hitevent andfleet/limit.jsonrecord carrieskind: "auto",actor(the detecting node —limit-hitevents also keep logging it as the event’s ownnode),provider(the provider the stage that hit the limit was running on —lib/stage-run.sh’sstage_provider; issue #2133), andevidence— the API’s own response, truncated to 400 characters (the structuredrate_limit_infoobject where the runner supplied one, else the first matching limit line of the transcript). An extension of the flag is therefore always accompanied by the fresh observation that justified it, because the only writer is the detector responding to a hit.provideris what this check scopes on (issue #2135): a record names only its own provider’s stages. xAI’s Grok Build (issue #2134) now writes this path too, under its own phrase table (requirement 10); a transient refusal on either provider remains requirement 2.7’s business. Akind: manualrecord only ever entersfleet/limit.jsonby an operator’s hand: honoured until itsresume_atpasses or--clear-limitlifts it, never probed (1b) or escalated (1c), its reason naming itsactor, provider, and that it is manual; nokindreads asauto.limit-clearedevents record their ownactorandkind(manual/auto). This check gates onlycheck_provider; the Implementer-launch, Enabler and Refiner re-checks cover their own provider (issue #2135) — except the Reviewer launch, which carries none (agent-ops#2661). 1b. An estimated stand-down probes its own exit. When the governing record’sreset_knownis false,resume_atis this system’s invented time and carries no information about the limit — so before standing down, the Script spends one minimal headless invocation of a model resolving to the frozen provider (limit_probe_model_for, issue #2135):implementer_model_trivialfirst, then this cycle’s other resolved models, for whichever one’sMODEL_PROVIDERmatchescheck_provider, or that first one again if none does. A fixed one-line prompt, 180 s timeout, transcript kept aslimit-probe.out, through the same provider-neutralrun_model_stage(requirement 4d) every other stage launches on. It is not a stage — it logs nostage-start, like 0h’s credential probe and a<stage>-salvageresume — but it still spends real tokens, solib/standdown.shlogs its ownstage-end,stage: "limit-probe", carrying requirement 33a’s metering record (issue #2239, D30) so this spend reaches the fleet-wide ledger like any other launch’s.lib/stage-health.sh’s stage list omitslimit-probe, so this carries no verdict risk. The Script classifies it withlimit_probe_verdict(lib/limit-detect.sh), againstcheck_provider’s phrase table (limit_phrase_regex_for, requirement 10): that provider’s limit phrase anywhere in the transcript islimited; a well-formed envelope withis_error: falseand a non-emptyresultisclear; anything else — a timeout, network failure, or empty file — isinconclusive.clearretires both carriers forcheck_provideras--clear-limit <provider>would (thelimit-clearedevent namesauto-probe@<node>asby, carriesprovider, and deletes the flag outright) and the cycle proceeds;limitedrecords the re-observed hit (requirement 10) under this provider, upgradingreset_knownto true if the message states a reset;inconclusivechanges nothing. Either way the cycle stands down, with the verdict appended to the logged reason.The economics run the right way round on both sides: a limited account answers the probe with the limit message at no token cost, and an unlimited one answers once for a fraction of a cent — the first
clearverdict retires that provider’s stand-down fleet-wide, so its gate stops firing. A stated reset is never probed (the message named the time; asking earlier is the one spend that buys nothing), and--dry-runnever probes (a cycle that promises to change nothing must not writelimit-cleared, and a verdict it would have to ignore is pure cost). Nor is akind: manualrecord ever probed: it is an operator’s decision, not a detector’s inference, and no verdict is evidence about whether the human still means it — a probe must never clear a deliberate human stand-down (#244). 1c. A long-running automatic freeze escalates; a manual stand-down never pages. While an automatic stand-down holds, the Script ages it from the freeze’s start, narrowed tocheck_provider(limit_union_state_for’ssince: thetsof the firstlimit-hitafter the lastlimit-clearedin that provider’s bucket — the start of the current freeze, not its latest extension). When the union holds no live hit — the stand-down rests onfleet/limit.jsonalone — it ages from the governing record’s owntsinstead: whenfleet_limit_publish(lib/toggle.sh) last wrote it, i.e. the latest extension. Once that age reacheslimit_escalate_after_hours(0 disables the check), it files an escalation issue incrash_loop_repo— labelenabler_escalation_label, assigneeenabler_assignee, body carrying the governing record, the provider, and the item refusage-limit-freeze:<provider>:<since>— through the same duplicate-guardedcreate_escalation_issuethe Enabler and the crash-loop check use, and logslimit-freeze-escalatedwith the issue, the provider, and the time/basis it aged from (since/since_basis:unionorflag). This makes the escalation once-per-freeze-per-provider: a cycle finding one naming this provider whosesincematches does not file again, and the open-issue guard catches the cross-node race the union has not yet carried. A flag-only freeze that is extended gets a newsince, and so is aged and escalated afresh from that extension. A failed filing logs awarningand retries next cycle. Skipped on--dry-run, whencrash_loop_repoorenabler_assigneeis unset, and always forkind: manual— the operator who set a manual stand-down does not need to be paged about their own decision. Skipped too, for that cycle, when the union could not be built or read (1’sunion_state_ok): whether this freeze was already escalated cannot then be told, so nothing is filed, awarningsays so, and the next cycle tries again — filing anyway would rest on the open-issue guard alone, which a closed escalation passes. And when the flag record carries no usablets, the age test is skipped and reported (guard-degraded, sitefreeze_since:flag); it never runs on an empty time, since GNUdate -d ""answers midnight today. 1a. Claim GC: runlib/claim.sh gc(requirement 17a) — best-effort, skipped on--dry-run— so registry entries a dead node left behind are swept before back-pressure counts them. Every node runs it; no coordination is needed, because a registry delete is sha-guarded and a claim branch is deleted only if unmoved and PR-less, so the worst race outcome is a no-op. -
Back-pressure: if the number of draft PRs labelled
pr_label, plus the ready PRs labelledpr_labelwhosereviewDecisionisCHANGES_REQUESTED, across all configured repos, plus the live claim-registry entries for those repos (requirement 17a — work a node has claimed but not yet surfaced as a PR; an item-keyed entry is dropped the moment its PR exists), is ≥max_open_agent_prs, stand down. This is the primary throttle on both spend and on the landing gate silting up. The count is approximate by design: N nodes can pass it simultaneously, so the stated bound ismax_open_agent_prs + (nodes − 1), transient.lib/claim.sh countdrops every registry entry that names a pull request the PR listing above has already counted, because such an entry is that PR a second time rather than work in flight without one. Two shapes name a PR. A PR-keyedpr-<n>entry (requirement 17a, issue #238) is dropped unconditionally — it is only ever written for a PR that exists, and unlike an item-keyed entry it is held past its PR’s own raising, until the claiming cycle ends (issue #360), so counting it would double-count that PR for as long as that cycle’s Reviewer stage runs. An item-keyed entry whose ref ispr-<n>-<kind>-<scope>— the shape the five sources that finish an existing pull request (requirements 3c, 3e, 3g, 3z and 53; see requirement 3p) key their items on — is dropped only when that PR is among the drafts and pipeline-owed PRs actually counted, which is why the caller passes those numbers in per repo. A ready PR sitting in the human’s queue is not among them (see below), so a conflicted or dequeued PR the pipeline is working keeps counting through its claim, which is then the only record that the work is in flight.The registry is wider than the configured repos: the Enabler and the Refiner claim engagement tombstones under the pseudo-slugs
enablerandrefiner(requirement 35c). Those never reach this count, because it is taken one configured repo at a time — an invariantlib/claim.shstates in its own header, and one any other reader of the registry (the dashboard’s back-pressure card among them) has to re-impose for itself.A ready PR whose
reviewDecisionis notCHANGES_REQUESTED— approved, or awaiting a first or re-review with nothing currentlyCHANGES_REQUESTED-blocking it — does not count. Its next action belongs to a human, and the pipeline cannot shrink a full human queue by declining to open new work; counting it would only back-pressure the fleet for a queue it has no lever to drain (agent-ops#246). This is the same “whose turn is it” rule requirement 3c’s review-feedback candidate filter uses (scripts/gather-review-feedback.sh), read here rather than re-derived, so the two definitions cannot disagree.This exclusion is level-aware (D18 WI-6): for a repository whose
merge_autonomy_effective_level(requirement 2.3b) ranksagent-merges-routineor above, every otherwise-eligible ready pull request counts,CHANGES_REQUESTEDor not. Above that level there is no human queue for an otherwise-eligible ready pull request to be parked in — the Approver App, not a human, is next in line — so the exclusion’s own premise (“its next action belongs to a human”) no longer holds for that pull request. The qualifier is load-bearing, not incidental: a ready, non-CHANGES_REQUESTEDpull request the pipeline is barred from landing — bycomplexity:*grade or by originating source,landing_eligible’s (lib/landing.sh) own two deterministic gates — has no other actor to move it regardless of level, so it stays in the human queue exactly as it would belowagent-merges-routine(issue #946). The narrowing reaches a non-CHANGES_REQUESTEDpull request only, and that restriction is itself load-bearing: aCHANGES_REQUESTEDpull request is owed a change by the pipeline at every level whatever its grade or source — thereview-feedbacksource (requirement 17) re-engages it, and that path consults neither list — so it counts here as it does belowagent-merges-routine. The narrowing can therefore only ever hold more pull requests out of the human queue than the un-narrowed rule does, never fewer against the cap: of the two ways to be wrong, opening work past a full cap is the one that is not recoverable next cycle. This is read throughlanding_routine_eligible(lib/landing.sh) rather thanlanding_eligibleitself: the complexity-and-source subset of that function’s gates, deliberately never its protected-path gate, which is a live changed-file read for a decision (arming a landing) this one has no need of — a protected path does not stop a human from landing a pull request, only the pipeline from doing so automatically. Complexity comes from the same pull-request listing this count already took (its owncomplexity:*label); a pull request’s source carries no field on GitHub at all and is read back from a single pass over the fleet’s own union log instead (landing_retry_source_map,lib/union-log-scan.sh— built once per repository per cycle, and only where that repository has at least one candidate to spend it on, so a repository with none reads the log no more often than it did before the map existed; shared with the 2.1e landing-retry sweep below, which uses the same map on the same terms rather than re-parsing the log once per candidate) — a candidate whose source cannot be resolved this way counts toward the cap rather than being excluded from it (fail-closed: of the two ways to be wrong here, opening work past a full cap is the one that is not recoverable next cycle), logged as awarningnaming the repository and the pull request. Judged per repository, inside the same per-repository loop the count is already taken in, against the effective level (not the configured one), so a fleet-wide kill switch or a merge-budget freeze (requirement 2.3c) affecting the effective level un-excludes those pull requests again by the next cycle’s process — this read is advisory, not a site that acts on the level, so it is memoised for the running process’s whole lifetime like every other advisory read (requirement 2.3a).counted_prs_json’s own record of which pull requests this count held (2.2b,claim.sh count’s exclusion) is built from the identical otherwise-eligible verdict, per pull request, so the two can never disagree about the same one.The logged reason — of the stand-down here and of the restriction warning in 2.2a — states the count’s full composition:
(N pipeline-owed + N draft + N unraised claim(s) — plus N waiting on human (N raw)). The pipeline-owed figure is every ready pull request the pipeline owes action on: aCHANGES_REQUESTEDPR at any level, plus, atagent-merges-routineand above, every otherwise-eligible ready PR the pipeline is next in line to land,CHANGES_REQUESTEDor not — the exact set the level-aware paragraph above defines, which is why the label names the bucket rather than any one review state; a draft is work in flight (the Implementer’s own claim marker, requirement 23); an unraised claim is a registry entry whose PR does not yet exist; the human-queue count is the ready PRs excluded from the trip, and the raw total is what the count would have been before that exclusion. Whether the cap stood the fleet down because the queue was genuinely full, or fired early on in-flight work, or would have tripped only on PRs already waiting on a human, is exactly what a cap-tuning decision needs — and it must be readable from the log line alone, because the PRs behind a historical count are merged or closed by the time anyone asks, leaving cycle-record archaeology as the only other answer.The listing behind the count asks for
GITHUB_PR_LIST_LIMITpull requests (lib/github-limit.sh) rather than inheritinggh’s undeclared default of 30, and a response that came back at that cap trips the gate on its own — with awarningnaming the repository, and the composition suffixed to say the figures are floors.ghgives no signal that it truncated, so a capped listing simply produces low counts, and low counts open a gate whose purpose is to stay shut. Note that nothing bounds the listing atmax_open_agent_prs: a pull request sitting in whichever queue the level-aware exclusion above currently parks it in still carriespr_labeland is deliberately excluded from the sum above, so a repository can hold arbitrarily many open labelled PRs while the sum stays small. Of the two ways to be wrong here, deferring a cycle that could have run is recoverable next cycle and opening work past a full cap is not. 2.2a. Back-pressure throttles starting work, not finishing it. Compute the count in 2.2 but defer the stand-down until the sources are gathered (requirements 3c, 3g, 3z and 3e). If back-pressure has tripped and anyreview_feedback,merge_conflicts,dequeuedorabandoned_draftscandidate exists, do not stand down: restrict every repo’ssourcesto["review-feedback", "merge-conflicts", "dequeued", "abandoned-drafts"]and continue. Only stand down when the count is over and nothing is waiting to be finished. All four are finishing sources — they complete an already-open PR rather than opening a new one — and three are doubly apt here, because they already hold back-pressure slots the cap counts: an abandoned draft occupies a slot nothing will clear until the draft is finished, and a conflicted or dequeued PR occupies one nothing can land to free until it is fixed.
Without this the pipeline deadlocks exactly when it is most stuck.
max_open_agent_prsPRs all sitting on “changes requested” is a state the system can only escape by answering them — and the plain check stands the cycle down before the Co-Ordinator ever runs, so the one source that could clear them is never reached. The pipeline dies silently, and the fix (merge or close something by hand) is invisible unless you already know.The restriction preserves back-pressure’s stated purpose exactly: the system still cannot open a new PR while the gate is full; it can only finish what is already in it, which is the one activity that un-silts the gate. Implement it by narrowing the
sourceslists rather than by adding a mode flag: the Co-Ordinator is already told the runtime input’ssourcesare authoritative over its own table (requirement 15), so a source it cannot see is a source it cannot select — no new prompt concept, and nothing for it to reason around. The pre-fetchedissues(requirement 3j) andtech_debt(requirement 3t) arrays are emptied along with the narrowing — they are the two that carry a whole document each, an issue’s entire thread and a tech-debt issue’s entire thread, and paying the Co-Ordinator to read candidates it cannot pick is the exact spend this gate exists to stop; the other non-finishing arrays are compact enough that stripping them would buy nothing. Emptyingtech_debthere also settles requirement 3t’s corroboration for a restricted cycle: the eligible set it measures is read after this narrowing, so a back-pressuredselected: false— which forbade the tech-debt source outright and therefore owes no account of it — is never scored as contradicting a band it was not allowed to walk. 2.2b. The decision site folds in what 2.2’s count missed. 2.2a’s own justification for treating a conflicted or dequeued PR as doubly apt — “occupies one nothing can land to free until it is fixed” — is only true if that PR is actually counted somewhere. It usually is not: 2.2’s count is taken before this cycle’smerge_conflictsanddequeuedcandidates are gathered (they arrive only once each repo’s sources are populated, in step 3, requirements 3g and 3z), and neither gatherer’s candidate rule readsreviewDecisionat all (scripts/gather-merge-conflicts.sh,scripts/gather-dequeued.sh). So a conflicted or dequeued PR that is not alsoCHANGES_REQUESTEDpasses through 2.2’s count exactly like an ordinary PR waiting on a human — ready PRs are excluded from the trip unlessCHANGES_REQUESTED(2.2’s own rule) — and fordequeuedthis is not even a coincidence: a PR only reaches the merge queue after approval, so itsreviewDecisionisAPPROVEDby construction. Left uncorrected, the gate trips later than it should, and does so exactly when a conflicted or dequeued PR is what is filling it — the one state 2.2a’s restriction exists to reach.So, at the decision site, before 2.2a’s stand-down/restriction check: take the distinct PR numbers named across every repo’s
merge_conflictsanddequeuedcandidates (a number named by both counts once), drop whichever ones 2.2’s own count already held — that repo’s drafts andCHANGES_REQUESTED-ready PRs — add what remains toadjusted_open_count, and, when anything was added, re-evaluateadjusted_open_count >= max_open_agent_prs: a cycle whose plain 2.2 count left it untripped can trip here. State the addition inopen_composition, in the same composition-line style 2.2 itself logs, so the log line stays the one place a cap-tuning read needs and stays legible against the dashboard card’s word-for-word mirror of 2.2’s own line (requirement 2.2,docs/spec/dashboard/README.md). This runs whether or not 2.2’s own count tripped — both gathered arrays exist by this point regardless, from the same per-repo loop that buildsordered_repos_jsonahead of this check — so a cycle 2.2 alone would have let run can still be correctly narrowed to the four finishing sources.The dashboard’s own back-pressure card is unaffected: it mirrors requirement 2.2’s count alone (
docs/spec/dashboard/README.md), a continuous, cross-cycle read of live PR state rather than one cycle’s stand-down decision, and has no access to themergeable/queue-membership data this fold-in needs. 2.2c. A drain (requirement 2.3d) narrows unconditionally. 2.2a’s own restriction — every repo’ssourcescut to["review-feedback", "merge-conflicts", "dequeued", "abandoned-drafts"],issuesandtech_debtemptied — is not only a back-pressure response: while amode: "drain"record is active (agent-cycle.sh’s ownDRAINING, set at the switch check in requirement 2.3d, before this site), the same restriction applies regardless of whetheradjusted_open_countever reachesmax_open_agent_prs. A drain’s whole purpose is refusing new intake while finishing work already open, and 2.2a already is exactly that restriction — reusing it rather than inventing a second narrowing keeps every downstream consumer ofordered_repos_json.sources(the Co-Ordinator’s own runtime input,coordinator_eligible_items, the Refiner’s candidate set) blind to why it is narrowed, only that it is, which is the same property 2.2a’s own design note claims for back-pressure.The one place this and 2.2a diverge is what happens when the restricted set turns out empty (
finishing_waiting == 0): 2.2a alone stands the cycle down and exits, exactly as before back-pressure existed. A drain does not merely stand down — it is requirement 2.9’s own at-rest check, described there, and it never treats “nothing to do this cycle” as a reason to revert to intake or to exit any differently than an ordinary quiet cycle would. Both conditions reaching this site simultaneously (back-pressure tripped and a drain active) narrow exactly once — the mechanism does not stack — and 2.9’s own bookkeeping (the cached remaining count, thedrainedevent) runs wheneverDRAININGis set, whether or not back-pressure was what would have narrowed anyway. 2.3. The switch. A file,state_dir/disabled.json, whose presence stops cycles starting. Checked before the lock and before anyghcall — a disabled pipeline should cost nothing — and honoured by both this Script andreview-cycle.sh(docs/spec/review/requirements.md, R2a) through one shared implementation (requirement 34a), withagent-cycle.shthe only writer. Managed by four flags that manage the switch and run no cycle:--disable [<reason>] [--for <90m|4h|2d|forever>] [--until <timestamp>] [--this-node],--drain <reason> [--for <90m|4h|2d|forever>] [--until <timestamp>] [--this-node](requirement 2.3d),--enable [--this-node],--status.--untiltakes a GNUdate-compatible absolute timestamp, an alternative to--for’s relative duration; with both given, the later of the two deadlines wins and a warning names which. Transitions are logged (disabled,enabled), carrying thescopeandfleet_flagvocabulary requirement 33 defines, and — since requirement 2.3d — the record’s ownmode.--this-node(issue #379) modifies--disableor--enableto act on this node alone, never on the fleet switch of requirement 2.3a:--disable "<reason>" --this-nodewritesstate_dir/disabled.jsonexactly as an unmodified--disabledoes — same record shape, sameactor/kind, same--for/--until/disable_default_ttlhandling, same mandatory reason, sameextendsbehaviour — and skips the fleet publish, printing plainly that only this node stands down.--enable --this-nodeclears only that local record and never touchesfleet/disabled.json, so a fleet-wide disable (or a peer’s own node-scoped one) is left exactly as it was. Unmodified--disable/--enableare unchanged: they still write and clear both levels. This is the graceful way to stand one node down for maintenance — no container recreate, no role flip — without pulling the rest of the fleet down with it.--this-nodegiven with anything but--disableor--enableis a usage error (exit 64); the role guard’s bypass list (requirement 2.4) is unchanged, since a switch command must stay usable on every node regardless of--this-node.scopesays which of those two a record is. Because an unmodified--disablewrites both levels, the node that issues a fleet-wide stand-down ends up holding a local record that is byte-identical to a--this-nodeone — so every reader announced a node-scoped disable nobody had asked for, and that node alone wore the dashboard’s amber disabled badge while its peers, equally down, wore none. The record therefore carriesscope:"node"for a stand-down of this node’s own (a--this-nodedisable, or an unmodified one on a single-node operation with nostate_repoconfigured),"fleet"for the local mirror of a fleet-wide one. A record with noscopereads as"node"— what every record written before the field existed effectively was, and the reading that keeps a node down rather than one that talks itself out of a stand-down.This is not the same
scopethedisabledevent carries (issue #426, requirement 33), and the two part company in exactly one case, so they are computed separately rather than shared. The event records the operator’s instruction, which is why a--disableon an installation with nostate_repostill logsscope: "fleet"withfleet_flag: "unconfigured"saying why nothing was published. The record answers a different question — is there a fleet flag for this to mirror? — and with no state repo there is none, so it is"node". Tagging it"fleet"there would have--statusclaim a mirror of a switch that cannot exist, and--enable --this-noderefuse to clear the only record holding that node down. Everywhere else, including under--this-node, the two agree.The local write still happens first and is tagged with the intent, since it must be on disk before anything talks to GitHub; when the fleet publish then fails, the record is retagged
"node"in place — leavingdisabled_atand every other field untouched, because that node really is standing down alone and a record still claiming"fleet"would describe a switch that was never set.--statusand the dashboard name a mirror as a mirror rather than as a second decision (requirement 2.3’s--statusbullet,docs/spec/dashboard/README.md), and--enable --this-noderefuses a"fleet"record outright (exit 64, naming plain--enableas the command that undoes a fleet-wide disable). That refusal is not tidiness: the mirror is this node’s fail-closed hold on itself for exactly the window in which the fleet flag cannot be read — that flag fails open (2.3a) — so clearing it while the fleet switch stands is how a node resumes the work the fleet was stood down to prevent.The mirror also closes a failure that had no signal at all.
--enablerun on a peer clearsfleet/disabled.jsonbut cannot reach this node’s file, so the node stays down alone, indefinitely under--for forever, on a decision that was lifted elsewhere. Tagged, that state is nameable: both--statusand the node’s dashboard card report a record left over from a cleared fleet-wide disable and name--enableon that node as the fix.The record carries
actorandkindalongsidebyandreason(#244).actoristoggle_actor(lib/toggle.sh):NODE_NAMEwhen set, else the invoking user at this host, falling throughid -unto the numeric uid — neverunknown, because an unattributable flag is what let a deliberate operator stand-down read as a runaway automatic freeze.kindismanualfor everything this entry point writes — an operator’s or agent’s decision, honoured until its expiry or--enable, never probed and never auto-cleared. A--disableissued while a switch is already set is an extension of the earlier decision, and thedisabledevent records the superseded record asextendsrather than presenting a fresh stop.Why it exists. Both cron pipelines execute code out of the agent-ops working tree. An agent editing
agent-cycle.sh,lib/orprompts/is editing the files the next tick will source; a cycle firing mid-edit runs half of one revision and half of another, and the resulting failure gets attributed to whatever the agent happened to be writing. That is also why the switch is shared rather than per-pipeline: the review pipeline runs out of the same tree and sources the samelib/, so a switch that stood down only the implementation pipeline would leave the hazard in place.Four details decide whether this helps or becomes its own outage:
-
A disable expires after
disable_default_ttlunless it explicitly saysforever. The switch’s whole risk is that it is a deliberate, silent, total stop: an agent that sets it and then dies — killed, timed out, context exhausted, or simply finished and forgetful — has stopped every future cycle, and nothing will alert, because “no PRs” is what a working pipeline looks like on a quiet week. A TTL turns “forgot to re-enable” into a few lost cycles. This is the stale-lock rule of requirement 1 applied to the same failure. -
Everything ambiguous resolves toward disabled. An unreadable record, or one whose
expires_atwon’t parse, keeps the pipeline down. The file exists because something meant to stop the pipeline; recovering “enabled” from a truncated write runs the cycle the switch was set to prevent. -
A reason is required, and an unparseable
--foror--untilis an error. The next person to wonder why nothing is happening is entitled to a reason, and a typo’d duration or timestamp — or a--untilthat names an instant already past — must not be guessed in either direction — one resumes the pipeline mid-edit, the other never resumes it. -
The switch stops the next cycle, not the one already running. Say so when it is set while a lock is held, in
--statusand in--disable’s own output. An agent that disables the pipeline, assumes the coast is clear and starts editing has gained nothing and doesn’t know it. -
--statusdistinguishes a node-scoped disable from a fleet-wide one, and says what clearing each leaves. With neither set it reports the switch enabled; with only the fleet flag set it names that record and says a plain--enableclears it fleet-wide; with only ascope: "node"local record set (a--this-nodedisable) it says--enable --this-nodeclears it; with both set it reports both records and spells out the asymmetry —--enableclears both,--enable --this-nodeclears only the local record and leaves the node down under the still-set fleet switch. An operator who finds a node down for more than one reason is entitled to know which command undoes which.A
scope: "fleet"local record is not a second reason, and is never reported as one. With the fleet flag still set,--statussays the local record mirrors it and that--enableclears both levels; with the fleet flag clear it reports the orphan plainly — a mirror of a fleet switch since cleared, probably by--enableon another node, leaving this node standing down alone until--enableis run on it.
Deliberately not bypassed by
--onceor--dry-run: “these files are being edited, do not run them” is no less true when a human runs them. -