# PR pipeline convention ## Contents - [Files](#files) - [Stages](#stages) - [Lanes](#lanes) - [Activities](#activities) - [Patch rules](#patch-rules) - [Slots and order](#slots-and-order) - [Concurrency](#concurrency) - [Outputs and skips](#outputs-and-skips) - [Merge authority](#merge-authority) - [Review-lane holds](#review-lane-holds) - [Trust-root paths](#trust-root-paths) - [Claude Code CLI releases](#claude-code-cli-releases) - [The lane sweep](#the-lane-sweep) - [The monitoring lane](#the-monitoring-lane) - [Write identities](#write-identities) - [Models](#models) - [Funding](#funding) - [Loop caps](#loop-caps) - [Limits](#limits) - [WIP cap](#wip-cap) - [Adoption](#adoption) - [Review threads](#review-threads) - [Red main](#red-main) - [Attended work](#attended-work) - [Branch cleanup](#branch-cleanup) - [Planning lane work](#planning-lane-work) - [Changing this config](#changing-this-config) - [Outside this repository](#outside-this-repository) - [Names](#names) - [Not settled yet](#not-settled-yet) - [Versioning](#versioning) Owner doc for the PR pipeline: the fixed sequence of GitHub Actions lanes a pull request passes through once it is marked ready, until it merges. Local sessions stop at "ready"; the lanes run the rest and a human steps in only where a lane escalates or a rung requires it. This doc fixes the shape every PR-side lane builds on. Each lane's mechanics live in its workflow and the skills it calls, not here. The loop-lane convention ([`loop-lane`](../../contracts/loop-lane/README.md)) governs local loop sessions; this convention governs CI lanes. Holds, escalation and work classes stay owned by loop-lane and the autonomy plugin, and this doc points at them. ## Files | File | Holds | |---|---| | `README.md` | This contract. No config values. | | `pr-pipeline.schema.json` | Schema for a repository's pipeline config. | | `examples/` | Worked configs that show the shape. Script paths in them are placeholders until their lanes land. | | `CHANGELOG.md` | Contract versions, written by the release pull request from fragments under `.changes/pr-pipeline/`. | A repository's config lives at `docs/conventions/pr-pipeline.yaml` unless the lane passes another path as the config reader's `config-path` input. The reader reads that path at the base SHA; it must be relative with no `..`, have the basename `pr-pipeline.yaml`, and sit outside `.github/actions/**`. Config values live only in that YAML file; agent instructions live only in Markdown. ## Stages A PR moves through these stages in order. Stages are named, never numbered, so a new stage needs no renumbering. | Stage | What happens | Starts on | |---|---|---| | `intake` | Issues are triaged into work items. | issue events | | `work` | An agent works one issue a person labeled `agent-ready` to a PR opened ready, or hands it back ([Issue mode](pr-run-activity.md#issue-mode)). | the `agent-ready` label | | `pre-ready` | The implementer writes the change and may push draft checkpoints at any time. Local today; the design assumes no particular implementer. | the implementer | | `refine` | Behavior-preserving changes that make the PR review-ready: simplify, tidy, docs and format fixes. One push at the end. | ready (or opened ready) | | `verify` | Checks, reviews and outcome verification on the refined commit. Mechanical and judgment lanes start together; a failed mechanical gate cancels the running judgment lanes, and `pr-require-checks` aggregates the results into `ci-status`. | dispatch from `refine` | | `unblock` | Take the action that unblocks a PR: resolve conflicts with the base branch, fix failing CI, address review feedback, review a Dependabot update, or sync shared copies. | see [Lanes](#lanes) | | `merge` | Merge, within the configured rung. | final check green, or a hold removed | | `post-merge` | Verify the default branch and sweep late comments into issues. | push to the default branch | `maintenance` and `upstream` are scheduled producers, not steps in a PR's path. They file work into `intake`. An answered issue re-enters `intake` through [`intake-reenter.yml`](../../../.github/workflows/intake-reenter.yml), a scripted workflow with no model. On a new comment on an open issue, not a pull request, it acts on a `needs-owner-decision` issue whose comment is a decision (first line `**Decision recorded.**`, by a human on the trusted-actors list, not posted through an App, unedited or last edited by a listed human) or a `status: confirmed` issue with no other `status:` label and no `agent-ready` whose comment is such a decision, whether admission parked it there or a person confirmed it, or on a `needs-reporter-info` issue whose comment is by the issue's author or a listed human. It removes that status label and adds `needs-triage`. A decision on an issue that carries `needs-human` changes nothing; a listed human's removal of `needs-human` re-enters an issue with no `status:` label or at `needs-owner-decision`, removing that label the same way. A listed human's change of the Work status field from a hold state to none or `needs-triage`, on an issue with no status label but `needs-triage`, re-enters it too, writing no label: the claim is a comment marked with the field event that left the hold, which a re-run of that release finds, and the field is set to `needs-triage` before the dispatch when the release left it empty. It dispatches `intake-triage.yml` once only when the issue's author is one intake admits on open (a listed human or the lanes App); any other issue waits in `needs-triage` for a person, so an outside author cannot start a model run with each reply. A dispatch skips the born-triaged check. Removing the status label is the claim, so a second answer dispatches nothing. A blocker stops blocking once it is a pull request merged in this repository, or an issue closed, for any reason, by a listed human or, in this repository only, a merge (owner decision Q95, `blockerDone` in `.github/scripts/intake-triage/admit.mjs`): the lanes follow that rule, not the work-items tracker's `blocked_by_count`, which still counts a won't-do close. When a blocker of an issue admission parked at `status: confirmed` closes after it parked, `work-unblock` removes that label with the lanes App's token instead of admitting the issue, and that removal starts this workflow, which adds `needs-triage` and dispatches on the same author rule. It acts only when the newest removal is the App's and the issue carries no `status:` label, `agent-ready`, `needs-human`, `needs-triage` or `admission-deferred`, which leaves out every other App removal; `needs-triage` is the claim there, and a failed dispatch leaves the issue with no `status:` label for a re-run or the triage sweep. A milestone in `admission-rules.json`'s `cordoned-milestones` keeps an issue parked. It never adds `agent-ready`, and it holds the job's own `GITHUB_TOKEN` (`actions: write`, `contents: read`, `issues: write`), never a lanes App token. Anyone outside the organization who writes on an issue or pull request is flagged for a person by [`intake-label-outside-actor-activity.yml`](../../../.github/workflows/intake-label-outside-actor-activity.yml), a scripted workflow with no model, secret or kill switch. It runs on an issue or pull request opened, edited or reopened, a pull request synchronized (`pull_request_target` for a pull request), on a comment, review or diff comment created, submitted or edited, and on `security: outside-actor` removed from an issue or pull request. A label-outside-actor job starts only when the sender is not a Bot (an App installed here), or the event is on a pull request whose head is a fork (an App on the fork can act there), and either the content's author is neither `OWNER` nor `MEMBER` or the event is an edit, push or reopen by someone other than the author, which judges the sender. The run then trusts the actor only by numeric id on the default branch's trusted-actor list, and an unreadable list flags. An outside actor's item always gets `security: outside-actor` and `needs-human` written, and one comment per actor names the login, without a mention, and the event, quoting none of their text. `security: outside-actor` is a hold of its own (`merge-holds.mjs` `OUTSIDE_ACTOR_LABEL`): the merge queue, auto-merge arming, the babysit merge gate, ci-status, intake triage, the work-unblock sweep and every pull request activity (its `labels-absent`, which the write runner holds too) skip it, and `clear-escalations.mjs` keeps `needs-human` on an item carrying it. Only a person on the trusted list removes it: when anyone else removes it (any letter case of the name), the run puts both labels back and posts one comment naming the remover, without a mention. The job holds the job's own `GITHUB_TOKEN` (`contents: read`, `issues: write`, `pull-requests: write`). A review or diff comment on a fork pull request gets a read-only token and is not flagged; the fork pull request itself is flagged when it opens. Pipeline lanes skip draft PRs; `ci-status` still reports on them, and passes the skipped lanes. The `ready_for_review` run tests the head, and the merge queue re-runs every lane before a merge. Converting a PR back to draft cancels every running pipeline lane for it. ### Refine before review A PR's path, in order: build, refine, review, fix, verify, merge. Build is `work` or `pre-ready`; review is the AI review lanes; fix is `unblock` (fixing CI, addressing review feedback); verify and merge are their stages. `pr-refine.yml` runs the Refine passes. Its `select-passes` job lists the PR's changed files and picks each activity with `stage: refine` whose `applies-when` `paths` match a changed file that no `paths-ignore` glob matches, so a changelog fragment alone (`.changes/**`) starts no `fix-docs`. Adding a pass is an activity entry with `stage: refine`, its globs, an `order` and a `group`, and its jobs in `pr-refine.yml`. The plan also outputs `batches`: in `order`, a pass joins the batch before it when it is not `serial`, shares that batch's `group`, and matched none of the batch's files; otherwise it starts a new batch. No job reads `batches` yet, so every planned pass starts at once; a second pass's first job must also wait on the batch before it. A PR that matches no pass ends the run at the plan, every later job skipped and no model turn. The plan reads the lane's slots as the runner's config reader expands them, so a disabled slot or a slot's own `applies-when` counts, and a pass taking `changed-paths` needs a file left after instruction surfaces and owned paths are dropped. A changed-files list the plan cannot read holds: no pass runs and `fix-docs-head-held` logs a `PR head hold` notice; a plan that fails logs `refine-failed` for `pass=plan`. Each job has a `timeout-minutes`, its own or its reusable workflow's input. #### Signals | Signal | Means | |---|---| | A push to a branch | Work in progress. | | A non-draft PR | The author is done. | | A `refine-pass` notice per pass in `pr-refine`'s `record-passes` job: `pass= files= outcome= seconds=` | What each pass did, and how long since the plan started. A failed pass also logs a `refine-failed` warning, which [signal 13](#the-monitoring-lane) counts as a `pr-refine` hold. | | Refine complete | The signal review starts on. Each hosted review run's `wait-for-refine` job (`.github/scripts/pr-review/wait-refine.mjs`) waits up to 40 minutes for the `pr-refine` run that this head's `pr-unblock-dispatch.yml` `refine` job dispatched, inside the review's own `pull_request` run, since ci-status reads only those. A head that moved meanwhile, by Refine's push or another, is not reviewed: that push starts the new head's review. Any other outcome reviews: no dispatch, a Refine that failed or ran past the cap, or a read that failed. | ## Lanes A lane is one workflow with one model job; scripted jobs beside it report its check runs. The lane name is its workflow file stem, and the lane never does another lane's job. Each activity runs through one of two shared runners: [`pr-run-activity-read.yml`](../../../.github/workflows/pr-run-activity-read.yml) for a `read` effect, with no App key and no OIDC token in the job that runs head code, after a separate job asks the lanes token broker whether the lane may run, and [`pr-run-activity-write.yml`](../../../.github/workflows/pr-run-activity-write.yml) for any other effect, which gets its effect-scoped App token from the lanes token broker before any head checkout. No workflow holds the App key. Their job contract is [`pr-run-activity.md`](pr-run-activity.md). Each lane's stage, the effects and gating it may not use, and what it never does are in [`lane-rules.json`](../../../.github/actions/resolve-config/lane-rules.json), which the config reader applies. | Lane | Starts on | |---|---| | `pr-refine` | a `fix-docs` dispatch from `pr-unblock-dispatch.yml`'s `refine` job, on the PR's own `pull_request_target` event (opened, reopened, ready for review or pushed), for each ready PR that changes Markdown, never had `fix-docs` and is not a `work-resolve-issue` PR tidied in its own run (within the tidy cutoffs), or a trusted human's dispatch; a push to the default branch or the dispatcher's half-hourly tick starts none, and `limits.fix-docs-per-run: 0` turns the dispatches off; on a listed human's event (never the lanes App's) the same job also dispatches each activity `refine-dispatch.activities` lists, from the allowlist in `refine-event-dispatch.mjs` (`fix-marker`), empty by default | | `pr-run-checks` | dispatch from `pr-refine` | | `pr-review`, `pr-review-security` | the PR's own `pull_request` run on a ready head (`pr-review-hosted.yml`, `pr-review-security-hosted.yml`), whose `wait-for-refine` job first waits for this head's `pr-refine` run | | `pr-verify` | `workflow_run` on the completion of a successful, or hold-only, `pr-require-checks` run of a same-repository, non-draft PR ([Verifier verdict](#verifier-verdict)) | | `pr-explain` | dispatch from `pr-refine`, alongside verify | | `pr-require-checks` | each verify result | | `pr-unblock` | a dispatch for each conflicting PR but a Dependabot head (Dependabot rebases its own), each unreviewed review-tier Dependabot PR, and each failing lanes App PR after a push to the default branch or at the dispatcher's half-hourly tick, a dispatch after a review lane finishes on a lanes App PR with an open reviewer-bot thread, a dispatch at the half-hourly tick for a fix request on such a thread, or a trusted human's dispatch | | `pr-merge` | final check green, or a hold removed | | `work-unblock` | an issue closing, by a listed human, and an hourly sweep of the issues a listed human or a merge (a merged PR or a commit) closed in the last three hours (catching PR merges a bot ran; a sweep whose closed-issue listing fails holds green, and the next one reads back past it), which each finished `work-resolve-issue` run that ran a job also starts, so a freed slot admits the next deferred issue at once; labels `agent-ready` on each issue it blocked that is now unblocked, unheld and owner-ratified; the label starts `work-resolve-issue`. The sweep also restarts or re-fires stopped issue runs (one a merged `Refs:` pull request names after its newest decision comment goes to triage instead) and relabels a red-main fix issue a repeat failure reopened | | `post-merge-verify` | push to the default branch | | `post-merge-sweep-comments` | push to the default branch | `pr-unblock`'s dispatches come from `pr-unblock-dispatch.yml`, a scripted workflow with no model that runs on a push to `main`, half-hourly five minutes after each lost-run reconciler tick, and on a trusted human's `workflow_dispatch`: - It lists open, non-draft, same-repository PRs into `main` that GitHub reports as `CONFLICTING`, re-querying an `UNKNOWN` PR up to 5 times, 10 s apart. - It skips a held PR without recording it: `do-not-merge`, or the human-gated label unless another lane's escalation put it on (below). The next run after the hold comes off picks it up. - It skips a PR whose head already has a `pr-unblock / resolve-conflicts` check run from the GitHub Actions app, unless that run is a neutral `Skipped: untrusted-trigger`, or a `Skipped: awaiting-human` (a skip while held), a limit stop past its reset or a failure, until `limits.limit-stops-per-head` of those last three stand on the head. A limit stop is a run whose lane-outcome record's `class` is `rate-limit` or `auth` (a refused credential); until it resets the dispatcher logs a notice naming the class and the reset time. - It dispatches `pr-unblock.yml` on `refs/heads/main` for at most 3 PRs per run, lowest number first, passing `pr-number` and `dispatcher-run-id`. - A read that fails holds, whatever GitHub answered. A listing it cannot read dispatches nothing, and a PR whose holds or check runs it cannot read is skipped, each with a warning, and the next tick reads them again. This holds for every dispatch the run sends, the ones below included, with one exception: `fix-ci` dispatches under its caps when it cannot read its required run or the head's check runs for a reason other than a `5xx` or a rate limit, or when the verifier reader fails. A failed read does not fail the run. A dispatch that failed or named no run id, config the run cannot read, or a rate limit (the shared rate guard fails the step) still does. - A hand run or a re-run must be started by a listed human (`check-trusted-trigger` with `require-pr: false` and `require-kind: human`). That mode handles no `schedule` event, so a re-run of a scheduled run fails; the next tick replaces it. - With the kill switch on, the run ends green with a notice and dispatches nothing. In `pr-unblock.yml` no model holds a write token or runs git: `resolve-conflicts-select` (base code only, read-only token) merges the default branch tip into the head and decides clean, conflicted or escalate, and posts the `resolve-conflicts` check neutral when no model is needed; `resolve-conflicts` (a `read` skill in [patch output mode](pr-run-activity.md#patch-output-mode), on run-claude-cli with the subscription fallback) resolves a conflicted merge from read-only context files with no shell; and `apply-conflict-patch` (a script, `mutate-branch`) commits the merge with the head and the pinned base as parents ([`pr-run-activity.md`](pr-run-activity.md#prepare-merge-base)). A trusted human may also dispatch `resolve-conflicts` for a PR GitHub reports as mergeable, to merge the default branch into a head whose stale base breaks a required check. The select job merges it the same way when the head is behind, and skips one that already holds the default branch tip, posting no check, so the dispatcher can still take that head if it later conflicts. The dispatcher itself still sends only `CONFLICTING` PRs. A PR whose base is not the default branch (a stacked layer) skips `not-applicable`, clean or conflicting, since every job merges the default branch tip. GitHub starts no `pull_request` workflow on a PR with a merge conflict, so a conflicted head gets no CI. When `resolve-conflicts` stops on a reason routed to a failing status (below), `pr-unblock.yml`'s `report-stop-status` job (a script job with no model, the lane's only `statuses: write`, on its own `GITHUB_TOKEN`) posts a `failure` commit status with context `pr-unblock/conflict` on that head; for `unresolved-conflict` it says CI does not run until the conflicts are resolved. A push that resolves them is a new head, which the status does not reach. A conflict that clears with the head unchanged (main moved again) leaves the failing status on it until a push or a person replaces it. An `address-feedback` or `fix-ci` failing status stays too when a person resolves the threads or gets the checks green on that head: a `pr-unblock` dispatch of that activity then finds the cause gone and clears it. On a lanes App pull request the dispatchers start that run themselves, once per stop: `pr-dispatch-feedback.yml`'s sweep for an `address-feedback` stop with no unresolved thread left (`sweepStale`), and `pr-unblock-dispatch.yml` for a `fix-ci` stop whose head's checks all pass (`staleStop`). On any other pull request a person dispatches it. `pr-unblock`'s `address-feedback` dispatches come from `pr-dispatch-feedback.yml`, also scripted, on `workflow_run` `completed` of `pr-review-hosted` and `pr-review-security-hosted`. It takes only the upstream run id from the event and reads the rest back. It dispatches `pr-unblock.yml` with `activity: address-feedback` when the upstream is a `pull_request` run of one of those two paths in this repository, exactly one open non-draft PR into `main` has its head, the lanes App or an [adopted owner](#owner-pull-requests) opened that PR, it carries no `do-not-merge`, both lanes' newest reviewed-head markers name the head, an unresolved thread exists that `address-feedback` would keep (left only by the reviewer bot, one the lane never answered where a fix request, below, follows the reviewer bot's finding or sits in a thread a trusted person opened, or answered by a trusted human after the lane escalated it; on a PR carrying the human-gated label, only one whose answer is a fix request, unless a lane escalation put the label on: the lanes App added it last, its `work-items:escalation lane=pr-unblock` comment (pr-unblock or fix-ci) followed within a minute, no other marker is on its comments since, no review-lane `claude-lane-hold` names the current head or is open, and no `check-signed-commits` hold is open, per `.github/scripts/pr-unblock/gate-source.mjs`; anything ambiguous keeps the fix-request rule, and the label stays on, and `clear-escalations.mjs` removes it only while no address-feedback round record is on the lanes App's comments since it went on; to stop the lane working such a PR, a person adds `do-not-merge`, since re-adding a label already on records no event), the head has no `pr-unblock / address-feedback` check run (one that started before the head's newest `pr-unblock / publish-feedback` check run stops counting when that run skipped `no-model-turn` (the round handled nothing) or `finding-stands` (it left a finding standing at that head), and the round cap still bounds the retries; a limit stop keeps its reset hold and counts toward `limit-stops-per-head`; since such a head may see no later review, each scheduled `pr-unblock-dispatch.yml` run's completion also starts a sweep that decides each such head as for its newest completed review run, under three such skips at that head, and sends up to five rounds a tick (`SWEEP_TICK_CAP`) once every decision is made, each PR at most once), and no `pr-unblock.yml` run titled `pr-unblock address-feedback #` is still queued or going (both lanes finishing at once). Then it runs the base's resolve-config for that PR and head with `address-feedback` selected, so only that slot's `applies-when` is decided, and dispatches only when the `pr-unblock` lane and its `address-feedback` and `publish-feedback` slots are enabled and `address-feedback` applies. It records `pr-feedback-dispatched--`, which the gate and the broker read to tie the run to a review of the PR's current head. It also runs on `workflow_run` `completed` of `pr-review-comment-relay`, which a person's new review comment on a lane branch starts (`pull_request_review_comment` `created`, no permission, no checkout, no secret). It reads the relay run back and dispatches as above, with the relay run as the upstream the record names, only when the run succeeded, its actor and re-runner are both listed humans (never the lanes App), its `pull_requests` name the PR, and an unresolved thread the lane escalated was answered by a listed human (a fix request alone keeps the tick's sweep); only check runs started after the relay run count. The gate and the broker accept that upstream by path, event and actor id ([ADR 0088](../../adr/0088-relay-a-listed-humans-review-comment-to-the-feedback-dispatcher.md)). GitHub starts no such run on a conflicted PR; that reply is picked up by the review run after `resolve-conflicts` pushes. It also runs on `workflow_run` `completed` of `pr-verify`. When that run of `pr-verify.yml` on `main` uploaded a `fail` verdict, its `post-verify-notes` job (a base job with no model, holding `pull-requests: write`) posts the verdict's summary and notes on a lanes App PR as file-level review comments by `github-actions[bot]`, each starting ``, on the head the verdict judged (`.github/scripts/pr-unblock/verify-notes.mjs`). It posts only on an open PR still at that head, and only the comments that head does not hold yet, by file; a note in a resolved thread does not count, so a FAIL after a pass that superseded an earlier one at the same head opens a thread again. A PR a person opened gets no review comment: GitHub lets only a PR's author or a writer resolve a thread, the lanes App is neither, and every conversation must be resolved to merge. It gets one PR comment instead, starting with the same marker and edited in place on a later fail, and the `pr-verify-failed` label, which `ci-status` holds in the merge queue. No round starts there. A withheld fail (a verdict whose text is shaped like a credential, or whose step stopped on the credential scan, which `write-verdict.mjs` alone records as `withheld: true`) also holds for a person, and no fix round works past it, since a later clean commit rotates nothing: at whatever head the PR has moved to, and in any state, so a closed PR that reopens stays held, it takes the human-gated label and, once per head, a comment with a `security` stop reason, and an open PR leaves the merge queue. That comment keeps the label through every clear path (`clear-escalations`, `enable-auto-merge`'s lift, `ci-status`'s cost-hold clear) until a person removes the label. A failure in the hold still posts the notes, then fails the job. A note that starts with a path the PR changes goes on that file; the summary and the other notes go on the first such file, or on the PR's first changed file. `address-feedback` keeps such a thread as the `verifier`'s finding, as it keeps the reviewer bot's, when its review is `github-actions[bot]`'s on a head the reviewed-head markers name. The dispatch job then decides as above, with the newest completed review run at that head as the upstream it records, except that only `pr-unblock / address-feedback` check runs started after the `pr-verify` run was created count, and the head's handled record is not read, since the notes are new work at a head an earlier round may have handled; with none yet, the review run dispatches when it completes. The fix round's push gives a head the verifier judges again. When the run uploaded a `pass` or `pass-notes` verdict instead, on an open PR still at that head `post-verify-notes` removes `pr-verify-failed` from a PR a person opened, if it is there, and dispatches nothing. On a lanes App PR it posts and resolves nothing: it reads the review threads, and when an unresolved fail-note thread is open (`address-feedback.mjs` `staleVerifyNotes`, by the first comment's original commit) it names the head in `pass-head-sha`. The dispatch job then sends a pass-only round (input `verify-pass-head`), needing no workable thread, review marker or check-run room, and not held by a round for the PR in progress: `pr-unblock.yml`'s per-PR concurrency group queues it behind that round. A round waiting to start still holds it, since the group keeps one waiting run and sending would cancel that round. When the merge gate's reader, in the dispatch job's FAIL-cap read, reports the FAIL at that head superseded (`babysit_verify_evidence.py` `supersededAtHead`, the gate's own `_superseded` judgment), the dispatch also names the head in `verify-superseded-head`. `address-feedback-select` lists in `run.json`'s `stale_notes` the threads from another head, and those at the passing head only with `verify-superseded-head` at it (then naming it in `superseded_head`); a failed or missing read leaves those open. No model job or neutral check runs, and `publish-feedback` resolves each one still open and stale while the PR head is the passing one, as the lanes App, with no reply and no round marker, and skips `pass-only`, which the dispatcher's release reads pass over. A pass-only round goes only to lanes App PRs; other address-feedback rounds also go to adopted owner PRs ([Owner pull requests](#owner-pull-requests)). Resolving a thread takes more than the `post-verify-notes` token holds, so that job never resolves one. When the gate's reader refuses a lanes App PR's head `verify:earlier-fail` (a FAIL at another head of the same change), its report's `earlierFails` names the FAILed heads, and the dispatcher sends a model round with them in `verify-earlier-fail-heads`, even with no unresolved thread. When no thread is left to work, `address-feedback-select` (with `actions: read`) reads those FAILs' notes from their verdict artifacts (`earlier-fail-notes.mjs`: the head's FAIL index, a run the gate counts, `verify-notes.mjs` `readVerdict` and `noteComments`) into `threads.json`'s `verify_notes`; a read that fails stops `feedback-verdict-unreadable`. The model fixes each note or reports it `already-addressed`; `publish-feedback` posts nothing for them. A push fixing a named note ends as any fix round; no push with every note already addressed stops `feedback-already-addressed` for a session builder. In `pr-unblock.yml`, `address-feedback-select` (a base job with no model and a read-only token) keeps the threads, `address-feedback` (the model job, `read`, on the read runner with a subscription fallback) answers them and hands on a patch and its replies, `apply-feedback-patch` (a script job with no model, `mutate-branch`) pushes the patch, and `publish-feedback` (a script job with no model, `publish-artifact`) posts the replies, naming the pushed commit ([`pr-run-activity.md`](pr-run-activity.md#prepare-review-threads)). It re-reads each thread against the reviewed heads the select job recorded in `run.json`, since a review lane edits its one marker in place when it reviews the pushed fix. `publish-feedback` also brings the body sections a landed fix made stale up to date, unless the base's `pr_body_refresh` is `false`: the select job offers the `##` sections the base's `pr_body_required_sections` lists (every one when it lists none) whose text holds no gate-read line, never `## Follow-ups` or the body's last section, and pins each by SHA-256 in `run.json`; the model job records replacement text with the review-thread tool; and `publish-feedback` puts it in place of an offered section still unchanged, leaving every other byte, or drops the refresh alone, naming why in its log and round marker, when any text holds a line a gate reads or the body's gate-read lines would change. Its body writes are those sections and its `## Follow-ups` entries. `fix-ci` rewrites no body section; an attended session does ([`monitor.md`](../../../plugins/source-control/skills/pull-request/reference/monitor.md) §3.3.2 step 5). ### Outage posture Every lane pauses and resumes through an outage by these six elements (#9205, owner decision Q677). [The outage posture audit](../../outage-posture-audit.md) records each lane's verdicts. 1. **Retries.** Scripts retry and the model never does. Each call gets at most 3 attempts. A script waits for `retry-after` when the header is present. For a primary rate limit it waits until `x-ratelimit-reset`, and for a secondary limit at least 60 s. Otherwise it uses capped exponential backoff with full jitter. A wait longer than a small per-step budget counts as unknown under element 2 instead of a sleep. Non-idempotent writes are never retried. 2. **Unknown holds.** A failed read, or a 200 whose completeness check fails, makes the verdict unknown. The lane then holds, files nothing, merges nothing, and exits green with a notice. 3. **Next tick probes.** The next existing cron tick is the probe. There is no stored breaker, no re-arm and no status-page trigger (element 5). 4. **Positive evidence.** A lane demotes or files a failure only on positive evidence from a complete read. When a later complete read contradicts a record the lane filed, the lane closes it. 5. **Status page.** The GitHub status page may stop work but never starts it. A lane may idle while the page lists an Actions outage, and it resumes only when the page is green and its own reads succeed. The page never opens or closes a record, and a hold notice may quote it as context (owner decision, #12292). 6. **No extra load.** Reads are serial and repeated polls send conditional requests (`etag`). Scheduled lanes keep the default single-pending concurrency. Optional work is skipped while the state is unknown, and other lanes stay off minute 0. ### Owner pull requests Agent sessions answer review threads under the owner's login, so on a PR the owner opened a lane answer cannot be told apart from the person's, and the babysit worker tier, which resolves only threads a lane login answered, resolves none of them (#10763). `address-feedback` therefore also serves an adopted owner PR, posting its replies as the lanes App: - Who: a PR whose author is a `kind: human` id on the base's trusted-actors list, typed `User`, under an [`adoption`](#adoption) section (`feedback-dispatch.mjs` `ownerAuthored`). Without that section, or for anyone else, nothing changes: the dispatch skips the PR. - When: as fix-ci adopts one, no body line starts `Hold:`, and both the PR's last update and its head commit's committer date are at least `adoption.idle-hours` old (`ownerSkip`), so the lane never pushes onto a branch a session is still working on. A review usually finishes while the session is active, so that dispatch skips; each scheduled tick's sweep then sends each idle owner PR, within its cap, whose reviewed head has no `pr-unblock / address-feedback` check run (`sweepIdleOwner`), deciding it as for its newest completed review run. It decides such a head only within `IDLE_OWNER_WINDOW_HOURS` of the PR turning idle, so a head with nothing for the lane is not re-read every tick; any new update opens the window again. A head whose round stopped with a failing `pr-unblock/address-feedback` status, and no thread left, is dispatched to clear it, as for a lanes App PR, under the same `Hold:` and idle gates. The select job reads the body again when the round starts and skips `awaiting-human` on a `Hold:` line added after dispatch. - Human gate: a lane escalation's human-gated label lets the round work only as it lets fix-ci work the PR (`gate-source.mjs` `prHold`): not after an `address-feedback` escalation, and not once a person commented or reviewed after the label went on. Held, the round works only a thread a trusted person with write access asked the lane to fix. On a lanes App PR a lane escalation's label lets the round work. - What: the round is the App PR round, unchanged: the same threads (only the reviewer bot's, a listed review bot's, or a lane's, under the same trusted-person rules), the same CRITICAL and security holds, the same `apply-feedback-patch` push under the same patch rules, and no merge. A thread a person wrote without a fix request, answered without one, or directed still goes to that person; on an owner PR such a thread starts no round, and the select job skips it with no stop instead of escalating `feedback-untaken-threads`. - Resolve: GitHub lets only a PR's author or a writer resolve its threads, so `publish-feedback` (`publish-artifact`, no writer) posts each answer and leaves the thread open, logging it. The `resolve-feedback-threads` job after it, a script with no model and `checkout: base` (no PR head checkout), holds `mutate-branch` (`contents: write`, which makes it a writer) and resolves, on a PR a person on the trusted-actors list opened, each thread whose comments are all a review bot's or the lanes App's, whose finding no reviewer comment rates CRITICAL and an adjudicator could judge (`adjudicable`: no person-decided security finding), and that is answered (the lane's VALID reply or a `finding-answered` adjudication is its last comment) or outdated with no lane reply that left it open (`resolve-threads.mjs`). It reads the threads from GitHub, never from another job, judges each again on its re-read comments just before resolving, and escalates nothing. It runs after an acted round and after the reply script's own stops (an escalation, `finding-stands`, `no-model-turn`), never after a kill-switch or gate skip, and starts no job (so asks the broker for no token) on a PR no listed person opened (the select job's `person-opened`) or on a round whose upstream is a relayed person's reply (the dispatch's `upstream-relay`), where it has no thread to resolve. A CRITICAL finding and any thread a person wrote or joined stay open for the person. - No pass-only round goes to an owner PR: a person-opened PR gets no fail-note threads (`verify-notes.mjs`). The push is the power fix-ci already holds on an adopted PR, under the same idle rule; the one grant the lane gains is `resolve-feedback-threads`' `mutate-branch`, used only to resolve. The reviewer bot is `claude[bot]`, a review bot listed in [`review-threads`](#review-threads), or `github-actions[bot]` on a comment whose last non-blank line is a review lane's `claude-lane: ` footer, as ci-workflows' `pr-review-cli.yml` posts its findings; the review holding the thread's first comment must be that comment's author's own. A fix request is a reply by a person on the trusted-actor list who holds write or admin permission on the repository, never edited, or last edited by a person on that list, with a line that starts with `PR-fix lane: please fix this finding`, in any letter case, outside a fenced code block (a quoted `>` line never matches). On a thread the lanes App never commented on, one fix request after the reviewer bot's finding makes the thread one `address-feedback` works, as long as every other comment is the reviewer bot's or a trusted person's; their comments from the first fix request on are direction. A thread such a person opened is worked the same way: their own fix request in it, first comment or a later one, asks the lane to fix what it names (a failing check, say, on a PR no review bot commented on), so the lane works it instead of stopping with `feedback-untaken-threads`. A thread anyone else opened, or one without a fix request, is left alone. Such a thread, and one a trusted person answered after the lane escalated it, is worked even when its review is on an earlier head than the one the reviewed-head markers name. On a lanes App PR, the next half-hourly tick picks up a fix request on an unresolved thread the reviewer bot opened: each scheduled `pr-unblock-dispatch.yml` run's completion starts `pr-dispatch-feedback.yml`, whose sweep decides each such head ahead of the heads it retries, within its cap of five a tick. The request must be newer than the head's newest `pr-unblock / address-feedback` check run; check runs that started before it stop counting for that dispatch, except a limit stop, which keeps its reset hold. Each request is sent once, a head with three rounds or releasing skips is not sent, and `dispatchFeedback` re-checks every other condition. This sweep does not take a fix request in a thread a trusted person opened or on an owner PR. To start a round at once, an account on the trusted-actor list dispatches the lane directly: ```bash gh workflow run pr-unblock.yml -R melodic-software/claude-code-plugins -f pr-number= -f activity=address-feedback ``` That run names no dispatcher run, so the gate checks that account as the actor, and the select step judges the threads as above. A lane escalation's human-gated label does not stop the other fixers that could clear its cause. `resolve-conflicts`, `fix-ci` and `fix-docs` work a PR carrying the label when `gate-source.mjs` reads it as a lane escalation (the conditions below), no person has commented, reviewed or replied in a review thread since the label went on (they may want the lanes to wait; GitHub's timeline shows no reply inside an existing review thread, so the PR's review comments and reviews are read too, and a failed read holds it), and no escalation since then names a reason of the activity's own, read from the `- Reason:` line `report-escalation.sh` writes (`ci-fix-*` is `fix-ci`'s, `feedback-*` `address-feedback`'s, `dependency-*` `review-dependency`'s, any other `resolve-conflicts`'s). Their dispatchers and base-code jobs (`resolve-conflicts-select` and `pr-refine.yml`'s `fix-docs-head` through `lane-hold.mjs`, `fix-ci-context`) read it; anything else, a person's label included, holds the PR as `awaiting-human`, and `do-not-merge` holds it in their `labels-absent`. `check-signed-commits`' escalation holds the PR too, even under a lane escalation: a `github-actions[bot]` comment whose first line is ``, written or edited since the label was last removed, holds `resolve-conflicts`, `fix-ci` and `fix-docs`, leaves `address-feedback` to the fix-request rule above, and keeps `clear-escalations.mjs` from removing the label; the same marker from any other account is not read. When they work past the label, the write runner lifts only the human-gated hold for that push. That verdict is read once, before the model turn: a person who comments, or a hold that lands, while the run works does not stop that run's push (the next dispatch reads it), and `do-not-merge` still does. The label stays on, and `pr-merge` refuses the PR until it comes off. On a PR carrying the human-gated role label (`needs-human` unless the base's tracker binding in `docs/conventions/work-items.yaml` names another), `address-feedback` works a thread only when it carries a fix request, after the lane's escalation when there is one. Without such a thread the dispatcher starts nothing and the select step skips with `awaiting-human`, so the PR stays held; with one, the write runner lifts only the human-gated hold for that run, and `do-not-merge` still stops it. `pr-merge` refuses the PR either way. `pr-unblock`'s `review-dependency` dispatches come from the same `pr-unblock-dispatch.yml` run, so the gate and the broker check them as they check a conflict dispatch. After the conflict dispatches it lists open, non-draft, same-repository Dependabot PRs into `main`, sorts each with `dependency-classify.mjs`, and dispatches `pr-unblock.yml` with `activity: review-dependency` for at most 2 `review`-tier PRs per run whose head has no `pr-unblock / review-dependency` check run from the GitHub Actions app (the untrusted-trigger skip aside; one that started before the head's newest `pr-unblock / apply-dependency-verdict` check run stops counting when that run skipped `no-model-turn`, unless it is a limit stop, and the round cap still bounds the retries). Their run ids join the same dispatched-runs record. A push to `main`, the half-hourly tick or a hand run wakes it. In `pr-unblock.yml`, no model holds a write token: `review-dependency-select` (base code only, read-only token) selects the pull request or posts its check neutral; `review-dependency` (a `read` skill in [patch output mode](pr-run-activity.md#patch-output-mode), on run-claude-cli with the subscription fallback) returns its verdict as structured output and leaves a fix as a patch; `apply-dependency-patch` (a script, `mutate-branch`) pushes that patch only on a scanned `fix` verdict; and `apply-dependency-verdict` (a script, `publish-artifact`) acts on the verdict and never merges; the pr-merge lane merges on its `verdict=merge` marker at the current head ([`pr-run-activity.md`](pr-run-activity.md#prepare-dependency-review); [ADR 0074](../../adr/0074-review-risky-dependabot-updates-in-a-model-job-and-act-in-a-scripted-job.md)). When the head's `package.json` approves the `@anthropic-ai/claude-code` install script (`allowScripts`) for a version other than the one its `package-lock.json` installs, `review-dependency-select` writes the patch that moves that one pin to the lockfile's version, when it is also the exact version the manifest pins, instead of a model turn ([`install-script-pin.mjs`](../../../.github/scripts/pr-unblock/install-script-pin.mjs)), and `apply-dependency-pin` pushes it with `apply-dependency-patch`'s grant under the `install-script-pin` row, which checks the pin against the manifest's version as Dependabot set it, not the lockfile; it posts no round marker, and the new head is reviewed as any other. `check-catalog` fails `ci-status` while the pin and the lockfile disagree, so a Dependabot bump of the CLI sorts `review` and reaches this step. Once the pin lands, its lanes App commit keeps the pull request `review` in both lanes, so the pr-merge lane merges it only on a `verdict=merge` marker at the new head. `pr-unblock`'s `fix-ci` runs in separate jobs of `pr-unblock.yml`, so no model holds a write token: `fix-ci-context` (base code only, read-only token) writes the failing checks' context or hands the pull request to a person once `loop.fix-ci-rounds` fixes were pushed; `fix-ci` (a `read` skill in [patch output mode](pr-run-activity.md#patch-output-mode), on run-claude-cli with the pr-unblock role's API key) runs `source-control:pull-request ci --ci`, which reruns, fixes and reruns the checks; `fix-ci-subscription` runs the same on the role's OAuth token, only when `fix-ci-handoff`'s read of this run's jobs shows `fix-ci` posted no check, as a credit stop or an empty key leaves it ([two calls](pr-run-activity.md#two-calls-on-one-credential-each)); and `apply-patch` (a `mutate-branch` script, no model, no head code) pushes the patch as one commit without force, refusing the whole patch on any change `patch-rules.json`'s `ci-context` row refuses: the universal set, an agent instruction path (`CLAUDE.md`, `AGENTS.md`, `.claude/` or `.claude-plugin/`, a plugin's `hooks/`, `monitors/` or `bin/`, `.mcp.json`, `.lsp.json`, `.gitmodules`, `CODEOWNERS`), or more than 300 paths ([`prepare: ci-context`](pr-run-activity.md#prepare-ci-context), [`prepare: apply-patch`](pr-run-activity.md#prepare-apply-patch)). An empty, invalid or unappliable patch goes to `report-escalation`, as does a run that changed nothing and escalated a check. A patch that pushed escalates nothing, whatever the model escalated beside it: the new head's CI decides, and a red new head gets its own run. The one exception: a run at `model-rung` 0 that changed nothing and escalated only `unfixed` or `not-reproducible` checks skips `apply-patch` with `rung-up`, and the same `pr-unblock` run runs `fix-ci` and `apply-patch` once more at `model-rung` 1 (`fix-ci-rung-up`, `fix-ci-rung-up-subscription`, `apply-patch-rung-up`; [Models](#models)). The retry posts its own `pr-unblock / fix-ci` check, which the dispatcher counts toward fix-ci's per-head cap (`maxRunsPerHead`) like any other run, so that cap bounds rung-ups on a head too. `report-escalation` ends the run unless that retry's patch applied cleanly: the retry's own reason, else `ci-fix-escalated` (a neutral or failed retry), each routed to a failing `pr-unblock/fix-ci` status; `ci-fix-escalated`, `ci-fix-protected-path` and `ci-fix-weaken-required` (a check the rung-up retry could not fix, or one the model could fix only through a path the lane token may not push or by weakening a required check) also queue the PR with `needs-session` for a session builder, while the dispatcher's same-head retry still runs: the session that finds the head green or lands the fix removes the label; no lane removes it. A cancelled run applies no label: the write workflow's `run` job has no status function in its `if:`, so it skips on a cancel, nothing pushes and `ci-status` stays red. In a run that changed nothing, `protected-path` goes to the `needs-session` queue (a failing status and the label) and `flaky` to a failing status, both without a rung-up. `weaken-required` on the head's first fix-ci attempt stops `ci-fix-weaken-retry` instead, a failing status: the dispatcher retries the head once at `model-rung` 1, a fresh fixer round whose context carries a fixed brief (fix the code under test and keep every test's assertions and expected values). A `weaken-required` in that round, or after any earlier attempt on the head, stops `ci-fix-weaken-required` for a session builder; the guard itself is unchanged. Beside a pushed patch, the new head's CI decides for all of them. The same `pr-unblock-dispatch.yml` run starts `fix-ci`, after the conflict and Dependabot dispatches: one GraphQL query per page of 50 open pull requests, its `rateLimit.cost` logged, lists the non-draft, same-repository ones into `main` that the lanes App opened (by bot id), or that a trusted actor opened ([`adoption`](#adoption); a person's once idle), with no `do-not-merge`, `needs-human` or tracker human-gated label (one another lane's escalation put on aside, as above), whose head's `ci-lanes` commit status from `github-actions[bot]` is `failure` or `error`: the lanes' verdict ci-status records, not ci-status itself, which also fails on a hold, a pending review or the PR contract, none of which a CI fix mends. It dispatches those whose head has no `pr-unblock / fix-ci` run yet (an untrusted-trigger skip or a skip while held aside), or only failed ones and `Skipped: not-applicable` or `Skipped: stop-resolved` ones (no failing check found), fewer than `limits.limit-stops-per-head` of them, and since the base tip was committed (the same query reads it) no such skip and at most `limits.fix-ci-restarts` failed ones; a new head starts with none. No `fix-ci` run for the PR may still be queued or going, and it sends at most `limits.fix-ci-per-run` per run, lowest number first. Their run ids join the dispatched-runs record. The dispatcher job's concurrency group cancels a run in progress, so a burst of pushes ends in one listing. `pr-refine`'s `fix-docs` runs the same way in three jobs of `pr-refine.yml`: `fix-docs` (a `read` skill in patch output mode with no prepare mode, on run-claude-cli with the pr-unblock role's API key) runs `ai-slop:audit fix` on the PR's changed Markdown files; `fix-docs-subscription` runs the same on the role's OAuth token, only when `fix-docs-handoff`'s read of this run's jobs shows the broker allowed `fix-docs` and `fix-docs` posted no check, as a credit stop or an empty key leaves it; and `apply-docs-patch` runs the `apply-patch` activity on a `written` patch, pushing it as one commit under `patch-rules.json`'s `docs` row (`patch-prepare: docs`), which admits only markdown and refuses the universal set, any path under a `skills/` directory, any `SKILL.md` and more than 300 paths. No change is the common case, so an `empty` patch runs no push job. `pr-refine.yml` has no escalation job: a refused or unappliable patch posts the `pr-refine / apply-patch` check neutral `awaiting-human` and labels nothing. Every job trusts the default branch tip (`trusted-base: default-tip`). `fix-docs` routes to the `docs-fix` profile ([Models](#models)). CI `fix-docs` runs on every pull request not tidied in its own run ([ADR 0089](../../adr/0089-narrow-d100-to-pull-requests-tidied-in-their-own-run.md)). The skip reads the base config's tidy cutoffs when it dispatches, not the ones the lane run used. `limits.fix-docs-per-run` is `2` here; each event offers one pull request, so any value from `1` up turns its dispatch on. At `0` the dispatcher logs `fix-docs is off (fix-docs-per-run: 0)`, sends nothing and makes no GitHub call for it. Only `pr-unblock-dispatch.yml`'s `refine` job dispatches `pr-refine.yml`'s `fix-docs`, on the pull request's own `pull_request_target` event (`refine-event-dispatch.mjs`); a push to the default branch, the half-hourly tick and a hand run of the dispatcher start none. It dispatches once per pull request: one GraphQL query, its `rateLimit.cost` logged, reads that pull request, and it keeps it when it is a non-draft, same-repository one into `main` whose event the lanes App or a listed human sent (a pull request whose events come only from other senders gets no fix-docs), except Dependabot (account 49699333, whose own rebases a lane commit stops), the release App (337859524) and the standards-sync App (300666570), whose files are generated or synced, and `work-resolve-issue` PRs tidied in their own run (within the tidy cutoffs): the lanes App's on a lane branch (`work-resolve-issue/issue---`) whose one commit is the App's API commit (a valid signature, the App as author, GitHub as committer), and whose change is within `resolve-issue`'s `tidy.cutoffs` in the base config, read from the PR's file count, added plus removed lines, changed paths and their areas as the [`tidy` entry](#activities) defines them. A lane PR with any other commit (a later push its tidy never saw), over any cutoff, or whose file list is cut off, was not tidied and is kept, and so are the lanes App's other PRs and a person's PR on a branch with a lane name. An author with no account id is skipped. It keeps one with no `do-not-merge` or `needs-human` label (a lane escalation's aside, as above), that changes at least one `.md` file, and whose head has no `pr-refine / fix-docs` or `pr-unblock / fix-docs` (the lane `fix-docs` ran in before) check run from the GitHub Actions app. One more query reads the check runs on its last 50 commits, and a PR with a `fix-docs` run on any of them is skipped for good. A run older than 50 commits, or a force-push that dropped its commit, costs one more run. It sends none for a PR whose `fix-docs` run is still queued or going, and the run id joins the dispatched-run record. A PR this run skips (a read that failed, a sender neither the lanes App nor a listed human, a re-run) waits for its next event. A `fix-docs` run whose run job emits an empty head posts no check (`post-decline: false`). The event dispatcher reads and saves no dispatch record, so the per-head cap of `limits.limit-stops-per-head` record-broker-allow runs that posted no check holds only within one run, where it never binds: each event starts at most one run, and a new head arrives as a new event. A completed `fix-docs` run ends the PR too, check or not, unless it says nothing about the PR. One lost run gets another dispatch. So do fewer than `limits.limit-stops-per-head` runs that went red or held on a failed `handoff-evidence.sh` read or an unread PR head, the PR's next event being the probe: red alone cannot tell a read that failed from a broker that refused, so the count is what ends a refusal, and an outage past that many runs still ends the PR. A held run ends green, so the dispatcher reads the jobs of each green run it finds for a candidate: a leg that handed off, whose handoff job succeeded, with no next leg started, is a held run, and so is a run whose `fix-docs-head-held` job succeeded, which runs only when `fix-docs-head` could not read the head or the human-gated hold, or the plan could not read the changed files. A run whose jobs cannot be read holds the PR for its next event. `workflow_run` runs the default-branch copy of a workflow with secrets; the conditions fixing CI from it holds to are in [ADR 0051](../../adr/0051-start-pr-fix-ci-from-workflow-run-for-same-repository-trusted-prs.md). Lanes run on GitHub-hosted runners without default-deny egress under the conditions in [ADR 0049](../../adr/0049-run-ci-lanes-on-github-hosted-runners-under-trigger-and-token-hardening.md). Lane commits are signed, and signing is enforced by the default-branch rule only: [ADR 0054](../../adr/0054-keep-commit-signing-on-the-default-branch-rule-and-add-no-all-branch-rule.md). Every lane: - Acts only on same-repository PRs, and only trusted actors' text reaches its prompt. The filter runs per item: each comment, review reply and linked issue is checked by its own author, not by the PR's. Web pages and CI logs are untrusted wherever they came from and stay data. The trusted-actor list is one central standards component that every lane reads. - Runs Claude Code with `--permission-mode dontAsk` and the tools its skill needs to do its job, always in the read runner with no GitHub token: a skill's effect is `read`, and the config reader refuses any other. Its change reaches the branch only through a script activity ([`pr-run-activity.md`](pr-run-activity.md#skill-activities)), which gets the write access its job needs through a short-lived, job-scoped App token, revoked when the job ends. Local lanes keep auto mode ([loop-lane, Permission modes](../../contracts/loop-lane/README.md#permission-modes)). Capability is never removed for safety: a lane's scope comes from how granular its activity is, the PR is the review step, and safety comes from who can trigger a lane, token lifetime and scope, workflow execution protections, the kill switch, and a `ci-status` no lane can write (below). - Reads its config, scripts and the trusted-actor list from the base SHA, never from the PR head, so a PR cannot change the rules it is judged by. Only the default branch is a trusted base, and a skill activity loads nothing else from the head: [ADR 0055](../../adr/0055-load-nothing-head-controlled-into-a-pipeline-skill-activity.md). - Checks the org and repository kill switches before its model step starts, and runs only when both read exactly `false`. - Never holds `checks: write` or `workflows` permission in a job that runs the model. `ci-status` and the ` / ` check runs are written by scripted jobs with no model step, and branch protection pins `ci-status` to the source that writes it ([ADR 0053](../../adr/0053-run-each-pipeline-activity-as-a-model-job-and-a-scripted-report-job.md)). A base merge escalates to a human instead of being pushed when a path under `.github/workflows/` is left conflicted by the merge (before any model turn), or when the model staged a change under `.github/workflows/` (after it). A workflow change that comes cleanly from the base is merged and pushed with the rest. - Writes through one per-PR queue (a concurrency group that queues, never cancels; see [Concurrency](#concurrency)). It pushes its own commits as fast-forward updates, never with force. A head that moved before the token mint skips the run with `superseded-sha`; one that moved during the run fails its push. Either way a later run on the new head does the work. - Works each layer of a stack but touches only the lowest unmerged layer when fixing, and never rebases a stack. - Respects the cross-lane hold, the `do-not-merge` label ([loop-lane](../../contracts/loop-lane/README.md#cross-lane-pr-hold)), and the merge rule in AGENTS.md. A lane escalates through the `needs-human` role in the same section's escalation contract. ## Activities An activity is one unit of lane work with a declared contract. A leaf is a skill invocation, or a scripted step with no model in it (the merge act and `ci-status` are scripted). A composite groups leaves under `children:`, a list of slots with the same keys and order rules as a lane's `slots:`, and may set an `applies-when` that gates every child. Every activity is defined once under `activities:` and referenced by key from lane slots or composite children, so moving it is a config edit and the skill itself never changes. A composite holds only leaves, so no leaf sits more than two layers below its lane. It declares no effect, gating or inputs: each leaf keeps its own, gets its own grant, runs as its own job and reports its own ` / ` check, and the lane's rules apply to every leaf. A leaf runs only when its lane, every slot on its path and its own slot are enabled, and when the composite's predicate and its own both match. A leaf key appears at most once in a lane, so the key alone selects it. Each leaf declares: - `skill` (`:`) or `script` (a repository path), with optional `args` passed verbatim: after the skill name in that skill's own syntax, or to the script. - `prepare` (optional): what the runner does around the activity. `apply-patch` is the one mode for a script (a `mutate-branch` one), `ci-context`, `review-threads`, `dependency-review` and `merge-base` the modes the read runner performs, each on a `read` skill that hands on a patch ([`pr-run-activity.md`](pr-run-activity.md#prepare-ci-context)). `merge-base` runs on the read runner after the caller's base job merged the base tip into the gated head and found it conflicted: it merges the same base again, gives the skill the conflicts as read-only files, and hands on its resolutions as a patch, which a `prepare: apply-patch` job commits with the head and the base as parents ([`pr-run-activity.md`](pr-run-activity.md#prepare-merge-base)). `review-threads` runs on the read runner after the caller's base job kept the PR's unresolved reviewer-bot threads and decided skip, escalate or proceed before any model turn: it checks that job's thread file, gives the skill the review-thread tool, and hands on its fix as a patch and the replies it records (`applied-by.feedback-replies`) for script jobs with no model to push and post ([`pr-run-activity.md`](pr-run-activity.md#prepare-review-threads)). A runner performs this only where it declares support by passing `prepare-supported: true` to `resolve-config`; anywhere else an applying leaf that sets `prepare` fails red rather than running without it. - `applied-by` (optional, `skill` only, effect `read` and gating `advisory`): what the skill hands on, keyed by artifact (`patch`, `feedback-replies`, `dependency-verdict`, `work-outcome`), each naming the script activity that applies it. A `patch` target runs `prepare: apply-patch` ([patch rules](#patch-rules)). Every lane that holds the producer holds each target, in a slot whose `needs` names the producer. A runner hands on only the keys it passes as `applied-by-supported` to `resolve-config` (`pr-run-activity-read.yml` passes `patch`); an applying leaf with any other key fails red before the head checkout. A skill that hands on a patch gets the same edit tools as a write skill and commits nothing. The read runner collects its uncommitted change as a patch when `applied-by.patch` names its applier (`fix-docs`, `fix-ci` and `resolve-issue`). Those edit tools and the `changed-paths` filter key on "an effect other than `read`, or `applied-by.patch`"; the effect half goes once the last skill leaves `pr-run-activity-write.yml`. - `checks` (optional, `skill` only): repository check scripts, each `scripts/.sh` with its flags fixed, that the skill may run. The read runner gives a skill that hands on a patch its edit tools and runs each from the base copy against the checkout, so no head code runs, and tells the skill to fix what a check reports before it reports done ([`pr-run-activity.md`](pr-run-activity.md#skill-activities)). The schema refuses `checks`, `self-checks`, `verify-scripts` and `web-access` turned on for any other skill (one without `applied-by.patch`, or with `prepare: ci-context`), where they would do nothing, except `verify-scripts` under `prepare: ci-context`, which the read runner stages as a base copy the skill is told to run in place of the checkout's; its Bash, Edit and Write stay open, so review of the patch is the control. - `self-checks` (optional, `skill` only): the same shape as `checks`, run and fixed by the skill through the same wrapper before it commits or hands its change on. Advisory: unlike `checks`, no runner job reruns them, so a failure the skill cannot fix still opens the PR and is named in its report. A script in both lists fails red. - `verify-scripts` (optional, `skill` only): exact repository-relative paths of scripts, each `scripts/.sh`, `plugins//scripts/.sh` or `plugins//skills//scripts/.sh`, that the skill may run with any arguments but a path outside the checkout. The runner that gives the skill its edit tools runs each from a read-only base copy of its plugin (or of `scripts/`) against the checkout, with `GH_TOKEN` and `GITHUB_TOKEN` unset. No Bash process above it holds the token either: the read runner's run-claude-cli steps set neither token ([`pr-run-activity.md`](pr-run-activity.md#skill-activities)). The arguments are the model's, so a script that changes files, runs code from the checkout or reaches the network hands the run that power: list one only when it limits itself, as `scripts/run-test-file.sh` (one test file inside the checkout), `scripts/git-mv-rm.sh` (`git mv` and `git rm` inside the checkout) and `scripts/new-changelog-fragment.sh` (new files under the checkout's `.changes/` only) do, or when the run may hold that power, as `plugins/skill-quality/scripts/check-skill.sh` (each checked skill's `scripts/*.test.sh` and the checkout's markdownlint) does. Those two run checkout code, which the read runner's run job may, since it holds neither the lane token nor `id-token: write`. - `web-access` (optional, `skill` only, off when absent): `enabled` and `domains`, either `any` or a list of host names (`*.` allowed as a prefix). When on, the skill may search the web, fetch those domains, and run the research skills, wherever the runner gives it its edit tools ([`pr-run-activity.md`](pr-run-activity.md#skill-activities)). An activity that turns it on must set `reads-untrusted: true`. - `tidy` (optional, `skill` only, off when absent): the run tidies its own change before its last check run. `entry` is the diff-scoped tidy skill, `passes` the other quality skills it may call, `turn-share` the percent of the run's turn cap tidy may spend (at the cap the passes left are skipped and the change is handed on; tidy never fails the run), and `cutoffs` the one named value that decides whether a change is small and single-area enough to tidy in the run: `max-files`, `max-lines` (added plus removed), `max-areas` (`plugins/` with its `.changes/`, `docs/`, else the top-level segment) and `shared-paths` (a directory ends in `/`). The runner allows the entry and the passes and no other skill. The schema takes it only on a `read` skill whose `applied-by` sets `patch` with no `prepare`, and the launcher stage only for an issue lane ([`pr-run-activity.md`](pr-run-activity.md#issue-mode)). - `permission-mode` (optional, `skill` only): `dontAsk` (the default) or `auto`, the Claude Code permission mode of a PR-mode skill on the read runner's launcher; other runners run `dontAsk`. The run job fails red unless the CLI reports the mode asked for ([`pr-run-activity.md`](pr-run-activity.md#two-calls-on-one-credential-each); [ADR 0049](../../adr/0049-run-ci-lanes-on-github-hosted-runners-under-trigger-and-token-hardening.md)). - `effect`: one of `read`, `mutate-branch`, `mutate-tracker`, `mutate-variable`, `publish-artifact`, `merge`. `mutate-variable` reads every scope and writes only what its lane's `activity-grants` row in `lane-rules.json` adds: repository Variables write, which the token broker grants to work-unblock's `publish-lane-level` alone (owner decision Q113 (a)). The runner derives ordering from it, takes the token grant from [`effect-grants.json`](../../../.github/actions/resolve-config/effect-grants.json), and fails a `read` activity that leaves the working tree dirty unless it hands its change on as a patch. A skill's effect is always `read`: the schema and the config reader refuse any other, so no model runs beside the lane token. An activity that runs head code (tests, linters, builds) takes effect `read`, because a write-effect activity must not execute head code. To change the branch it hands its change on to a `prepare: apply-patch` script with no model and no head code, named in its `applied-by.patch`, as fix-docs and fix-ci do with `apply-patch`. - `gating`: `gate` feeds `ci-status`; `advisory` is reported only. `ci-status` stays the only required check. Tests, linters and builds that gate run as a `script` activity or under a separate design. - `reads-untrusted`: whether it reads issue, PR, comment, web or CI-log text, or PR head files, which can quote such text. Ingested text is data, never instructions ([`untrusted-content`](../../contracts/untrusted-content/README.md)). - `inputs`: typed, from a closed set (`base-sha`, `head-sha`, `changed-paths`, `pr`, `issue`, `baseline`, `findings`). An activity reads nothing from a session. `changed-paths` is computed by the base-SHA config reader from the PR's file list, never from head text. It names what the activity is asked to work on, not what it can touch; for an activity that edits (an effect other than `read`, or a skill that hands on a patch) it leaves out instruction surfaces and paths `.github/CODEOWNERS` lists ([`pr-run-activity.md`](pr-run-activity.md#skill-activities); `changedPathTargets` in [`resolve.mjs`](../../../.github/actions/resolve-config/resolve.mjs)). When nothing is left, the activity skips with `not-applicable-paths`: `pr-refine / fix-docs` does not run on a PR whose only changed Markdown is instruction surfaces or CODEOWNERS paths, such as this directory. - `scope` (`diff`, `tree`, `target`) and `applies-when` (paths, labels, `labels-absent`, events, `mergeable`, `draft`). `mergeable` is `conflicting` or `clean`, read from the PR at the gated head SHA only; unknown mergeability never matches. `labels-absent` matches only when none of its labels is on the PR. No predicate reads a work class: on an issues lane the triggering label alone admits the issue, so `agent-ready` added by a listed human or the lanes App admits, and resolve-issue's `labels-absent` holds keep an issue a person must decide. An activity is idempotent: a rerun on the same commit gives the same verdict or reuses it, a mutating activity with nothing to change makes no commit, and each commit it makes names the activity in a trailer. A verdict is bound to the commit it judged and is not reused for any other commit. A `pr-unblock` run that stops ends on the route [`escalation-routes.json`](../../../.github/scripts/pr-unblock/escalation-routes.json), the one routing table, gives its reason; `report-escalation.sh` reads it. Route `hold` is only for the owner's three reasons ([When work stops for the owner](../loop-lane/README.md#when-work-stops-for-the-owner)): an intent or design question the work item contract does not settle, a person's own thread or hold, a CRITICAL security risk (a security question, a finding no adjudicator may judge: a CRITICAL one, or a security-review one with no rating it reads; a security-review `IMPORTANT` or `SUGGESTION` is adjudicated like a code-review finding, owner decision on [#11020](https://github.com/melodic-software/claude-code-plugins/issues/11020#issuecomment-6534933426); a Dependabot security update the review would close, a risk the dependency review raised, or a commit on a Dependabot branch from anyone but Dependabot). A reason the table does not list holds too, with no activity to resume. The adjudicator settles an intent or design question for the reviewer itself when it quotes a line of the linked issues' spec text, the text pr-verify reads (`resolve-pr.mjs` `linkedIssues`), staged as `contract.json`: the script keeps the quote only when it is an exact substring of that text, at least 20 characters, and the reply quotes it with the issue's URL; the finding stands and the next round fixes it. A quote shows the text exists, not that it bears on the finding, so it never dismisses one: a `lane` verdict on an intent or design question goes to a person. A quote that fails the check, or no spec text, leaves the question a person's; a security question, a CRITICAL finding and an unrated security-review one never settle by quote. Every other reason routes `fail`. A `fail` entry that names `"label": "needs-session"` is a change the lane cannot make: a path its token may not push, a fix that weakens a required check after its fresh fixer round, a failing check the `fix-ci` rung-up retry could not fix, or a dependency update the review could not finish (its cap, an unlanded fix, an unreadable config, a cut-short listing, an uncited control, a workflow change beyond a pin swap), or a review thread the lane left open that no lane or verdict will settle (`feedback-untaken-threads`, `feedback-unadjudicated`; while that stop stands on the head, `address-feedback`'s select job skips `awaiting-session` instead of escalating again). `review-dependency` and `apply-dependency-patch` do not apply while `needs-session` is on (their `labels-absent` in `pr-pipeline.yaml`), so such a stop gets no same-head model re-run and no fresh round budget on a rebased head until a session removes the label, or `clear-escalations.mjs` does: once a same-head retry cleared the stop's failing status, or once the head moved off every such stop's head and the new head carries no failing status for their activities and passes its checks (`ci-status` aside, which the label keeps red). A `dependency-workflow-unpinned` stop is lifted only on its own head, since green checks do not judge a workflow change. If the cause holds, the lane stops again on the new head and labels it again. It also puts the PR in the session-builder queue with that label, which no merge gate reads, so a session builder makes the change instead of a person; a person arms it only where the merge gate already asks for one. Every other reason is a defect the lane's bounded retries (the `fix-ci` rung-up, the adjudicator, the round, repeat and per-head caps) did not mend, routed `fail`: no human-gated label (an entry naming `"label": "needs-session"` adds that label first, the session-builder queue, which no merge gate reads), a failing commit status on the head the activity gated (`pr-unblock/conflict` for `resolve-conflicts`, `pr-unblock/` otherwise; `report-stop-status` posts it, except for a `feedback-publish-failed` whose lane token was refused as workflow-modified, which the feedback sweep sends again; a transient broker refusal still posts it, since pr-merge's re-fire skips some PRs), and one lanes App comment per activity (marked ``, naming the run) that the next stop edits in place; when `report-stop-status` withholds the status, `report-escalation` posts no comment either. The stopping job's check skips `lane-stopped`. `workflow-staged` routes `fail` as a capability limit: the merge carries the PR's own `.github/workflows/` changes together with the base's, which the lane token cannot push, and nothing in it is a person's decision, so a session merges main by hand. A select job's stop (a cap, or a conflict no model can resolve) is final for its head. A stop after a model turn (the push, reply or verdict job's) is retried on the same head by the activity's dispatcher, under the cap it already keeps: `limit-stops-per-head` for `resolve-conflicts`, `fix-ci-restarts` and the per-head cap for `fix-ci`, `SWEEP_HEAD_CAP` for `address-feedback`. A `fix-ci` or `address-feedback` retry runs one model rung up (`escalate-to`), read in the run from the head's own stop record, never from a dispatch input; the others retry as a fresh session. A retry that acts and does not stop posts success over the failing status (`report-escalation.sh clear`); one that ends on a skip, such as a reply job with no model turn, leaves it. A select job that finds the stop gone on its head also posts success and skips `stop-resolved`: `address-feedback` once no hold and no unresolved review thread is left, `fix-ci` once a whole listing of the head's checks, every one completed, has none failing (round cap included). So a thread resolved by hand, or CI fixed by hand or re-run green, frees the same head at the next dispatch of that activity (the one the lane-stopped comment gives); on a lanes App pull request the dispatchers above start it once per stop, on any other a person does, and a `ci-status` that already failed stays failed until something re-runs it (the next review lane's `rerun-ci-status`, or a person). Once the retries are spent, and until a `stop-resolved` skip ends the stop, the monitoring lane's `stalled lane stop` signal names the PR. A new head carries no status, so the lane's next run there starts clean. When an activity needs a human, it escalates with a resume key and exits instead of blocking. An activity whose `labels-absent` lists `needs-human` or `do-not-merge` skips with `awaiting-human` while that label is on the PR; a human removes the label, then dispatches the lane, to resume it (the `pr-unblock-dispatch.yml` dispatchers pick a held `resolve-conflicts` or `fix-ci` PR up themselves once the label is off; a held `fix-docs` PR waits for its next push, reopen or ready flip, the events its `refine` job runs on). `labels-absent` reads only whether a label is present, not who set or removed it: it is a hold, not a trust gate. An expedite label from a human with write access skips `refine`. A label counts only when the actor on its label event is a trusted human: a label the App set never resumes an item, expedites it, sets its work class or lifts a hold. A pr-unblock escalation whose reason repository state can settle is also cleared without a person. On its schedule, `pr-merge` rechecks each open PR into main carrying the human-gated label and removes it, after one comment naming the reason and the head, when every reason the lanes App's escalation comments recorded since the label went on no longer holds at the current head: | Reason | Cleared when | |---|---| | `workflow-staged` (a label set before it routed `fail`) | main changes nothing under `.github/workflows/` since its merge base with the head; or a trusted move (below) took the head off the resume key and the head contains main as it was when the lane escalated | | `unresolved-conflict`, `protected-path-conflict` | GitHub reports the PR mergeable | | `ci-fix-round-cap`, `ci-fix-empty`, `ci-fix-invalid`, `ci-fix-not-applied`, `ci-fix-escalated` | a trusted move took the head off the resume key, and at the new head no check other than `ci-status` (which the label itself fails) fails, runs or was cancelled, the latest run of each ended `success`, `neutral` or `skipped`, and one passed | | `feedback-protected-path` | the PR changes nothing under `.github/workflows/` | | `feedback-not-landed` | the head is none of its escalations' resume keys, and no unresolved review thread carries a lanes App comment; a thread listing that may be cut short keeps the label (owner decision 2026-10-25). Then either a trusted move (below) took the head there, or, after a push no trusted person made (the lanes App's own included), at the current head both review lanes (`claude-review` and `claude-security-review`) have a newest run that completed successfully with a review-complete record for this head, the security review is a whole review whose summary reports `critical-findings: 0`, and no unresolved review thread carries a CRITICAL or unreadable severity (an `IMPORTANT` one is reported, not held). A lanes App push alone never clears it | | a reason `escalation-routes.json` routes `fail`, on a label set before it did | a `ci-fix-*` reason once a lane check of a `pr-require-checks.yml` run on the current head reads failed (`ci-status` itself fails on the label, so it is not read, and an advisory lane such as `pr-test-platforms` does not count; green, missing or unreadable keeps the label). Any other fail-routed reason but `feedback-not-landed` stays for a person: a lane posts a `pr-unblock/*` status on a head only when it stops there or clears its own failure, so a new head carries nothing that shows the cause gone or fails that head in the label's place | | `head-moved` (pr-merge's `babysit-merge-verify-escalation`, `babysit-merge-risk` and `babysit-merge-shared-copy-escalation`, with no pr-unblock escalation since the label, and the marked App comment written last before the label is pr-merge's and within a minute of it) | the newest App comment carrying each marker names, as ``at head `` ``, a 40-hex head other than the current one; pr-merge then judges the new head and escalates again if its refusal still holds | | `refusal-cleared` (under `merge.lane-prs: native`, `enable-auto-merge`'s own unedited person refusal comment on a lanes App pull request, naming the current head, whose recorded verifier or risk cause is one the lanes clear: every code on `LANE_CAUSES`) | the gate's reader at that head finds nothing refusing, or only causes the lanes clear, read at least as far as the recorded one. A recorded cause a person clears (an issue link, a security finding, a trust-gate widening, a cost hold, an untrusted spec, any code off that list) is never read or lifted at its head (owner decision Q-CLEAR B): a person removes the label, or the `head-moved` clear does once the head moves. At most three reader runs a run | | `stale-review-hold` (a label a review lane added, every hold comment since it was last removed naming an earlier head) | a trusted move took the branch off the newest held head, and one of the pull request's own commits since each held head (not reachable from `main`, so an `Update branch` brings in none) is not a merge; both review lanes passed on the current head with a whole review each (status job succeeded, review-complete notice and no hold notice for it, and the head changes neither review caller); no lane leaves a CRITICAL finding (`critical-findings: 0` from the security lane, every finding inline for the security lane and any lane a hold names, no unresolved lane thread at `CRITICAL`, nor one with no one readable severity from those strict lanes; an `IMPORTANT` thread is reported and keeps nothing); and a `critical-security` hold's lane left at least one `CRITICAL` inline finding at the held head, each in a file one of those commits changed (a finding only the summary carried stays for a person). The head and the hold comments are read again just before the removal. A lane that still finds the cause holds the new head again. `ci-status` counts the lanes App's removal only after its own newest `stale-review-hold` comment names a head no hold comment names, while none names the event's head (hold comments counted from the label's last removal before it went on), and only when the base commit's `recheckStaleHold` (the same predicate) passes again with the job's own token at the head the comment names, as it was when the App removed the label, including the check-signed-commits hold, other lanes App markers and a person speaking up to the removal; a later head is judged by its own review lanes, as after a person's lift | It removes only a label whose newest `labeled` event has the lanes App, or for `stale-review-hold` a review lane, as its actor, and keeps it when a person commented, reviewed or left a review comment since that event (a bot account, such as an AI review or another lane, does not count), or when an App comment written or edited since then carries any marker other than the escalation being judged (another `babysit-merge-*` marker, another lane's). A trusted move is read with the job's own token, never from comment text: the PR head is in this repository, every push on its branch since the label went on is by a `human` of the base `trusted-actors.json` (matched by id; never the lanes App, so its own push never lifts its own stop), the newest one landed the current head, and the head is none of the recorded resume keys. A read that fails keeps the label. Every other reason waits for a person: the security, intent and decision stops (`feedback-uncertain`, `feedback-disputed`, `feedback-unadjudicated`, `feedback-question-*`, `feedback-round-cap`, `feedback-not-converging`, `dependency-security-close`, `dependency-escalate` and `dependency-escalate-`), the protected-path and own-patch stops (`ci-fix-protected-path`, `unexpected-path-staged`, `conflict-patch-*`), and those with no cause-gone evidence yet (`repeat-cap`, `feedback-invalid`, `feedback-partial`, `feedback-incomplete`, and the other `dependency-*` stops). Removing the label this way approves nothing: `ci-status` still fails a review-lane hold the lanes App unlabeled, and hold paths still need a trusted person's approving review. Rules: `.github/scripts/pr-merge/clear-escalations.mjs`. Accepted risk: a person's request relayed through an App posts as a Bot account (`claude[bot]` replying to an `@claude` mention that asks to wait), and so does a third-party App writing "needs a human"; neither keeps the label. A person who wants the hold comments themselves or adds the label back. ## Patch rules [`patch-rules.json`](../../../.github/actions/resolve-config/patch-rules.json) is the registry of what one `prepare: apply-patch` script is to admit from a producer's patch, read from the trusted base: one row per prepare mode a patch-producing skill uses (`ci-context`, `review-threads`, `dependency-review`, `merge-base`), `install-script-pin` for the pin patch `review-dependency-select` writes with no model, `docs` for a push job that passes `patch-prepare: docs` to hold a patch to markdown (fix-docs's `apply-docs-patch`), `default` for one with no prepare mode, and `issue` for a patch that goes to a new issue-lane branch made at the run's base or resume tip. [`apply-patch.mjs`](../../../.github/scripts/apply-patch/apply-patch.mjs) reads it for fix-ci's, fix-docs's, resolve-conflicts's, address-feedback's, review-dependency's and resolve-issue's patches ([`prepare: apply-patch`](pr-run-activity.md#prepare-apply-patch)). [`patch-rules.schema.json`](../../../.github/actions/resolve-config/patch-rules.schema.json) closes each row to these keys: | Key | Holds | |---|---| | `refuse` | Named refusals; any match refuses the whole patch. | | `allow` | What every other changed path must also meet: `any`, `markdown` (a path ending in `.md`, in that case), `kept-threads` (a path in the scope of a thread the select job kept, its `named_paths` included, a file the pull request already changes or a shared copy of a canonical it changes that the patch does not add, its `pr_paths` and `copy_paths`, read from that job's thread file, or any non-instruction file under a plugin's or skill's `evals/` or in a plugin a kept thread or `pr_paths` file sits in), `dependency-manifests` (an npm or pip manifest or lock file outside `.github/` in a directory the base `.github/dependabot.yml` lists for its ecosystem) or `merge-result` (a path the base merge left conflicted; under a merge row only the patch's own changes, measured from the conflict tree, face the rules, every conflicted path left in the tree must hold no conflict markers, and the merge's base-side changes pass through). | | `max-files` | The most paths one patch may change, or `null`. | | `max-blobs` | Merge rows only: the most blobs one merge commit may upload, each one neither the head nor the base holds at its path; over it nothing is written. | | `requires` | What the producer's output must say before anything applies: `dependency-verdict: fix`, the scanned verdict's field. | | `content-rule` | Optional; what each changed file's bytes must also meet, on the local blobs before any commit is built, escalating as `protected-path`: `dependency-version-change` (`dependency-review`: modified in place, a regular file, changed only by a version, `fixRefusal` in `dependency-classify.mjs`), `install-script-pin` (`install-script-pin`: the root `package.json` alone, under `dependency-version-change`, with one `allowScripts` install-script pin moved to the exact version the manifest pins, unchanged from the commit before the patch, and nothing else, `installScriptPinRefusal`) or `pr-mode-revert` (`review-threads`: a file whose mode changes between `100644` and `100755` takes the mode its path has at the merge base of the PR head and its base, read through the GitHub API, so the lane can only revert a mode the pull request introduced). `protected-content` (`docs`) refuses nothing and leaves content out instead, after every other check passes on the whole patch: see the `docs` row below. | | `commit` | `parents` (`[head]`, or `[head, base]` for a merge), `message` and `trailer`, with `{ref}`, `{base}`, `{lane}`, `{activity}` and `{issue}` filled in. | | `thread-trailer` | Optional; `true` (`review-threads`, a `kept-threads` row only) adds after the trailer a `Lane-Thread: ` line for each kept thread a `VALID` reply in the model job's scanned replies names, the binding `publish-feedback.mjs` requires before it credits the commit to a thread; with no replies read, nothing is committed. | | `reads-report` | The producer report the apply reads (`ci-escalations`: the checks the model escalated), or `null`. | | `empty-at-push` | Optional; the kind a patch that applies but changes nothing escalates at push time: `empty` (the default), `invalid` (`ci-context`, as the producer said it wrote a change) or `conflict` (`merge-base`: its `unresolved-conflict` reason, since the conflicts stay as git left them). | | `skip-moved-head` | Optional, default `false`; `true` (`ci-context`, `review-threads`, `dependency-review`, `merge-base`) skips `superseded-sha` on any PR head that moved since the producer ran, where other rows take the moved tip with `--3way` when the moved commits touch no patched path. `default` and `docs` set `false`: fix-docs runs once per pull request, so a skipped fix-docs patch would never run again. | | `script-exec-bit` | Optional, default `false`; `true` (`issue`) makes each new or changed file that ends in `.sh` or starts with `#!` executable after every refusal passes, since the model's tools set no file mode. | | `escalations` | The escalation reasons the apply may give for the row. | Every row refuses `.github/workflows/**` in any case and through any `..` segment (the lane token has no `workflows` permission), `CODEOWNERS` at the root, in `.github/` or in `docs/`, `.gitmodules`, `**/settings*.json`, the central lane grant file ([`lane-grants.json`](../../../.github/actions/resolve-config/lane-grants.json)) and the trusted-actor list (`.github/standards/trusted-actors/trusted-actors.json`) in any case and through any `..` segment (`lane-grants`: they decide what every admitted repository's lanes may mint and who may start them, [ADR 0085](../../adr/0085-run-org-lanes-from-ci-workflows-under-one-lanes-app-with-central-grants.md) Decision 6), a symbolic link, a gitlink, and a rename into any of those. The rest of `.github/`, `.claude/` and `.mcp.json` (outside the `issue` row, below), plugin hooks, `.claude-plugin/`, `lib/`, `scripts/`, `CLAUDE.md`, `AGENTS.md` and an executable bit reach review, and merge on it: only the narrow [path floor](#merge-authority) (`resolve-config`, whose code the token broker runs from main, `request-lane-token`, the trusted-trigger check, `check-kill-switch`, the rate guard, `CODEOWNERS`, `.gitmodules` and the merge gate's own code; the other files that enforce the floor wait for a clean security review instead) waits for a person, and the security lane judges the rest. The `docs` row also refuses, in any case and through any `..` segment, a path under a `skills/` directory at any depth (`skills`) and a `SKILL.md` anywhere (`skill-md`), and allows only `markdown`, so a non-markdown path escalates `patch-protected-path`. Its `protected-content` content rule keeps fix-docs out of content a generator or the release tooling owns, and because fix-docs runs once per pull request it drops that content rather than refusing the patch. It reads git's own `-U0` hunks of each file and leaves out every hunk whose head lines meet a generated region (a standalone `` line through its `` line, the marker lines included), that inserts lines between a BEGIN and its END, or that writes a marker line; an insertion right before a BEGIN line or right after an END line is outside the region and kept, as is every other hunk. The whole change to a file, its mode included, is left out when the file sits in the `released` or `historical` tier of [`docs-naming.yaml`](../docs-naming.yaml) (`**/CHANGELOG.md`; `docs/adr/**`, `docs/upstream/**`, `.claude/unhobble/**`), when the patch deletes a file whose head holds a region (a rename, read as a deletion and an addition, so leaves the file at its old path), when its markers do not pair in the head or the patched blob, or when the kept or rebuilt blob's regions would not be the head's byte for byte; a mode change to any other file is kept. Each dropped hunk or file prints a `::warning` naming the file and, for a hunk, the generator its region's BEGIN line names, so the fix goes to the generator's inputs. A patch left with no change pushes nothing, escalates nothing and skips `not-applicable`. The row otherwise matches `default`. No other row names those two refusals or that rule, and none has to. The `review-threads` row alone also refuses a new file at mode `100755` or a change to that mode (`new-exec-bit`), so address-feedback can drop an executable bit but never add one; `ci-context` and `issue` keep setting script bits. The `ci-context` and `review-threads` rows also refuse, in any case and through any `..` segment, a `.gitattributes` file at any depth (`gitattributes`), a path whose first segment is `.husky` (`husky`) and every file lefthook reads its config or hook scripts from (`lefthook`): at the root, `lefthook`, `.lefthook`, `lefthook-local` and `.lefthook-local` with `.yml`, `.yaml`, `.toml`, `.json` or `.jsonc`; under a root `.config/`, `lefthook` and `lefthook-local` with those extensions; and a path whose first segment is `.lefthook` or `.lefthook-local`. Each changes what git, or a hook it runs, does on the next checkout or commit, so fix-ci and address-feedback cannot change them. No other row names these three. The `issue` row alone also refuses (`claude-protected`), at any depth, every path Claude Code denies writes to under the lanes' `dontAsk` permission mode ([protected paths](https://code.claude.com/docs/en/permission-modes#protected-paths)) except `.gitmodules`, which has its own refusal (`gitmodules`): its run can never write one, so a run whose change needs one stops with `patch-protected-path`. No other row names `claude-protected`, and a rename into such a path is not `rename-into-refused`. The `ci-context`, `docs`, `default`, `issue` and `merge-base` rows cap a patch at 300 paths, and the `merge-base` row a merge commit at 300 new blobs. `checkPatchRules` in [`patch-rules.mjs`](../../../.github/actions/resolve-config/patch-rules.mjs) rejects a row without that set, a `[head, base]` commit whose `allow` is not exactly `[merge-result]`, a refusal, allow or requirement name the schema does not list, and a patch-producing activity whose prepare mode has no row; `resolve-config` runs it before every lane resolve and fails closed when either file is missing. `loadConfig` and `resolveGrant` do not read the registry, so the lanes token broker needs neither file. ## Slots and order A lane's `slots:` list names the activities it runs. Stage order is fixed by the table above; the order inside a lane comes from config: - Mutating slots run one at a time, in list order. - Read slots run in parallel, each after the slots named in its `needs:`. - A slot may replace its activity's `applies-when` or set `enabled: false`. `refine`'s plan groups its passes into batches by `order` and `group` ([Refine before review](#refine-before-review)); a format pass takes the highest `order` and `group: serial`, because earlier passes change whitespace, and its first job waits on the earlier batches. `verify` runs on the refined commit; a push during `unblock` makes earlier verify results stale, and verify reruns on the new head. `refine` does not rerun on `unblock` pushes. The schema checks each file's shape. The config reader also rejects: - an activity whose `effect` or `gating` the lane's row in `lane-rules.json` forbids, such as a branch-writing activity in `pr-run-checks` or a `merge` effect outside `pr-merge`; - a leaf whose `effect` its row in [`activity-rules.json`](../../../.github/actions/resolve-config/activity-rules.json) forbids; a leaf with no row is valid; - a lane whose `stage` differs from its `lane-rules.json` row, or a lane with no row; - a `needs:` entry naming an activity that is not in the same `slots:` or `children:` list; - a composite child that is undefined or itself a composite, a composite that contains itself, or a leaf that appears twice in one lane; - `prepare` with an effect its mode does not take; - an `applied-by` target that is not a script activity, a `patch` target without `prepare: apply-patch`, or a lane holding the producer without the target in a slot that needs it; - a [patch rules](#patch-rules) row that does not refuse the universal set, or that commits with the base as a parent and whose `allow` is not exactly `[merge-result]`; - a lane or activity name missing from the vocabulary ([Names](#names)); - an activity named `run` or `report`, `pr-run-activity`'s own job names; - any `extends:` value ([Not settled yet](#not-settled-yet)). The reader adds no path to `merge.diff-check.denied-paths`: it resolves the config's own list, each entry once. ## Concurrency | Scope | Rule | Set by | |---|---|---| | Triggers of one PR's `pr-unblock` activity | A newer dispatch replaces one still waiting; a running one finishes | workflow group `pr-unblock--`, `cancel-in-progress: false` | | Within one run | Leaves run in slot order: `publish-feedback` after `address-feedback` once its skill ran; `report-escalation` after the others, and only when one escalated | the caller's `needs:` | | Across PRs | Unbounded: every group is per PR | group names | | Within one PR, across write lanes | One queue: a write job waits for the one ahead and never cancels it | job group `pr-pipeline-write-`, `queue: max`, on every write caller job | | `pr-unblock-dispatch` | One run at a time; a push cancels the run going, and a tick or hand run waits behind it; any newer run replaces one still waiting | workflow group `pr-unblock-dispatch`, `cancel-in-progress: ${{ github.event_name == 'push' }}` | | `pr-dispatch-feedback` | One run per group at a time: one per pr-verify run, one for all sweeps, and one per reviewed head otherwise; waiting runs queue and none is replaced | workflow group `pr-dispatch-feedback-verify-`, `-sweep` or `-`, `queue: max` | | `pr-merge` `enable-auto-merge`, across PRs | One run at a time, sweeps and verdict wakes alike, since the lane-room check is not re-read after arming; none is cancelled, and a waiting sweep, or a newer wake for the same PR, does a wake's work. At the measured peak of 31 `pr-verify` completions in 15 minutes, all of them wakes (as of 2026-11-03; recheck when the wake rate or the job's ceiling changes), the job's 44-minute ceiling queues about 91, under GitHub's cap of 100 queued runs ([Control the concurrency of workflows and jobs](https://docs.github.com/en/actions/how-tos/write-workflows/choose-when-workflows-run/control-workflow-concurrency)); a run past the cap leaves its PR to the next scheduled run | job group `pr-merge-enable-auto-merge`, `queue: max` | The write group sits on each caller job, behind an `if:` that leaves out the lanes App's own `pull_request` events, so a lane's push never queues a job in it. ## Outputs and skips Each leaf reports: - A verdict: `pass`, `fail`, `neutral` or `skipped`. - Findings in the detector-findings shape ([`detector-findings`](../../contracts/detector-findings/README.md)), for the commit the leaf judged. A new commit gets a new verdict, even when its content is unchanged. - An artifact bundle per [`record-bundle`](../../contracts/record-bundle/README.md). - A check run named ` / `, for example `pr-refine / simplify`; a composite gets none. A skip reports as a neutral check with one reason from the schema's `$defs/skip-reason`: `not-applicable-paths` (a `paths` predicate missed, or every matching path was left out of `changed-paths`), `not-applicable` (a label, event, work-class, `mergeable` or `draft` predicate missed), `prerequisite-missing` (among others, mergeability still unknown at the gated head after bounded re-reads), `cost-gated`, `awaiting-human` (among others, a `labels-absent` label is on the PR), `superseded-sha`, `disabled-by-config`, `untrusted-trigger` (a fork, no same-repository PR, or an actor or author not on the trusted-actor list), `workflow-modified` (the token broker refused a write lane's mint for a workflow file the PR itself changes), `kill-switch` (a lanes kill switch stopped the run: its own kill-switch step, or the token broker refusing a write lane's mint on a pull request for a switch turned on after that step; the pr-unblock dispatchers dispatch the head again once the switch lifts), `rung-up` (a fix-ci run's patch is held back for one retry one model rung up, [Lanes](#lanes)), `no-model-turn` (an address-feedback round whose model never ran, so the scan uploaded no replies), `finding-stands` (an address-feedback round's reply job, when an adjudicator let a disputed finding stand and the head did not move, so no review run starts the round that fixes it), `clean-merge` (a resolve-conflicts round whose base merge left no conflict, so no model ran and the push job commits the merge), `lane-stopped` (a pr-unblock stop `escalation-routes.json` routes to a failing status: on a select job's activity check it ends the head; on a push, reply or verdict job's check the dispatcher retries the head under its per-head cap), `pass-only` (a pass-only address-feedback round's reply job, which ran no model and only resolved fail-note threads a pr-verify pass superseded; the dispatcher's release reads skip it), `stop-resolved` (an address-feedback or fix-ci select job found no stop standing on its head, whether or not one ever did), `awaiting-session` (an address-feedback select job whose head's stop already sits in the `needs-session` queue, so it does not escalate again), `owned-branch` (a fix-ci select job on a pull request whose head branch `merge.refire-skip-branches` lists: the workflow that owns the branch rebuilds it, so a fix-ci push would race the rebuild), or, for an issue run under `models.issue-dimensions`, `research-first` or `probe-first` (its Uncertainty), or `split-required` (its Size is `split`). Issue mode posts no check, so work-resolve-issue.yml reports those three dimension skips on the issue instead, to no person: `research-first` and `probe-first` lose `agent-ready` and `status: ready` and park at `status: confirmed` beside admission's comment naming the next step, as admission parks the same refusal, and `split-required` goes back through intake, whose split files its sub-issues ([Issue mode](pr-run-activity.md#issue-mode)). Silence is not a skip, with three exceptions that post no check: a fork PR, whose read-only token cannot write checks; a `pull_request` event sent by the lanes App; and a run on any other event whose run job gated no head SHA. Each review finding goes to an independent validator. Valid: fix it and reply with a citation. Invalid: reply with a cited disagreement. Unsure: an adjudicator judges it (`adjudicate-feedback.mjs`), as it judges a disputed finding; only a finding at the security tier a person decides (a `CRITICAL` rating, or a security-review finding with no rating the lane reads) and a thread a person opened or directed go to that person (`feedback-uncertain`, `feedback-disputed`). A script resolves bot threads after the reply; human threads stay open for the human. ## Merge authority `merge.authority` names the repository's one merge authority: `local-babysit`, the babysit wrapper run by the local babysit lane (loop-lane), or `pr-merge`. When it is absent the authority is `pr-merge`. The babysit wrapper merges only when it reads the authority the wrapper runs as: `local-babysit` by default, `pr-merge` under `--authority pr-merge` (below). `merge.report-only: true` makes that authority report each decision and write nothing. `merge.rung` is a pacing cap: `off` merges nothing without a human, and `merge` or `merge-reviewed` lets the authority merge. On the pr-merge lane both merge on the verifier verdict; on the local babysit lane `merge-reviewed` also needs AI review to be blocking (its promotion cells, below). `C2` and `C3` are accepted aliases for `merge` and `merge-reviewed`. Neither authority reads a work class ([`work-classes.md`](../../../plugins/autonomy/reference/guardrails/work-classes.md#merge-authorities-that-read-no-class)). - `off` is the default. The first rung a repository adopts is `merge` (`C2`), together with `merge.diff-check`: the diff touches no denied path and stays under the size cap. - No work class is read, and no class, missing class or diff shape caps the rung. The only class-named check is the untrusted-provenance hold: a pull request whose linked issue carries `provenance: untrusted` (any label naming untrusted work), or had it removed by a non-human, waits for a human, in the local babysit lane and when `enable-auto-merge` arms a lanes App pull request. The pr-merge lane merges on the verifier verdict ([The pr-merge lane](#the-pr-merge-lane)). - A rung rises only through a merged change to the config file. Under `pr-merge` it falls automatically: when the default branch fails after a lane merge, that lane's merge rights turn off through a repository variable that can only lower the rung, and a `needs-human` issue is filed. The local babysit lane falls through a demotion issue instead (below). - A `pr-merge` merge needs a review verdict bound to the commit being merged. This is a precondition of the lane's own merge, not a required check. A lane merge commit, including one where the lane resolved conflicts, needs a fresh verdict on that commit before the merge. The local babysit lane accepts only evidence bound to the pinned head SHA (below). - `merge.stack-landing` defaults to `manual`. - A repository has one merge authority, Dependabot pull requests included: the pr-merge lane merges tier `auto` ones, and tier `review` ones once the pr-unblock lane's review activity leaves a merge verdict ([Dependabot pull requests](#dependabot-pull-requests), below). ### The local babysit lane The babysit wrapper does not enforce these reads yet; until it does, the live config does not set `local-babysit`. The babysit wrapper (`babysit_merge.py` in the source-control plugin) may merge without a human only when every read below allows it. Each read happens at one captured base SHA, and any read that fails counts as a refusal. The `merge:` block and `babysit_loop_merge` are also read at the default branch head, and each setting takes the stricter of the two values: the lower rung, any true switch, the union of path lists (each side's `check-inputs` read in a diff of its own), the smaller cap, the stricter Dependabot mode. Two settings are exceptions: `risk-escalation-minutes` keeps the base's value, and `max-in-flight` is read at the default branch head alone, so a raised cap applies at once. So a tightening on the default branch reaches pull requests opened before it, a loosening waits until a pull request's base includes it, and a pull request still cannot drop its base's declaration. A different authority, or an identity set on one side only, stops the lane and its queued entries leave; two different identities, or an unreadable head config, refuse. The pr-merge gate reads a Dependabot pull request's `.github/dependabot.yml` and Dependabot policy at the default branch head too (read once per run-cache window, and again before an enqueue), by the rules that only tighten in [Dependabot pull requests](#dependabot-pull-requests) and [Review-only dependencies](#review-only-dependencies). - **Authority and identity.** `merge.authority` reads `local-babysit` and `merge.agent-identity` names the login the lane acts as. The schema rejects `local-babysit` without an identity. The identity must be the `[bot]` login of a GitHub App dedicated to this lane, and the schema rejects any other login: a machine user is a GitHub user and would pass every human test, and the shared `github-actions[bot]` and `dependabot[bot]` are refused in any letter case. With no `merge:` block, or no `authority`, the wrapper merges nothing. - **Same repository.** The pull request's head is in this repository, never a fork. - **Risk score.** A diff the risk scorer rates LOW merges, and so does a MEDIUM one whose every reason is a size or reported-finding reason (`lines-over`, `files-over`, `no-patch:*`, `findings:claude-review`, `findings:claude-security-review`, `cost-finding`). Every other MEDIUM reason (unbound or missing review evidence, an unread file listing) and every HIGH one refuse. `no-patch:` is an image, font or PDF, or a file whose blob ids show no unread content: a rename, mode change or modification that keeps its blob and does not gain execute, or an empty file added or removed. Any other file the files API sends no patch for (a script with a NUL byte that git calls binary, an over-size patch, a copy, an unread blob id) no review read, so it holds for a person as `unreviewed-patch:`. - **Review flags.** A review flag holds only for a real new charge (`cost-review-required`), a trusted-actor widening (`trust-gate:trusted-actors`) or a CRITICAL security finding (`security-finding`), owner decisions Q25, Q33 and Q693. Every other open finding, from claude-review or a lower security one, is listed in the reasons and does not hold. - **Review evidence.** For each review lane, the newest run of the lane's caller workflow on the pinned head SHA concluded success and carries the lane's completion record for that SHA. - **Effective rung.** The lowest of `merge.rung`, the `babysit_loop_merge` key (the value in `docs/conventions/source-control.yaml`, `off` when it sets none or the wrapper cannot read or trust the file), the cap variable, and `off` while any demotion issue holds. - **Cap variable.** `CLAUDE_LANES_MERGE_RUNG_CAP` (`off`, `merge` or `merge-reviewed`, or the aliases `C2` and `C3`) is a repository variable only a human sets, and it can only lower the rung. The wrapper never writes it, and the identity can read variables but not write them. A 404 after the variables listing proved readable means no cap; any other failure means `off`. - **Kill switches.** The org variable `CLAUDE_LANES_DISABLED` and the repository variable `CLAUDE_LANES_REPO_DISABLED` must each read exactly `false`. A read error, or a repository-level variable named `CLAUDE_LANES_DISABLED` that shadows the org one, refuses. - **Demotion issue.** A failed post-merge check files an issue whose body starts with ``. A record is a state marker, never lane work: no record is sent to intake triage, since the fix issues carry the work, and its text keeps the fix-issue rule (each newly failing check by job name only, never a gate's annotation title or a revert command). `post-merge-file-demotion-issues.yml` files a red-main record (signal `schedule` or `dispatch`) with no label, since it clears itself (below), unless a failing check got no fix issue (over the cap or outside the charset), which labels it `needs-human`; it labels a canary or revert record `needs-human`, since a green main clears neither; each keeps the label until it lifts (below). `babysit_postmerge.py --remediate` labels every record it files `needs-human`: the lanes App's issue starts intake triage on its own, and that label keeps admission off it. On each completed scheduled full run on main, the alert's `close-cleared` job closes as completed each open schedule or dispatch record, demotion or post-merge-failure, that either filer opened, that was never edited, and that a later green full run on main cleared by the merge gate's own rule (`_recovered_at`: attempt 1, a schedule or a github-actions[bot] dispatch, created after the record, at a commit ahead of its SHA and on main); closing it is the record's state only, and the merge gate still decides whether it holds. A fix issue not delivered to intake triage gets a hidden marker comment on it and on its record, a quarantine issue one on the issue, and a check whose fix issue could not be filed or reopened one on the record; each alert run retries what a marker names until it succeeds, with the failing run staying red, and adds no label. A record gets `needs-human` when a failing check got no fix issue because it was over the cap or outside the charset; a fix issue reopened on a repeat failure keeps whatever labels it has, so one labeled `needs-human` stays with a person. It holds the rung at `off` until it clears: a human's direct close clears any record. A close through a pull request's or commit's `Closes #N` does not count, and an issue that a non-human edited at any time stays in force. A red-main record (signal `schedule` or `dispatch`) that no non-human edited also clears, open or not, once main is green at a later commit: a green `pr-require-checks` run on main, attempt 1, from a schedule or a `github-actions[bot]` dispatch, created after the record, at a commit ahead of the record's SHA and on main's history. The earliest such run's creation is the clear time, read a week at a time from the record, oldest first, up to about a year and stopping at the first week that clears it, so newer runs never move it and a record cleared long ago reads one week. A canary, revert or read-back record that no non-human edited lifts, open or not, on its own evidence (`babysit_merge_policy.py` `_lift`), in either of two ways. (1) Its own condition holds on main again: for a canary or revert record, every line its lift block counts is in that path's file at main's tip, as often as it was deleted, over and above the copies the file held at the record's own SHA, so a moved or common line the deletion left behind is no restore and a final newline is no blank line (once the lane closed it, at the commit its close comment's `` line names, so a later edit on main does not re-demote a closed record); for a read-back record, the pull request it names reads back after all (the agent identity's newest pin comment among its first 100 comments is unedited, was posted no later than the merge and names the head that merged). The record's creation is the clear time. (2) A pull request that references the record merges into `main` of this repository after it was filed, at a merge commit on main's history; the reference was made no later than the merge by a person with write access or the agent identity (anyone can mention the record in a comment on a pull request, merged or not, which also makes a reference); and the record's own condition holds at that merge commit: a canary record's counted lines are in the tree there, or, when its block says the merge deleted nothing (the canary failed on its self-test, replay or restoration step), a canary push run passed there; the pull request reads back, for a read-back record, which can happen only when a pin exists for that merge (while the record holds the rung is off and the wrapper pins nothing); a revert record needs nothing more, since the referencing merge confirms the revert. The earliest such merge is the clear time. A failed read, more than 100 references or more than 100 comments lifts nothing. The lift block is one line, ``, holding per path the first 12 hex digits of each deleted line's SHA-256 and how often it was deleted (`babysit_lift.py`). The alert writes it into a revert record from the lines its revert commits deleted, and into a canary record from the lines `scripts/check-silent-revert.sh` attributes to a culprit in the pushed commits (its `DELETED_SINK`); for a canary record `babysit_postmerge.py --remediate` filed first, the alert posts the block as a comment, which counts when github-actions[bot] or the agent identity wrote it and nobody edited it. The one exception is a canary record with no block, because the pushed commits are not in main's checkout or were not all read (more than 20 since the previous canary push run's head, or that head unreadable or off the push's history), the scan could not run, or the block passed 40,000 characters: no lane can tell what was deleted, so only a person's close clears it. On each completed scheduled full run on main, `close-cleared` runs `babysit_lift.py close` from main's checkout, which comments on, removes the human-gated label from and closes as completed each open canary, revert or read-back record either filer opened that has lifted by that same rule; post-merge-failure canary records lift and close the same way. A push to main files a `revert` record when one of its commits names a pull request it reverts and the lanes App enqueued that pull request or its enqueuer cannot be read; a revert of one a person enqueued files nothing, and one on a record-mode path gets labels only ([Merge paths](#merge-paths)). The file-demotion-issue job finds the revert and hands the record, through its job outputs, to the `file-revert` job, whose token holds `issues: write` alone; that job re-reads the revert records and files nothing when one already lists every revert commit. A commit names it on a line of its squash message: `Reverts` (optionally after a `-` or `*` bullet) followed by `#N` or `/#N` references, each counted; a GitHub revert-button subject `Revert "... (#N)" (#M)`; or `This reverts commit ` or the red-main bot's ``, through that commit's `(#N)` subject. Every canary push run, whatever it concluded and on every attempt, reads every commit the push brought, a merge-queue batch included: main's first-parent range since the previous canary push run's head, at most 20 commits, and the newest 20 when that head cannot be read or is not on the push's history, read from main's full history. A revert commit any revert record already lists, in any state, is skipped, so a commit is filed once and never again after a person closes its record. A reverted commit whose pull request cannot be read is an unproven revert and files the record. The wrapper finds these issues by author (the agent identity or `github-actions[bot]`), so removing the marker or the label does not clear one. When `post-merge-file-demotion-issues.yml` proves that no merge the failing run covers was enqueued by the agent identity, it files a post-merge-failure record instead, first line ``, labeled as a record of its signal is: a full-run one carries no label unless a failing check got no fix issue (over the cap or outside the charset), since its fix issues fix main, and a canary one is labeled `needs-human` on purpose, since a canary files no fix issue and nothing else clears it. That record does not hold the rung off. With a new record of either kind, the alert files one fix issue per newly failing check, at most 5 per run (an overflow line on the record says when more failed, and labels that record `needs-human`, as does a failing name outside the fix-issue charset), first line ``, in fixed text only (the failing job's name, the SHA, the run link, the merge range and the record's number, never an annotation title), with no label, locks it, and dispatches intake triage for each; a fix issue that could not be filed, locked, reopened or sent is named in a comment on the record. A check whose fix issue was closed reopens that issue with a comment naming the new range, keeping `agent-ready` and sending it to intake triage no second time, so a repeat goes straight back to agents (a first failure still waits for the owner's ratification). That reopen starts no run, so work-unblock's hourly sweep removes and re-adds `agent-ready` with the lanes App token, once per recurrence comment, unless the issue is held or has an open lane PR or a lane run in flight; one closed as not planned or duplicate stays closed and mutes the check. Closing a fix issue releases nothing on the record. - **Opt-in label.** `merge: agent-allowed` makes a pull request eligible; it does not make it safe, and the diff risk score still decides. It counts only when a human added it last and the pull request body was not edited afterwards. - **Narrow path floor.** A set of globs, each with a class: `babysit_risk.FLOOR_CLASSES`, the paths every consumer shares, joined to the repository's `merge.diff-check.floor-paths` rows (`glob`, `class`, and on a `gate` row an optional `author-lift: false`, which keeps the row with a person). A row can add to the floor and never drop or loosen a built-in row, and a row the loader cannot use turns the rung off. `scripts/sync-hold-floor.py` writes the joined table's copies into `merge-holds.mjs` `HOLD_PATH_CLASSES`, the review callers' `hold-paths` and ci-status's `hold_patterns`, and `test_merge_holds_sync.py` runs its `--check` (owner decisions Q-FLOOR (B), [Q-ENFORCE (A)](https://github.com/melodic-software/claude-code-plugins/pull/9826#issuecomment-6401599691) and Q26 option B). The floor matches case-insensitively whatever `high-path-floor` says, while `merge.diff-check.path-holds` is true (owner decision Q15 turns it off here): - `trust`, a person merges it: `.github/actions/request-lane-token/**`, which mints the lanes App token, `.github/actions/resolve-config/**`, whose code the token broker runs from main in its signer process with `effect-grants.json`, `lane-rules.json` and `activity-rules.json`, which scope each lane token, `docs/conventions/pr-pipeline.yaml`, whose activity `effect:` values and lane slots the broker reads, `.github/actions/check-trusted-trigger/**`, `.github/actions/check-kill-switch/**`, whose output writer both actions use, `**/CODEOWNERS`, `**/.gitmodules`, and the code that computes the author lift and the hold tables: `babysit_merge.py`, `babysit_merge_policy.py`, `babysit_risk.py` and `babysit_review_evidence.py`, which compute the security review's clear condition, `.github/scripts/pr-merge/merge-holds.mjs`, `scripts/sync-hold-floor.py`, which writes the floor's copies, and the pr-merge scripts that apply and enforce the holds: `enable-auto-merge.mjs`, `superseded.mjs`, `clear-escalations.mjs`, `gate-check.mjs` and `head-ref-map.mjs`. - `gate`, a person merges it: the rest of the merge gate's own code, which is the rate guard (`.github/actions/log-api-budget/rate-guard.mjs`) with its rate-limit defaults (`.github/actions/log-api-budget/rate-limits.json`) and every other script of `.github/scripts/pr-merge/`. And the review's own surface (owner direction 2026-10-28): the review callers and `pr-review-main.yml` with `.github/scripts/pr-review-main/**`, which run the review itself and set the counts the gate reads, and each workflow that holds a credential beyond its job's `GITHUB_TOKEN`: a secret other than `GITHUB_TOKEN`, a lane token (`request-lane-token`), or an OIDC token (`id-token: write`), `pr-merge.yml` and `pr-unblock.yml` among them (owner decision Q11 (A), 2026-10-28: a job token dies with its job and cannot push to main past branch protection, while an App key or PAT outlives the run). So is ci-status, `pr-require-checks.yml`, which posts the required status and runs the hold step, named by file, and each workflow whose job token has `actions: write` (or `write-all`), which can dispatch those credentialed workflows, `intake-reenter.yml` and `pr-dispatch-feedback.yml` among them: a logic edit inside scopes it already holds trips no patch hold, so a model verdict alone never clears it. 23 workflows are gated. `scripts/sync-hold-floor.py` derives these rows from the workflow files with `babysit_risk.gated_workflow`, so a workflow that gains a secret or `actions: write` joins the gate, and `--check` fails on a stale table. A workflow whose job token writes other scopes only is off the gate: the main-run review binds it, and a gained write scope, trigger, secret or model leg holds by its patch. Also what changes what agents may do unattended or what later reviews judge against: `**/.claude/**` and `**/.claude-lane/**` whole (settings, hooks and the scripts settings registers, skills, agents, commands, rules, output styles and memory, under owner decision Q11, which supersedes the 2026-10-22 direction for rules), `docs/conventions/source-control.yaml` (the babysit loop's team layer, trusted bot logins included), `docs/conventions/instruction-exception-register/**` and `docs/conventions/untrusted-content/**` (the security review's criteria), `**/.mcp.json`, `**/CLAUDE.md`, `**/CLAUDE.local.md`, `**/AGENTS.md`, `REVIEW.md` and `docs/standards/**`. On a pull request a person on the trusted-actor list opened, a `gate` path only that person's own commits touched clears as an `enforcement` path does (owner direction 2026-10-27: such pull requests merge without a person's review), on a head pr-verify passed (`babysit_merge_policy.author_reviewed_paths`, `babysit_risk.Floor.author_review`). A lanes App or other bot pull request, a lane's fix commit on a gate path, commits that do not read, and a path a `trust` glob or a configured denied path also matches keep the person's hold, so a lane changing its own powers is still merged by a person. The review's own surface above never takes this lift (`babysit_risk._NO_AUTHOR_LIFT` and every workflow row), so it always waits for a person. The token-scope files and the lift and hold-table code and the scripts that apply the holds are `trust`, never `gate`, so they never take this lift: agents commit as the trusted owner, so a pull request that widens a lane token's scope, widens the lift, drops a floor row or weakens a hold waits for a person. - `enforcement`, a clean security review clears it: every other module the floored scripts import (`.github/scripts/pr-unblock/address-feedback.mjs`, `gate-source.mjs` and `thread-scope.mjs`, `escalation-routes.mjs` and the routing table `escalation-routes.json` it reads, `.github/scripts/work-resolve-issue/report-outcome.mjs` and `limits.mjs`, `.github/scripts/lib/retry-fetch.mjs` and `lane-hold-marker.mjs`, and the stop routes `report-outcome.mjs` loads, `stop-routes.mjs` and `stop-routes.json`, and `fix-ci-context.mjs` with the `.github/scripts/maintenance-reconcile-lost-runs/infra-failure.mjs` it loads), the scripts that act on a pr-unblock stop's route (`report-escalation.sh`, which labels a held reason, `adjudicate-feedback.mjs` and `publish-feedback.mjs`, which decide and resolve threads, and `.github/scripts/apply-patch/apply-patch.mjs`, which holds fix-ci escalations) with every module they import (`request-budget.mjs`, `dependency-classify.mjs`, and `predicates.mjs` and `protected-paths.mjs` in `apply-patch/`, and `.github/scripts/lib/run-main.mjs`), and the rest of the Python that decides the holds (`babysit_verify_evidence.py`, which `enable-auto-merge.mjs` runs, and the `babysit-prs/scripts/` modules it and `babysit_risk.py` import). It scores HIGH as `review-path:` until the `claude-security-review` evidence binds to the head with no open finding, then merges with no person; ci-status leaves it to the gate. A lane source is a path the head's checkout feeds or forges its own review from (`LANE_SOURCE_PREFIXES` and `readonly_workflow` in `babysit_review_evidence.py` state the rule). A pull request that changes one binds its reviews only from main (see "Main-run review" below). A changed workflow file is not one when its head copy cannot post as `github-actions[bot]` with a write token nor reach a secret: a top-level `.yml` other than the two review callers and the floor workflows (`babysit_risk.Floor.all`), present at the head, with every job's `permissions:` read-only and set explicitly, no `pull_request_target`, `workflow_run` or `workflow_call` trigger, no `secrets` reference but `secrets.GITHUB_TOKEN`, and `name:` equal to its file stem or that stem in Title Case. A deleted workflow stays a lane source, and so does every floor workflow whatever its content. The `merge` and `enable-auto-merge` jobs install the hash-pinned PyYAML from `.github/requirements-ci.txt` for that read; without it no workflow change clears. A comment by a lane author (`github-actions[bot]` or the Claude App) binds only while its last editor is its own author: anyone with write access can edit a comment, so one edited by another identity unbinds the review as `comment-edited`. The edit is read before the body, so an edit that removes the lane footer or the marker line still unbinds. **Main-run review.** The pull_request review lanes run the head's copy of their callers and post as `github-actions[bot]`, which any write-token workflow a head adds can also post as, so for a pull request that changes a lane source no comment, marker or pull_request run counts. `.github/workflows/pr-review-main.yml` reviews it instead: it runs on `pr-require-checks`' completion through `workflow_run`, so its definition is main's, gates the trigger as pr-verify does, and for a pull request whose changed files include a lane source runs both lanes on the head's diff as data, each lane's criteria and the standards copied from main, with a read-only token and a model that may only Read its data directory. A head both lanes already reviewed, where the merge gate's own predicate (`_main_bound`) binds each lane on what the check-trigger job reads, is not reviewed again, and no leg starts for a pull request with no lane source. A verdict counts there only when its run's main commit has no diff from main's tip over what the review reads from main (`.github/scripts/pr-review-main/criteria.txt`, which the copy steps also read), so a verdict judged under other criteria reviews again; a failed or cancelled review, another head of the same tree, or a failed read, fetch or diff reviews again. The diff is `git diff --text`, so a file git would call binary is shown as text, and a patch that still holds a binary file gets no verdict. A patch over 300000 bytes is split into chunks of at most 300000 bytes, cut at file boundaries with each file whole (`split-diff.py`); each chunk is reviewed by its own run, in order, and the lane's one verdict sums the chunks' findings and takes the most CRITICAL ones any one chunk found; the verdict's `items` give each finding its `chunk`, so they can hold more CRITICAL items than its `critical` count, which alone binds. A patch that holds a single file over 300000 bytes, or needs more than 4 chunks (the diff step's `MAX_CHUNKS`, at most the leg's review steps), gets no verdict: a multi-file diff over about 1.2 MB still stops as `too-large` until a dynamic chunk count lifts it ([#11000](https://github.com/melodic-software/claude-code-plugins/issues/11000)). A chunked diff also writes `manifest.txt` in the data directory, every file of the whole diff with its chunk and status (added, modified, deleted, or renamed with both paths), up to what one Read returns whole (`PART_BYTES`). Each chunked prompt names that file, tells the reviewer to read it as untrusted data, and asks for a finding naming both paths when a change references a file another chunk holds; the paths, which the pull request's author chose, never enter the prompt, and a one-chunk prompt is unchanged. The diff step logs a `pr-review-main chunks` notice with the chunk count, each chunk's bytes and `manifest_paths`, the files the manifest names, and the verdict step one `pr-review-main chunk` notice per chunk with its bytes, findings and CRITICAL ones. Each chunk is split into parts one Read returns whole (15000 bytes and 1000 lines at most), and a verdict is written only when every chunk's run succeeded and read each of its parts whole, with no offset or limit (`write-verdict.mjs` `readCoverage`). A chunk that hands off hands the whole lane to the next leg, which reviews every chunk again. Read may cut a long line short, so a diff line over 1800 bytes (`babysit_risk.LONG_LINE_BYTES`) continues on lines that start `\ continued:`, never cut inside a UTF-8 character, as pr-verify's `chunk-diff.sh` folds; the prompt says each such line is the rest of the line before it and adds no line to the file's numbering. Every byte reaches a whole Read, and the binder counts no verdict whose recorded `max_line_bytes` is past the cap. The diff is `--no-renames`, so a renamed file is reviewed whole. Only when that patch is over the size cap does a file moved unchanged (git's 100% similarity) show as its rename lines alone, and even then a move into or out of a lane source (`lane_source`), one that changes the file mode or moves a symlink or submodule, one that may run or load (an executable, a path under a `skills`, `agents`, `commands` or `hooks` directory, or a file a tool reads by name such as `SKILL.md`, `hooks.json`, `plugin.json`, `marketplace.json`, `conftest.py`, `__init__.py` or `settings.json`), and one whose new path, last directory and name, name, or name without its extension an added line names show whole (`write-diff.py`); the prompt tells the reviewer a rename-only entry is unseen and that a change referencing a moved path is a finding. The caps apply after. A verdict binds only when the head also carries the report-review-counts job's `pr-review-main: ` check run with the same counts, so a run cancelled before it recorded binds nothing. Each lane uploads `verdict.json` as `pr-review-main---`, the tree read by git, never the model, and a separate job with no model posts its counts as the check run `pr-review-main: ` (titled `findings= critical=`, conclusion neutral) on the reviewed head. A designed stop (a binary file or a patch over the chunk cap) leaves the leg green with no verdict, and the report-review-counts job posts it on the head as the same check run titled `verdict=none reason=`, so each stop is a countable record; it posts nothing else. `chunk-failed` is a chunked review one of whose chunks failed, left no result or skipped a part: no chunk's counts bind, and that leg still fails. A stop counts no CRITICAL finding and never binds a lane: with no verdict the lanes stay unbound as `main-review-stop:`, a lane's reason. A forged stop only renames that reason. The gate (`babysit_review_evidence._main_bound`) counts a verdict only when its run is that file, event `workflow_run`, on the default branch of this repository with a head the branch holds, and the verdict names that lane, pull request and tree. As with pr-verify's FAIL, a finding counts whatever the run's conclusion; the lane binds only when a counted verdict from a completed, successful run names the pinned head, with the most findings, and the most CRITICAL ones, that any counted review of that tree reported, so a re-run, a failed run or an empty commit never clears one. The security lane also keeps any CRITICAL finding its pull_request review left open, and the most CRITICAL findings any `pr-review-main: claude-security-review` check run records on any head of the pull request (its commits and the heads force pushes replaced), so a whitespace push whose new tree reviews clean cannot re-roll one away. Check runs were chosen over a comment because the checks API has no delete: a pull_request workflow's token can delete an artifact or a comment, not a check run, and a forged one can only add a hold. A count that cannot be read leaves the lane unbound. With no such verdict the lanes stay unbound (`lane-source-changed`), a lane's reason, and a floor `enforcement` path beside it waits for that review. Each lane runs one leg on the reviews role's credentials in the review lanes' order: the API key (`REVIEWS_CLAUDE_API_KEY`); then, for a lane whose key leg handed off (a credit stop, a 401 or 402) or whose key is empty, the subscription token (`REVIEWS_CLAUDE_CODE_OAUTH_TOKEN`) in the `review-subscription` job; then, for a lane that leg handed off (a limit stop, a credit stop, a 401 or 402, or an empty token) with `FALLBACK_CLAUDE_CODE_OAUTH_TOKEN` set, the fallback token in `review-fallback`. Each leg is a job on a new VM holding one credential, and a route job with no secret passes on only lanes whose handoff reason is in a closed set. The key leg checks out the main tip when it starts and records that commit; a later leg checks out the recorded commit, which the route passes on only as 40 hex characters, so a re-run of an old run cannot bring back older review code. Every leg writes the same verdict, so neither the report-review-counts job nor the gate depends on the leg; the lane record (`report-lane-outcome`) names the credential and why the leg ran. A handed-off leg stays green, so a later leg's verdict still comes from a successful run. A run whose first attempt failed before any lane's verdict write started (every leg stopped) is re-run once, recorded, by the lost-run reconciler, as a lost pr-verify run is (`maintenance-reconcile-lost-runs`); any other run that leaves no verdict leaves the lanes unbound until the next push. `merge.diff-check.denied-paths` (empty here) joins the person classes. `test_merge_holds_sync.py` derives the JS and Python import closures and requires them on the floor, with every pr-merge script as `gate`. No other path is held for being trusted (owner direction 2026-10-24): the trusted-actor list and every other path merge on the review lanes, which judge them. A `plugins//.claude-plugin/plugin.json` or `.claude-plugin/marketplace.json` change that installs or runs something new is a security-review finding, not a hold; where `high-path-floor` is on, the gate still scores it HIGH as `manifest-review-required`, and this repository sets it off. Here the security review is the only control on such a change: no deterministic check holds it, and the review's CRITICAL rating of an added `hooks`, `mcpServers`, `lspServers` or `monitors` key, or a marketplace entry added, removed or repointed, is what holds it ([owner decision Q-FLOOR (B)](https://github.com/melodic-software/claude-code-plugins/pull/9826#issuecomment-6399729716)). - **Trusted-actor widening.** A change that adds or widens an entry in `.github/standards/trusted-actors/trusted-actors.json` scores HIGH as `trust-gate:trusted-actors` in both lanes and waits for the owner, whatever `high-path-floor` says and whatever an adopted author's own paths leave off the floor. The gate compares the base and head entries: a change that only removes entries merges; an added or changed entry, any other key changed, a side that cannot be read or parsed or repeats a key, and an added, removed, renamed or copied list hold. An owner cost decision does not clear it. `ci-status` holds the same widening on a lanes App pull request pushed after auto-merge is armed (`merge-holds.mjs` `actorsHold`), lifted as a hold path is (see below). - **Security findings.** The security lane flags; only a CRITICAL finding, its top tier, holds the merge, as `security-finding`. Its inline comments and summary carry the severity lines `/review:security-review` defines, and a finding whose severity the gate cannot read counts as CRITICAL. Its other open findings are reported as `findings:claude-security-review`. - **Cost hold.** Cost is not a stop; only a real new charge is ([when work stops for the owner](../../contracts/loop-lane/README.md#when-work-stops-for-the-owner)). A change that could start one (billed infrastructure or billed runner minutes) scores HIGH as `cost-review-required` in both lanes, whatever `high-path-floor` says and whatever an adopted author's own paths leave off the floor, and waits for a human like any other HIGH reason. It catches: - any changed Pulumi project or stack file (`Pulumi.yaml`, `Pulumi.*.yaml` and their `.yml` and `.json` forms, which [Pulumi reads too](https://github.com/pulumi/pulumi/blob/master/sdk/go/common/encoding/marshal.go)), `*.tf`, `*.tf.json`, `*.tfvars`, `*.tfvars.json`, `*.bicep` or `*.bicepparam` file, any ARM template under the names [Azure's quickstart samples use](https://github.com/Azure/azure-quickstart-templates/blob/master/1-CONTRIBUTION-GUIDE/README.md) (`azuredeploy.json`, `azuredeploy.*.json`, `*.azuredeploy.json`, `*.azuredeploy.*.json`), and any file under a directory that holds a Pulumi project file at the base. A base tree the gate cannot list whole holds every file; - a file renamed or copied into `.github/workflows/` or a `pr-pipeline.yaml` path from outside; - a runner value the workflow's head text gains over its base text, or an added inline `runs-on:` value: on a public repository only one that is not a free literal (GitHub's standard `ubuntu-*`, `windows-*` and `macos-*` labels, the self-hosted managed labels, or a list holding `self-hosted`), so an expression, a `group:` and a larger runner hold, since [GitHub bills larger runners even on public repositories](https://docs.github.com/en/billing/concepts/product-billing/github-actions); on any other repository every one, and any added `windows` or `macos` line. A `runs-on` expression that names a matrix key or an input (`${{ matrix.os }}`, `${{ inputs.runner }}`) counts each value that key or the input's `default:` and `options:` gain in the same file; - on a repository not known to be public, an added `cron:` key in any YAML or JSON spelling (a schedule runs billed minutes), a raised timeout as below, or an artifact `retention-days` the patch adds above every one it removes, or above GitHub's [90-day default](https://docs.github.com/en/organizations/managing-organization-settings/configuring-the-retention-period-for-github-actions-artifacts-and-logs-in-your-organization) when it removes none (storage past the free quota); - a workflow or pipeline file with no patch. Off a public repository, a raised timeout is a `timeout-minutes` or `leg-timeout-minutes`. In a workflow whose head text uses one of the model actions below, or could not be read, it is one the patch adds above every one it removes once equal values cancel, so a value removed and re-added on another job hides nothing, or one set to an expression. In a workflow whose head text uses a model action or a local `uses: ./` workflow or action, it is also, head text against base text at each job's key path (a step's timeouts compared among its job's steps), block or flow style, one raised, set to an expression, added above the highest number already at its path, a `timeout-minutes` set where none was above GitHub's [360-minute default](https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax), or one removed from a job or step the head still has, so that default or the action's own applies. A `leg-timeout-minutes` set where none was is a cap, not a raise. Cost means only what can bill. Model usage under a subscription or prepaid credit does not, so a `--model` or `--max-turns` flag reports nothing; nor do hosted minutes or artifact storage on a public repository, so a `cron:` key, a raised timeout or a raised `retention-days` there reports nothing. Any `pr-pipeline.yaml` change is reported as the MEDIUM `cost-finding`, which never holds, except one whose added and removed lines are all blank, comment-only, or a `description:` or `title:` value, or that only edits trailing comments on the same lines in place. Flow style, quoted keys and new list items count. A workflow patch that gains a `secrets` reference (`secrets.NAME`, `secrets.*`, `secrets['NAME']`, `toJSON(secrets)`, `secrets: inherit`, or the bare `secrets` context anywhere in a `${{ }}` expression outside a string, such as `${{ secrets }}` or `contains(secrets, 'X')`, or in an `if:` value without `${{ }}`, job or step level, quoted or a block scalar; every `${{` starts a fresh read, and an expression whose string is still open where its read ends counts as one) scores HIGH as `secret-exposure-review`, and a workflow or composite action patch that gains a `uses:` of `run-claude-cli` or any `claude-code*` action or image (matched ignoring case) or a run line invoking `@anthropic-ai/claude-code` scores HIGH as `agent-surface-review`, each counted against the lines it removes, an expression split across a folded scalar read whole, so a moved line or a repin is not new; so does a composite action file with no patch to read, unless it is deleted, re-moded, or renamed from another composite action, with no line added. The secrets reference is also read from the head text against the base text, so a workflow with no patch is not skipped. A workflow whose token gains a write scope scores HIGH as `permission-widening-review`: base and head are parsed (PyYAML; without it, the text alone) and each job's write scopes compared, a job left with no `permissions:` of its own or at the top level counting as a gain because it runs on the repository default, an added file compared against none, and unread text, a repeated key or an alias holding. One that gains a `pull_request_target`, `workflow_run`, `issues`, `issue_comment`, `pull_request_review`, `pull_request_review_comment`, `discussion`, `discussion_comment` or `repository_dispatch` trigger scores HIGH as `privileged-trigger-review`. These widen what a credential, an agent or a write token can reach, not only spend, so a person clears them and no cost decision does. Accepted: a `secrets` reference moved within one file is net zero, so `secret-exposure-review` does not see it, and it adds no charge, so the cost hold does not either; where it moved is the review lanes' call. Other new triggers, a removed `concurrency` or job `if:` guard, matrix growth and `max-parallel`, a non-Claude model action, and paths outside the ones above (a workflow in a subdirectory of `.github/workflows/`, an ARM template under another name) are left to the review lanes' cost hold, which holds for a real charge (`pr-review-hosted.yml`). The hold clears only when the pull request body links an owner decision that covers it: a comment on the pull request's linked issue (its closing issue, or its `Refs:` issue as [The pr-merge lane](#the-pr-merge-lane) reads it) or on the pull request itself, in this repository, whose first line starts `**Decision recorded.** Cost:`, written by a User with admin permission who is not the agent identity or one of the gate's own logins, not posted through an App, and never edited; one on the closing issue must also be created after the pull request was. A link inside an HTML comment in the body counts for nothing. A push after the decision is an accepted residual: the decision is not bound to a head. The gate reads the linked comments only for a pull request the hold catches, and a failed read leaves the hold. A decision clears only this reason: a change that is also on the HIGH path floor still waits for a person to merge it. Cite the decision before the human-gated label lands; a body edit does not remove that label (only a new head or a person does). Not detected: budgets, billing settings and new paid services outside these files, and the shapes [#9241](https://github.com/melodic-software/claude-code-plugins/issues/9241) lists. azure-iac's Pulumi program is C#, and its deploy gate ([azure-iac#75](https://github.com/melodic-software/azure-iac/issues/75)) stops any Azure change for the owner at deploy time. The review lanes and the verifier judge the rest. Dependabot pull requests are not scored, so the hold does not apply to them. - **Merge queue.** The wrapper enqueues with `--match-head-commit`, never `--auto`, and only when every required check is green. An armed auto-merge request on the pull request is a refusal, and the wrapper disarms it. - **Merges in flight.** `merge.max-in-flight` (default 1) caps the identity's merge-queue entries plus its merged pull requests that have not passed the post-merge check. It is read at the default branch head once per cache window, not at the pull request's base (the base's value when that read fails), and read again uncached after an enqueue. The wrapper refuses at the cap, and an entry enqueued past it (another host's came first) dequeues itself. A red full run or canary run charges every unverified merge whose commit it contains, so a breakage found with several in flight demotes the rung and fails the post-merge check for all of them. The value is computed from `merge.in-flight-sizing`, measured burst rate, time in flight and lanes App spend, by `scripts/compute-max-in-flight.py`; the YAML states the formula. The gate reads a value above the schema's maximum as unset. A value above the merge-queue ruleset's `max_entries_to_build` needs no ruleset change: that setting throttles builds, not the queue's length, and this count also holds merges already out of the queue. - **Quarantined suites.** A red full run on the default branch demotes only for a newly failing suite (a test file) in the affected set of the merges since the branch's last green full run: `scripts/plan-test-lanes.sh`, the pull request runs' selector, over the paths changed since that run's SHA, run from a worktree of that green SHA with no token in its environment, so no merge judged can narrow its own set. A window that changes the selector's own files, or a plan that picks no suite, has no set. A suite is named from its test leg's log, in a Python leg only from lines carrying the nonce that step prints; a failed job whose suites cannot be named (a token without GitHub's `Actions` read permission cannot read the log, so it names none), a set that cannot be computed, and the merge gate's own suites (`GATE_SUITE_PREFIXES` in `babysit_postmerge.py`) demote. A suite outside the set that failed again on a re-run also demotes, unless it passed on an earlier attempt of the same commit (it is non-deterministic) or a full run at the last green commit failed it on some attempt (the merges did not cause it). Any other suite outside the set demotes nothing, the window counts as verified (its `max-in-flight` slots free), and the suite is quarantined: an issue marked ``, with no label and no assignee, filed by the agent identity's `--remediate` (whose issue starts intake triage) or by post-merge-file-demotion-issues.yml (which locks it and dispatches intake triage for it), so a lane picks it up. While that issue is open and younger than `merge.quarantine-days` (default 7, at most 30), the suite's out-of-set failures demote nothing; after that they demote again, even when the suite was already failing before the merge. An issue whose body was edited after filing, or whose title no longer names its marker's suite, excuses nothing from then on: the suite demotes until the issue is closed. Closing the issue ends the quarantine, and the suite's next failure outside the set files a new issue whose days start again, so closing an expired issue restarts its quarantine. A failure inside the set demotes whether or not the suite is quarantined, and an excused run gets no red-main report. Quarantine never changes a pull request's `ci-status` and starts no re-run. - **Repeat queue ejections.** `merge.max-queue-ejections` (default 2, at most 20) stops the wrapper enqueuing a head the merge queue has removed that many times for failed checks since the head last changed; the queue would eject it again on the same commits. A push resets the count. At the cap, a removal whose merge-group run failed only `CI Status` (and its `ci-status` alias) on a GitHub rate limit alone, by its failure annotations, is not counted once that limit has reset; a removal whose run or annotations cannot be read counts. An unreadable timeline, or 20 timeline items with no head change among them, refuses the enqueue. A refused head gets one `` comment naming the failing `merge_group` runs. Under `merge.lane-prs` `native`, `enable-auto-merge` applies the same cap before it arms a lanes App pull request (see [Native auto-merge](#native-auto-merge)). - **Stale check inputs.** `merge.check-inputs` lists git pathspecs the pull request checks read. When the base changed one since a pull request's merge base, the wrapper updates the branch from the base (`update-branch`, a merge) instead of enqueuing it; the new head enqueues on a later run once its checks pass. The answer comes from the local full-history clone of the base (never a shallow or partial one) with no API read; a head the clone lacks is fetched by SHA. The shared-copy registry (`scripts/shared-copies.txt`) counts only for a pull request whose own changes since the merge base touch the registry or a canonical or copy path it registers at the base tip, since a pull request touching none of them merges cleanly whatever the base registered; every other listed path counts for every pull request. With the registry listed, a canonical the pull request carries (its canonical or a copy touched, or a copy newly registered) that the base changed is refused as `shared-copy-sources-changed:` instead of updated: an update leaves the copies the pull request generated from its own canonical, so the fix is merging the base and running `scripts/sync-shared-copies.sh`. The wrapper escalates it: one `` comment naming the canonicals, the head and the fix, then the human-gated role label, both unchanged by a rerun at the same head; the `head-moved` clear removes the label once the head moves. On a lanes App pull request, pr-unblock's `sync-shared-copies` activity answers it with no model and no person: the dispatcher sends one run per refused head, a base-code job merges the default branch tip and runs the base's sync script, refusing a head that changes the script, its registry or `scripts/lib` (`shared-copy-tooling-changed`) and any write the base-tip registry lists as no copy (`shared-copy-path-unregistered`) and a merge that is not clean, which resolve-conflicts cannot take while the label holds it (`shared-copy-merge-conflicted`, queued for a session), and `apply-shared-copies` pushes one merge commit under patch-rules.json's `shared-copies` row, which admits only registered copies; when the merge already holds current copies, the commit is the merge alone. The new head moves past the refusal, so the next pr-merge sweep clears the label. Any doubt, an update the API refused with a 4xx (its status and message recorded as `updateError`), or a Dependabot head enqueues as before. An update with no answer (a timeout, no status, a server error) may have landed, so it holds the old head instead. Empty or absent updates nothing. - **Dependabot.** A dependency-manager author is never eligible for a local unattended merge. The pr-merge lane owns Dependabot pull requests (below). A human here is a GitHub user, not the agent identity and not an automation login, with write or admin permission on the repository. ### The pr-merge lane The same wrapper run with `--unattended --authority pr-merge` is the pr-merge lane's gate. It needs `merge.authority: pr-merge` and `merge.agent-identity` at the base and at the default branch head, and keeps every read above except six: - **Eligibility.** Not a fork or a dependency manager's pull request, opened by `merge.agent-identity` (the lanes App) or adopted, exactly one linked issue in this repository, and a diff where no path, either side of a rename, matches `merge.diff-check.denied-paths`. The linked issue is the closing issue (`closingIssuesReferences`), or, for a pull request with no closing issue at all, the one issue its body's `Refs: #` lines name (owner decision 2026-10-23: "why would we limit this? Seems like useless friction for now?"). A `Refs:` line counts only as a plain `Refs: #` from the first column, outside an HTML comment and a fenced code block; a `Refs:` line in any other form (another repository's issue, a URL, two issues, any other case) refuses `refs-line-not-plain`, two or more issues refuse `refs-issues:`, and a number that is a pull request, or names nothing (GitHub's NOT_FOUND, a typo), refuses `refs-not-an-issue`. A closing issue always wins, and the `Refs:` issue is read with the same fields, so the cost decision, the verifier verdict, the enqueue recheck and the worker tier's class, provenance and claim checks read it as they read a closing issue. Nothing closes it on merge: GitHub closes only on a closing keyword, and the lane closes no issue. Such a pull request is class C2, as a Dependabot pull request is: no `work-class:` label is read, on the issue or the pull request, and the diff-derived C2 checks of the risk score still apply. No opt-in label or lane claim is read. No linked issue, or more than one closing issue, refuses (`linked-issues:`); right before the enqueue the linked issue is read again and a different one refuses (`closing-issue-changed:>`). The linked issue also refuses, at eligibility and again before the enqueue, while it carries a label from resolve-issue's `activities.resolve-issue.applies-when.labels-absent` (`closing-issue-held: