docs/spec/implementation/acceptance-checks/acceptance-checks-01.md
Acceptance checks
Section titled “Acceptance checks”Every change to the system must leave all of these passing; before opening a pull request, run the ones the change touches and any it could regress.
No check below may expect a particular value from config.json. The
shipped configuration is asserted to be valid — that it matches
config.schema.json, and that scripts/doctor.sh passes it — and every other
fixture supplies its own configuration, either a block the test writes itself
or test/fixtures/config-base.json, the base test/config-schema.test.sh
mutates. Where a check is genuinely about the shipped file rendering or
resolving correctly, it reads the values it needs back out of it (through
config_defaults, the same resolution the code uses) rather than repeating
them. Changing a configured value — a threshold, a cadence, an autonomy rung,
a repository added or removed — is a configuration change, and must never
oblige anyone to edit a test.
-
shellcheck agent-cycle.sh scripts/*.sh lib/*.shis clean. 1a. The role guard holds in both directions.test/role.test.shpasses: every value that is notactivestands the node down with a cron-log line, exit 0 and nothing written understate_dir;--dry-run,--onceand the switch commands run regardless of the role. 1b. The image builds and carries the whole toolchain, on both architectures.docker build -f deploy/docker/Dockerfile -t agent-ops .succeeds, and inside it, as useragent:bash,git,jq,curl,python3,perl,flock,sha256sum,rsync,node,claude,gh(≥ 2.60),supercronic,shellcheckandsquid(the egress-proxy service’s fence, requirement-checked at check 10) all resolve;shellcheck --versionprints0.11.0, the same version.github/workflows/shellcheck.ymlpins;supercronic -test /app/deploy/docker/crontabreports the crontab valid; thetest/suite passes inside the container, save for the one narrower class of change check 1b-i carves out of it; and/app/agent-cycle.shwith no role set exits 0 through the requirement 2.4 guard. The build itself asserts one thing aboutghbeyond its version, becauseghis the one part of the toolchain installed unpinned: agrep -aFover the installed binary for each of the two stderr diagnosesreview_gate_required_checkssplits its verdict on (requirement 31c) — a release that reworded either fails the build at that step, here rather than on a node. Misspelling either substring must make the build fail there, which is how the guard is verified to be doing anything at all..github/workflows/build-image.ymlruns every one of these against both thelinux/amd64and thelinux/arm64build on every pull request that touches the image — each architecture in its own job, natively on a runner of that same architecture (ubuntu-latestandubuntu-24.04-arm), with no emulation anywhere in the tested path — so a change that breaks either architecture’s image cannot be merged, and it is the only place thetest/suite runs in CI. Onmainthe workflow publishes both architectures as one manifest list per tag. 1b-i. A documentation-only change builds nothing, everything else builds, and one narrower class builds without running the suite.test/is-docs-only.test.shpasses:scripts/is-docs-only.shcalls a change documentation-only when every path in it is underdocs/— exceptdocs/STANDING-DECISIONS.mdand the four specification filesmonitor-cycle.shnames (docs/spec/implementation/gotchas.md,docs/spec/review.md,docs/spec/monitor.mdanddocs/spec/dashboard/README.md), which the image does deliver to a running stage and so count as code — or isREADME.md,CLAUDE.md,AGENTS.md,TECH-DEBT.md,LICENCEordeploy/docker/README.md, or is undersite/— the public documentation site’s own toolchain, the one allowlist entry that is a directory rather than a named file and the only one.dockerignoreexcludes outright, so the image is not merely the wrong delivery path for it but no delivery path at all;.github/workflows/docs-site.ymlbuilds and deploys it, andtest/is-docs-only.test.sh‘s own “still exists” assertion skips inside the image for exactly that reason — and calls it code otherwise —prompts/*.mdincluded, since those are Markdown documents and the operating instructions of requirement 1a’s stages, so classifying by file extension would let a change to a node’s behaviour skip the build that deploys it. Everything undertech-debt/is code for the weaker reason that the allowlist does not name it: nothing reads/app/tech-debt/, so an edit to the frozen register costs a build nobody needed rather than reaching a node, and that is the side of the mistake this classifier is built to take. An empty path list, or none, is code. The test the allowlist encodes is “the image is not the delivery path for this file”, which is weaker than “nothing reads it” and cuts both ways: a cycle working on this repository reads its ownCLAUDE.mdand itsAGENTS.md, but from thegh repo cloneinworkspace_root— current the moment a pull request merges, with no image involved — so those stay documentation-only despite being read.docs/STANDING-DECISIONS.mdand the specifications’## Gotchassections are the opposite case:agent-cycle.shresolvesstanding_decisions_fileagainst$SCRIPT_DIR, which is/appin the image, andlib/escalation-autonomy.shfeeds the file to the decide-tactical pass as its precedents;monitor-cycle.shpasses each of those four$SCRIPT_DIR/docs/spec/paths tomonitor_digest_gotchasas the Monitor’s known signatures — both reach a node only through the image, so a change confined to either still needs one. Every other stage’s working directory is underworkspace_rootorstate_dir(requirement 6’s assertion pins the first), so /app is never a working directory nor an ancestor of one and itsCLAUDE.mdandAGENTS.mdare never loaded as project memory..github/workflows/build-image.yml‘schangesjob runs it over the change’s own diff (three-dot, so a pull request is judged on what its branch did and not on whatmaindid meanwhile) and, when the answer is yes, skips every step of thebuildjobs and the whole ofpublish; a checked-out state it cannot diff builds. The skip is neither apaths-ignore:filter nor a job-levelif:onbuild, because each of those leaves a required check that never reports and a pull request that can never merge: a filtered-out workflow reports nothing at all, and a skipped matrix job never expands its matrix, so it reports one check run named for the uninterpolatedBuild and test (${{ matrix.platform }})while the two names the ruleset requires go unreported. Skipping the steps instead leaves both legs running and reporting success on every pull request, at the cost of a runner that starts and does nothing. Every job here therefore reports on every pull request, andWork out what changedjoins the other three as a required check. Only an explicit “yes” skips: achangesjob that fails rather than answers leaves the steps’ condition unsatisfied-by-emptiness and they run, since a skipped job reading as success would otherwise carry a dead runner through topublishand leave a merge tomainwith no image at all.publishstates that condition itself rather than inheriting it throughneeds, itsbuildjobs now being successful on a documentation-only change rather than skipped. A documentation-only merge tomainpublishes no image, and no tag carries that commit’s SHA. The script’s--skip-suite-onlymode asks the narrower question the allowlist above cannot: of the paths the image is the delivery path for, which does no test read?docs/STANDING-DECISIONS.mdalone, and the mode answers yes only when every path in the change is either that file or in the inert set. The four specification files are deliberately not on that list, becausetest/monitor-digest.test.shreads their real## Gotchassections and a change to one of them can fail a test. Thechangesjob emits the answer as a second output,skip_suite, computed in the same step and false wheneverdocs_onlyis true; exactly one step reads it — “Run the test suite inside the image”, skipped when either output istrue. Every other step of thebuildjobs, and the whole ofpublish, stays gated on the documentation-only answer alone, so a change in this narrower class still builds the image on both architectures, still verifies the toolchain, the crontab and the role guard, and still publishes to GHCR onmain— it only declines to spend the suite’s ~40 minutes per architecture proving nothing such a change could break. The test covers all three outcomes and guards this one’s premise: it fails if anytest/*.test.shbut itself so much as namesdocs/STANDING-DECISIONS.mdoutside a comment, so the exemption lapses loudly the day a test starts depending on the file’s content rather than going on quietly skipping a suite that by then exercises it. 1c. The stack comes up from nothing and is idempotent. With a.envcopied from.env.exampleandCOMPOSE_PROFILES=local,docker compose up -dindeploy/docker/startsscheduleranddashboard-localon fresh volumes;curl http://127.0.0.1:$DASHBOARD_PORT/and/data.jsreturn 200; the scheduler’s log shows supercronic reading the crontab and the 5-minute heartbeat firing;agent-cycle.shandreview-cycle.shstand the node down through the requirement 2.4 guard withROLE=standby; and a secondup -dreports every containerRunningwithout recreating one.docker compose --profile tailnet configis valid. And thelocalprofile’s exposure is the host’s loopback and nothing more:docker compose --profile local configshowsdashboard-localpublishing with host IP127.0.0.1and nonetwork_mode, so the same curl from another machine on the host’s network is refused. Check 1c-ii is the same property guarded on every commit, where this one needs a node. 1c-i. A roll waits for a cycle.test/watchtower-pre-update.test.shpasses:deploy/docker/watchtower-pre-update.shexits 75 while, inside that pipeline’slock_stale_after, eitherlock.jsonorreview-lock.jsonnames a live process in the hook’s own container — or any process in another container: the suite models one lock read under the writer’s hostname and a neighbour’s, deferring in both while the writer’s process lives, and deferring for the neighbour regardless of the pid, which it has no way to check. It exits 0 when the locks are free, stale, unreadable, or dead by the writer’s own reading, and exits 0 rather than blocking when it cannot readconfig.jsonat all. Both cycle scripts stamphostinto the locks they write; the suite pins that too.docker compose configshows every service on the agent-ops image carryingcom.centurylinklabs.watchtower.lifecycle.pre-updatepointing at that script, andwatchtowercarryingWATCHTOWER_LIFECYCLE_HOOKS=true. On a live node:docker compose exec scheduler /app/deploy/docker/watchtower-pre-update.shechoes its finding and exits 0 when idle, 75 during a cycle. The same suite also pins theroll-pendingoverride (requirement 68 (Finish-then-continue), agent-ops#1096, scoped by agent-ops#1102): a valid, unexpired$state_dir/roll-pending.jsonmakes the hook exit 0 despite a livelock.jsonnaming a live process in the hook’s own container — but never despite a livereview-lock.json, which still defers on its own ordinary judgement whatever the marker says, and whose deferral the hook’s own output never reports as an override; an expired or unparseable marker leaves the ordinary lock-based judgement above unchanged; and no marker at all behaves exactly as it did before the marker existed. The allow the override does grant says so in the hook’s own output — it names the lock it overrode rather than the “no cycle in flight” the marker-free allow reports. And the same suite pins the compose-apply deferral (agent-ops#1913): a$state_dir/.compose-reconcile.jsonreadingapplyingwith a freshatmakes the hook exit 75 on an otherwise idle node, and keeps it at 75 even whereroll-pendinghas just overridden a livelock.json; a marker whoseatis fresh and whosesinceis hours old still defers, and the line reports thesince, because an apply still running has itsatrewritten every tick and what an operator needs is when it began; and the same marker past the ten-minute bound, one whoseatwill not parse, one holding any other status, junk, and no marker at all each leave the hook exactly where it was. 1c-ii. The dashboard is published to the host’s loopback and to no network.test/dashboard-exposure.test.shpasses: indeploy/docker/compose.yamlevery portdashboard-localpublishes is scoped to127.0.0.1, the mapping is127.0.0.1:${DASHBOARD_PORT:-8787}:8787soDASHBOARD_PORTmoves only the host side, and it carries nonetwork_mode; its server is told to bind0.0.0.0on that same container port, without which the published mapping would reach nothing; thetailnetdashboardis in the sidecar’s namespace (network_mode: service:tailscale), publishes no port and is given no bind address, so it keeps loopback where Serve proxies to it; thenode-healthservice (requirement 60d) publishes the one mapping127.0.0.1:${NODE_HEALTH_PORT:-8788}:${NODE_HEALTH_PORT:-8788}, takes nonetwork_mode, and is told to bind0.0.0.0on that same port; those two are the only services that publish anything at all, and every mapping either of them declares is127.0.0.1-scoped.scripts/serve-dashboard.shinvoked with no bind address resolves to127.0.0.1, and to0.0.0.0when given it. The socket-level half of the property — that a request from another machine is refused — is check 1c, which needs the stack up; this check runs in the image, where there is no Docker. 1c-iii. A node can tell when its compose.yaml has fallen behind.test/compose-drift.test.shpasses: identical copies readin-syncand so do copies differing only in comments and blank lines; a material difference readsdriftedwith a positivediff_lines; a missing mount readsunmountedinside a container andnulloutside one; an image carrying no copy of its own readsnull, never a guess; no path returns non-zero (the verdict is computed inside a heartbeat push running underset -e); anddeploy/docker/compose.yamlmounts itself read-only at/host/compose.yaml, the path the library reads — the line through which the check is armed. The file-level assertions of 1c-i pin the repository’s copy and prove nothing about any node’s; this check is what covers the gap they leave. 1c-iv. A node can tell when it has fallen behind the newest published image.test/image-drift.test.shpasses: a checkout (not a CI-stamped image) readsnull; a matching commit readscurrent; a differing one readsbehind, carrying the registry’s commit and the image’s creation label; a token, manifest or config-blob fetch that fails, or an image carrying no revision label, readsunverifiedwith a reason, never a guessed verdict; the multi-platform index this repository actually publishes is walked one level to reach the labels, into a per-platform image and never into one of the attestation manifests buildx writes beside them (whose config blob carries none of these labels, so reading one would report the whole fleetunverifiedwhile the registry was answering perfectly well); a second call insideIMAGE_DRIFT_TTLcosts no network call, while an empty cache-file path always re-fetches; no path returns non-zero; and.github/workflows/build-image.yml’s publish step stamps both the revision and creation labels the check reads.test/check-node-image.test.shpasses against a stubbeddocker: current, and behind within the configured grace, both exit 0; behind past the grace exits 1, naming the registry commit and the grace exceeded; a registry the container could not reach exits 2; a node not running a CI-stamped image at all is not a failure; and nocompose.yamlin the stack directory, or a scheduler that cannot be exec’d into, is exit 2, never a clean pass. 1c-v. The tailnet sidecar refuses to start withoutTS_AUTHKEY, and does not retry forever over one — and neither does the dashboard sharing its namespace. On a live node with thetailnetprofile selected andTS_AUTHKEYunset,docker compose up -dexits non-zero — Docker reportscannot join network namespace of container: … is restarting— leaving bothtailscaleanddashboardin a failed state, anddocker compose logs tailscalecarries one line per attempt naming the missing variable and the active profile (six identical lines, observed on issue #728’s keyless run againstmain@412b025), never reachingtailscaled— no new node key is registered against the tailnet.docker compose psshows neither restarting indefinitely — but they settle by different mechanisms, and at different counts, and the check asserts each separately.tailscalereachesExitedwith aRestartCountof 5: it starts, exits non-zero six times over (one initial attempt plus five retries), and its ownrestart: on-failure:5bounds the retries where the rest of the file isunless-stopped.dashboardreachesCreatedwith aRestartCountof 0: joining the network namespace of a container that is not running is refused at start, so the container never runs, never exits, and a policy keyed on exit codes is never consulted — whether that policy ison-failure:5or the anchor’sunless-stoppedmakes no observed difference, since neither is ever consulted; both settle at zero attempts immediately (TD-PPagop-26091401 records the measurement against TD-PPagop-26082303, whose belief thatunless-stoppedretries this failure indefinitely did not reproduce).docker eventsover the window shows five restart attempts for the sidecar and none for the dashboard, not an unbounded stream from either.The dashboard half is observed: on VM1, 2026-08-24,
dashboardsat atstatus=created, RestartCount=0, ExitCode=128behind atailscaleatstatus=exited, RestartCount=5, ExitCode=1. That run hadTS_AUTHKEYset but invalid rather than unset, so it is not this check’s own precondition and does not discharge it — the sidecar failed attailscale upinstead of at the entrypoint. It transfers for the dashboard regardless, whose view of both cases is identical: the sidecar is stopped, and the namespace cannot be joined. The sidecar’s own unset path — one line per attempt naming the missing variable,tailscalednever reached — is separately observed, on issue #728’s keyless run againstmain@412b025, corroborated on the deployed nodeockham-containerwithTS_AUTHKEYgenuinely absent. WithTS_AUTHKEYset, the sameup -dstarts both containers normally anddocker compose exec tailscale tailscale statussucceeds. 1c-vi. A node applies its own merged compose.yaml, and only when it is safe to.test/compose-reconcile.test.shpasses against a stubbeddockerthat creates nothing: identical copies readin-sync, run no docker command and log nothing; drift with every required${VAR}present and no lock held installs the image’s copy byte-for-byte, runs exactly onedocker compose --project-directory <dir> up -d --remove-orphans, keeps the file’s inode (a bind mount of a file pins the inode it was created against), leaves.envuntouched, and logs onecompose-reconciledcarrying both digests andcycle: null; the tick after it finds nothing to do. That recreate is asserted to run in a transient sibling — adocker run --rmof the image the stubbed daemon reports for this container, taking this container’s own mounts by--volumes-fromand its own memory, pids and cpu ceilings read back from the daemon, no network, no signal proxying, no daemon-side log,dockeras its entrypoint and the socket it was given named in itsDOCKER_HOST— and never from inside the project, which is the whole of agent-ops#1913. The stub models what each of the two shapes leaves behind, so the property held to is the outcome and not the command line: a tick killed exactly where the recreate would kill it ends with every service of the project running, its marker readingapplyingwithpending_applyand itstodigest, and the next tick retries the recreate and settles itreconciled— with the project still running, the retry cleared, and afromthat is the digest the apply replaced rather than the one it installed. A container whose own id the stubbed daemon cannot name readsdeferred, installs nothing and recreates nothing at all, while one whose project directory is spelt with a trailing slash reconciles, the lookup asking for the path Compose would have cleaned it to. While a container carrying the apply’s own name and label is alive, a tick readsapplyingwith a freshatand starts no second recreate, although a heldlock.jsonand a liveroll-pending.jsonwould each have deferred it, and logs no further event. A${VAR}with no default that.envdoes not define readsrefused, names the variable and changes nothing — while the same variable carrying a default does not, which is what distinguishes the check from a scan that would refuse every node. A heldlock.jsonorreview-lock.jsonreadsdeferredand applies nothing; the same lock pastlock_stale_afterdoes not defer; a liveroll-pending.jsonreadsdeferredon its own, with no lock held at all and with the marker’s own window indetailrather than inreason, while an expired one and one whoseuntilwill not parse hold nothing back; a marker re-armed under a wait already running is the same wait, keeping itssinceand logging nothing further, and a wait longer thanlock_stale_afterstops honouring the marker and applies; and a second and third deferral for the same reason log no further event. A recreate that exits non-zero readsdeferredwithpending_apply, having already installed the file, and the next tick retries the recreate although no drift remains — and two further failed ticks whose stubbeddockerprints a different last line each time still log one event between them, the stub varying deliberately because that line lives indetailand onlyreasonis compared. A cycle starting between the install and the retry readsdeferrednaming that cycle and keepspending_apply, since a postponed retry that was discarded would leave the node running acompose.yamlnone of its containers came from. A stack this container’s uid can neither write nor read.envin — the root-owned stackcloud-init.yamlleaves, played by the suite’s own files with the owner’s bits removed, which the stub lifts only for the daemon’sdocker cpand for a sibling started with--user 0— reconciles, installing the file in place and leaving every mode as it was; an in-sync node with an unreadable.envstill readsin-syncand asks the daemon nothing; acompose.yamlthis container cannot read isrefused, naming its owner and mode and achmodwhose path is quoted; an install the sibling cannot perform isdeferredas the write that failed, withpending_applykept and the file untouched; an.envthe daemon cannot hand over isdeferredand names.envrather than any variable; and no.envat all refuses as every required variable missing. A marker with nosince, and one already holding"since": "false", start the clock on the tick that reads them; an unchangedin-synckeeps thesinceit began with; and a newline in a storedreasonkeepspending_apply, the status and both digests. The audit (reconcile-compose.sh --audit, called both directly and through the script withstate_dirfromconfig.json) passes a freshin-sync; fails a verdict four ticks old, a refusal (quoting it), a lock deferral older than the larger lock bound, any deferral that is not for a lock or a roll, anapplyingthat old, a marker that will not parse or has noat, and a container the daemon cannot name by its project directory (naming the directory it was brought up from and the quotedcdthat fixes it); reports a fresh lock or roll deferral and a freshapplyingas information; reports no verdict asunableon a container that has just started and as a failure on one up for four ticks; keeps a multi-line reason on one line; and writes and logs nothing and asks the daemon onlypsandinspect.compose.yamldeclares the service in theauto-updateprofile with the socket, the same-absolute-path project mount,network_mode: none, neither shared anchor and no secret of its own — the lines through which the reconciler is armed and bounded, the way 1c-iii pins the mount line that arms the drift check. 1d. State replicates per node, and comes back as peers.test/state-sync.test.shpasses: a push carries the logs, cycles, reviews and switch but not the locks or the dashboard, and — of theghtransport shim’s own state (requirement 2.0e) — carries its per-call ledger andbudget.jsonbut neither its stored response bodies nor its lock files, onto the node’s ownnodes/<NODE_NAME>branch with a heartbeat naming the node, its role, its newest cycle, its version, its compose-drift verdict (asserted end to end: a node whose fixture copies differ publishesdriftedwith the differing-line count), an image-drift slot (what the verdict itself says is 1c-iv’s own coverage; this asserts only that state-sync.sh asks for one, and that its cache file does not replicate), and its own node-scoped switch (issue #379,toggle_switch_summary— a node whosedisabled.jsonis set publishesswitch.disabled: truewith the record’s reason); a second push amends rather than accumulating history; a standby pushes its own branch and never a peer’s; the branch keepscycles_retainedcycles while the node’s owncycles/andreviews/are pruned to the neweststate_local_cycles_retainedby the same push, newest always kept, andlog.jsonlis byte-for-byte untouched by that same local prune regardless of how many cycle/review directories it removes (requirement 2.6d); every file the push commits has been throughredact_filefirst (requirement 2.5,lib/redact.sh) — a token- and home-path-shaped fixture planted incron.logand in a cycle transcript reaches the branch as[REDACTED-TOKEN]and~, neither raw form survives, and the redacted transcript still parses as JSON, while a file the pass cannot rewrite at all is warned about and dropped or emptied rather than committed as it stands, every other file in the same push still reaching the branch redacted, and a file that resists removal and truncation too abandons the push with astate-sync-push-failedevent and no commit (requirement 2.5’s cascade, agent-ops#1679 and agent-ops#1703); a configurednotify_webhook_urlreaches the branch as[REDACTED-WEBHOOK]too — no shape rule matches a bearer secret carried in a URL path, so this asserts the runtime-literal registration (agent-ops#1721) instead — while an unrelated URL of similar shape is left untouched, and with the value unset the existing shape-based redaction is unaffected; anotify_webhook_url(config-sourced or fromNOTIFY_WEBHOOK_URL) containing a newline registers as a no-op instead of poisoning the shared rule set — the existing token-shape redaction still applies to the rest of the same push, the raw value itself reaches the branch unmasked, andstate-sync.shwarns about it on stderr rather than leaving the gap silent (agent-ops#1730); a fetch materialises a peer whole under the peers directory, leaves the node’s ownstate_diralone, never includes the node itself, and prunes a peer whose branch is gone; a fetch that loses the mirror lock to an ordinary, short-lived hold waits it out and completes with no contention ever logged, while one still held pastfetch_lock_wait_secondsis reported exactly as a push’s own lost race already is — “holding for Ns”, and “may be wedged” once that age passes one push interval (requirement 2.5, agent-ops#2745); the union read (lib/fleet.sh) carries both nodes’ events in time order; and pipeline events written throughlog_eventcarry the node’s name. Over a union holding a spliced peer line whose head is older than the node’s ownlimit-hitand whose recoveredlimit-hitis newer, a whole recordcatjoined to the next peer file’s first record, and a NUL run in a third,fleet_logsputs every record at its own timestamp’s place, leaves every line parseable with no NUL byte, passes a record that carries a nested record through byte for byte, counts the three damaged lines in its damage file and removes its candidate file; the freeze’s start read off that union is the node’s hit and the governing hit the recovered one; asort,awk, candidatejqortrthat fails makes the build fail and still leaves no candidate file; and a clean union builds with nothing counted. The same file coversfleet_repair_log: a NUL run is cleared from a plain-text and a JSONL target alike, with the stump it cut dropped, the record it ran into recovered and the loss recorded; a spliced line with no NUL byte is replaced by the record split out of it, in its place, with alog-repairedrecord counting one line dropped and one record recovered, and a second call adds nothing; a damaged line with no intact record and a line that is not a record are both dropped and counted, with none recovered; a record carrying a nested record is left exactly as it is; a whole record that lost only its newline is kept with the one it ran into; a spliced line before an unterminated last line is repaired, with the last line kept byte for byte and unterminated after the repair record, and a file whose only damage is that line is not rewritten; a file holding a NUL run and a splice recovers the splice’s record too; a step that fails underset -e(theawkthat counts the plan) ends the repair rather than the caller, leaving the file and no working copy behind; and the swap keeps a file that grew during the repair, discarding the repaired copy, while replacing one whose size is unchanged. 1e. The fleet flags reach every node.test/toggle.test.shpasses, including its fleet section against the contents-API stub (TOGGLE_GH): a flag one node writes reads as disabled on another; an unreachable state repo falls back to the cached copy, and to enabled with none; a 404 is clear and clears the cache; a garbage flag is disabled; the limit flag only ever extends; a delete never reports cleared for a flag still set — including on a repo-level 404 from its read-for-sha, which it probes withfleet_repo_visibleunconditionally rather than accepting as clear (TD-PPagop-26081604) — and reports which of the two ways it can succeed actually happened —deletedwhen a flag was removed,absentwhen there was nothing to remove — whichfleet_flag_write_outcome/fleet_flag_delete_outcome(issue #426) translate, along with a genuine failure, into theok/failed/unconfiguredvocabulary requirement 33 documents; and — end to end, offline —--disableon node A publishesfleet/disabled.jsonand both real pipelines on node B stand down naming the fleet switch,--enableon A genuinely removes the flag, and afleet/limit.jsonpublished by A stands B down until itsresume_at. The same file covers requirement 2.3’s actor/kind fields and requirement 2’s kind gates (#244): a disable record carrieskind: manualand a non-emptyactorthat is neverunknown(NODE_NAMEwhen set, the user otherwise,id -unwith noUSERat all); the publishedfleet/disabled.jsonnames the setting node as its actor; a limit flag published with evidence carrieskind: auto, its node asactor, and the evidence; a hand-writtenkind: manualfleet/limit.jsonstands a node down with a reason naming its actor and the manual kind, is not probed (no probe note in the reason) and is not cleared; and an automatic freeze older thanlimit_escalate_after_hoursattempts the 1c escalation (offline, whereghfails fast, the attempt is the loggedwarningnaming the freeze’s start). The same file covers--this-node(requirement 2.3, #379):--disable --this-nodereports plainly that only this node stands down, writes the local record and publishes no fleet flag, and a peer’s own cycle is unaffected;--enable --this-nodeleaves a fleet flag another node set untouched while clearing only the local record; a node carrying both a node-scoped disable and a fleet disable stands down for the local one first and, once that alone is cleared, for the fleet one next; a node-scoped disable clears itself and logsdisable expiredcarryingscope: "node"and nofleet_flag, on the same TTL terms as the fleet switch; a fleet-wide disable past its TTL clears itself the same way, loggingfleet disable expiredcarryingscope: "fleet"andfleet_flag: "ok"and actually removingfleet/disabled.json(issue #426, defect 3 — the outcome used to be discarded); and--this-nodegiven with a command other than--disable/--drain/--enable(--statushere) exits 64 naming the three it modifies (requirement 2.3d). Everydisabled/enabledevent this file’s e2e block logs is asserted forscope— a plain--disable/--enablecarries"fleet", a--this-nodeone"node"and nofleet_flagat all — and a fleet-scoped--enableforfleet_flag: "ok", including the case where the node clearing a live fleet flag has no local record of its own to report (acceptance 4: the defect that used to leave that resumption silently absent from the log). It covers--status’s own distinction in all three combinations: with only the local record set it reports no fleet switch and names--enable --this-nodeas what clears it; with only the fleet flag set it reports that record, its reason, and that this node adds no node-scoped disable of its own; with both set it reports both and spells out that--enableclears both while--enable --this-nodeleaves the node down under the fleet switch.The same file covers the record’s
scope(requirement 2.3): an unmodified--disabletags its local recordfleetwhile still publishing the flag, and--statusnames that record as the fleet switch’s mirror rather than as a second, node-scoped disable;--enable --this-noderefuses a mirror with exit 64, naming plain--enable, and leaves the record in place; a mirror that survives a peer’s--enableis reported as a leftover of a cleared fleet switch and cleared by--enableon its own node; a--disablewhose fleet publish fails is retaggednodewith itsdisabled_atunmoved and no flag published, and--enable --this-nodethen clears it;--disable --this-nodetagsnode, and that scope reaches peers throughtoggle_switch_summary; and a record written without the field reads asnodethrough bothtoggle_scopeand the summary.The same file covers the per-process memo’s own key and its hit (requirement 2.3a): a
clearmemoised by a default-mode read is not served to aprobe-404read of the same flag and the samestate_dir, which probes for itself and readsunreachable; and a memo entry that is empty, or that has vanished since it was written, falls through to a live fetch rather than being served as a confirmed answer. 1e-i. The drain is a mode on the same switch, and never loosens a stop (requirements 2.3d, 2.2c, 2.9).test/toggle.test.shpasses: at the library level,toggle_disabledefaults the record’smodeto"stop"and writes"drain"when asked,toggle_modereads either back and defaults a record with no field, an empty record and no argument at all to"stop",toggle_switch_summarycarriesmodeto peers, and a drain record still reads.state == "disabled"— mode is orthogonal to state, which is whyreview-cycle.shneeds no branch of its own. End to end, offline:--drainwith no reason exits 64 naming the requirement;--drain <reason>writes an otherwise ordinary switch record carryingmode: "drain"and logs adisabledevent carryingmodebesidescope;--statusreportsDRAININGfor it and neverDISABLED;--drainover an active stop exits 64 naming--enableas the way out and leaves the stop’s own record and reason untouched; a peer’s unmodified--disablelikewise refuses a fleet-scoped--drainon a second node that carries no local record at all, leavingfleet/disabled.jsona stop and writing no record on the refusing node, while--drain --this-nodeunder that same fleet stop is allowed and leaves the flag untouched;--disableover an active drain tightens it tomode: "stop"with the new reason;--drainover an active drain extends it, loggingextends;--enableclears a drain exactly as it clears a stop; and a realreview-cycle.shrun under a drain exits 0 logging areview-stand-downwhose reason names the drain mode rather than a baredisabled.test/drain.test.shpasses, coveringlib/drain.sh’s own pure functions against a stubbedlib/claim.sh(the same"$AGENT_OPS_ROOT/lib/claim.sh" claims <slug>seamagent-cycle.shuses, so nogh, lock or cycle is involved):drain_remaining_count/drain_at_restread zero and at-rest for empty bands and no claims, count the four finishing bands across repos, still surface a live finishing-source claim whose pull request the gather has not seen yet, ignore a claim that names no finishing-source ref, and take the larger of the two counts rather than their sum so a claim its own band already counts is not doubled;drain_write_state/drain_read_stateround-trip{disabled_at, remaining, at_rest, checked_at}and read asnullbefore any cycle has written one; anddrain_status_linesays so honestly when no cache exists or the cache belongs to an older drain, and otherwise reportsDRAININGwith the remaining count orDRAINEDwith the check’s own timestamp. Thedrainedevent’s own dedup (drain_event_logged) is asserted against a union log carrying a matchingdisabled_at, a differing one, and none; a spliced line in the union does not hide a matching event; and a read that fails outright answers “not logged” and reports itself throughguard_warn. 1f. A provider-qualified model id resolves; an unsupported one fails fast (requirement 1a).test/model-id.test.shpasses: a bare id and itsanthropic/-qualified form resolve to the same value; an empty value (the “disable this stage” convention) passes through unresolved; a qualifier naming any other provider fails, printing nothing and naming the offending key and provider on stderr; and an assignment of the rejected form underset -euo pipefail— the exact context everycfgread inagent-cycle.shandreview-cycle.shuses — aborts the script rather than silently continuing with the qualified string. The same file covers the two resolution forms requirement 1a distinguishes:resolve_model_id_intoassigns the bare id to the variable it names and leaves the provider recorded in the caller’s ownMODEL_PROVIDER, while the printingresolve_model_idreturns the identical bare id and leaves that map empty, because the command substitution it is called in discards the recording; an empty value assigns empty, records nothing and succeeds, since the three cycle scripts call this underset -eand a disabled stage must not abort startup; and a rejected qualifier fails and records nothing. The same file coversmodel_key_fingerprint_json, the fingerprint’s own reader of a weighted set (requirement 1a, issue #2660): a set-configured key’s handle printsMODEL_SET_JSON’s normalized member array, an ordinary key’s value prints as that JSON string unchanged, an empty (disabled) value prints"", and editing a set’s weights changes the function’s own output for the same handle — the property a bare handle cannot have, since it is a constant.test/selection-fingerprint-model-set.test.shpasses, carrying that through to the producers: liftingselection_config_json,enabler_config_jsonandrefiner_config_jsonverbatim out oflib/gather-phase.sh, editing a weighted set’s membership or its weights changesselection_config_json‘s value for that key, while an ordinary key’s value in all three objects is byte-identical to what a bare--argproduced. 1g. Every shell script in the repository is shellcheck-clean, and a caller may lint a named subset instead of the whole tree../scripts/lint-shell.shexits 0. Invoked with no arguments, it discovers the file set — every tracked*.sh, plus every tracked file whose first line is a sh or bash shebang, so the init scripts and git hooks are included and a script added tomorrow is covered without anyone adding it to a list. Invoked with one or more arguments that each name a file that actually exists, it lints only those files instead, through the same mechanism, so the size guard (acceptance check 1g-i) and the confined SC1091/SC2154/SC2034 handling apply to a selected file exactly as to a swept one; an argument that does not name an existing file is not a selector and is forwarded to shellcheck as an option instead, same as every argument is when no selector is present — there is no separate flag for this, and no new validation for a typo’d path. Either way the files are checked one process per file with-x, which is what letssourceresolve between the pipelines andlib/instead of raising SC1091 on each of them.-xfollows asourceby path whether or not the target was also passed in, so the file set does not have to share a process for this to work; what sharing one did do was couple every script’s fate to every other’s, and a process that died on the largest script took the other 253 scripts’ coverage with it (#770). Clean means nothing reported at all, info findings included; a false positive is silenced by a# shellcheck disable=in the file that carries it, with a comment saying why, never by an exclusion in the runner..github/workflows/shellcheck.ymlruns the same script on every pull request against a pinned shellcheck (component 10).test/lint-shell.test.shpasses. 1g-i. A script too large to lint in the memory available is degraded, or — where not even that fits — skipped, and never allowed to kill the cycle; and this is judged against every file, not only ones above some fixed line count (agent-ops#1305). What “too large” measures is the union-xactually parses — the file plus every file it names in a# shellcheck source=directive, transitively, each counted once (analysed_lines,scripts/lint-shell.sh) — and never the file’s own length. #771 is why the distinction matters: splittingagent-cycle.shmoved its bulk into thelib/*.shmodules it sources, and-xre-inlines every one of them, so the file’s ownwc -lfell from 10,136 to 2,865 while the union it costs stayed at 26,262. A guard reading the file’s own length would have declared the problem solved and gone on to OOM-kill the node it ran on. The largest unions in this tree are 35,674 lines foragent-cycle.sh, 12,953 forscripts/publish-dashboard.sh, 9,367 forscripts/doctor.shand 7,196 forreview-cycle.sh— every one of them a whole entry point’s worth oflib/*.sh, and every one of them growing with the tree, which is the reason the guard costs a union rather than compares it to a constant. The GHC runtime shellcheck is built on ignores+RTS -M(the release binary is not linked with-rtsopts) and reserves a 1 TB address space, so neither a heap cap norulimit -vcan bound it; the only thing that can is not running it. Soscripts/lint-shell.shreads the smallest of its own cgroup ceiling, its own explicitLINT_SHELL_BUDGET_MIB(unset by default — never the parent cgroup’smemory.high, deliberately, since agent-ops#1620: that ceiling has to be sized forscripts/publish-dashboard.sh’s real working set, ~1.4 GiB, and this guard needs roughly ≤700 MiB to keep steering the largest unions off-x, and one knob could not hold both without livelocking the node the way it did for most of 2026-09-16) andMemAvailable, names whichever of the three actually bound it, and estimates every file’s own cost to follow with-xby interpolating/extrapolating between three measured points (estimated_follow_mib: 4,945 union lines at 396 MiB, 23,569 at 1,983 MiB, 26,262 at 4,543 MiB, the last of these a floor rather than a peak since that run never finished) rather than gating on a fixed line count first. This is what closes agent-ops#1305’s own reading of the guard: a line count picked to isolate one file says nothing about what the node running it can afford, and the former 10,000-line gate let everything below it follow sources unconditionally, whatever the budget.scripts/doctor.shis the clearest case — 9,367 union lines, under that gate, and an estimated 772 MiB to follow, against the 768 MiB a node explicitly budgeted at that figure actually has. That is an uncostedshellcheck -xsized at the incident’s own first measured kill (964 MB anon-rss), on a node the guard was reporting nothing about. A file whose estimate fits the budget follows with-x; one whose estimate exceeds it but whose budget is still at leastLINT_SHELL_PLAIN_MIB(1,024, a roughly constant cost regardless of the file’s own size) is linted without-x, suppressing SC1091, SC2154 and SC2034 for that file — all three artefacts of the degradation rather than findings about the code: without-xshellcheck sees none of the modules the file sources, so asourceline raises SC1091 and every variable crossing the boundary reads as unassigned (SC2154) or as assigned and never read (SC2034), which after #771 is 25 of them inagent-cycle.shwith nothing wrong with any of them. BelowLINT_SHELL_PLAIN_MIBthe file is not linted at all, and which of the two reduced modes a node lands in is a property of that node’s budget rather than of the file. A scheduler container withLINT_SHELL_BUDGET_MIBunset has its whole container ceiling to work with — 1,536 MiB by default, which is aboveLINT_SHELL_PLAIN_MIB— so nothing there is ever skipped:agent-cycle.shwithout-xcompletes in 634 MiB, comfortably inside that ceiling, where before #771’s split it was killed at that ceiling and skipped outright. A node whose operator has setLINT_SHELL_BUDGET_MIBto today’s typical parent-ceiling figure — 768 MiB,scripts/ cgroup-parent-setup.sh’s own--limitdefault — has that instead, which is belowLINT_SHELL_PLAIN_MIB— so on one of those the skip path is reached in practice, for every file whose estimate exceeds the budget:agent-cycle.sh,scripts/publish-dashboard.shandscripts/doctor.shas the tree stands. Setting it is a node-level act, like the Vercel variables above:LINT_SHELL_BUDGET_MIBis named indeploy/docker/compose.yaml’s shared environment block, so a node carries it by way of its own.envand adocker compose up -d— that block being an allowlist with noenv_file:beside it, a variable absent from it never reaches the container at all, however it is spelled in.env. That is the trade agent-ops#1305 accepted deliberately — reduced local coverage, announced on stderr, is strictly better than an invocation the node cannot afford — and it is another reason the skip does not fail the run: CI has the memory and checks all three in full. What no local ceiling can buy is following the sources inside it, and nothing else can either: a 172-line entry point over the same modules — 23,569 lines of union — already costs 1,983 MiB, againstagent-cycle.sh’s 26,262-line union at the time of that measurement passing 4,543 MiB before the kernel stops it. The cost is the union, the union is this pipeline’s whole codebase, and following it from an entry point is a CI-sized job by construction. So the guard’s reduced modes are permanent for the largest entry points rather than a stage on the way to something better, and the checks they give up are recovered in CI rather than one day locally. Degrading and skipping are both announced on stderr naming the file, its own length, its union, the estimated cost, and which ceiling bound the budget, because silence would read as coverage that did not happen; a skip alone does not fail the run, since CI has the memory and does check it —.github/workflows/shellcheck.ymlsetsLINT_SHELL_FOLLOW_MIB: 0, which disables the guard outright (every file follows with-xwhatever the estimate says) rather than merely raising a threshold, so the gate’s coverage does not quietly track how much memory a runner happens to have, which is also what keeps the three suppressed checks checked in full on every pull request. 1g-ii. Every GraphQL document this repository sends still validates against GitHub’s live schema, checked nightly rather than at merge time..github/workflows/graphql-drift.ymlruns./scripts/check-graphql-drift.shon a daily schedule, and exit 0 is every discovered document validating (component 10a). Being off the pull-request path is the point rather than a compromise: this failure arrives without a commit. GitHub movedmergeMethodandmergingStrategyoffMergeQueueontoMergeQueue.configurationbetween 2026-08-16 and 2026-08-23, GraphQL rejects the whole document for one unknown field, andmerge_queue_for_branch— which asked for both and read neither — returned non-zero on every call for the six days that followed, whilelanding_armreported only its own gate-7 refusal and the suite stayed green. Nothing a pull request could have gated would have caught that, and gating one on GitHub’s endpoint being reachable would cost every merge for no return. A red run reaches the pipeline as afailed-run-graphql-driftcandidate (requirement 19) for as long as its run is still inside the single unpaginated 100-run page of the default branch that both the Co-Ordinator’s own live query andscripts/gather-source-state.shread — measured at 11h18m on 2026-08-29, so roughly the next seven hourly cycles and no longer. That is better than a mark on a page nobody opens and less than a durable work item; TD-PPagop-26082936 records the gap and what would close it.test/graphql-drift.test.shpasses: the repository’s own documents are all discovered —lib/issue-priority.sh,lib/landing.sh,lib/merge-queue.sh,prompts/implementer.mdandprompts/reviewer.md, seven documents between them — and all reachghas a{query, variables}body whose document is wrapped, with neither mutation’s field left collectable; a document declaring a variable named$queryis checked rather than overwritten by its own placeholder; a document that never closes is annotated at the line it opens on instead of contributing nothing, and a prompt that describes the form in a code span before using it yields exactly one document, the real one; a moved field fails the run annotated with the file and the line its document starts on, in GitHub’s own wording, and counts as answered because GitHub answered; a transport failure reports0 of 2, not2 of 2; an unreadable document alongside an unanswered one exits 2 rather than letting drift mask it; a response carrying atyped error beside real drift reports both; a multi-line GraphQL message stays one::errorline; the three shape malformations report three distinct reasons; a file that callsapi graphqland yields no document fails the run naming what discovery recognises; a variable type with no placeholder is annotated with its line;--helpreaches the whole exit-code contract;--listlists a malformed document and exits 0, and exits 2 over a tree with nothing to list; a tree with no document at all exits 2 saying it refuses to report no drift;test/, this repository’s CHANGELOG and this document itself all quote the delimiter and none is checked as a document, while aprompts/file carrying one is; two documents in one file are each found at their own line; and an anonymous shorthand query is wrapped like any other. 1g-iii. The four hand-pinned toolchainARGdefaults indeploy/docker/Dockerfile—SUPERCRONIC_VERSION,SHELLCHECK_VERSION,CLAUDE_CODE_VERSION,GROK_BUILD_VERSION— are checked against their own upstream release feed nightly rather than at merge time, and a stale pin is reported as an issue rather than fixed..github/workflows/ docker-toolchain-drift.ymlruns./scripts/check-docker-toolchain-drift.shon a daily schedule (component 10b). None of these four is visible to any Dependabot ecosystem — unlike the base image and the compose/Action manifests.github/dependabot.ymlalready covers — because each is a bare version string an install step substitutes into a URL or annpm install, not a manifest entry any ecosystem parses (issue #2697). Being off the pull-request path, like component 10a’s GraphQL check beside it, is the point: the drift this catches is an upstream release, which does not arrive with a commit to this repository, so gating a merge on it would cost every pull request for no return. The script never bumps a pin and never opens a pull request — issue #2708’s own decide-tactical decision rejected that shape, because the two GitHub-released pins (SUPERCRONIC_VERSION,SHELLCHECK_VERSION) each sit beside two architecture-specific checksums (*_SHA1SUM_{AMD64,ARM64}/*_SHA256_{AMD64,ARM64}), so a correct bump recomputes three values, not one, which is implementer work rather than safe template substitution in a scheduled job, and because the rejected alternative — accepting manual review as the permanent model — is a standing human obligation, owner-only under requirement 36a condition 5.SUPERCRONIC_VERSIONandSHELLCHECK_VERSIONresolve against GitHub’s releases API foraptible/supercronicandkoalaman/shellcheckrespectively (the same releases each one’s own install step indeploy/docker/Dockerfiledownloads from);CLAUDE_CODE_VERSIONandGROK_BUILD_VERSIONresolve against the npm registry’s ownlatestdist-tag for@anthropic-ai/claude-codeand@xai-official/grok— two different feeds, read through two different resolvers, never one path reused for both.lib/github-limit.shis sourced ahead of everything else, exactly as component 10a’s own script does, so a rate-limit refusal on either GitHub releases lookup is waited out rather than read as “could not check” — the issue-filing call gets that same coverage only because the workflow’s ownGH_TOKEN(secrets.GITHUB_TOKEN) is passed through astechdebt_file_debt’sTOKENargument; the tokenless default every othertechdebt_file_debtcaller relies on execsghdirectly (env -u GH_TOKEN gh) rather than the shadowed shell function, and would bypass this coverage entirely. Each resolved version is validated against a conservative character allowlist before it is used for anything else — interpolated into the filed issue body or into--list’s own output — since a GitHub release tag name or an npmlatestversion field is upstream-controlled text that could otherwise carry injected markdown or instruction-shaped content into the pipeline’s own work queue (issue #2726). A version that fails the allowlist is treated exactly like an unresolvable one: logged, discarded, and never forwarded, so it exits the same way an unresolved pin already does rather than opening a new exit path. On any drift, filing goes throughlib/tech-debt-file.sh‘stechdebt_file_debt(component 23d) under a stable title, so a second scheduled run that finds the same or further drift comments on the issue a prior run already opened rather than filing a duplicate — the “updates the existing open one” half of the behaviour falls out of that dedup rather than this script tracking any state of its own between runs. The filed issue is labelledpw::type:tech-debtfor the ordinary tech-debt gatherer to serve, never a pull request: bumping a pin, including recomputing the two GitHub-released pins’ checksums, happens afterward as ordinary selected implementer work. The two GitHub-released pins’ own issue text additionally names the checksum recompute, so the implementer who eventually picks up the filed issue is not surprised that the bump moves three values. Exit 0: every pin’s upstream version was resolved — whether or not any had drifted, and whether a drift was newly filed or commented onto an existing issue. Exit 1: a pin had drifted but the filing itself failed. Exit 2: at least one pin’s upstream version could not be resolved at all — never reported as clean, and never as drift, the same convention component 10a’s own exit contract uses.--listprints every pin and its resolved upstream version and files nothing, never returning 1.test/docker-toolchain-drift.test.shpasses: stubbed against both aghand acurlrecorder — never the real GitHub releases API or the real npm registry, the same reason component 10a’s own test stubsghrather than asking GitHub — it asserts no drift files nothing; a drifted pin with no existing open issue opens one naming the stale pin, its pinned and upstream versions, and the checksum-recompute note; a drifted pin with an existing open issue comments on it instead of opening a second one; an unresolvable upstream version exits 2 and files nothing; a resolved version that fails the allowlist (one GitHub tag, one npm version, each carrying markdown-shaped text) exits 2, files nothing, and never appears in--list’s own output; and--listprints every pin without filing. Must passshellcheck.