Skip to content

A pull request whose landing was refused for a reason that can change without the pull request changing is never re-armed — a human has to merge it by hand

Id: TD-PPagop-26081701 · Status: resolved · Filed: 2026-08-17 · Resolved: 2026-08-18 · Ref: https://github.com/Poetic-Poems/agent-ops/pull/557

D18 WI-7 (agent-ops#410, requirement 8d) arms landing exactly once, on the round the Approver’s own engagement reaches an explicit, non-adjudicating approve (run_landing_stage, agent-cycle.sh). Every gate it re-reads fresh can refuse, and a refusal ends the attempt: nothing revisits an already-approved, already-pr-ready pull request to ask the same question again later.

This item is the whole class of refusals whose reason can change without the pull request changing — where a later “yes” is available and no mechanism goes back for it. It is deliberately not about the budget hold alone; that is only the founding case.

The founding case is the merge budget. When the repository’s rolling-24-hour cap is already spent, merge_budget_decide (lib/merge-budget.sh) returns hold, merge_budget_apply_decision logs merge-budget-hold, and the pull request is left approved but unarmed — the design’s own “the backlog queues visibly” (§5.4). The 24-hour window then rolls over and the reason evaporates with nothing watching for it.

The same shape covers, at least:

  • a fleet kill switch or a WI-6 budget freeze that binds at the arming step and is later lifted;
  • a merge_autonomy level below agent-merges-routine, or a merge_autonomy_routine_sources list the source is absent from, that a later config change widens;
  • the transient unreadables, every one of which fails closed by design and so is indistinguishable at the time from a real refusal: a landing_protected_paths_hit exit 2 (a gh error or a page-capped changed-file listing), a review gate reading unknown, an Approver review that could not be read back;
  • required checks not green at that moment which a re-run later makes green.

Deliberate classifier refusals stay out of this class, and are not debt: a protected path hit, a complexity:high grade, a source the installation has genuinely not put in its routine list. None of those changes without the pull request itself changing, and re-asking them later is exactly the gate-weakening retry the design refuses to build.

A human merging by hand is the only path left. That is visible through merge-budget-hold and the WI-8 digest (#411, not yet built), but it is not automatic, and it reads as a bug rather than the documented behaviour it is. docs/reviews/2026-08-14-autonomy-investigation.md §5.4 and “## The Landing Gate” (docs/IMPLEMENTATION-PIPELINE-SPEC.md) both say so explicitly as of this item’s own filing, so this is deferred scope, not an undocumented gap.

Stated as a class rather than as the budget case, the cost is clearer: at agent-merges-routine every one of these leaves an approved pull request sitting indefinitely, and the fail-closed unreadables mean a single gh blip is enough to strand one permanently.

  • agent-cycle.sh — run_landing_stage is the only caller of merge_budget_decide/merge_budget_apply_decision, and the only place any of these gates is evaluated; nothing else in the pipeline reads a merge-budget-hold or landing-refused event back.
  • lib/landing.sh — landing_eligible and landing_arm produce the refusals; the ineligible:/unknown distinction is already the seam between the deliberate refusals and this class.
  • lib/merge-budget.sh — merge_budget_oldest_waiting already names the backlog a hold decision carries (waiting_backlog); a retry mechanism would read from the same place WI-8’s digest will.
  • scripts/gather-*.sh — a new work source (or an extension of an existing one) is the natural shape for “a pull request refused for a reason that has since changed” to become selectable work again, the same way dequeued/merge-conflicts already turn a stalled-for-a-reason pull request back into something a cycle picks up.

A new Co-Ordinator source (or a Script-side sweep, matching whichever existing gather-*.sh shape fits best) that lists open, non-draft, pr_label-carrying pull requests whose last landing attempt was refused for a reason in the class above, and re-enters run_landing_stage’s own gate sequence for them (or a narrower re-check reusing the same gates) rather than waiting for a human’s click. The landing-refused and merge-budget-hold events are the input; the discrimination the source must make is exactly the class boundary drawn above, so a deliberate refusal is never retried.

Scope this against WI-8’s own digest (#411) first: a visible backlog a human clears by hand may be judged sufficient, in which case the right resolution is not-debt, not a build. That judgement is easier to make correctly now the item states the whole class — a backlog of budget holds is plausibly fine to clear by hand; a pull request stranded forever by one unreadable changed-file listing is less obviously so.