---
name: "skill-merge-pr"
type: skill
description: 'Merge approved pull requests for the delivery loop. Use when running the merge leg, or when an In Review ticket carries agent:R3-LAY — the approval signal, set by the loop''s clean-pass routing of unflagged work or by Aled''s manual approval. Squash-merges, deletes the claude/ branch best-effort, and only after reading the PR back to confirm the merge landed moves the ticket to Done and comments — never writing Done on an unconfirmed merge. On CI failure or an unconcluded check: Blocked, Urgent, routed to the vertical''s operator first and to Aled on age. A conflict routes by remedy — a plain rebase to Todo + F0-RGE for exec, a scope/content conflict to the Owner. Asks the Owner once when a PR is merge-ready but unapproved rather than waiting silently. Never merges without R3-LAY and never sets it itself; the signal binds to the current PR and head, and an autonomous merge also requires a QA verdict at that head — never a stale, inherited, or unreviewed approval.'
license: CC BY-NC-SA 4.0
---

# merge

The merge leg of the Claude Code PM agent. Executes the physical merge once a ticket carries the
approval signal — `agent:R3-LAY` on an In Review ticket, arrived at either autonomously by the
delivery loop's clean-pass routing of unflagged work, or by Aled's explicit approval of a ticket he
has reviewed. Runs as the delivery loop's merge leg, and is independently pollable. Requires GitHub
write access. Follows `convention-linear`, `convention-comms-owner` and Pattern A.

## Context

- Processes issues in **In Review** carrying `agent:R3-LAY` — invoked directly as the delivery
  loop's merge leg, and pollable across all delivery projects.
- **The approval signal is `agent:R3-LAY` on an In Review ticket.** It is set in one of two trusted
  ways, and both authorise the merge:
  - **Loop routing (autonomous).** Within `routine-delivery-loop`, an **unflagged, clean, unblocked**
    QA pass routes the ticket to `agent:R3-LAY`. The loop's clean-pass routing *is* the approval
    signal for unflagged work — the merge proceeds **without** a separate `@relay` comment.
    **The same route runs inside an operator's interactive session (Owner direction, Aled
    2026-10-19, APP-1756, APP-2427).** Where an operator invoked in a session drives its own
    delivery (`skill-operating-loop` step 4), the operator is that session's driver and performs
    the driver's route step. Two conditions must hold: an isolated Prism leg has returned a clean
    `[qa] HEAD: <sha7>` verdict at the live head, and **none of the human-review criteria is
    met**. That means no `Human gate: required` marker and no embedded human sign-off criterion on
    the ticket (`skill-review-pr`, *Hand off*), and no bounce-cap escalation, QA block or merge failure.
    Where both hold, the operator routes the ticket to `agent:R3-LAY` and spawns this leg as a
    separate Relay subagent. **No Owner signal is asked for, and the operator never merges
    itself.** Asking the Owner to signal a merge that needs no judgement of his is an
    over-forward. An operator merging its own session's PR skips the separation the legs exist to
    keep. Both happened on `assoc-one/claude-ops#464` on 2026-10-19, and the Owner corrected both.
    A PR the operator raised with **no backing ticket** gets one first, filed from its `type:*`
    template with both checkbox sections, so that the Prism leg and this gate have a surface to
    read (`convention-ticket`, *Obligations belong in structure, not prose*). Where a human-review
    criterion **is** met, the ticket takes the flagged route to the Owner, exactly as in the loop.
    How an approval he then gives in chat binds to this signal is the open ruling on APP-2035, not
    this clause.
  - **Operator approval (manual).** Aled sets `agent:R3-LAY` himself on a ticket he has reviewed,
    with his `@relay` signal — for flagged work, or any ticket he chooses to gate by hand.
- The label is the gate because it is only ever reached in those two ways: the loop sets it solely
  for unflagged, clean, unblocked work, and **flagged work, bounce-cap escalations, QA blocks, and
  merge failures are routed to the vertical's `operator-<venture>` (or to `human` + Aled where only he can act) — they never carry `agent:R3-LAY`,
  so they never reach autonomous merge.** Do not merge an In Review ticket that does not carry
  `agent:R3-LAY`.
- **Missing approval is a thing to say, not a thing to skip.** A ticket the leg may not merge is
  still a ticket the leg has something useful to report. Where the only thing standing between a PR
  and main is Aled's approval, the leg says so once, in the register `convention-comms-owner` sets —
  see *Approval pending*. That changes the voice, never the authority: the gate is unchanged and the
  leg never sets `agent:R3-LAY` itself.
- Never touches Pipeline team tickets.
- Repos: clones `claude-ops` (for skill loading) + the delivery repo(s) for GitHub writes.
  `claude-ops` is also a permitted **merge target** when the PR originates from an **os.Claude
  (Apps team) delivery ticket** carrying the `agent:R3-LAY` approval signal.

## Trigger

Process issues in **In Review** carrying `agent:R3-LAY` — the loop hands these to the merge leg, and
a poll finds any others. Skip if none. Note: the label is stored as `R3-LAY` inside the `agent`
group — resolve by that name.

An In Review ticket **without** `agent:R3-LAY` is never merged, and is not otherwise processed — but
where the leg has already looked at it and found it merge-ready in every respect except the approval
signal, it owes the Owner the one-line ask in *Approval pending* before moving on.

## Behaviour

For each qualifying ticket:

1. **Locate the PR.** Find the linked pull request from the issue's comments or relations. If no PR
   can be found, take the **Blocked path** (step 6) — a missing PR is not a conflict with a mechanical remedy, so the rebase route in step 5 does not apply to it.

   **Test the no-PR exit before the Blocked path — a missing PR and a deliverable that never had one read identically here.** `routine-delivery-loop` already settles the class, so read the definition of done first. Where it **names a PR**, the PR is genuinely missing and the Blocked path above holds. Where it **names none**, the deliverable is not code: make no merge write and take the **no-PR exit** — In Review, `human`, assigned to the reviewer (`operator-<venture>`, or Aled where the operator has already ruled) — never Done, and never Blocked, which would reverse a correct ruling on finished work. Step 2's box gate still binds on that exit: a waiver recorded only in a comment is not a waiver (`convention-ticket`, *Waiving a box*, requires it struck on the description). (Worked case: A1-346, In Review, `R3-LAY`, `operator-a1`, unassigned and already Urgent, its definition of done naming four Figma-file conditions and no PR — read live 2026-10-07. Eighth occurrence of the surrounding starved-chain shape; APP-2127.)

2. **Check PR status.** Before merging, verify:
   - **Every box in *both* the `## Acceptance criteria` and `## Definition of done` sections is ticked** (`- [x]`), or struck through with a recorded one-line waiver — this is the Definition of Done (Pattern A). A ticket carrying the `agent:R3-LAY` approval signal but with an unticked, unwaived box in *either* section is **not ready**: do not merge it (see the Not-ready path below). **An absent section is a fail, not a pass — assert both headings exist before counting any boxes.** This gate counts boxes, so a description carrying no `## Definition of done` section at all passes its DoD half **vacuously**: there is nothing to tick, every box that exists is ticked, and the merge proceeds on the acceptance criteria alone. Both literal headings are mandatory on a ticket under a delivery executor (`convention-linear`, *Issue states*; `convention-ticket`, *Per-type ticket formats*), but that invariant's check points are the **promoting acts** — triage's route, the operator loop's promotion, `skill-build-ticket` step 3b's claim gate — and **a ticket the Owner files straight into a started state in an interactive session passes none of them**. This gate is the last one before Done, so it is where that entry point is caught. Do the heading check **first in this step**, before CI and before the diff reads: where either heading is missing, take the **Not-ready path** and return the ticket to Relay to instantiate the section from the `type:*` template — one `save_issue` write, cheap precisely because nothing else in the merge has been done yet. **Where the loop is its own Relay — an interactive session driving every leg on its own ticket — "return it to Relay" names an act, not a hand-off, and the act is still a separate one.** The session performs the Relay write through a **Relay-role subagent spawned for that leg alone**: it instantiates both headings from the `type:*` template in `convention-ticket` with every box **unticked**, and that is its whole remit. The merge leg then **re-reads the ticket and re-runs this step from the top**, gating on the boxes exactly as it would on any other ticket. What stays forbidden is unchanged, and is the whole point of naming the act: the merge leg does not author the section inline, and no leg ticks a box it has itself just created — so a session that improvises the section inside the merge has skipped the separation the Not-ready path exists to keep, even where it arrives at the same text. This instantiates, at this gate, the Owner's stated shape for an interactive loop: a session that builds a PR **spawns separate subagents for the remaining legs** — QA, then merge — rather than stopping to ask, with the legs remaining separate, tool-scoped agents (`convention-agent-runtime`); the *what* is his, and the mechanism here is only where that shape meets a gate canon has already fixed in the same breath, since the section is instantiated from the template and never authored here. **Left deliberately unauthored:** who may tick a box that is the Owner's own judgement call, and whether an approval given in a chat session licenses it, are the subject of an open Owner ruling (APP-2035, which carries APP-1756's unruled half since the no-judgement route was ruled on 2026-10-19) — until it is answered, such a box left unticked takes the Not-ready path exactly as it does today, and this clause neither widens nor narrows that. (Worked case: A1-600, `assoc-one/meirionpritchard-com` PR #224, 2026-10-05 — filed in-session with `## Acceptance criteria` only and no `## Definition of done`, a filing miss; it travelled In Progress → In Review → `agent:R3-LAY` and a clean QA verdict without anything flagging the absent section, and was caught here. The session then improvised: pasted the `type:bug` DoD inline, ticked the boxes the builder could evidence, had QA re-verify each box on its own runs, and merged — correct, at about one extra QA round trip, and derived live rather than read. APP-2043. Repo, PR number and the QA leg's own behaviour on an absent section are **unverified** here: this refine surface reads no repo.) **Never author the section here, and never substitute a by-hand comparison against the per-type template for it**: a re-derivation at the merge gate is the right fallback in the moment and the wrong standing answer, because it is re-done from scratch by every leg that meets the shape and leaves nothing on the ticket for the Done gate to read. (Worked case: A1-589, `assoc-one/meirionpritchard-com#215`, merged `7e55990` on 2026-10-02 — Owner-filed as a `type:bug` split out of A1-576 carrying `## Acceptance criteria` only, with no `## Definition of done` section at all; it travelled Backlog → In Progress → In Review → `agent:R3-LAY` → merged with no leg stopping on it, and the four acceptance boxes were ticked and the verdict clean, so nothing looked wrong. Prism noticed and compared the change against the `type:bug` DoD template by hand — regression guard, runtime verification, root cause recorded, cross-surface impact, PR + CI. Different entry point from the six app.Luna leaves on the same ticket, same gap: nothing between filing and the merge gate asserts the section exists. APP-1962. Repo and pull-request claims here are **unverified**: this surface can read no repo.) **And distinguish an absent section from boxes sitting under a non-literal heading — the instantiate-blank remedy is circular for the second.** This gate asserts the two *literal* headings, which is right, and its remedy instantiates from the `type:*` template with every box **unticked**, which is right where the section is genuinely absent. Where the lists are **present and complete under other headings** — the born-routing shape — that remedy resets ticks a clean verdict has already walked at the live head and buys another QA round for a clerical gap. So read the description for the **lists** before concluding the sections are missing. Where both lists exist and are complete against the `type:*` template, the Relay act is a **heading normalisation**: rename the headings to the two literal forms, carrying the existing box text and tick state across unchanged, and instantiate unticked only the template boxes the existing list does not already carry. The invariant is unchanged — the ticket leaves this gate with both literal headings — and so are the prohibitions: the merge leg still does not author the section inline, and no leg ticks a box it has itself created, which a normalisation creates none of. The merge leg then re-reads the ticket and re-runs this step from the top, as after any Relay act. Where a list is **partial** against the template, or where it is ambiguous which heading is the acceptance list and which the definition of done, that is the absent case and the instantiate-blank remedy holds unchanged. (Worked case: A1-581, In Review with `R3-LAY`, a clean review verdict at the live head and green CI, 2026-10-08 — its description carrying an `## Acceptance` heading and a bold combined block, with every box in both ticked and walked. The Relay subagent correctly refused to decide and stopped with no writes; the Owner ruled for that ticket alone that the existing lists satisfied the gate, at a cost of one stopped merge leg and an Owner round trip. First instance of the non-literal-heading shape; third of the surrounding born-routing bypass after A1-589 (APP-1962) and A1-600 (APP-2043), both of which were genuinely absent sections and correctly took the path above — APP-2184. The template read, the verdict SHA, the CI state and the provenance of the Owner's per-ticket ruling are that leg's report and are **unverified** here; that flag covers those four only.)
   - All required CI checks have **concluded** and passed (or there are no required checks).
   - **The test suite actually ran on this branch — not merely a green aggregate.** GitHub's "all checks passed" summary is green both when the suite ran and passed *and* when the suite never triggered on the branch (e.g. the branch predates the workflow, or a path/branch filter skipped it). A never-run suite reads as green but has verified nothing. Before an **autonomous** merge (the loop's clean-pass route, where no human has eyeballed CI), confirm the expected required checks are actually **present and concluded** on the head commit — not just that the aggregate is green with the suite absent. If the expected suite is missing from the head commit's checks, treat it as a non-passing CI state: take the Blocked path, do not merge. (Worked case: A1-72, "all checks passed" while the Playwright suite never ran because the branch predated the workflow — a false green that would have auto-merged unverified work, 2026-06-30.) A manual operator approval (`@relay`) carries Aled's own eyes on CI, so this present-and-concluded check is the autonomous-merge guard specifically.
   - **The QA verdict must exist at *this* head commit before an autonomous merge — the `agent:R3-LAY` label alone never proves a review happened.** The clean-pass route treats the routing label as the approval signal, but the label is a *state*, not evidence that a verdict was reached on the code being merged. Before an **autonomous** merge, confirm a `[qa] HEAD: <sha7>` verdict is present (on the ticket, and on the PR) whose SHA equals the **current** PR head. A verdict at a different SHA — or none at all — means this head was never reviewed: take the **Not-ready path**, routing it back to QA (In Review, `agent:PR-1SM`, unassigned), and do not merge. This is the review-side twin of the present-and-concluded CI guard above — a routing label without a matching-head verdict is not an approval. (Worked case: A1-262 / PR #98 was merged with no `[qa]` verdict at head `ec498c2`; the `agent:R3-LAY` state was trusted while nothing had reviewed the head, APP-832.)
   * **Where one ticket spans several PRs, the verdict key names a primary PR and the body enumerates the rest.** A ticket whose work is spread across N repositories has N heads and one dedup key, and the guard above — read literally — fails for N−1 of them: their heads never equal the single key, so a clean, fully reviewed ticket routes back to QA on every pass, forever. That is a defect in the guard, not in the ticket. So: where **the ticket body enumerates every PR and its head**, the `[qa] HEAD: <sha7>` key may name a **primary PR** — the one the ticket turns on — the verdict body lists all heads with the per-PR outcome, and this guard tests the **primary** head against the key. Verify the enumeration is present and that each listed head matches the PR it names before merging any of them; an enumeration that has fallen behind a repushed head is a stale verdict for that PR and takes the Not-ready path for that PR alone, not for the ticket. This preserves exactly what APP-832 introduced the key to do — stop a merge re-firing against a head nothing reviewed — while dropping the one-PR-per-ticket assumption the key never meant to encode. (Worked case: APP-1111, one ticket across 14 repos and 12 PRs; QA keyed on `claude-ops` and enumerated all twelve heads in the verdict body, a convention it had to invent live — APP-1126 (1).)
   - There are no unresolved merge conflicts.
   - The branch is mergeable.

   **The ticket description is the checkbox surface this gate reads; the PR body's copy is a hand-off-time snapshot.** The same AC/DoD pair exists on two surfaces — the Linear ticket description and the PR body — and nothing re-edits the second when the first is ticked, so by merge time a PR opened with boxes correctly unticked at hand-off can still show them unticked while the ticket reads all `[x]`. **That disagreement is neither a Not-ready trigger nor a gap to re-derive.** This gate counts the boxes in the **ticket's** `## Acceptance criteria` and `## Definition of done` sections — the first bullet of this step, and the Done gate `convention-ticket` owns — and the PR body is not a gate anywhere in canon. So where a PR-body box is unticked and the ticket's equivalent is ticked, the leg **verifies the underlying condition directly from the instrument that box names** — the head commit's check-run conclusions for the CI box, the `[qa] HEAD: <sha7>` verdict's SHA match for the review box, both of them reads this step already takes — and merges on that, recording in the merge comment that the PR body was stale and naming what it verified instead. **The reverse disagreement is a fail, not a formality:** a PR body showing `[x]` where the ticket's box is unticked proves nothing about the ticket, which is the surface both this gate and the Done write read, so it takes the Not-ready path unchanged. Patching the PR body so the two surfaces agree belongs to whichever leg ticks the Linear-side box and is not this leg's to do; this clause only stops the merge leg re-deriving the same reconciliation from scratch on every occurrence. (Worked case: APP-2051, `assoc-one/claude-ops` PR #384, merge leg 2026-10-05 — the PR was opened with two boxes unticked, CI not yet concluded and the verdict not yet posted, both correct at hand-off; both were then genuinely met and ticked on the Linear description only. The merge leg had to re-derive that the PR-body text was stale rather than a real gap, re-verify the check-run conclusions and the verdict SHA independently, and post a reconciliation comment on both surfaces before merging. No harm, correctly merged — and the fourth instance of the pattern after APP-1025, APP-1520 and APP-1760, this one on a plain, clean, unflagged publish. APP-2068. **Unverified premise, named:** which leg writes which surface — specifically whether the QA leg ticks only the Linear description, and whether anything re-edits a PR body after hand-off — is unverified, no repo access from this refine surface. This clause is written to hold whichever leg left the two surfaces disagreeing and asserts nothing about any named agent's mechanism; the premise flag covers that one claim and implies nothing about the rest of this step.)

   **Re-fetch the ticket and the PR immediately before the merge write — the merge leg's freshness precondition (APP-1028).** Mirror `skill-build-ticket` step 2: the reads that qualified this ticket for merge are a snapshot, and another driver — a scheduled run, or a session woken by PR activity on a PR this loop itself opened — can merge and close it in the seconds between. So, immediately before `merge_pull_request`, re-read the ticket and the PR: if the ticket is no longer In Review carrying `agent:R3-LAY`, or the PR is already merged or closed, **make no write** and return `no-op` to the driver, which ends the run per the run-level lock. (Worked case: PR #41 / APP-679, 2026-09-02 00:22 — another session set In Progress, merged, and set Done inside sixteen seconds while this session was undrafting the same PR; only Linear's atomic `patch` failing on rewritten anchors exposed it.)

   **`mergeable_state` lags — re-read it immediately before calling `merge_pull_request`, and never
   treat `"unknown"` as "probably fine".** GitHub computes mergeability asynchronously, so a
   `pull_request_read get` taken moments earlier can return `mergeable_state: "unknown"` on a PR that
   is genuinely `"dirty"`. `"unknown"` is not a weak yes; it is *not yet computed*, and merging on it
   fails with `405 Pull Request has merge conflicts` — a real conflict discovered by attempting the
   merge rather than by checking for it. So: if any read of `mergeable_state` was `"unknown"`, or the
   last read is more than a couple of minutes old, take a **fresh** `pull_request_read get` right
   before the merge call and act on that. This is the same discipline step 2 already applies to CI
   ("poll real state, never trust a stale read"), extended to the field that gates the merge itself.
   (Worked case: `meirionpritchard-com` PR #66 / A1-208 — `"unknown"` on the first read, `405` on the
   merge attempt, `"dirty"` on a second fresh read, 2026-07-17, APP-582.)

   **Where the run holds a local checkout, the freshness check may be split across two cheaper reads — never dropped.** `pull_request_read get` has no field selection and returns the whole PR body, which on this loop's PRs is long, and a costly guard is a guard a run is tempted to skip — the exact skip APP-582 exists to stop. `mergeable_state` answers two questions, and each has a cheap authoritative substitute: the **conflict** half is answered by `git merge-tree --write-tree origin/main origin/<branch>` in the local checkout, **with both operands resolved by name and proven distinct before the result is read** — a clean tree with no conflict lines means the merge is clean, and this is the same two-argument form step 5 already mandates; the **check-state** half (`unstable`) is answered by the `get_check_runs` and `get_status` reads the leg already takes on the head (`convention-github` *Reading CI / PR state*). Together they answer what the field answers, without the body. A fresh `pull_request_read get` remains required where there is no checkout, where `merge-tree` reports a conflict (step 5 then classifies it), or where the draft bit has not been read this pass. The rule is a substitution, not a licence: the `405` on a stale `unknown` is still the failure being prevented. (Worked case: four `bot-trader` merges on 2026-09-02, each re-read pulling the full body to check one field; the run substituted `merge-tree` by hand — APP-1079.)

   **Resolve both operands by name, never through `FETCH_HEAD`, and assert they differ — this check fails in the flattering direction.** `git fetch origin main <branch>` writes **both** refs to `FETCH_HEAD`, and `git rev-parse FETCH_HEAD` returns the **first** of them, which is `main`. A leg that fetches both in one command and reaches for `FETCH_HEAD` as the obvious handle therefore compares `main` against itself: exit 0, zero conflict markers, a merged tree that is just `main`'s own tree — a clean result guaranteed regardless of the branch's actual mergeability, and indistinguishable downstream from a genuinely clean merge. This is the shape `claude-ops`' own rule names — *a figure that measures the apparatus is not a measurement of the change* — landing on the one check whose whole purpose is to refuse a merge. **So fetch the two refs in separate commands, name both operands, and guard the comparison:**

   ```sh
   git fetch origin main
   git fetch origin <branch>
   MAIN=$(git rev-parse origin/main); BR=$(git rev-parse origin/<branch>)
   [ "$BR" != "$MAIN" ] || { echo "VACUOUS: comparing a ref against itself"; exit 1; }
   git merge-tree --write-tree origin/main origin/<branch>
   ```

   **A clean `merge-tree` is evidence only where both operands have been shown to be the intended, distinct commits.** This binds every use of `merge-tree` in this skill — the freshness substitution here, the `"unknown"` fallback, the conflict classification in *Merge conflict — route by remedy*, and the guardrails that restate them — all of which share the command shape and the bare `<branch>` placeholder. (Worked case: the 2026-09-13 delivery run ran `git fetch origin main claude/APP-1411` then `git merge-tree --write-tree origin/main FETCH_HEAD`, got a clean result, and had already cited it as corroborating evidence on the preceding merge, PR #54, before recognising the returned SHA as main's. Re-run with the refs separated, the real check passed and nothing shipped wrongly — the merge had been properly gated by a fresh `pull_request_read get` returning `mergeable_state: clean`, so the failure was in the corroboration, not the gate — APP-1415.)

   **An `"unknown"` that does not resolve is answered by the local read, not waited out.** GitHub computes mergeability asynchronously and usually resolves within a poll or two, but not always: on a PR whose base is moving under repeated merges the field can sit at `"unknown"` across a whole bounded wait. Followed literally, the never-merge-on-unknown rule then parks a verified, approved, genuinely mergeable PR indefinitely; followed loosely, the leg merges on exactly the field APP-582 exists to distrust. Neither is the answer. **After a bounded wait — three reads across roughly a minute — a still-`"unknown"` field is treated as unavailable rather than as a verdict, and the local two-step above becomes the instrument of record**, with the substitution stated in the merge comment. It is strictly stronger than the field it replaces: it answers the conflict question from the actual trees rather than from GitHub's cache. The APP-582 prohibition is unchanged and is what this preserves — never merge on an `"unknown"` *read as though it were clean*; do merge on a demonstrated clean merge tree.

   **And on a repo with committed generated build products, a clean textual merge is not the whole question.** A conflict-free merge says nothing about whether a generated artefact committed on the branch is still in sync with the merged tree — a manifest, a lockfile, a snapshot, a generated index built against a base several merges back merges cleanly and lands stale, and the repo's own staleness gate then goes red on `main` rather than on the PR. Where the repo commits a generated product, extend the local read to prove it: merge into a detached worktree, run the repo's generator, and require the working tree to come back clean.

   ```sh
   git fetch origin main <branch>
   git merge-tree --write-tree origin/main origin/<branch>   # exit 0, no conflict markers
   git worktree add --detach $WT origin/main
   cd $WT && git merge origin/<branch> --no-commit --no-ff && git commit
   npm install && npm run build:manifest                     # the repo's own generator
   git status --porcelain public/                            # must be empty
   ```

   Abort the worktree when done — this is a read, never a resolution (step 5). (Worked case: `assoc-one/claude-ops` PR #178, 2026-09-08 — three `pull_request_read get` calls across a 40-second bounded wait all returned `"unknown"` on a PR whose base had moved three merges in the preceding four minutes. The local two-step showed a clean merge; the manifest had been generated on 2026-08-17 against base `ba22a5c`, three merges back, and the regenerate-and-check came back empty, so the merge was safe — but the leg had to derive that second check rather than read it. APP-1165.)

   **And where the base moved after the verdict's head CI, the merged tree is a tree no gate has read.** Every check above asks whether the merge is textually clean; none asks whether the PR's own hunks still compile against what landed under them. Head CI is valid for the head and silently not for the merge result, and a clean `merge-tree` over a rename, a signature change or a moved export says nothing about the PR's references to the old name. So compare `origin/main` against the base the verdict's head CI ran on: where they differ, extend the local read the same way the generated-product check below extends it — merge into the detached worktree already described and run the repo's own typecheck (the script that carries its codegen pre-hooks), requiring it green before the merge. Where the repo has no such script, route back to exec for a merge-from-`main` and a fresh head rather than merging on CI that never saw this tree. (APP-2122; extends APP-1079's `merge-tree` substitution and APP-1631's absorbed-content test.)

   **A clean merge tree does not prove the PR's own work is still unmerged — test for absorbed content.** Every check above asks whether the *base* has moved under the PR. None asks whether the PR's *own commits* have already reached the base some other way, most often because a sibling PR cherry-picked them and merged. Such a PR can pass every staleness check above and still be unsafe: its head carries an older copy of whatever the absorbing PR moved on from, so merging it lands no new work and can put a stale file back. Where the run holds a local checkout, test it after the two-operand fetch above, with both refs resolved by name:

   ```sh
   BASE=$(git merge-base origin/main origin/<branch>)
   git diff --name-only "$BASE" origin/<branch>                 # the files this PR changes
   git diff --stat origin/main origin/<branch> -- <those files>  # what still differs on the base
   ```

   If **every hand-authored file the PR changes is already byte-identical on the base**, and anything that still differs is a generated product or nothing, the PR's content has shipped elsewhere. **Do not merge it.** Find the absorbing PR (a recently merged PR in the same repo whose body discloses the cherry-pick, or whose diff carries the same files). Comment once on this PR: *"Content already on `main` via #N (merged `<sha7>`); do not merge as-is."* Then take the Not-ready shape below: leave the ticket In Review with `agent:R3-LAY` and the PR in place, and write the Owner-facing comment assigned to Aled. Its decision should read *"this PR's work already shipped in #N; I recommend closing it as superseded and closing the ticket Done citing #N once its boxes are confirmed met there"*. Whether another PR delivered this ticket's acceptance criteria is a judgement, so the leg recommends it and does not close anything itself. A PR only *partly* absorbed, where some hand-authored files still differ, is not this case: it is an ordinary conflict or rebase, and step 5 routes it. A PR the absorption has also made conflicted reads `mergeable_state: "dirty"`, and the fresh re-read above already stops it. This test is for the one that reads clean. Where the run holds no checkout, a sibling PR in the same repo that merged since this head was pushed and names this PR's commits is enough reason to hold the merge and route it back to QA the same way. (Worked case: `assoc-one/meirionpritchard-com` PR #150 (A1-463). Its commits were cherry-picked into #152 (A1-466), which merged. #150's head was not an ancestor of `main`, but its content was already on `main` byte-identical. Merging it would have restored a stale `| {}` union member in `types.gen.ts` and taken `next build` from 0 to 53 `tsc` errors, which the repo's CI does not run. QA caught it by diffing each file against `main`, and #150 was closed as superseded. The same batch's #149 (A1-461) was in the same position and read `"dirty"`. 2026-09-22, APP-1631.)

   **Not-ready path — unticked acceptance box.** If any acceptance box is unticked and unwaived, do not merge and do not treat it as a CI/conflict failure. Leave the ticket **In Review**, post a comment @mentioning Aled naming the unticked box(es) and that the DoD is not yet met, and assign Aled. Leave the `agent:R3-LAY` label and the PR in place — this is a definition-of-done gap for the operator or a bounce to exec, not a merge failure. Write that comment in the Owner-facing shape below (*Owner-facing comments*): the decision and the one action he must take at the top, the box-by-box detail beneath it.

   **Mark it `[merge] not ready — HEAD: <sha7>`, and do not repeat the ask while the SHA and the box set are unchanged.** This path is the only one of the leg's three Owner-facing holds that shipped without a dedup key, and a hold with no key has two failure modes and no rule separating them: a run meeting a standing, still-accurate Not-ready comment either re-posts it — adding noise to an ask that already carries decision, action and why in full — or stays silent on a judgement it had to derive from scratch, and the next run derives it again. The siblings both settled this and this path inherits their shape. The key is the **head SHA plus the set of unticked box identifiers**: a repushed head, a box ticked or waived since, or a **new** unticked box re-opens the ask and a fresh comment is posted against the new key. Where the key is unchanged, say nothing on the ticket and **name the held ticket, its head and the age of the standing ask in the run report** — the report is where a stale Owner ask becomes visible, not a second comment on a ticket he has already read. **And a Not-ready ask does not wait forever: where the key is unchanged and the ask is older than three days, re-ask once against the same SHA**, mirroring the red-base path's cadence (APP-1060) — one re-ask per three-day window, never per run — then return to silence on the same key. The three-day window and the re-ask-once bound are the point: *"never waits in silence"* (APP-645) is a rule about not skipping the ask, and it was read — correctly, and with nothing to cite — as saying nothing at all about re-asking. (Worked cases: `A1-386` and `A1-380`, both `assoc-one/firmup-operator`, In Review + `R3-LAY` on open draft PRs #28/#36. A 2026-09-28 merge-leg pass found genuine unticked, unwaivable boxes on each — A1-386's AC3 scope question, A1-380's AC4 "verified at runtime after deploy" — and left Owner-facing Not-ready comments asking Aled to rule. The 2026-10-04 delivery-loop run swept both as out-of-band merge candidates, found the same head SHAs and no reply six days on, and declined to re-post, reasoning that the post-the-ask-once rule governs *whether* to ask and not *how often* — a correct reading derived live, which the note filed precisely because a later run could as reasonably have re-posted — APP-2019.)

   **Before taking that path, test for the one box this leg may waive itself.** An unticked box is not automatically the operator's. Where the box is **environment-unverifiable rather than unmet** — the work may well satisfy it and this environment simply has no instrument to confirm it (the sandbox's egress proxy 403s the PR's own preview URL before the request leaves; no runner drives a live deployed surface) — Relay carries a **bounded waiver** (`convention-ticket` *Waiving a box*; decision Aled, 2026-07-16). Apply it only when all three hold:

   1. The box is environment-unverifiable and **not in doubt on the evidence**.
   2. An **independent signal already covers the surface** — CI that genuinely ran and passed (the present-and-concluded check above, not a false green), a passing visual diff, or an identical local code path exercised by a test.
   3. The waiver **names the signal it relies on**.

   Then strike the box with the one-line reason naming that signal, comment the waiver, and merge. If any of the three fails, it is an **unmet** box: take the Not-ready path above.

   This exists because the alternative was a rule with no path through it: canon told Relay to re-route an unverifiable box "not as an ask to the operator", while Relay's only lever *was* the operator's waiver — so the ticket reached him anyway, via the route the rule forbade, and the same evidence resolved two ways run to run (A1-209: waived and merged; A1-216/A1-217/A1-208: routed to Aled). **The waiver routes around a missing instrument; it never replaces one** — where the verification is worth having, file the repo-lane ticket for the runner (`OPS:`/`FIX:`, `agent:R3-LAY`) in the same pass, and say in the waiver comment that you have. A box waived repeatedly in one repo is that ticket's evidence. (APP-568, consolidating APP-555.)

   **And the cited write lands before the comment that cites it.** The rule above requires the waiver to say it has filed the repo-lane ticket; it does not say in which order, and a waiver written first states the filing in the past tense whether or not it happened. Re-reading the waiver cannot catch that — the comment is internally consistent, and the only place the omission is visible is the other artefact. So: make the write first, then cite it by the identifier the write returned — the ticket ID from the create call, or the comment URL where the lane is an existing ticket carrying a fresh note rather than a new leaf. This is the create-first-reference-second discipline `convention-linear` already applies to issue references, extended to the one comment whose whole purpose is to report a gap as handled. A waiver whose named follow-up does not exist is worse than no waiver: it closes the gap on the record while leaving it open in fact. (Worked case: APP-1223 / `aledpritchard-com` PR #35, 2026-09-10 — the waiver said the repo's CI gap was "noted on APP-1125 rather than filed as a duplicate" while APP-1125's thread had ended three days earlier; caught only because that merge leg happened to read APP-1125 before merging, and the note was written afterwards — APP-1285 (2).)

   **A second named case — the objectively-verifiable box the merge leg ticks, recording not waiving.** Distinct from the waiver above: some boxes are neither unmet nor environment-unverifiable but **true in substance and merely unticked**, because no leg before the gate is permitted to tick them. The standing case is `- [ ] Review verdict posted — Prism's`: Forge hands off *before* the verdict exists, and `skill-review-pr` posts the verdict and, on its own verification, closes any box it can verify end-to-end from its own reads and that no change to the diff would close — the carve-out it states as a test rather than a list (`skill-review-pr`, APP-1025, APP-1507) — and patches the PR body's checklist to match the ticket's in the same pass. What QA does not do is advance the ticket or tick on the builder's behalf. So the reason *this* box reaches the gate unticked is **sequencing, not a prohibition on QA editing the description**: Forge hands off before the verdict exists, and QA's own verdict box is the one box whose truth-maker is the act of posting it — so every clean pass reaches the gate with exactly this one box unticked. Where the box's condition is **objectively verifiable from the ticket's own record** — a `[qa] HEAD: <sha>` verdict comment present on both the ticket and the PR — the merge leg **ticks it on that evidence and merges**, citing the verdict in the merge comment. This is *recording a met condition*, not waiving an unmet one: it relies on no missing instrument, so it is not a waiver and files no `OPS:`/`FIX:` ticket. It is bounded to a box whose truth-maker is a fact already on the record — an unticked box with *no* such record is genuinely unmet and takes the Not-ready path. This keeps distinct the three states the one box was conflating (met-and-recorded, genuinely unmet, environment-unverifiable-and-waived) and stops every run re-deriving the same workaround under the gate. (Worked cases: A1-310, A1-309, A1-272 and APP-751 each merged this way independently — APP-736, APP-755.)

   **And the branch is the test it gives its reason as, not a one-box list.** The reason above — a fact already on the ticket's own record — reaches further than the one box it was written for, and bounding it to that box makes every other evidenced box re-derive the same workaround under the gate. So: **any box whose condition is objectively verifiable from the ticket's own record is ticked by the merge leg on that evidence, cited in the merge comment, and merged.** That includes a box a clean QA verdict at the live head records as met with its own evidence, and the CI box against the head's check-run conclusions. The bound is the record, not the box's name: still recording a met condition rather than waiving an unmet one, and an unticked box with no such record is still genuinely unmet and takes the Not-ready path. **Where a QA verdict evidences boxes QA did not close, the merge leg records them, names the brief-side miss in the merge comment, and merges** — it does not route a set of evidenced boxes to the Owner, which turns a clean pass into an Owner decision about nothing. Naming the miss is the point: `skill-review-pr` already requires QA to close what it can verify end-to-end and to bring both surfaces level, so a leg that reports boxes as met and says it was told not to edit the description has been **briefed against canon**, and that is a brief to fix rather than a judgement for the gate to keep absorbing. (Worked case: APP-2481, `assoc-one/claude-ops` PR #488 head `4e12cd6`, 2026-10-20 — a clean `[qa] HEAD: 4e12cd6` verdict, green CI, no human gate, and all eight AC and DoD boxes unticked, each reported met with command output by a QA leg that recorded it had been told not to edit the description. The merge leg ticked all eight on that per-box evidence, checked the CI box against the head's check-runs, disclosed it in the merge comment and merged — a judgement this skill did not name until now, which is exactly how one leg's correct call stays one leg's. The pull request number, the head, the eight boxes' unticked state and the verdict contents are the merge leg's report and are **unverified** here, no repo or GitHub surface being readable from the authoring surface; the `skill-review-pr` rule they are weighed against is observed in live canon. APP-2482, with APP-1005 and APP-2292 on box ticking and APP-736 / APP-755 on the verdict box.)

   **A fourth branch — a box in a recognised post-merge section is not counted here at all.** The three branches above each resolve a box that *this gate must account for*: ticked, waived as environment-unverifiable, or recorded as objectively verifiable. A fourth class is not the gate's business. Where a step can only happen **after** the merge — a Figma library publish, a Storybook Connect link, any manual one-click step on a surface the merge itself produces — `convention-ticket` (*Per-type ticket formats*) gives it its own section under the literal heading `## After merge (Owner, manual — not merge gates)`, and the boxes in that section are **not counted by this gate**. The merge proceeds with them open, and the merge comment names the section rather than waiving anything. This lowers no bar: such a box is unmeetable before the merge by construction, so counting it made the bounded waiver the only route through — and a waiver asserts a missing instrument where none is missing (*the waiver routes around a missing instrument; it never replaces one*).

   **The literal shape is the authority — an arbitrary trailing section is not one.** This branch applies **only** to that exact heading. A section under any other name, or boxes appended below the two gate sections without one, is **inside the gate** and counted exactly as before. Otherwise the branch becomes a way to move a real gate out of the merge's sight by renaming a heading, which is strictly worse than the waiver it replaces, because a waiver is at least recorded and read. So assert the literal heading before exempting a single box; and where the section exists but a box in it plainly *could* have been met before the merge, treat that box as misfiled — take the **Not-ready path** naming which box and why, rather than exempting it. (APP-2434. A1-646 took seven Owner waivers against this shape, and A1-656's merge leg stopped on 2026-10-19 on checks 9, 11, 12 and the checklist flip; the Owner then ruled on A1-656 that "the acceptance criteria need to take into consideration the manual publish" and added the section to that ticket by hand. The PR number, the merge commit and the Linear–GitHub integration's auto-close behaviour reported on that thread are **unverified** here — this refine surface reads no repo.)

   **CI-wait — poll in-progress checks to a conclusion through the GitHub MCP, never `gh`/curl.** When
   required checks are still queued or running (not failed), do not decide immediately and do not
   guess a fixed delay. **This environment has no working `gh` CLI and blocks raw `curl`/API-token
   HTTP to the GitHub REST API (the egress proxy 403s it, silently, so a `curl -s` poll misreads the
   empty body as "checks passed" — a false green); only the `mcp__github__*` tools have real access.**
   So the canonical CI-wait here is a **bounded, `date`-driven bash delay that alternates a sleep with
   an MCP check** — re-query the head commit's check state via `mcp__github__pull_request_read`
   (method `get_check_runs`) each iteration, inside an overall time cap:

   ```
   end=$(( $(date +%s) + 600 ))
   until [ $(date +%s) -ge $end ]; do sleep 20; done   # one wait interval; re-query check_runs via the MCP between waits
   ```

   Gate the loop on the **MCP check result**, never on a network call that can itself be blocked
   (that is what produced the false green), and never on a bare `sleep N` (the harness blocks a
   standalone sleep — the condition-based `date` delay is the working substitute). This supersedes
   the earlier `gh pr checks <pr> --watch` example, which does not run in this environment. On a clean
   conclusion within the window, take the happy path; only if checks are still unconcluded when the
   timeout elapses does the Blocked path apply. The full pattern and its failure modes are canon in
   `convention-github` *Reading CI / PR state in autonomous runs*. (Worked cases: A1-78 merge leg — a
   guessed background timer is fragile when CI runs faster or slower than the guess, 2026-06-30; PR #49
   Playwright check reported green when it had not run, APP-450; the CI-wait clunkiness re-surfaced on
   the meirionpritchard-com loop of A1-150/151/154/152, 2026-07-07, APP-458.)

   **The bound is a prompt to look, not a verdict — read the run's own step timestamps before
   calling it.** The `600` above is a **worked example, not a limit**: it is the shape of the loop,
   and the number belongs to the example rather than to the rule. A required check still unconcluded
   at the bound is in one of two states, and they take opposite paths. Before treating the elapsed
   bound as "unconcluded", read the job's **step-level timestamps** — `mcp__github__actions_get`,
   method `get_workflow_job` — and separate them: a job whose slowest known step is **still
   executing**, with its own start time recent and advancing, is progressing, so extend the wait and
   keep polling; a job with no step started, a step started and not advancing, or a silent retry is
   **stalled**, and that is the Blocked path the bound exists to reach. Say which of the two was
   observed in the merge comment, with the step name and its timestamps, so the extension is a
   recorded read rather than a judgement re-made each run. Routing on elapsed time alone escalates a
   clean, approved and QA'd PR to Blocked for no reason but a suite's own runtime, which is the same
   shape APP-551 named for a rebase — a fail-safe assigning the Owner work that was never his —
   applied here to CI duration. (Worked case: on `assoc-one/meirionpritchard-com` PR #197, head
   `102e457`, 2026-09-26, `typegen-check`, `chromatic` and Vercel all concluded within ~90s of the
   push while `playwright` was still `in_progress` at the ten-minute mark. Reading the job's steps
   confirmed "Run Playwright tests" was still executing rather than hung; polling continued and the
   check concluded `success`, the job completing 11:32:43Z against a start of 11:15:23Z. A literal
   read of the bound would have Blocked it — APP-1800.)

3. **Happy path — merge.**
   * **A PR still in draft when it reaches this leg is un-drafted here — the residual case only.** `skill-review-pr` step 3 already owns taking a PR out of draft (APP-1110); a PR arriving at the merge leg still in draft has escaped that step. Once every gate in step 2 has passed, mark it ready for review and continue the merge — do not bounce it back to QA for the draft flag alone, and do not treat it as a merge failure. Record the instance in the closing ops-retro capture so the escape is counted rather than re-inferred each run (APP-1126 (2)).
   - **Squash merge** the PR into **the PR's own base ref** — resolved exactly as `skill-build-ticket`'s rebase-before-hand-off step already resolves it, and never `main` or the repo default branch by reflex, because on a repo that stages its work on an integration branch `main` *is* the GitHub default branch, so that hedge squashes straight past the staging gate (`APP-3003`; the rule stands on this leg otherwise contradicting `skill-build-ticket`, which is readable here — the repo evidence in that note, that `assoc-one/agents-site` carries both `main` and `next` with CI on PRs into each, is **unverified from this surface**, no repo being readable, and the note gives the methodology document's path two different ways). Squash message:
     [Ticket identifier] [Ticket title] (#PR number) — e.g. APP-104 Fix fitness tracker sync (#12).
   - **Confirm the merge actually landed before doing anything else — prove a merge commit exists on the base branch.** The confirmation is a **property to demonstrate, not a single field to read**: after the squash-merge call returns, establish that a merge commit for this PR is now present on the base branch. State it that way because the obvious field is not available — `mcp__github__pull_request_read` (method `get`) **does not return `merge_commit_sha`** (confirmed absent on two squash merges across two repos, APP-846), and its `mergeable_state` reads `"unknown"` post-merge, so neither is a usable proof. The reads that **do** work, and together satisfy the property:
     - `pull_request_read get` returns `merged: true` (present and reliable), **and**
     - the merge commit SHA from the **`merge_pull_request` response**, verified independently — `mcp__github__get_commit` shows that commit exists (titled `<ticket> … (#PR)`), and/or `mcp__github__list_branches` shows the base branch now points at it.

     Do **not** proceed to the branch delete, the Done write, or the confirmation comment on the merge call's own response alone — a conflict, stale base, permissions refusal or dropped response can return without an error while nothing shipped. If `merged` is not `true`, or no merge commit can be shown on the base branch by the reads above, the merge did **not** land: take the **Blocked path** (step 6) naming the failed merge, and **never move the ticket to Done**. **Where that ticket is already Done and this leg wrote nothing, caveat rather than fail.** The prohibition is on this leg *writing* Done, not on reversing a Done it finds, and the integration writes that state on the merge event — so its presence, on a ticket this leg has not touched, is itself a signal the merge landed. Take one further independent read of the base branch (`list_branches`, or `get_commit` on the SHA the merge call returned) before concluding anything. If that answers, the property is satisfied and the happy path continues. If every confirmation read is unavailable, do **not** take the Blocked path and do **not** revert the state: moving a shipped, integration-closed ticket to Blocked parks finished work on a human for a verification failure that is the leg's, which is the APP-551 shape. Leave the ticket Done, post the confirmation comment naming every read that failed and stating the merge as unverified *from this leg*, and carry it into the end-of-run report as an unverified merge. (APP-1309.) This is the read-after-write discipline `convention-linear` mandates for every state write, applied to the write with the largest blast radius — Done stops every downstream check from looking, so a false Done hides until someone manually re-checks. Naming the confirmation as a property rather than a field also stops the guard failing in the wrong direction: reading it literally as "`merge_commit_sha` non-null" makes a genuinely-landed merge look failed (the field is simply absent), which is the APP-819 shape arriving by a false negative. (Worked cases: A1-261 and A1-262 both went In Review → Done 80ms apart on 2026-07-30 with neither PR merged, and sat falsely Done for twelve days — APP-819; the named-field-absent gap found on the APP-831 and APP-838 merge legs, 2026-08-13 — APP-846.)
   - **Delete** the claude/-prefixed branch after a successful merge — **best effort, never a gate.**
     First check it still exists on the remote (e.g. `git ls-remote --exit-code origin <branch>`).
     GitHub's "auto-delete head branches" repo setting may have already removed it on merge; if the
     branch is gone, the goal is already met — skip the delete rather than run
     `git push origin --delete`, which would otherwise fail noisily with "remote ref does not exist".
     If it still exists, delete as normal.

     **Where the run holds no local checkout, the existence check has no instrument — and empty
     output is not an answer.** A merge leg whose working directory is not a git repository, or which
     holds no credentials for a private delivery repo, gets **no output and no error** from
     `git ls-remote --exit-code origin <branch>` — not a `Repository not found` 403, not a timeout,
     nothing — so it reads as a hang or a silent no-op, and an absent branch and an absent instrument
     become indistinguishable. Never justify a skipped delete on empty `ls-remote` output. Run the
     existence check through `mcp__github__get_commit` instead, passing the branch name in place of
     the SHA: it answers cleanly with `No commit found for SHA: claude/<ticket-id>` when the ref has
     gone, and returns the commit when it has not. The best-effort posture is unchanged — where no
     instrument answers at all, the confirmation comment records that, the delete is skipped, and it
     is never a gate and never a Blocked. (`APP-2987`, the merge leg of `APP-2972` on
     `assoc-one/claude-ops`, 2026-11-10, where `mcp__github__get_commit` confirmed GitHub's
     auto-delete had already removed the branch at the cost of one extra round trip; the no-checkout
     environment is **reported** by that leg, not re-read from a repo on this surface.)

     **If the delete is refused, note it and move on.** This environment's git proxy blocks
     ref-deletion pushes specifically: `git push origin --delete claude/<ticket-id>` returns
     `error: RPC failed; HTTP 403` / `send-pack: unexpected disconnect while reading sideband packet`,
     while ordinary pushes over the same remote succeed in the same session, and no GitHub MCP tool
     deletes a ref, so there is no fallback to reach for. Do **not** retry, do **not** improvise, and
     do **not** take the Blocked path: the merge has landed, the PR is closed, and the branch is inert
     — nothing depends on it. Record it in the confirmation comment and continue. Branch cleanup is
     repo hygiene; shipping is the outcome, and hygiene never gates it. (Worked case: A1-210,
     `assoc-one/firmup` PR #9, 2026-07-14 — APP-528.)
   - **Surface — never close — any other PR still open on the ticket.** After the merge is confirmed landed, read the ticket's PR attachments; where a sibling PR is still open (a superseded lineage, an earlier attempt, a re-land's predecessor), name it in the confirmation comment — number, branch, opened date — and in the end-of-run report as an orphan for the operator to close and whose branch to delete. Do not close it: an open PR on a Done ticket can legitimately mean the ticket was closed in error, and no sweep keyed on Linear state ever revisits a Done ticket, so this is the one moment the orphan is visible. It is a live tripwire, not tidiness: `skill-build-ticket`'s duplicate-open-PR check reads it and takes the Blocked path on a future ticket touching the same lineage. (Worked case: `assoc-one/meirionpritchard-com` PR #91 on A1-301, open 24 days behind merged #93, found by no sweep — APP-1115.)
   - **Tell any other ticket's PR whose commits this merge absorbed — comment, never close.** The bullet above covers siblings *on the ticket*. A merge can also strand a PR on a *different* ticket: where this PR cherry-picked commits from another open PR (the PR body or the leg's own run disclosed it), that PR still reads as an ordinary open PR carrying approved, reviewed work, and nothing on it says its content is now on `main`. After the merge is confirmed landed, comment once on each such PR: *"Commits from this PR were absorbed into #N (merged `<sha7>`); do not merge as-is — re-check it against `main` first."* Name it in the confirmation comment and in the end-of-run report. Do not close it and do not touch its ticket. It belongs to another ticket and may be Owner-assigned (as #149 was), and the pre-merge absorbed-content test in step 2 is what stops it being merged blind later. (Worked case: #152 on A1-466 merged with #150 and #149 still open, labelled `PR-1SM` and unreviewed, with nothing on either PR recording the cherry-pick. 2026-09-22, APP-1631.)
   - **Reconcile the Linear ticket to Done — read it before writing.** The ticket can arrive at this
     step already Done: Linear's GitHub integration transitions it on the merge event itself, inside
     a second of `merged_at` and well before the leg gets here. So read the ticket and write Done
     only where it is not already there; a no-op is the expected outcome on the happy path, not a
     sign something went wrong. Do not predict the state — read it, since integration settings need
     not be uniform across repos. The confirmation guard above is unchanged and is exactly what this
     preserves: it forbids *this leg* writing Done on a merge it has not confirmed, not the
     integration writing it on a merge that demonstrably landed. (Worked case: APP-1259 /
     `claude-ops` PR #212, 2026-09-10 — `merged_at` 18:51:53Z, ticket `completedAt` 18:51:54.759Z,
     the leg's own `save_issue` at 18:52:16Z finding Done already set — APP-1309.)
   - **Re-read every *other* ticket the PR names — the integration can close a ticket that is only mentioned.** The merge event's Done write is not confined to the `Closes` line: a ticket named anywhere in the PR title, body or squash commit message can be moved to Done by the same event. So after the merge is confirmed landed, list every ticket ID those three carry other than this one, read each, and treat a Done transition within a second or two of this ticket's `completedAt` that no merge of its own explains as the integration's, not a delivery. Restore that ticket to the state it held before (read it from the ticket's history, never guessed), comment one line naming the merge that closed it, and name it in the confirmation comment and the end-of-run report. Where the prior state cannot be read, leave the ticket as it is and surface it to its owner instead of guessing. This is APP-1309's read-after-write carried to the tickets this leg did not mean to touch. (Worked case: agents-site PR #13, "Closes A1-441", also set A1-409 Done — named only in a "Relationship to A1-409" section, its criteria unticked and its blocker APP-1302 still open, `completedAt` 00:15:49.348Z against A1-441's 00:15:49.273Z. The step-4 re-read caught it and it went back to Blocked — APP-1548.)
   - Evict `agent:R3-LAY` (remove the label).
   * **Where the merged repo deploys to Vercel, confirm a deployment of the merge SHA exists — and start one through the connector where none appears.** A landed merge is not a deploy. The auto-deploy on push to the production branch has failed with **no deployment record created at all** — not Ready, not Error, absent — on two separate projects, three instances, and after an API squash-merge every time, which is precisely the call this step makes (`convention-vercel`, *Merged is not deployed*). So once the merge is confirmed landed, where the repo has a Vercel project and this leg holds a Vercel connector: read `list_deployments` with `sha` set to the **full 40-character merge commit SHA** — a short SHA matches nothing and an empty list reads exactly like "never deployed" — and name the matching row's state in the confirmation comment. Where the list is empty, `create_deployment` from the merge commit, re-read `list_deployments` on the same full SHA to show the deployment exists and reached READY, and say in the confirmation comment that this leg started the deploy rather than the push trigger. **Where no Vercel connector is on this leg's toolset the check has nothing to read**: say so in the confirmation comment and leave the production-URL confirmation to the Owner, as `convention-vercel` has it. Either way a missing deployment is **not** the Blocked path — the merge landed, and the gap is downstream of it. (Worked case, **reported**: `assoc-one/hackneyshowrooms` A1-764, 2026-10-21 — PR #6 squash-merged through the GitHub REST API, and about eleven minutes later Vercel had created no production deployment and posted no commit status for the merge commit, while the same project's API squash-merge forty minutes earlier had deployed within seconds; the leg started the deploy itself with `create_deployment` and it reached READY. Two earlier instances on `aledpritchard-com` in July. The PR numbers, the merge commit, the timings and the deployment id are that leg's report; **premise unverified — no repo, GitHub or Vercel surface is readable from the authoring surface.** APP-2555, extending APP-576.)
   * **Where the diff touches canon artefact bodies, say so in the confirmation comment: the merge published the mirror, and the Claude-side save is still outstanding.** Canon lives Claude-side as the saved skills and the `claude-ops` repo is a downstream mirror (`core-operating-model`), so a PR changing a `SKILL.md` under `canon/skills/` or `canon/tasks/` — a skill, convention, agent or operator profile, task or routine — publishes the mirror and the public site and changes nothing the fleet executes. The check is a path test on the diff, not a judgement: where any changed path sits under `canon/skills/` or `canon/tasks/` — the two directories `claude-ops` has held its canon in since the 2026-09-14 move out of `.claude/` (APP-1457, APP-1458), `.claude/` there now holding only `settings.json` — so a test written against `.claude/skills/` can never fire on a canon publish PR at all, and a test naming only one of the two new directories misses every `task-*` publish. A path test that cannot fire is the quiet failure in the costly direction: the disclosure line is silently never added, the ticket reads as delivered, and nothing downstream recomputes it (APP-2506, the uncompleted remainder of APP-1692; the repo layout is reported, no repo being readable from the authoring surface, and is stated in live canon by `skill-ops-sync`), add one line naming the affected artefacts and stating that the change takes effect on the Claude-side save, not on this merge. Do not block the merge and do not withhold Done — the PR did what a PR can do; what is wrong is a ticket reading as delivered while the running system is unchanged. Note also that the repo now sits **ahead** of Claude for those artefacts, a direction `skill-ops-sync` flags and does not reconcile. A canon change should never arrive as a Forge PR at all (`core-operating-model`); this rule is the consequence half, for one that already has. (Worked case: APP-1436 / `assoc-one/claude-ops#237` wired `skill-telemetry-capture` as a loader footer onto three tasks — both acceptance criteria genuinely met, the diff clean, the staleness gate green, 25/25 tests — and instrumented nothing. The ticket's own notes asserted that merging it started APP-1131's five-weekday observation window, which would have produced an empty baseline readable as a collector fault rather than a deployment one; QA caught it only by reasoning from first principles about which surface the three tasks run on — APP-1441.)
   - Add a comment: "Merged: PR #[number] squash-merged into main. Branch deleted. ✓" — or, when
     GitHub had already removed it, "Branch auto-deleted by GitHub. ✓" — or, when the delete was
     refused, "Merged: PR #[number] squash-merged into main. Branch delete refused by the environment
     (403); branch left in place, inert. ✓"

4. **Unblock dependents.** After a successful merge, query for tickets in **Blocked** that list the just-merged ticket as a blocker. For each:
   - Check whether any other blockers remain unresolved (i.e. not Done).
   - If no remaining blockers, move the ticket to **Todo** and comment: "Unblocked — [ticket identifier] has merged."
   - If other blockers remain, leave the ticket in Blocked (do not comment).

5. **Merge conflict — route by remedy, not by "the loop hit a wall".**

   A conflict is usually the most mechanical thing in the loop, so it does not take the Blocked path
   by default. First decide **who the remedy belongs to**. That decision needs a diagnosis, and the
   diagnosis has a method — use it rather than reinventing one under a `405`:

   **How to classify a conflict — the two-step local read.**

   1. **List the conflicting files** with the modern three-dot form:

      ```
      git merge-tree --write-tree origin/main <branch>
      ```

      **Use this form, not the older 3-argument `git merge-tree <base> <ours> <theirs>`.** The old
      form silently auto-merges non-overlapping hunks and emits no `<<<<<<<` markers even when GitHub
      reports the PR `dirty` — it under-reports, so a genuinely conflicted branch reads clean and the
      classification comes out wrong in the safe-looking direction.

   2. **Read the real markers** in a throwaway worktree:

      ```
      git merge --no-commit --no-ff <branch>
      ```

      Then read each conflicted hunk against the merge-base to see **which side changed what**. That
      is what separates the two routes: additive or non-competing changes on either side (a comment
      block landing on the same lines as a functional change; an import moved; formatting drift) are
      **mechanical**; hunks where both sides rewrite the same behaviour differently are a **decision**.
      Abort the worktree merge when done — this is a read, never a resolution.

   (Worked case: `meirionpritchard-com` A1-208 / PR #66 and A1-130 / PR #46, 2026-07-17. Both were
   mechanical — a JSDoc pass from A1-199 colliding with functional lines, and an unrelated import
   landing on the same line as a `client`→`sanityFetch` swap — and both were routed back to exec with
   the exact resolution instruction and merged on the next pass. The routing was right; the method had
   to be derived live, mid-merge-attempt. APP-582.)

   With the diagnosis in hand, route:

   - **Rebase — the remedy is mechanical and fully specified.** The conflicting hunks are additive or
     otherwise reconcilable with no scope or content call to make (two independent additions to the
     same block; a formatting drift; a moved import). This is **exec's work, not the Owner's**:
     - Move the ticket to **Todo**, keep `agent:F0-RGE` (evicting `agent:R3-LAY`), leave it unassigned.
     - Comment the resolution instruction the merge leg has already written — which branch to rebase
       onto what, which hunks conflict, and how they reconcile — so exec picks it up with the remedy
       in hand.
     - Do not merge. Do not close the PR. Leave the branch in place.
   - **Decision — resolving the conflict needs a scope or content call.** The hunks genuinely compete,
     the right answer isn't determinable from the two tickets, or reconciling them changes what was
     agreed. Only this is the Owner's: take the Blocked path below.

   The distinction matters because the fail-safe otherwise conflates *"the loop hit a wall"* with
   *"a human must clear it"*. Those coincide for a credential gap or an ambiguous requirement; they
   don't for a rebase. Parking a rebase on the Owner is the "looks routed but stalls unowned" failure
   in reverse — work sitting on a human for something an agent should do — and it parks at **Urgent**,
   where the escalation ladder has nothing left to give. Per `convention-linear`, Blocked is for
   *"a genuine external blocker that separate work must clear"*, and a rebase is not one. (Worked case:
   A1-199 / PR #63 — the fail-safe correctly diagnosed the conflict, correctly named the remedy as an
   additive rebase, correctly identified **exec** as the actor, and then assigned the Owner and set
   `human`. It sat Blocked + Urgent on Aled's plate for 3 days for a rebase nobody intended him to do
   by hand, 2026-07-12 → 07-15, APP-551.)

6. **Blocked path — CI failure, or a conflict needing a decision — and the red-base hold that is not the Owner's.**

   **First, test whether the red is the base's.** Where a failing required check is also red on the base branch at its current tip — the same check, the same failure, on `main` — the PR has inherited it, and nothing in this PR can turn it green. That is not the Owner's to clear and it is not Blocked: parking an approved, QA-clean PR on the Owner at Urgent for a failure that is not in the work is the same misroute as parking a rebase on him (step 5). Instead: keep the ticket **In Review** carrying `agent:R3-LAY`; set a `blockedBy` relation to the `FIX:` ticket tracking the base failure (the exec leg files it per `skill-build-ticket` step 4; where none exists, file it — `FIX:`, the repo's project, `agent:F0-RGE`, priority High); and **write once to that blocker**, in the Owner-facing shape, that it is holding a PR — *"holding <repo>#<pr> for <ticket>, approved and QA-clean at HEAD <sha7>; merges on its own once this is fixed"*. The blocker is the one ticket that can clear the jam, and until this rule it was never told. Mark the comment `[merge] holding — HEAD: <sha>`. *Say it once* applies to the hold as to the ask, with one extra trigger: **a blocker still in Backlog or unstarted three days after the hold was written re-opens the ask against the same SHA** — the age of an unstarted blocker is a change in the question, not the passage of time alone. Every held merge is listed in `routine-delivery-loop`'s end-of-run report under the zero-eligible diagnostic, naming the blocker and its state, so the hold is loud in the digest and quiet on the ticket. (Worked case: APP-966 / `bot-trader` PR #42, QA-clean at `708efad`, refused on 2026-08-23 and again on 2026-08-24 over `backfill.test.ts` red on `main`; the blocker APP-1055 sat in Backlog with zero comments until the second run wrote to it by hand, and *say it once* correctly forbade a second ask — an approved PR permanently quiet — APP-1060.)


   **And annotate the box as held, never as waived — the two remedies must not be interchangeable on the ticket's own text.** A red-base hold reaches the description as an unticked `## Definition of done` box, and step 2's bounded waiver is the only box language canon spells out — so the box gets struck and annotated *waived (bounded waiver, APP-568 shape)*, and the ticket then carries the wrong gate's conditions in its own words. The citation is wrong on both halves: a waiver is for a box this **environment** cannot verify and turns on an independent signal already covering the surface, whereas a red-base box is perfectly verifiable, has concluded, and is genuinely failing — just not on this PR's work. So this path records the box in its own form: **leave it unticked and annotate it `held pending <FIX ticket>` on the same line**, matching the `[merge] holding — HEAD: <sha7>` comment, and file no `OPS:`/`FIX:` instrument ticket for it — the blocker already named is the ticket that clears it. Struck-and-waived belongs to step 2, held belongs here, and a later pass can then tell from the description alone which gate governs. The run that writes it reaches the same outcome either way; the cost falls on the next pass, which can pattern-match *the box says waived, move on* and apply a three-part test that does not fit the case. (Worked case, **reported**: APP-2510 / `assoc-one/agents-site` PR #23, 2026-10-21 — a "CI present, concluded, green" box red at head `bc135a6` because a published `agent-draft` artefact had no matching marks or roster entry, so `npm test` failed identically on an unmodified `main`. The hold itself was done correctly: the `FIX:` ticket filed as APP-2519, the `blockedBy` relation set, the ticket kept In Review carrying `agent:R3-LAY`. Only the box annotation cited step 2 — and a later merge pass re-derived the correct read from first principles and commented the distinction on the ticket, which is the re-derivation this removes. The PR number, the head, the box text and the base's test failure are that session's report; **premise unverified — no repo or GitHub surface is readable from the authoring surface.** APP-2521.)

   **Second, test whether this is a partial merge.** Where a ticket's work spans several PRs, N−1 have merged and been confirmed landed, and one is correctly held — a red check, an unresolved conflict, an expired credential — the ticket is neither Done (work outstanding) nor Blocked, and it is **never Blocked + Urgent**. Route it instead: keep it **In Review**, set the executor to `human`, assign Aled, carry a `blockedBy` relation to the ticket tracking the held work, and set the priority to **the blocker's own priority** — never Urgent for the remainder alone. Comment in the Owner-facing shape naming what merged, what is held and why, and which ticket clears it. Two rules meet here. `convention-linear` reserves **Blocked** for *a genuine external blocker that separate work must clear*, with a **named dependency**; a remainder that needs only a review pass once the blocker clears is In Review work, and Blocked with no dependency named is the state used as a shrug. And APP-551 ruled that a fail-safe must not park at **Urgent**, where the escalation ladder has nothing left to give — escalating mostly-shipped work to Urgent buys nothing and spends the one priority that means *drop everything*. (Worked case: APP-1111, one ticket across 14 repos and 12 PRs — 11 merged, `agents-site` held on a red check whose remaining action belonged to APP-1124; the fail-safe set Blocked + Urgent, overstating the urgency of a ticket with nothing left for anyone here to do. APP-551's shape arriving from a different direction — APP-1126 (3).)

   **Otherwise — CI failing in the PR itself, checks still unconcluded after the CI-wait window (step 2), or a merge conflict needing a scope or content decision (step 5):**
   - Move the ticket to **Blocked**.
   - Set priority **1 (Urgent)**.
   - **Clear the executor, set the vertical's** `operator-<venture>`**, clear the assignee, and comment the escalation category and the question.** Since the `operator` label group became independent of the executor `agent` group (confirmed live 2026-09-03), setting `operator-<venture>` **evicts nothing** — the operator label now sits beside the executor value rather than replacing it. Written the old way, a merge failure routed to the operator would leave `agent:R3-LAY` armed on the ticket and the merge sweep would re-fire on it. So the hold is expressed by removing the `agent`-group value outright: **no executor**, plus `operator-<venture>`, plus **no assignee**, plus a comment naming the escalation category and the one question the operator must answer. A failing check or a conflict needing a scope call is a judgement the operator makes first; set `human` and assign Aled only where the fix needs an account or a lever he alone holds, and Aled is the second hop on age or at the mandate's edge. A ticket carrying **no executor and an** `operator-<venture>` **label is a valid held state**, never an anomaly for a sweep to repair; no executor *and* no operator label remains the anomaly. ("Evict" was the mechanism of the old single-select shape, not a requirement. `convention-linear`, *Executor*; APP-1035; Owner ruling 2026-09-04 on APP-1117, placement APP-1128.)
   - **Mechanically, an** `agent`**-group write is a full** `labels` **replace.** The `agent` group is single-select, so `addLabels` returns a 400 against it and cannot be used to change or clear the executor. To clear it, send the complete `labels` array for the ticket — restating every other label it carries, `operator-<venture>` and the `work:*` and team labels included — and simply omit the `agent:` value. The same applies wherever this leg sets `human` instead: replace the array, never add to it.
   - Add a comment @mentioning the vertical's operator — or Aled where only he can act — in the Owner-facing shape below, that lists:
     - Which checks are failing (by name), or that checks did not conclude in the window, or that a conflict exists
     - The PR link
     - What is needed to unblock
   - Do **not** merge. Do not close the PR. Leave the branch in place.

## Owner-facing comments — decision and action first

Three of this leg's outputs are read by Aled and not by another agent: the **Not-ready** comment, the
**Blocked** comment, and the **Approval pending** ask below. All three follow
`convention-comms-owner`: open with a short block he can act from without opening the PR, the thread
or the diff, and keep the full record beneath it.

- **Decision** — what the leg concluded, in one line, including its recommendation.
- **Action needed** — the one thing that is now his, written literally (*"reply `@relay`, or set
  `agent:R3-LAY` on this ticket"*), or *"nothing beyond your yes"* where the leg carries the rest.
- **Why** — one or two plain sentences, no framework or API names in the opening.

Then the detail as it already stands: the check names, the PR link, the box list, the waivers and the
signals they name, the conflict hunks. The block is a lens onto that record, never a replacement for
it — and it never says something the detail below contradicts.

The merge comments in step 3 are unchanged: a completed merge is a record, not a decision, and its
one-line confirmation is already legible. The `[exec]` / `[qa]` / `Relay —` agent-to-agent markers are
also unchanged — this adds an Owner-facing surface above that record, it does not replace it.
(APP-729: a thorough, correct thread on A1-219 left the Owner unable to tell what was actually his to
do; APP-575: as the fleet does more autonomously his read time is the binding constraint.)

## Approval pending — ask once, do not wait in silence

Where a PR has **everything it needs except the approval signal**, the leg says so, once, and asks.

The precondition is that every mechanical gate this leg owns is already satisfied and re-checked, not
assumed:

- the PR is located and open;
- the expected required checks are **present and concluded** green on the head commit — the
  present-and-concluded check of step 2, not a bare aggregate;
- a **fresh** `mergeable_state` read is `clean` (never `unknown`, never stale by more than a couple
  of minutes);
- every box in both sections is ticked, waived under the bounded waiver, recorded under the
  objectively-verifiable case, or sitting in a recognised post-merge section under the literal
  `## After merge (Owner, manual — not merge gates)` heading, whose boxes this gate does not count;
- there are no unresolved review comments.

With all of that true and only `agent:R3-LAY` missing, do **not** pass over the ticket in silence and
do **not** re-arm a wait. Post one comment in the Owner-facing shape above:

- **Decision** — *"This is ready to merge and I recommend merging it,"* with the one-line risk read
  (what the change touches, and whether it changes behaviour).
- **Action needed** — *"Reply `@relay` on this ticket, or set `agent:R3-LAY` — I will merge on either
  and there is nothing else for you to do."*
- **Why** — the checks that passed and what the diff does, in plain language.

Then: leave the ticket **In Review**, assign Aled if it is unassigned, leave the `agent`-group value
as it stands (a ticket without `agent:R3-LAY` is already in a non-merge lane — the ask does not
re-route it), and continue to the next ticket. The recommendation is a recommendation; the leg does
not act on it.

**Say it once, and say it against a commit.** Mark the comment `[merge] approval pending — HEAD:
<sha>`, the same shape as the QA verdict marker. A later pass that finds the **same head SHA and the
same check state** with the ask already posted adds nothing — do not repeat it, and do not escalate
priority for the passage of time alone. A **new head commit, a changed check conclusion, or a new
review comment** makes it a different question, and the ask is owed again against the new SHA. One
clear ask is a prompt; the same ask every hour is noise, and noise is how a gate stops being read.

**The gate is untouched.** This leg still merges only on `agent:R3-LAY` set by the loop's clean-pass
routing of unflagged work or by Aled's own approval, and it **never sets that label itself** — asking
and answering the same question is exactly the gate it is meant to hold. Nothing here lowers the bar,
shortens the CI-wait, or converts "low risk" into authority. The fix is voice, not authority: the leg
was already forbidden to merge, and was additionally, needlessly, silent.

**Why this is a rule at all.** Silence at a gate reads to the Owner as work in progress, so both
sides wait — he comes back to check on something that has been sitting ready, and the agent re-checks
something only he can release. That is not a slow merge; it is a merge nobody is doing. (Worked case:
`assoc-one/claude-ops` PR #151, 2026-07-21 — CI green, no review comments, `mergeable_state: clean`
throughout, a doc-only correction, re-checked on a 60-minute timer for four hours and merged in
seconds once the Owner finally asked why nobody had asked him. APP-645.) The same shape is what
`convention-comms-owner` names in its escalation rule: never hand the Owner an open-ended wait where
a recommendation is possible.

**What is not this leg's to fix.** The **cadence** of a watching session — how often a subscribed PR
is re-checked, whether a check-in timer re-arms, and when a session should stop watching — is
`routine-delivery-loop`'s sequencing and the PR-subscription conduct of a Claude Code session, not
the merge leg's. This section governs only what the merge leg says when it looks at a merge-ready,
unapproved ticket. Left deliberately unauthored here: the loop's own wait/re-arm behaviour (APP-645,
residual half).

## Guardrails

- Never merges without the `agent:R3-LAY` approval signal on an In Review ticket — set by the loop's
  clean-pass routing of unflagged work, or by Aled's manual approval (see Context for both routes).
- **Never sets `agent:R3-LAY` itself, and never treats its own recommendation as approval.** The leg
  may ask for the signal; it may not supply it. "Low risk", "doc-only" and "clean on every check" are
  reasons to *recommend* a merge, never grounds to perform one (APP-645).
- The loop's autonomous merge applies to **unflagged, clean, unblocked work only**. Flagged work,
  bounce-cap escalations, QA blocks, and merge failures never carry `agent:R3-LAY` — they stop for
  Aled, so the human gate is preserved exactly where it matters.
- **A no-judgement merge never goes to the Owner, and the operator never merges.** Where an
  operator drives its own interactive session and no human-review criterion is met, the merge is
  this leg's. It runs as a Relay subagent on the operator's route to `agent:R3-LAY`, with no
  `@relay` signal asked for (Context; APP-1756). The driver differs, but the route, the gate and
  this leg do not.
- **Never waits in silence on a merge-ready, unapproved PR.** Where every mechanical gate is
  satisfied and only the approval signal is missing, post the ask once — decision, action, why, with
  the recommendation stated — rather than skipping the ticket or re-arming a wait. Mark it
  `[merge] approval pending — HEAD: <sha>` and do not repeat it while the SHA and check state are
  unchanged; a new head commit or a changed check conclusion re-opens the ask (APP-645).
  **Every Owner-facing hold this leg takes carries a dedup key, and the key is the head SHA plus
  what the hold is waiting on.** Approval-pending keys on the SHA and the check state; **Not-ready
  keys on the SHA and the unticked box set** (`[merge] not ready — HEAD: <sha7>`, step 2); the
  red-base refusal keys on the SHA and the blocker's state (APP-1060). A hold with no key is a hold
  that is either re-posted every run or never followed up, with nothing in canon choosing between
  them — so a new hold shape added to this leg carries a key, or it is not finished. Where a key is
  unchanged, the hold is named in the **run report** with its age rather than re-commented on the
  ticket; a Not-ready ask older than three days earns **one** re-ask against the same SHA, then
  silence on that key again (APP-2019).
- **Holds a red-base refusal on the FIX ticket, not the Owner, and tells the blocker once.** A required check red on `main` too is inherited, not this PR's: keep In Review + `R3-LAY`, `blockedBy` the `FIX:` ticket, write once to that blocker naming the held PR and head, and re-ask against the same SHA if the blocker is still unstarted after three days. Every held merge is named in the run report (APP-1060).
- **Writes to the Owner in the Owner's register.** The Not-ready comment, the Blocked comment and the
  approval-pending ask each open with decision / action needed / why, above the technical detail, per
  `convention-comms-owner`. Agent-to-agent markers and the merge confirmation are unchanged
  (APP-729).
- Never force-merges — a merge never proceeds while CI fails, CI does not conclude in the CI-wait
  window, or conflicts stand.
- **A conflict routes by its remedy.** A conflict whose fix is a plain rebase goes back to **Todo +
  `agent:F0-RGE`**, unassigned, carrying the resolution instruction — it is exec's work. Only a
  conflict needing a scope or content decision takes the Blocked path to the Owner. "The loop hit a
  wall" and "a human must clear it" are different claims; the fail-safe must not treat them as one
  (APP-551).
- **Never auto-merges on a false green.** For an autonomous (loop clean-pass) merge, verify the
  expected test suite is actually present and concluded on the head commit, not merely that GitHub's
  aggregate is green with the suite never having run. A missing-but-required suite is a non-passing
  CI state → Blocked path. This guard is what keeps the clean-pass auto-merge safe: a green that
  verified nothing must never ship unattended.
- **Never writes Done without confirming the merge landed — confirm it as a property, not a field.** After the squash-merge call, require `merged: true` from `pull_request_read get` **plus** an independently-shown merge commit on the base branch — the SHA from the `merge_pull_request` response verified via `get_commit` and/or `list_branches`. `pull_request_read get` does **not** return `merge_commit_sha` (absent on two squash merges, APP-846) and `mergeable_state` is `"unknown"` post-merge, so neither is a usable check; reading the guard as a literal non-null field both fails a landed merge falsely and tempts trusting the merge call's own response. A failed or unconfirmed merge takes the Blocked path — never Done. Done is self-concealing: a false Done survives until someone manually re-checks (APP-819, APP-846).
- **Never autonomously merges a head with no matching QA verdict.** The clean-pass `agent:R3-LAY` label is a routing state, not proof of review. An autonomous merge requires a `[qa] HEAD: <sha7>` verdict at the **current** head; a verdict at another SHA, or none, routes back to QA (In Review, `agent:PR-1SM`) — never a merge (APP-832).
- **Never merges on an inherited or stale approval.** The approval signal binds to the PR and head it was set against. A re-land on a new PR or branch, or an advanced head, voids it — re-gate rather than merge. A closed predecessor PR's approval (e.g. #80's) never carries to its re-landed successor (#98); confirm the signal's PR and head match the PR being merged (APP-832).
- **Re-reads mergeability immediately before merging, and never merges on `"unknown"`.** Mergeability is computed asynchronously, so `"unknown"` means *not yet known*, not *probably fine* — merging on it returns `405 ... has merge conflicts`. Take a fresh read right before the merge call whenever the last read was `"unknown"` or more than a couple of minutes old: a `pull_request_read get`, or, with a local checkout, `git merge-tree --write-tree origin/main <branch>` for the conflict half plus the head's check-run and status reads for the check-state half — a substitution, never a skip (APP-582, APP-1079).
- **Classifies a conflict by the two-step local read, not by eye.** `git merge-tree --write-tree
  origin/main <branch>` for the file list — the modern form only, since the 3-argument form
  under-reports by silently auto-merging — then `git merge --no-commit --no-ff` in a worktree to read
  the real markers against the merge-base. Additive or non-competing hunks are mechanical and go back
  to exec; genuinely competing hunks are the Owner's (APP-582).
- **Never merges a PR whose content is already on the base, and never closes one it stranded.** Before an autonomous merge, where a checkout is held, test whether every hand-authored file the PR changes is already byte-identical on the base. If it is, hold the PR in the Not-ready shape with a recommendation to close it as superseded, and do not merge (step 2). After a merge that absorbed another ticket's PR by cherry-pick, comment on that PR once and report it, and never close it (step 3; APP-1631).
- **Read all CI / PR state through the GitHub MCP, never `gh`/curl.** The CI-wait polls
  `mcp__github__pull_request_read` (`get_check_runs`) between `date`-bounded sleeps; a raw `curl`/API
  poll is egress-blocked and silently misreads the 403 body as green (`convention-github`). The
  `gh pr checks --watch` primitive does not exist in this environment — do not reach for it.
- Never merges with an unticked, unwaived box in *either* the `## Acceptance criteria` or
  `## Definition of done` section — the Definition of Done is every box in both sections
  ticked (Pattern A). An unticked box takes the Not-ready path (leave In Review, surface to Aled),
  not the Blocked path.
- **Waives the environment-unverifiable box itself, never the unmet one.** Where a box is
  unverifiable *here* rather than unsatisfied — and an independent signal already covers the
  surface (genuinely-run green CI, a passing visual diff, an identical tested code path) — strike
  it with a one-line reason **naming that signal** and merge. All three conditions in step 2 must
  hold; if any fails the box is unmet and it is the operator's. This is the narrow class only:
  a judgement call about whether an unmet criterion matters is never this leg's to take
  (`convention-ticket` *Waiving a box*; APP-568/APP-555).
- **Names the missing instrument when it waives, and files it before it names it.** A waiver routes
  around an absent runner; it does not replace one. File the repo-lane ticket for the verification
  where it is worth having, and say so in the waiver comment — in that order, citing it by the
  identifier the write returned, because a waiver asserting a follow-up nobody has written reports
  the gap as handled and nothing downstream re-checks it (APP-1285). A box waived repeatedly in one
  repo is that ticket's evidence, not proof the criterion was decorative.
- **Records an objectively-met box; does not route it to Aled.** A box that is true in substance but unticked only because no pre-gate leg may tick it — the standing case `Review verdict posted — Prism's`, evidenced by a `[qa] HEAD: <sha>` comment on the ticket and the PR — is ticked by the merge leg on that evidence and merged: recording a met condition, not waiving, and not a Not-ready divert. Only a box with no such record is unmet — and the same holds for any other box the record settles, including one a clean QA verdict at the live head records as met with its evidence and the CI box against the head's check-run conclusions: recorded and disclosed, never routed to Aled as a set of evidenced boxes, with the brief-side miss named where a QA leg evidenced boxes it did not close. (APP-736, APP-755, APP-2482.)
- Squash only. Done is final. Delivery repos only. `claude-ops` is additionally permitted as a
  merge target for os.Claude (Apps) delivery tickets on the `agent:R3-LAY` approval signal.
  Never touches Pipeline. Never merges `claude-ops` PRs without that signal.
- Branch cleanup is best-effort and idempotent: a branch already removed by GitHub's auto-delete is
  success, and a delete refused by the environment's proxy (403) is a line in the confirmation
  comment, not an error to retry and never a reason to Block. The merge is the outcome; the branch is
  hygiene (APP-528).
- Fresh session each run. All state lives in Linear and GitHub, not the agent.

## Setup

- Runs as the merge leg of `routine-delivery-loop` (Claude Code cloud), and is independently pollable.
- Connectors: Linear + GitHub (Contents: read & write; Pull requests: read & write on delivery repos).
- Repos: delivery repo(s) + the `claude-ops` clone (for skill loading).

On finish, run skill-ops-retro capture on this run's friction: **search the Pulse queue first and add the evidence to a same-root note if one exists, otherwise file a new FRICTION note** for the drain pass to assess, in capture step 3's literal shape — team Apps, project os.Claude, `FRICTION:` title, labels `task` + `work:configuration` + `PUL-5E`, Backlog, unassigned — filing the friction, never the run report.
