Skip to content

The merge-autonomy kill switch fails open on a fresh node that cannot reach the state repo — the no-cache case must fail closed before WI-5 arms a landing path

Id: TD-PPagop-26081507 · Status: resolved · Filed: 2026-08-15 · Resolved: 2026-08-15 · Ref: https://github.com/Poetic-Poems/agent-ops/pull/448

merge_autonomy_kill_state (lib/merge-autonomy.sh, requirement 2.3b) reads the kill switch through lib/toggle.sh’s fleet_flag_fetch, whose contract deliberately hides the difference between “the flag is clear (confirmed 404)” and “the state repo is unreachable and no cached copy exists” — both print nothing, and the caller resolves nothing to {"state":"enabled"}. So a node that cannot reach state_repo and holds no fleet-cache/ copy runs at its configured merge_autonomy level, not human.

The direction is inherited from fleet/disabled.json, but the two flags’ risk profiles invert once WI-5/WI-7 (issues #408/#410) make merge_autonomy_effective_level load-bearing. The fleet switch failing open means a cycle runs that should have stopped — it raises a pull request a human still gates. This flag failing open means a node keeps landing pull requests autonomously at exactly the moment an operator has pulled the lever §6 of docs/reviews/2026-08-14-autonomy-investigation.md describes as existing for “something is landing that should not be”. The realistic instance — a fresh container with an empty fleet-cache/ during a state-repo outage — is also the one an operator is least likely to know happened. Today this is harmless: nothing arms an approval or a landing on the flag (WI-2 is validation-only). That justification expires the day WI-5 lands.

  • lib/merge-autonomy.sh — merge_autonomy_kill_state’s comment and the library header both note this item.
  • lib/toggle.sh — fleet_flag_fetch’s “the caller cannot tell” comment is the machinery-level constraint.
  • docs/IMPLEMENTATION-PIPELINE-SPEC.md — requirement 2.3b and the “the merge-autonomy kill switch fails open” Design decisions entry both reference this item; the resolver updates both.

With or before WI-5 (#408), give the fetch path a way to distinguish a confirmed-clear 404 from unreachable-with-no-cache — a variant of (or an out-parameter on) fleet_flag_fetch, leaving fleet/disabled.json’s own fail-open reading untouched — and have merge_autonomy_kill_state resolve unreachable-with-no-cache to {"state":"disabled",...}, so merge_autonomy_effective_level answers human. The last-fetched cache should remain the fallback for a transient outage on an established node: that confines the fail-closed blast radius (a state-repo outage silently halting autonomous landing fleet-wide) to fresh containers during an outage, which is precisely the population that cannot know whether an operator has set the switch. WI-5 must not arm the Approver stage on merge_autonomy_effective_level while the no-cache case still reads as enabled.

The resolution scopes “unreachable” to transport-level failures: a repo-level 404 — the state repo missing, or invisible to the token — is indistinguishable from a clear flag at the contents API and still fails open. Found in this pull request’s review and filed as TD-PPagop-26081602.