docs/spec/implementation/acceptance-checks/acceptance-checks-10.md
Acceptance checks
Section titled “Acceptance checks”Acceptance checks — continued (part 10 of 10; items 2j-i–34p)
Section titled “Acceptance checks — continued (part 10 of 10; items 2j-i–34p)”2j-i. The merge reconciles repositories correctly, and a rejected verdict
costs a mechanical pick, never the cycle (requirements 15z, 3v; issue
#587). test/coordinator-merge-fallback.test.sh passes, against
run_coordinator_stage_attempt, fallback_select_candidate,
coordinator_merge_candidates and coordinator_corroborate_and_fallback
lifted verbatim out of lib/stage-attempt.sh:
coordinator_merge_candidates’s six-tier order, unit-tested directly. A security-tier candidate wins even ranked last within its own repository; anissues-source candidate whose own repository marks itUrgentoutranks areview-feedbackcandidate from a later-walk-order repository, while the identical ref is not treated asUrgentby a different repository that does not mark it so (the tier lookup is scoped to the candidate’s own repository’sissuesarray); all six named tiers (security, urgent issues, review-feedback, merge-conflicts, dequeued, abandoned-drafts) sort in the prompt’s own order regardless of walk order; two residual-tier candidates from different repositories — carrying no cross-repository tier of their own — order by walk order alone, whichever of the residual sources either one is; two same-tier candidates from different repositories break their tie by walk order, and two candidates from the same repository’s own tier break theirs by that repository’s own rank;candidates_maxcaps the merged result (four raw candidates across two repositories, capped to two, keep the more-overdue repository’s own two rather than one from each — repository order dominates a residual tier entirely); no internal_tier/_repo_order/_ranktag leaks onto a returned candidate; a non-arraycandidatesargument degrades to an empty result, a non-arrayreposargument still merges by tier/rank alone, and a non-numericcandidates_maxdegrades to the documented default (3) — never a crash.coordinator_corroborate_and_fallbackscopes corroboration to the repositories that said no. A repository that selected needs no corroboration at all, even when a different selected repository’s own eligible item went unreported — asserted directly: an eligible item belonging to a repository outside the false-repos list produces zerocorroborationevents regardless of whether it was ever accounted for. A false repository’s own unaccounted item is rejected (attempt: 1always now — there is no second attempt to distinguish it from, since issue #587 dropped the model retry a fleet-wide rejection used to buy), and the mechanical fallback fires and finds it, with nonone-selectedevent at all (the cycle selected something). A false repository whose ownneeds_refinement/voidedreport fully accounts for its band is accepted, with no fallback call and notd_verdict_rejected. When the fallback also finds nothing, the resultingnone-selectedcarriestd_verdict_rejected: true, the unaccountedbandstally, and nofingerprint(requirement 3t: a rejected verdict must never arm the no-op short-circuit) — proving the fingerprint-omission rule survives the retry’s removal intact. When every configured repository’s own bands are genuinely empty, nocorroborationevent fires at all (there is nothing to corroborate), and the resultingnone-selectedcarries notd_verdict_rejected.refinement_policybinds the mechanical pick. Againstfallback_select_candidatein isolation: under{"tech-debt": "required"}an unrefined tech-debt item is not selected and a lower band wins instead.fallback_select_candidate’s band order and shapes, unit-tested directly (no stage stub needed): against a syntheticordered_repos_json, a security finding outranks a tech-debt item in the same repo; alanding-refusalsentry outranks tech-debt and carries its own existing branch/PR; every band empty printsnull, not a crash or an empty-string candidate accepted downstream as one.sourcesbounds the mechanical pick (requirement 3x). The same fixture with itssourcesnarrowed to the four finishing bands and itsissues/tech_debtemptied — requirement 2.2a’s own back-pressure shape — yieldsnullrather than the security finding still sitting in itsfindingsarray, and yields that finding again the moment the token is restored.- The gate is no longer tech-debt-only, and stays scoped to the
repositories that said no (requirement 3x, issue #322). A silent
selected: falseover a non-emptyissuesarray and a non-emptyreview_feedbackarray — with the tech-debt band empty, so a tech-debt-only gate would have accepted it — is rejected,eligible_totalcounts both bands, and thewarningandcorroborationboth carry abandstally naming each; the rejected verdict’s own mechanical fallback then picks the highest reachable band. A report filed under the wrongsourceleaves its actual band exactly as unaccounted as silence would. A verdict answering each band by its own route (aneeds_refinementfor the issue, avoidedfor the review-feedback entry) is accepted, buys no fallback call, and keeps its fingerprint. - The argv cap survives the split (requirement 4g, TD-PPagop-26081401/
26081406). 3000 unclaimed tech-debt items, none reported back, still
reach the
warning/corroborationevents in full pastMAX_ARG_STRLEN(131072 bytes); 3000 recordedneeds_refinementreports, read back through the same function, still fully account for an equally large eligible set. - A no-verdict or zero-candidate Co-Ordinator engagement omits the
fingerprint (requirement 15y). The three consequences of requirement 15y
are asserted in lifted blocks from
agent-cycle.sh: the all-engagements- failed exit exits 0 when every engagement failed (full failure), exits 9 when only some failed (partial failure), and exits 9 when zero repositories are configured (zero-configured case), proving every failure mode is correctly distinguished; an engagement that produced no verdict omits the fingerprint and records the count inengagements_failed, so the next cycle asks again (requirement 3t, requirement 3b), while a complete cycle where every engagement answered arms the fingerprint and carries noengagements_failedat all; aselected:trueengagement that returned an emptycandidatesarray is folded into the false-repos set with a reason naming the contract violation (“selected:true but returned no candidates”), contributes nothing to the merged candidates, and is distinguished from a non-empty list, which is carried into the merge as before. 2j-ii. The corroboration covers every pre-fetched band (requirement 3x, issue #322).test/verdict-corroboration.test.shpasses:coordinator_eligible_itemsemits{repo, item, source}for each band the repo’s ownsourceslists and nothing for a band it does not (thecode-qualityhalf of afindingsarray whose repo lists onlysecurityis the case that separates the two); drops amerge_conflictsentry that is a never-nudged Dependabot PR while keeping its superseded sibling, which the prompt requires invoided; admits an issue only under its ownPriorityband’s token and drops one recorded blocked (repo-scoped exactly asexclude_blocked_or_void_itemsscopes it, blankrepoincluded); bounds everything by the narrowedsourceslist a back-pressured cycle leaves behind, so a restricted cycle owes no account offindingsorhuman_visibilitystill sitting populated; and degrades to[]on malformed repos, and to filtering nothing rather than everything on a malformedblocked.unaccounted_itemsmatches aneeds_refinementreport on repo and item and source — the same ref filed under another band, or against another repo, accounts for nothing — while avoidedentry, which carries no source, accounts for its repo+item in whichever band it was eligible in; it appliesrefinement_policyper entry’s own source, so"required"exempts that band and no other; and every entry it returns carries the band it was eligible in.test/coordinator-merge-fallback.test.shpasses the wiring: a silentselected: falseover a non-emptyissuesarray and a non-emptyreview_feedbackarray — with the tech-debt band empty, so requirement 3t alone would have accepted it — is rejected,eligible_totalcounts both bands, and thewarningandcorroborationboth carry abandstally naming each; a report filed under the wrongsourceleaves its band unaccounted; and a verdict answering each band by its own route (aneeds_refinementfor the issue, avoidedfor the review-feedback entry) is accepted on the first attempt, buys no retry, and keeps its fingerprint.test/verdict-corroboration.test.shalso passesunaccounted_items’ fit-ladder exemption (requirement 4i, agent-ops#683): a 4thtrimmed-jsonargument naming one eligible item exempts only that item, on the same repo+item+source key asvoided/needs_refinement, leaving any other still-unaccounted item flagged; an omitted 4th argument exempts nothing, matching the function’s behaviour before this change; and malformed trimmed JSON degrades to exempting nothing rather than everything. 2j-iii. Aneeds_refinementblock against an entry the fit ladder trimmed this cycle is refused, never recorded, and the completeness check owes no account of it either (requirement 34e’s fourth refusal, requirement 3x’s matching exemption; agent-ops#683).test/coordinator-input.test.shpassescoordinator_fit_trimmed_items/coordinator_fit_trim_refusal_reasonin isolation: a cycle driven to the ladder’s bottom rung with every entry still present marks every one of them trimmed; an untrimmed cycle marks nothing; a cycle trimmed only enough to clip one of two entries marks only that one; an entry whose comment prose alone was clipped — its body inside the rung’s cap and its comment list kept whole — is marked trimmed on the marker inside that comment; and the refusal function refuses only an entry whose repo+item the trimmed set carries, names the rung in its reason, and degrades to refusing nothing on an empty or malformed trimmed set.test/fit-trim-block-refusal.test.shthen drives the realrecord_needs_refinement_block(lifted verbatim, the same techniquetest/dependency-block-refusal.test.shuses) and passes: an agent-ops#683-shaped report — the Co-Ordinator citing a trimmed body’s own lack of acceptance criteria — is refused with awarningnaming the item and the rung, applies no label, and writes noattempt-failedat all; a genuine report against an item this cycle’s fit never touched is recorded exactly as requirement 34e already describes; the refusal is scoped tostage == "coordinator"— the identical entry reported by a Refiner or an Implementer is not refused on this bar, since neither reads this cycle’s fit-ladder-trimmed Co-Ordinator input; and the malformed-entry bar (requirement 34d) still runs ahead of this one. The same file then proves the two halves compose: with both of a fully-trimmed cycle’s eligible items left unreported (as the refusal above forces),unaccounted_itemsfinds nothing unaccounted — a"selected": falseverdict over that cycle is accepted — whilecoordinator_unassessable_itemsstill surfaces both as unassessable for the log, closing the loop the incident opened: the refusal alone would have just relocated the mass-flag into a corroboration-rejected retry loop over the same trimmed input, and this is the assertion that it does not. Both those files supply the trimmed set themselves, so neither can tell whetheragent-cycle.shever builds one — the gap agent-ops#933 lived in for as long as the gate shipped.test/coordinator-input-wiring.test.shcloses it, over the exemption-set block lifted verbatim and driven off the fit report a genuinely-trimmed cycle actually left behind rather than a hand-written one: the block’siftakes its true branch, socoordinator_fit_trimmed_jsoncomes back non-empty andcoordinator_fit_rungnon-zero; requirement 3x’s own accounting inside that same lifted block counts those candidates unassessable and logscoordinator-input-fit-unassessablecarrying the count, the rung and its detail sentence; andcoordinator_fit_trim_refusal_reason, given aneeds_refinementreport naming one of the items that block actually trimmed, refuses it and names the rung. Every one of those assertions fails against the pre-fix gate, which is what the empty-input fixtures above could not do. 2f. A preview nobody can reach is never reported as a healthy one (requirement 24a).test/preview-deploy.test.shpasses: against a stubbedghand a stubbed Vercel that answers the login flow to any request not carrying the project’s bypass secret, a built and reachable preview is exit 0; a preview behind Vercel Authentication is exit 2 namingVERCEL_AUTOMATION_BYPASS_SECRET, with a different diagnosis for a secret that is unset and one that is rejected, since the two have different fixes; a failed build is exit 1 naming the inspector, and carries the tail of the build log whenVERCEL_TOKENis set; a preview that built and then serves a 500 is exit 1 and is distinguished in words from a build failure; an application’s own redirect is followed rather than mistaken for the login flow; no deployment at all, a SHA deployed only to Production, and a deployment still building are each exit 2; and--waitre-asks rather than answering from its first look. With no--repoand no--prit resolves the checked-out branch’s own pull request without combining--repowith an unidentified pull request — a shape the realghCLI refuses, since--repooverrides the ambient-repository inferencegh pr viewotherwise uses to find the current branch’s PR — and an explicit--repowith no--prresolves the number first throughgh pr list --head <branch>rather than combining the two; that refusal is pinned directly against the installedghbinary, not assumed by the stub.--fetch <path>against a preview behind the same stubbed wall still returns that route’s status, headers and body — proving the bypass secret it sends internally reaches a protected preview’s own content — while the secret’s value never appears anywhere in the command’s output; a binary body is noted rather than dumped, and an oversized one is truncated with a note naming the size.prompts/implementer.mdandprompts/reviewer.mdare asserted to invoke the check with--fetchin the same literal form, so the two cannot drift (requirement 34a). Against the real API and a real protected preview,scripts/preview-deploy.sh --repo Poetic-Poems/poetic-fiddle --pr <n>from a shell with no bypass secret set reports that the deployment built and that the page could not be checked.test/preview-config.test.shcovers the config-block half of the same requirement (D19 Phase 1):preview_config_for_reporesolves a configured{"provider": "vercel"}entry unchanged, falls back to{"provider": "none"}for a repo carrying nopreviewkey at all and for a slug absent fromrepos[]entirely, andpreview_config_export_vercel_credentialsexports the two fixed variable namesscripts/preview-deploy.shreads from whichever variable name avercel.bypass_secret_env/vercel.token_envoverride names, is a no-op on the defaulted names, and is inert forprovider: "none".test/config-schema.test.shcoversscripts/doctor.sh’s (component 14) own side of this same requirement, alongside its other cross-key rules: the shape half throughconfig_schema_errorsdirectly (rejecting an unknownprovider, an unknown key insidepreview, abypass_secret_envthat is not a bare shell identifier), and the credential-presence check through a realscripts/doctor.shrun, asserting it warns rather than fails when a"vercel"-configured repo’s named variable is unset on the node it runs on. 2g. Every pipeline comment is visibly attributed (requirement 9d).test/comment-identity.test.shpasses:pipeline_actor_labelreturns the right display name for each ofscript,coordinator,implementer,reviewer,enabler,review-script,project-reviewerandmonitor, and fails open — prints the token itself — for one it does not recognise;pipeline_comment_headerrenders**<Display>** · autonomous pipeline · node \` for a known and an unknown actor alike;pipeline_comment_markercarries both the cycle id and the actor token, still prefixed withPIPELINE_COMMENT_MARKER_PREFIX; and each ofprompts/implementer.md,prompts/enabler.mdandprompts/reviewer.mdcontains the literal header formpipeline_comment_headerproduces for its own actor token.prompts/reviewer.mdalso contains the literal instruction to post an unconditional completion comment (requirement 30b), pinned by a distinctive phrase from that instruction.test/abandoned-drafts.test.shseparately proves an older, actor-less marker and a newer, actor-carrying one both still exclude a comment from the activity clock, and that all three prompts (now includingprompts/implementer.md) still carryPIPELINE_COMMENT_MARKER_PREFIX`.
-
A second invocation while one holds the lock exits without acting. 3a. The lock-held case above costs a
stat, a cache read and akill -0, never the fleet-log union (requirement 1; agent-ops#2312).test/lock-skip-before-union.test.shpasses: the lock pre-check that recognises a live, not-yet-stale holder is defined and called inagent-cycle.shbefore thefleet_logssnapshot that materialisesunion_log, before the stage-budget derivation that reads it, and before the full lock acquisition that re-derives the preciselock_stale_afterfrom it. The same file asserts the derived-threshold cache that pre-check compares against (agent-ops#2321):.lock-stale-after-sec-cacheis written immediately after that derivation and read back inside the pre-check’s own body, so each cycle’s write is what the next cycle’s pre-check reads. Separately,test/union-read-memory-bound.test.shpasses: run over a generated union of at least 100 MB,log_latest_ts(lib/label-marker.sh) andcrash_loop_open_escalations(lib/crash-loop.sh) each still return the correct answer under aulimit -vof 50,000 KB — a bound neither reader’s pre-fix form (a whole-unionjq -s/jq -rsslurp) can pass — andlabel_own_actions_map, audited against the same question, does too. -
A simulated stale lock (fake lock file, old timestamp, dead PID) is taken over with a logged warning. A simulated foreign lock (fake lock file naming a different
host, fresh timestamp, a pid that is alive here because it collides with an unrelated local process) is taken over immediately with a logged warning, and that local process is left running. 4a. A signal leaves a record, a released claim, and no orphaned model (requirement 9c).test/signal-exit.test.shpasses: with the signal machinery lifted fromagent-cycle.sh(and fromreview-cycle.sh), a TERM delivered mid-stage kills the stub stage’s own process group, logs anattempt-failedwhose detail is<stage> terminated by SIGTERM, releases the claim —have-prwhen a breadcrumb names a PR,no-protherwise — and exits 143 through the EXIT trap; a stage that had already ended cleanly is not blamed (the event sayscycle); and the requirement-1 takeover grace TERMs a live stale holder, proceeds as soon as the holder exits rather than sleeping out the full grace, and still takes the lock over. -
An injected
limit-hitevent with a futureresume_atandreset_known: truecauses a stand-down with no probe launched; an expired one does not stand down. Withreset_known: false, the cycle launches exactly one probe: a stubbedclaudeanswering a clean envelope yields alimit-clearedevent (by: auto-probe@<node>) and the cycle proceeds; a stub answering the limit phrase logs a freshlimit-hitand a stand-down whose reason ends(probe: still limited); a stub that exits non-zero with no output changes no limit state and the reason ends(probe: inconclusive).--dry-runwith the same injected event launches no probe. 5a. A crash loop, of either class and in each configured repository independently, is detected once and escalated once (requirement 2.7).test/crash-loop.test.shpasses: forcrash_loop_verdict, a stream of threshold-many consecutive same-detail Co-Ordinator failures yields a verdict carrying the count, the window and every failing node; one fewer yields nothing; a Co-Ordinator success anywhere in the run resets the count (including thestage-end 0that precedes anunparseable final messagefailure, which counts as one, not threshold-plus); a detail change restarts the count at one; item-stage failures and other nodes’ noise never contribute; a threshold of 0 is the off switch. Per-repository grouping (agent-ops#1630): repository A accumulatingcrash_loop_afterconsecutive same-detail failures while repository B succeeds every cycle in between still yields A’s own verdict, untouched by B’s success; an event carrying norepoat all still yields its own verdict, with norepofield, independent of every real repository’s own group in the same stream; two repositories independently crash-looping in the same cycle both yield their own verdict — one JSON-Lines line each, each carrying its ownrepo,detailand count.crash_loop_reverifymatches a retry to the correct one of several same-cycle verdicts byrepoas well asdetail/first_ts, so a retry queued for one repository’s own run is never mismatched to another’s, even sharing a detail and a first_ts.crash_loop_preselection_verdictpasses the same shape of cases against the classcrash_loop_verdictcannot see: threshold-many consecutive cycles that each loggedcycle-startthencycle-endwith the same non-zeroexit_codeand nostage-startanywhere between them yields a verdict carrying the count, the window, every failing node and theexit_code; one fewer yields nothing; a completed cycle that reaches a selection-path stage (coordinator,implementerorreviewer) resets the count whatever that stage then exits, as does a clean (exit_code0) cycle, while an Enabler or Refinerstage-startnever counts as recovery; an exit-code change restarts the count at one; a cycle with nocycle-endat all is dropped, counted neither way; item-stage failures and other nodes’ noise never contribute; a threshold of 0 is the off switch. Forcrash_loop_escalated_since, an escalation event for the same detail after the run’s first failure suppresses re-escalation, while an older one — a closed issue from a past loop — does not, and a different detail never matches. Forcrash_loop_open_escalations, twocrash-loop-escalatedevents bound to the sameissue_number(a rebind, agent-ops#1140) yield only the newer-by-tsone’s own fields, regardless of the events’ order in the log, while a single escalation still round-trips exactly as it always did. Forcrash_loop_detail_recurred_since(the 2026-09-05 fleet flap): a same-detail Co-Ordinator failure at or after a given timestamp reads as a recurrence whether or not it ever reachescrash_loop_after; no such failure, a different detail, or one strictly before the timestamp does not; a failure exactly at the timestamp counts (the boundary is inclusive). The same file replays the 2026-09-05 incident’s own real timestamps end to end: the first run’s verdict names its real first failure and count, a verdict computed once the clearing success is already logged never fires, the second flap is on its own a genuinely new threshold-crossing run, andcrash_loop_detail_recurred_sincecorrectly reads that second flap as a recurrence of the first run’s own detail since its clearing success — the factcrash_loop_retire_resolved(lib/ enabler.sh) relies on to keep the first run’s issue open across the flap rather than closing it and forcing a fresh one.test/crash-loop-escalate. test.shcovers that reliance directly, withgh/create_escalation_issuestubbed: replaying the same incident, a clearing success younger thancrash_loop_min_clear_minutesis never retired, a same-detail failure since the clearing success blocks retirement outright regardless of how old that success is, a success that has genuinely held the window with no recurrence is retired exactly as before, andcrash_loop_min_clear_ minutes0 restores instant retirement on the first nameable success.A fleet that recovers node by node still retires (agent-ops#2311).
test/crash-loop.test.shcovers the two readers directly: the success lookup names the earliest qualifying success at or after whatever instant it is given, so a later instant skips an earlier success, andcrash_loop_detail_last_failure_sincenames the latest same-detail failure across nodes, nothing when the detail never failed at or after the instant asked about, nothing for a different detail, and — under a non-emptyrepo— only that repository’s own failures.test/crash-loop-escalate.test.shcovers the retirement those two compose into,crash_loop_min_clear_minutesat its schema default: a run whose second node clears half an hour after the first retires, with the later node’s success named in the closing comment; a same-detail failure after the only clearing success leaves the issue open; a recurrence that itself clears and then stays quiet past the window retires, naming that settled success; a recurrence re-arms the window even where an earlier success is long past it, so a flapping run stays open; and a fleet that recovered hours ago and has been succeeding every cycle since, right up toUNION_LOG_HORIZON, retires — naming the success that ended the incident rather than the newest one in the log, which no elapsed window could ever be measured against. A sixth fixture covers the boundary the clamp hands back to the recurrence guard: a same-detail failure sharing the clearing success’s own timestamp, with the window long elapsed and no failure after, still leaves the issue open and logs no retirement. The same file also covers per-repository dedup and retirement (agent-ops#1630), two repositories sharing a generic detail (e.g. both “coordinator exited 1”): repository B’s own run still files its own escalation issue undeterred by repository A’s own same-detail escalation; repository A’s own escalation is retired on repository A’s own clearing success even while repository B, sharing the detail, is still actively failing under its own independent run; and repository B’s own clearing success never retires repository A’s own still-open escalation. And the transition case the same grouping has to survive: an escalation carrying norepoat all — one filed before agent-ops#1630 — is still retired by a repository-scoped clearing success, which is named in the closing comment, and its flap guard still sees a repository-scoped recurrence of its own detail and blocks that retirement.The escalation quotes the API’s own words (agent-ops#2308).
crash_loop_verdict’s own emitted object now carries the run’s newest counted event’s ownapi_message, when any event in the run carried one, andcrash_loop_escalate‘s issue body quotes it in a fenced block, naming the model credential as a third possibility alongside “the image or the config” whenever the run’s owndetailis credential-shaped (authentication_failed,workspace_scope_refused, or a 4xxapi_error_<status>).test/crash-loop-escalate.test.shcovers this directly: a four-event run carrying the 2026-10-10 outage’s own workspace- scope message yields a verdict whoseapi_messageis that message, and the filed issue body both quotes it and namesANTHROPIC_API_KEY; the original, api_message-lessfour_failsrun’s own issue body quotes nothing extra and names no credential. back-pressure, and the logged reason states the count’s composition (N ready + N draft + N unraised claim(s)). 5b. A personal access token’s own expiry is read, recorded, and escalated once per credential (requirement 2.7a).test/token-expiry.test.shpasses:token_expiry_parseturns aGitHub-Authentication-Token-Expirationheader value into an ISO-8601 UTC instant and a day count that floors toward zero — a fractional remainder rounds down, six hours out reads 0 days rather than 1, and a token already past its own expiry reads 0 rather than a negative number — while an empty or unparseable value is refused outright rather than read as some fallback date;token_expiry_escalated_formatches on the exact node andexpires_at, so a rotated token (a new expiry) escalates again despite the repeated event name, and another node’s identical expiry never cross-matches.test/token-expiry-wiring.test.shpasses against the block lifted verbatim out ofagent-cycle.sh: a recordedtoken_expiryunderTOKEN_EXPIRY_WARN_DAYSfiles exactly one issue, throughcreate_escalation_issueincrash_loop_repounderenabler_escalation_labeland keyedtoken-expiry:<node>:<expires_at>, and logs onetoken-expiry-escalatedevent naming that expiry; a second cycle over the same expiry — reading the first cycle’s own event back out of the log union, as state-sync would deliver it — files nothing and logs nothing further; a rotated token files again; and a token at or above the threshold, atoken_expiryofnull, and a missing.doctor-status.jsoneach file nothing. In every one of those cases the block falls through and the cycle proceeds — unlike requirement 2.0b’s, this check never stands the cycle down, because a token that has not yet expired blocks nothing the cycle needs. 6a. The switch stops both pipelines and lets go by itself.--disable 'testing'then a plain invocation of bothagent-cycle.shandreview-cycle.sh: each logs a stand-down carrying the reason, exits 0, and launches noclaude.--enablerestores both. Then plant a record whoseexpires_atis already past and run a cycle: it must clear the switch, logenabledsaying the disable expired, and proceed — the assertion that an agent which sets the switch and dies costs a few cycles rather than every future one. Assert the ambiguous cases resolve toward disabled: a truncated record, and one whoseexpires_atis gibberish, both keep the pipeline down. 6c. A review round is answered exactly once. With a PR carrying an unansweredCHANGES_REQUESTED, a cycle must select it (source: "review-feedback",itemthe round’s ref,branchthe PR’s existing branch) and the Implementer must push to that branch without opening anything. Then the check that matters: run another cycle and assert the PR is no longer a candidate, whilegh pr view --json reviewDecisionstill reportsCHANGES_REQUESTED. Those two facts are true simultaneously, and that is the point — the agent cannot clear a review on its own PR, so nothing about the PR’s state ever says “answered”, and only the turn rule (a marked reply or a re-requested review since the blocking review, never a commit’s date — see the design note on why) distinguishes “our move” from “theirs”. Get it wrong and the PR is re-fixed hourly forever while every cycle looks productive. Assert the reopen too: a new review after the agent’s push makes it a candidate again under a new ref, or a round that once wentblockedwill swallow the human’s next attempt to unstick it. 6d. Back-pressure cannot deadlock the pipeline (requirement 2.2a). Setmax_open_agent_prsto 0 with a finishing candidate present — a review-feedback round, a merge-conflicted PR, a dequeued PR or an abandoned draft: the cycle must not stand down, and must reach the Co-Ordinator with every repo’ssourcesnarrowed to["review-feedback", "merge-conflicts", "dequeued", "abandoned-drafts"]. With none present it must stand down as before. This is the check that a system whose PRs have all been sent back for changes — or all stalled as abandoned drafts or wedged on conflicts, the very slots the cap is counting — can still dig itself out; without it, the state the pipeline is least able to escape is the one it is guaranteed to reach. 6e. An abandoned draft is finished, not restarted (requirements 3e, 15c). With an open draft PR carryingpr_labelon abranch_prefixbranch whoseupdatedAtis older thanabandoned_draft_after_hours, a cycle must select it (source: "abandoned-drafts",itemthe head-SHA-scoped ref,branchthe PR’s existing branch), and the Implementer must check out that branch and push to it without opening a new PR or branch. Assert the freshness gate: the same PR with a recentupdatedAtis not a candidate — a draft merely being worked, or one a peer node just touched, must never be stolen. Assert a ready PR of ours is never an abandoned-drafts candidate (that is review-feedback’s job). And assert the claim uses a file claim, not a create-ref against the already-existing branch (requirement 17a), or every attempt would 422 and no abandoned draft could ever be picked up. 6f. A conflicted PR is rebased, not restarted (requirements 3g, 15d). With an open non-draft PR carryingpr_labelon abranch_prefixbranch whosemergeableisCONFLICTING, a cycle must select it (source: "merge-conflicts",itemthe head-SHA-scoped ref,branchthe PR’s existing branch), and the Implementer must check out that branch, rebase onto the base and push without opening a new PR or branch. Assert the guards: a PR whosemergeableisUNKNOWNis not a candidate — mergeability is computed asynchronously and guessing would rebase a PR that may not conflict; a draft conflicted PR is not a candidate here (that is abandoned-drafts’ job once it goes stale); and a mergeable PR is never a candidate. And assert the claim uses a file claim, not a create-ref against the already-existing branch (requirement 17a), or every attempt would 422 and no conflicted PR could be picked up. 6i. A merge-group-checks-failure dequeue is fixed, not restarted (requirements 3z, 15d; TD-PPagop-26081409). With an open non-draft PR carryingpr_labelon abranch_prefixbranch whosemergeableisMERGEABLEand whose most recentmerge_queue_probereportsqueued: false, a non-nulldequeued_at, anddequeue_reasonexactlyfailed_checks, a cycle must select it (source: "dequeued",itemthe head-SHA-scoped ref,branchthe PR’s existing branch), and the Implementer must check out that branch, push a fix without opening a new PR or branch, and never attempt to re-queue it. Assert the guards: a PR whosemergeableisCONFLICTINGis not a candidate here (that is requirement 3g’s job, and the two candidate rules must never both admit the same PR head); a PR whosedequeue_reasonis anything other thanfailed_checks(including empty/unreadable) is not a candidate; a currently-queued PR (queued: true) is never a candidate; and a dequeue the pipeline has already answered is not a candidate at a moved head — a markedactor=implementerreply newer thandequeued_atexcludes the PR even though the probe still reports the same dequeue, which is what stops the fixed pull request being re-offered on every cycle until a human re-queues it. Assert the clause’s own edges too: the same reply beforedequeued_atdoes not exclude (so a second dequeue re-opens candidacy), another actor’s marked comment or an unmarked one does not exclude, and a reviews or comments read that fails yields no candidate rather than one. And assert the claim uses a file claim, not a create-ref against the already-existing branch (requirement 17a), or every attempt would 422 and no dequeued PR could be picked up. 6g. The review runs at the tier the work graded itself (requirements 26a, 8a).test/cycle-state.test.sh’s reviewer-complexity section passes: the resolution takes the highest valid grade among the summary’scomplexityand the PR’scomplexity:*label values (a labelhighoutranks a summarymedium, and vice versa); an unknown grade contributes nothing rather than failing; and with no valid grade at all it falls back tolowfor a trivial-classified work order andmediumotherwise. Driving a cycle end-to-end: the Implementer’s PR carries exactly onecomplexity:*label, its summary carriescomplexity, and the reviewer’sstage-startevent records the resolvedcomplexityand amodelequal toreviewer_model_complexwhen and only when the grade ishigh. 6b. The no-op short-circuit skips only what it can prove, and stops skipping when anything moves. Drive a cycle that endsnone-selected, confirm the event carries a fingerprint, then run a second cycle: it must stand down without launching the Co-Ordinator — that saving is the entire feature, so time both and see it. Then the half that actually matters, and the half it is tempting to skip because the happy path passed: assert per-source that the fingerprint changes when a commit lands, an issue is relabelled or assigned, a workflow’s conclusion flips, a claiming PR closes, a draft PR of ours crosses theabandoned_draft_after_hoursstaleness threshold (assert this one especially — it is the sole transition that moves no other signal, so theabandoned_draftsarray is the only thing that can carry it), a ready PR of ours turnsCONFLICTINGafter its base moved (assert this one too — like the staleness transition it moves no other fingerprinted signal once the base advance is a cycle past, so themerge_conflictsarray is the only thing that can carry it), a ready PR of ours is dequeued over a merge-group checks failure (assert this one too — it moves no other fingerprinted signal at all, not evenmergeable, so thedequeuedarray is the only thing that can carry it), an item is unblocked or unvoided, a source is added toconfig.json, orprompts/coordinator.mdis edited. Each of those is a source of work, and any one of them missing from the fingerprint is an unbounded silent stall that no other check in this document would catch. Assert too that a scheduled workflow rerunning green does not change it (see requirement 3b — this is where the feature quietly dies), and that a repo whose state could not be sampled makes the cycle unfingerprintable rather than skippable. -
A blocked verdict round-trips. Append an
attempt-failedfor a selected item, then run a cycle: the Co-Ordinator’s input must list that item as blocked, with its detail. This is the one check that catches the writer and the reader disagreeing about the event key (requirements 33/34) — nothing else in the system will tell you they disagree, because both halves look correct in isolation and the only symptom is work being silently redone. 7a. The mandatory re-check round-trips too (requirement 18a).test/cycle-state.test.sh’s requirement-18a section passes, proving both halves the requirement adds on top of check 7’s general case. The comparison itself — a blocked GitHub issue’supdated_atagainst the later of the block’stsand itsrecheck_clean_ts— is the Co-Ordinator’s own judgement (prompts/coordinator.md, “A blocked issue with fresh evidence must be re-read”), not shell code, so the test mirrors that documented rule to check the real datablocked_itemscomputes: with only anattempt-failedon record, an issueupdated_atafter the block’stsreads as due a mandatory re-read and one no later thantsdoes not (half 1, “forces the whole-thread re-read”); appending arecheck-cleanfoldsrecheck_clean_tsin, and the same, unchangedupdated_atthat just read as due now reads as not — a thread that said nothing new is not paid for twice (half 2, “stops the next cycle repeating it”); movingupdated_atagain past therecheck_clean_tsflips it back to due, so the marker’s suppression lasts only as long as the thread stays quiet. Together with check 7, this is the writer (recheck-clean, requirement 33) and the reader (blocked_items’s fold) agreeing on both timestamps a blocked GitHub issue carries, the same way check 7 catches them agreeing on one. 7b. An orphaned claim branch is put back in front of the pipeline (requirement 17b).test/sweep-orphan-branches.test.shpasses: with a stubbedgh, a stale moved ref with no PR and no registry entry yields a draft PR carryingpr_labeland arecoveredaction; a stale unmoved ref in the same state yields a ref delete and areleasedaction; a ref with an open PR, a ref with a live registry entry, and a ref younger thanabandoned_draft_after_hoursare each left untouched; a registry read that fails with anything but 404 leaves the ref alone and says so (warning, fail closed); a missing label falls back to an unlabelled PR loudly; a stale ref with commits ahead but a merged PR against its head yields a ref delete and areleasedaction rather than another recovery draft, and a failure to determine the merge state leaves the ref alone and says so; a stale ref with commits ahead, no merged PR of its own, but a rival branch sharing its stem merged after its first commit yields a ref delete and areleasedaction carryingreason: supersededand the rival’s URL, with nopr createcall ever made; a same-stem rival that merged before this branch’s own first commit does not count, and a tech-debt id’s own eight-hex-digit numeric suffix (TD-PPagop- 26081403) is never mistaken for the twelve-character random one, so neither collapses two unrelated same-scope items to one stem — both still yield the ordinary recovery draft, silently; and a failed or unparseable rival lookup also still yields the ordinary recovery draft, but with awarningnaming the branch, distinct from the silent no-match case; and a backlog past the per-run cap acts on the cap’s worth and reports the remainder (deferred) rather than flooding or staying silent. A stale ref with commits ahead, no merged PR of its own, whose most recent closed pull request carries theobsoletelabel yields a ref delete and areleasedaction carryingreason: "retired", with nopr createcall ever made (agent-ops#2923); the same holds when that pull request carries no such label but adraft-obsolete-flaggedorvoid-object-closedevent, passed in on the union-log argument, already names this branch’s own item — matched onbranch_prefixstripped from the front for an ordinary item, or, for a finishing-source event logged under its own engagement ref rather than any claim branch’s name, on the pull request number the event carries against the number of this branch’s own most recent closed pull request (agent-ops#2929) — and the same holds for a label differing only in case; a run given no union-log argument reads no events and leaves its own stdin unread; and a ref whose most recent closed pull request carries neither signal — an ordinary human decline — is unaffected, still reaching the rival-branch search and the ordinary recovery draft exactly as before this check existed. For thetd-record/*namespace (TD-PPagop-26082310): a stale record branch whose only pull request was closed without merging yields a ref delete carryingreason: "filing-declined"and, on a clean 404 fortech-debt/<id>.mdat the default branch, a secondreleasedfor the pairedtd/<id>reservation, with nopr createcall ever made; a 200 for that record keeps the reservation, and a contents read failing with anything but 404 keeps it and says so (warning, fail closed); a merged filing is released by the ordinary merged-PR arm instead, never counted as declined and never asked the reservation question at all; a record branch with an open PR is left untouched and one with no PR at all is still recovered as a draft, both by the ordinary flow; and a run with only one action of headroom left defers the declined pair whole — neither ref touched — so the per-run cap holds strictly rather than overshooting by the release. 7c. Claim visibility is deterministic, both shapes and both directions (requirement 3o, issue #175).test/claim.test.sh‘sclaims/branchessection passes: a fresh branch claim’s registry entry appears inclaims’ output taggedkind: "branch"with its item; an entry older thanclaim_ttl_hoursdoes not (the staleness escape survives); andbranchesno longer recognises thetd/namespace at all — a livetd/*ref matches nothing it lists, regardless of its age or its registry entry.test/noop-skip.test.shcovers the fingerprint half: a fresh entry added toclaimedchanges the fingerprint, and an emptyclaimedarray canonicalises identically to an absent key, so a claim ageing back out of the array changes it too — the same silent-stall shapeabandoned_draftsandmerge_conflictsclose for their own transitions. 7d. The PR-keyed claim outlives the PR’s own raising (requirement 17a, issue #360).test/pr-claim-hold-through-review.test.shpasses: withrelease_claimandrelease_pr_claimlifted fromlib/candidate-select.shand the reallib/claim.shrunning against a create-onlyghstub,have-pr-pendingdrops the item-keyed registry entry and leaves thepr-<n>one standing; a peer’s own claim on that samepr-<n>loses (rc 3) for as long as it stands, and wins only oncerelease_pr_claimhas run;release_pr_claimis idempotent;have-pr/no-prstill drop both entries together in the one call, the ordinary end-of-cycle shape; and an unhandlederrexitabort afterpr-raised— the one ending no handler reaches — still releases thepr-<n>entry through the EXIT trap’s backstop, proven by running the realcleanupunderset -e.test/claim.test.shcovers the back-pressure half:countcounts the item-keyed entry a cycle just won and does not count apr-<n>entry surviving on its own; and, given the pull requests the caller has already counted, it drops an item claim naming one of them while keeping a claim on a PR the caller’s sum does not hold — matching whole numbers, so a claim on PR 90 survives a caller that counted PR 9. 7e. The back-pressure block hands its parts to each other correctly (requirement 2.2). The counting seam, not the parts: issue #427 and the over-correction in PR #434 were both defects of this wiring, and both shipped past a suite that testedlib/claim.sh countthoroughly and its caller not at all.test/backpressure-wiring.test.shpasses, against the block lifted verbatim fromagent-cycle.shwith aghstub replaying a listing per repo and alib/claim.shstub recording its argv: each repo’s claim count is asked for against that repo’s own drafts and pipeline-owed PRs and no others, so a claim on an approved PR waiting on a human keeps counting; a repo whose listing could not be read names no PRs at all, counting every claim, which is the fail-closed reading beside its own zeroed counts; and the composition line states the split the operator and the dashboard card both read. The same test covers the exclusion’s level-awareness (D18 WI-6, requirement 2.3c): the identical approved, non-CHANGES_REQUESTEDpull request is excluded for a repo athumanand counted for one whosemerge_autonomy_effective_levelisagent-merges-routine, and in the counted case its claim does not double-count on top of it — so the difference is demonstrably the level and not a change to the underlying rule. 7f. The decision site folds in what requirement 2.2’s count could not see yet (requirement 2.2b, issue #459).test/backpressure-decision.test.shpasses, against the fold-in block lifted verbatim fromagent-cycle.sh: a repo with nomerge_conflicts/dequeuedcandidates adds nothing and leavesadjusted_open_count,open_compositionandbackpressure_trippeduntouched; a candidate PR already amongcounted_prs_json‘s drafts and pipeline-owed PRs (it happened to also beCHANGES_REQUESTED) is not added again; a candidate PR that count did not hold is added exactly once, growsadjusted_open_countby it, and is named inopen_composition; the same PR named by bothmerge_conflictsanddequeuedis not double-counted; two repos’ candidates are both folded in, and a PR number shared by two repos is scoped per repo rather than conflated; a fold-in that reachesmax_open_agent_prstripsbackpressure_trippedfrom0to1even though requirement 2.2’s own count left it untripped; and an already-tripped cycle with nothing left to fold in stays tripped without its composition line changing. 7j. The backgrounded-wait ban is mechanical, not just prose, forBash,AgentandWorkflow(requirement 4m, issues #2778, #2800).test/background-wait-guard.test.shpasses:background_wait_guard_should_denydeniesBashonly whentool_input.run_in_backgroundistrue; deniesAgentwhenevertool_input.run_in_backgroundistrueor the key is absent, or whenevertool_input.isolationis"remote"regardless ofrun_in_background(including an explicitfalse), allowingAgentonly whenrun_in_backgroundis explicitlyfalseandisolationis not"remote"; deniesWorkflowunconditionally, tool input ignored; and never denies any other tool name.background_wait_guard_mainreads a synthetic{"tool_name":…, "tool_input":…}PreToolUse payload from stdin and returns 2 with a stderr reason naming a foreground retry (or, forWorkflow, naming that there is none) for a denied call, 0 with no output otherwise, and 0 for stdin that is not valid JSON; and the installedscripts/background-wait-guard.shbehaves identically end to end, as the real hook runner invokes it. The same test andtest/stage-project-settings.test.shboth pass an assertion that the shippeddeploy/docker/claude-managed-settings.jsonregisters this hook’s installed path against the matcherBash|Agent|Workflowas aPreToolUsecommand hook, so the policy that makeshooksinert for a checkout’s own settings file (requirement 4k) is also the one that ships this hook. 34p. A repeated void-refusal is escalated once and stops re-selecting (requirement 34p, issue #2789).test/cycle-state.test.shpasses, againstvoid_refusal_streaks/void_refusal_escalation_candidates/void_refusal_escalated_since(lib/cycle-state.sh) andvoid_refusal_escalate(lib/enabler.sh), lifted verbatim: a single void-refusal streaks at1and is not yet an escalation candidate at threshold 2, so it stays the ordinaryblockeditem requirement 18/18a’s re-check already covers; two consecutive void-refusals with nothing clearing the block in between streak at2, carry the run’s ownfirst_ts/last_ts/detail, and are a candidate at threshold 2 (not yet at 3); an interveningunblockedoritem-voidbreaks the run back to1; a repo-lessunblockedoritem-void— the Co-Ordinator’s own report form and a human’s hand-appended one — breaks the repo-scoped run it was written to clear, so requirement 34p’s own escape hatch is reachable, while a clear predating every failure suppresses no run; an ordinary (non-void-refusal)attempt-failednever joins a run; a repo+item pair counts independently of the same id in another repo, and resolves through the slug-rename alias map; a threshold of0or a non-numeric one is the off switch;void_refusal_escalated_sincededups a run already escalated at or after its ownfirst_tsand does not dedup a fresh run or a different item; andvoid_refusal_escalate(create_ escalation_issue/log_eventstubbed) files throughcreate_escalation_ issue— never a second, independentgh issue createcall — labelled, naming the item ref in the body’sItem: `…`footer, quoting the most recent refusal’s own detail, naming the “Done-ness inferred from one channel” gotcha, and loggingvoid-refusal-escalatedwith the filed issue’s number; a run already escalated callscreate_escalation_issuenot at all.test/cycle-state.test.shadditionally passes, againstcompute_band_eligibility’s own gate onvoid_refusal_escalated_json(lib/eligibility.sh, issue #2806), lifted verbatim: a run already at threshold is not excluded from a band whenenabler_assigneeis empty — the same gate the escalation filer above already requires, so an Enabler-less installation never excludes an item with no human ever asked about it — and the identical run is excluded onceenabler_assigneeis configured.test/verdict-corroboration.test.shpasses, againstcoordinator_eligible_items’s own third,escalatedargument, lifted verbatim: an escalated issue is excluded from the eligibleissuesband the same way a blocked one is, a repo-less escalated entry suppresses that issue in every repo, and an omitted or malformed argument excludes nothing new.test/cycle-state.test.shadditionally passes, againstexclude_blocked_or_void_items/exclude_blocked_or_void_issues’s own fifth,escalatedargument, lifted verbatim: an escalated item is dropped unconditionally, the same as a void one, in every band — including an issue whose thread has moved and would otherwise be due requirement 18a’s live re-read — and an omitted or malformed argument changes nothing for every existing caller.test/enabler-void-refusal-exclusion.test.shpasses, against the inline filter lifted out oflib/eligibility.sh’scompute_enabler_eligible_set: an escalated repo+item is dropped fromenabler_eligible_jsonand logged asenabler-void-refusal-escalated- skipped, a different repo’s identically-numbered item survives, and an empty, malformed or unset escalated set changes nothing.