diff --git a/GLOSSARY.md b/GLOSSARY.md
index 6b42d9d07..a20be9b48 100644
--- a/GLOSSARY.md
+++ b/GLOSSARY.md
@@ -28,6 +28,8 @@ _Avoid_: task, sub-task
**Ready issue**:
An open issue a **Pickup run** may take: labelled `ready-for-agent`, written by a **Trusted account** or a named author, with its most recent `ready-for-agent` labelling made by a Trusted account and with later title and body edits only by Trusted accounts or the authorized author, with no label that makes an **Unready Ticket** and no **Claim**, not a sub-issue, not a **Base fix**'s or a **Security run**'s fix issue, with no open blocker, either never started (no **Issue branch** and no pull request) or handed back at or after the last **Claim** ended, as recorded in its label history: by the **Day shift** applying `ready-for-agent`, or by thirdshift putting it back on a Spec whose Spec run ended only waiting, which it does only when only Trusted accounts or the authorized author have edited the Spec since its last Trusted `ready-for-agent` labelling, and otherwise labels the Spec `needs-triage`, and only when each of its open Tickets in its repository passes the Trusted account check for Tickets, and otherwise labels it `agent-failed`, left untouched long enough that whoever is shaping it has finished, and, if it is a **Spec**, with a **Startable Ticket** or with every Ticket closed and a resumable **Spec branch** on `origin` (the latest numbered branch, with no PR or an open PR). A hand-back made in the same edit as the Claim's removal counts in either listed order at that timestamp; a Claim applied at the same timestamp leaves the issue Claimed. On a Spec, the label says its Tickets are published. A `ready-for-agent` Ticket inside a Spec is not one: it is reached through its Spec, when the Spec is itself a Ready issue.
+
+An open pull request whose latest locally recorded Run ended at a **Self-merge check** hold keeps its issue waiting for the **Day shift**, even after a hand-back.
_Avoid_: queued issue, backlog item
**Trusted account**:
@@ -262,10 +264,12 @@ _Avoid_: computer use, video artifact, test skill, app harness
**Self-merge**:
The step at the end of a **Ticket run** asked to merge in which thirdshift itself merges Delivery's captured pull request by number in its repository, with a merge commit at the exact head whose CI it watched. A **Custom process** reaches that same step through a `self-merge` catalogue Step directly after `delivery`, and only when its command or the **User config** asks. A fresh observation validates its expected **Issue branch** and **Base branch**, open state, readiness and mergeability immediately before the request. GitHub guards the requested head, but offers no atomic expected-base guard against a retarget between that observation and the server merge. No human reviews it first. A failed or interrupted request counts as merged only when a completion observation of the same number confirms the requested head and expected branches. Completion then continues even after Command interruption. It ends with the **Issue branch** deleted, the issue closed by thirdshift, unless it is already closed, and the issue's **Claim** removed. A protected path in a Custom process holds it and leaves the pull request ready for review, as an unaddressed **Security finding** does.
+Before a Self-merge into the Base branch, a configured **Self-merge check** can leave the pull request ready for review.
+
**Repair loop**:
The rounds a **Delivery** goes through until the pull request's head is mergeable with the **Base branch** and its CI is green or absent. Each round merges the Base branch in (and, in a **Ticket run** asked to merge, any **Foreign commits**), pushes, watches CI, and starts a **Repair** for a conflict or for the branch's own red checks. When the Base branch moved while green or absent CI ran, a Ticket run asked to merge goes round again to merge it in. A Delivery that leaves the pull request ready for review stops on that head if GitHub reports the pull request mergeable, and the move is not counted; otherwise it goes round again. Repairs and upstream moves have fixed budgets. A **Custom process** may set a lower Repair cap. It cannot set a higher one.
-A **Sign-off hold** can end the loop ready for review once the pull request is mergeable.
+A **Sign-off hold** can end the loop ready for review once the pull request is mergeable. A **Self-merge check** can hold a requested **Self-merge** after the loop has settled CI.
**Repair**:
A follow-up agent session a **Ticket run** starts after the pull request exists, or a **Spec run** starts on its **Spec PR** after the **Spec review**: to resolve a merge conflict with the **Base branch** or the **Issue branch** on `origin`, to fix failing CI checks, or, in a **Ticket run** asked to merge, to review and fix **Foreign commits**.
@@ -290,6 +294,11 @@ Settled CI with a failing check. **CI watch** identifies which failures belong t
**Sign-off hold**:
A named check and hold label for a repository in the **User config**. When **CI watch** sees that check red, the open pull request carries the label on the watched head, and every other check has settled green, a **Ticket run**, **Spec run** or **Fix run** ends ready for review. The run releases its **Claim** or pull request reservation, and a requested **Self-merge** waits for the **Day shift**. The check and label appear in the **Inbox**, **Run notification** and **Command log**. Each machine that runs on the repository needs its own entry.
+CI watch handles the Sign-off hold independently of the **Self-merge check**.
+
+**Self-merge check**:
+A command a repository or host provides, which thirdshift runs immediately before a **Self-merge**. A repository script runs as committed on the **Base branch**. A nonzero exit ends the Run ready for review with the command's first output line as the reason. The **Sign-off hold** handles its named red check earlier in Delivery.
+
**Check re-run**:
The [one re-run](docs/guide.md#check-re-run-allowance) of a branch's own failed checks allowed per head commit within a **Delivery**, after a CI-fix **Repair** leaves that head unchanged and before a **Declined CI fix**. It gives a transient CI failure one chance to pass without another Repair. It is separate from the re-run of **Abandoned jobs**, which comes before any Repair.
_Avoid_: retry, re-trigger, CI re-run
@@ -397,7 +406,7 @@ Inbox, without adding to its count of active Commands.
Ready for review shows one row per validated pull request across the visible
**Commands**, including across the **Fleet**. A grouped pull request keeps its
contributing Commands available individually.
-An ending at a **Sign-off hold** appears in Ready for review with its check and label.
+An ending at a **Sign-off hold** or a **Self-merge check** appears in Ready for review with the reason.
_Avoid_: dashboard, feed, queue
**Needs you**:
diff --git a/docs/adr/0037-repositories-own-the-self-merge-check.md b/docs/adr/0037-repositories-own-the-self-merge-check.md
new file mode 100644
index 000000000..b80726b53
--- /dev/null
+++ b/docs/adr/0037-repositories-own-the-self-merge-check.md
@@ -0,0 +1,33 @@
+# Repositories own the Self-merge check
+
+A repository can configure one command to run immediately before a Self-merge
+into its Base branch. A successful exit allows the merge request. A nonzero
+exit, start failure or timeout leaves the pull request ready for review. The
+check receives the current and first-observed pull request bodies so the
+repository can apply its own policy and recognize a changed declaration.
+
+The checkout for an Issue branch can change during a Run. Read a repository
+command directly from the tip of the Base branch on origin, and execute the
+copy in Command scratch. An operator can also name an absolute host path
+outside worktrees and share it across repositories. The last readiness
+observation binds the check to the head and body being considered. GitHub
+guards the head at the merge request. A body edit detected in the final
+observation holds the PR, and GitHub offers no atomic expected-body guard
+after that observation.
+
+[ADR 0035](0035-a-sign-off-hold-is-ready-for-review-past-one-named-red-check.md)
+still governs Sign-off holds. The Self-merge check runs once CI and the other
+merge checks have cleared. Tickets landing in a Spec branch bypass it. The
+Spec PR runs it before landing in the Base branch.
+
+## Considered options
+
+- Teach `thirdshift-pr` to write Release Lanes and thirdshift to parse them.
+ Repositories own what their declarations mean and how their rules evolve.
+- Ship a built-in Door-only hold. Wait until several repositories run the same
+ check before promoting a lane or Door rule into thirdshift.
+- Run the command from the Issue branch. That would let a Run change the
+ policy deciding whether its own branch may merge.
+- Use a Custom process `command` Step. Delivery and Self-merge share a Repair
+ loop, and the catalogue puts no command Step between them. Built-in
+ processes also need the same check.
diff --git a/docs/guide.md b/docs/guide.md
index d2b9622c0..322c4047a 100644
--- a/docs/guide.md
+++ b/docs/guide.md
@@ -2907,6 +2907,61 @@ label_from = { "owner/repo" = ["maintainer-login"] }
Configure one **Sign-off hold** per repository with `delivery.sign_off_hold`. Repository keys and label names match without regard to case. Check names match exactly. Config validation rejects blank checks or labels, repository keys that differ only in case, and the factory's `in-progress` reservation label. Add the entry on each machine that runs on the repository.
+Configure a **Self-merge check** with `merge.self_merge_check`. Add the entry
+on every host that runs on the repository. Repository keys match without regard
+to case. The same repository can also have a Sign-off hold. CI watch handles
+the named red check and label first. The Self-merge check runs only when the
+pull request is otherwise ready to Self-merge.
+
+```toml
+[merge]
+self_merge_check = { "owner/repo" = "scripts/self-merge-check 'release policy'" }
+```
+
+The first word is the executable and the remaining words are its arguments.
+Use shell quoting to group words. A relative path names a repository script.
+Immediately before the check, thirdshift reads the committed script at the tip
+of the Base branch on `origin`, copies it to Command scratch and runs that copy.
+A symbolic link must resolve to a file in that same commit.
+To change the rule, merge a pull request that updates the script. Edits on the
+Issue branch have no effect on the check judging that branch. If the script is
+absent from the Base branch, the hold reason reports the missing path.
+
+An absolute path such as `/usr/local/bin/self-merge-check` names a host
+executable outside Git worktrees.
+
+Both forms run from Command scratch with `PR_NUMBER`, `REPOSITORY`
+(`owner/repo`), `BASE_BRANCH` and two pull request bodies in their environment.
+
+- `PR_BODY` comes from the readiness observation of the head about to merge.
+- `PR_BODY_AT_START` contains the opening body for a pull request created by
+ the Command. For an existing pull request, including a Fix run or
+ Continuation, it contains the body at the Command's first observation.
+
+A Repair can change `PR_BODY` while `PR_BODY_AT_START` keeps the starting text.
+The repository's check can allow a declaration where the starting body had
+none and hold a Repair that changes an existing declaration.
+If the starting body is unavailable, the Run leaves the PR ready for review.
+
+Exit `0` allows Self-merge. Any other exit, a missing or unstartable executable,
+or a one-minute timeout leaves the pull request ready for review. The first
+nonempty stdout line, trimmed and capped at 240 characters, becomes the
+reason. Without a line, thirdshift reports the exit status, timeout, missing
+path or start failure. The reason appears on stderr, in the Command log, in
+the Run notification and in the Inbox. The Run releases its Claim or PR reservation
+and keeps the open PR. A targeted Review that asked to Self-merge exits with
+status `1` when held. Ticket, Spec and Fix runs and author Review Passes
+exit successfully. If the body changes during the check, the Run leaves the
+pull request ready for review.
+
+Use `no-self-merge-check` or `--no-self-merge-check` to turn the check off for
+one Command. Use `self-merge-check` or `--self-merge-check` to require a
+configured command. If the repository has no entry, this is a usage error
+before work starts. Give at most one of these options per Command. The
+choice carries through to Runs dispatched by a Pass and to Base fixes. It
+applies to requested Self-merges into the Base branch, including the Spec PR.
+Tickets land into the Spec branch without running the check.
+
After saving the User config and any entered Credentials, `thirdshift setup`
checks the host tools for pull request **Visual evidence**: `gh >= 2.103.2`,
`ffmpeg` on `PATH`, and an installed Playwright Chromium executable. It checks
@@ -3834,8 +3889,9 @@ The word applies only to a Fix Pass: targeted Fix runs and other commands reject
it. An existing `fix- Once a Pickup run, an Architect run or a Security run knows its repository, it replaces that kind's last-fired time under the repository's log folder, before launch checks or the Command limit. Repeated skips update the time without adding Activity log lines. A Pass takes no Issue URL, so your operating system's scheduler can start it; thirdshift never schedules itself. A Pass is skipped while its repository is at its Command limit, A Fix run, The Pass otherwise searches open, non-draft, same-repository PRs by Trusted accounts, giving Merge conflicts and current-head CI red priority in ascending PR number. The Pass otherwise searches open, non-draft, same-repository PRs by Trusted accounts, giving Merge conflicts and current-head CI red priority in ascending PR number. The Fix-Pass-only word A Fix Pass checks every linked closing issue before and after reserving the PR. An Pending or re-running Base branch checks, an occupied CI reservation, or an existing repair branch or PR skip only Base branch maintenance and leave PR selection available. Stderr and the Activity log record the reason, including when no eligible PR is found. Failed opening Base CI sessions publish preserved work as draft repair PRs with a Fix Recovery command. An existing repair branch prevents another attempt if PR creation failed. Configure one Sign-off hold per repository with Configure a Self-merge check with The first word is the executable and the remaining words are its arguments.
+Use shell quoting to group words. A relative path names a repository script.
+Immediately before the check, thirdshift reads the committed script at the tip
+of the Base branch on An absolute path such as Both forms run from Command scratch with A Repair can change Exit Use After saving the User config and any entered Credentials, Architecture
- Architecture
thirdshift status, thirdshift cronjobs and their Console views read the same per-repository times; no reader starts work. A Custom process started with no issue, and neither an Issue-branch nor a Spec-branch worktree, counts toward the Command limit, runs beside other Passes up to it, takes no lock of a kind, and does not record a last-fired time. A file that declares either branch worktree is refused when no issue is given, before the Command limit.[pass] command_limit, 1 by default: every live Command on the repository on the machine counts, a Ticket run started on an Issue URL included, but only a Pass is skipped. Passes of different kinds share a repository up to the limit, but never two Architect runs or two Security runs at once: each of those holds a lock of its kind and a review worktree of its own, and reserves the plan or fix it dispatches on origin, as a Pickup run reserves its Ready issue. A Pass with nothing to do is skipped, not failed. Architect and Security runs wait while a Ready issue is open, so work you shaped goes first. A Custom process started with no issue is a Pass for that rule and does not wait on a Ready issue or an Architect idea, unless the file declares either branch worktree: that is refused before any session, rather than skipped. One started with an issue is not a Pass. Your scheduler can start Architect runs every few minutes and Security runs on a schedule, with fixing allowed.thirdshift fix <PR URL or number>, targets an explicit PR; with no PR target it is a Pass sharing the repository up to its Command limit. Without --author, it first checks the Base branch's origin tip. A failed first push attempt gets one failed-jobs re-run, then PR selection continues without waiting. Persistent or non-rerunnable failures get a CI-fix session on fix-<base>-<short-sha> and a repair PR targeting the Base branch; that Fix run ends the Pass. All red checks are its own, existing repair PRs prevent duplicates, and merge and email policy apply. Self-merge closes the Base branch's CI-red reports and Base fix issues.behind <n> or the repository’s fix.behind setting adds PRs at least that many commits behind, furthest behind first. The Pass skips a PR held only by a Sign-off hold even when it meets the behind threshold. An explicit Fix run leaves that PR ready for review and names the check and label. Optional base <branch> and --author <login> scope that search. Selection skips in-progress PRs and passes over head branches checked out locally, naming the PR and occupying path on stderr. When none can be taken, the Activity log skip includes those reasons without recording a failed Fix run. Occupied checkouts remain intact; an explicit PR target still fails and names the occupying path. Selection reserves and rechecks candidates before dispatch. Busy reservations pass through to the next candidate. Its fix-run Built-in process is delivery → self-merge, using the existing PR's head branch and Base branch without implementation or initial code review. It holds an origin reservation and in-progress through Repair and failure preservation, and records its own Command log and Run notification. Self-merge requires recorded agent authorship or review of the exact adopted head by thirdshift's GitHub account; completed Ticket, Spec and Base CI Deliveries record their delivered heads too. Absent that evidence, the repaired PR stays ready for review, preserving ADR 0004. Skips record an Activity log reason when it changes and send no notification. Later Passes skip PRs left as drafts. A closing-issue trust stop keeps unpublished Repair work local and leaves the PR in its current state.behind <n> or the repository’s fix.behind setting adds PRs at least that many commits behind, furthest behind first. The Pass skips a PR held only by a Sign-off hold or whose latest run on this machine ended at a Self-merge check hold, even when it meets the behind threshold. With no-self-merge-check, a PR held by the Self-merge check can qualify under the usual rules. A Merge conflict or settled CI red apart from the Sign-off hold keeps the PR eligible. An explicit Fix run facing a Sign-off hold leaves the PR ready for review and names the check and label. Optional base <branch> and --author <login> scope that search. Selection skips in-progress PRs and passes over head branches checked out locally, naming the PR and occupying path on stderr. When none can be taken, the Activity log skip includes those reasons without recording a failed Fix run. Occupied checkouts remain intact; an explicit PR target still fails and names the occupying path. Selection reserves and rechecks candidates before dispatch. Busy reservations pass through to the next candidate. Its fix-run Built-in process is delivery → self-merge, using the existing PR's head branch and Base branch without implementation or initial code review. It holds an origin reservation and in-progress through Repair and failure preservation, and records its own Command log and Run notification. Self-merge requires recorded agent authorship or review of the exact adopted head by thirdshift's GitHub account; completed Ticket, Spec and Base CI Deliveries record their delivered heads too. Absent that evidence, the repaired PR stays ready for review, preserving ADR 0004. Skips record an Activity log reason when it changes and send no notification. Later Passes skip PRs left as drafts. A closing-issue trust stop keeps unpublished Repair work local and leaves the PR in its current state.merge-base-fix grants Self-merge only to a repair newly authored by the Base branch CI step, through the usual Delivery and Self-merge gates. Selected PRs keep the ordinary merge / no-merge and merge.always policy. Thus thirdshift fix base master no-merge merge-base-fix merges a new Base branch repair and leaves selected feature PRs ready for review even when merge.always = true. Existing repair PRs selected later or retried gain no permission from this word or their branch name; merging one requires the usual merge policy, such as targeted fix <PR> merge. Omission, --author scoping and Ticket-run base-fix behavior are unchanged.in-progress Claim on a Spec or standalone Ticket run's issue, including on another host, makes it skip the PR and name the claimed issue on stderr. It can adopt the PR on a later Pass after the Claim ends. Unreadable links or labels fail closed; explicit PR targets keep their existing behavior. Once the Pass has selected a pull request, an untrusted author of a linked closing issue, or any title or body edit by an account that is not a Trusted account, stops the Fix run before the issue is used and does not take the next candidate.delivery.sign_off_hold. Repository keys and label names match without regard to case. Check names match exactly. Config validation rejects blank checks or labels, repository keys that differ only in case, and the factory's in-progress reservation label. Add the entry on each machine that runs on the repository.merge.self_merge_check. Add the entry
+on every host that runs on the repository. Repository keys match without regard
+to case. The same repository can also have a Sign-off hold. CI watch handles
+the named red check and label first. The Self-merge check runs only when the
+pull request is otherwise ready to Self-merge.
+[merge]
+self_merge_check = { "owner/repo" = "scripts/self-merge-check 'release policy'" }
+origin, copies it to Command scratch and runs that copy.
+A symbolic link must resolve to a file in that same commit.
+To change the rule, merge a pull request that updates the script. Edits on the
+Issue branch have no effect on the check judging that branch. If the script is
+absent from the Base branch, the hold reason reports the missing path./usr/local/bin/self-merge-check names a host
+executable outside Git worktrees.PR_NUMBER, REPOSITORY
+(owner/repo), BASE_BRANCH and two pull request bodies in their environment.
+
+PR_BODY comes from the readiness observation of the head about to merge.PR_BODY_AT_START contains the opening body for a pull request created by
+the Command. For an existing pull request, including a Fix run or
+Continuation, it contains the body at the Command's first observation.PR_BODY while PR_BODY_AT_START keeps the starting text.
+The repository's check can allow a declaration where the starting body had
+none and hold a Repair that changes an existing declaration.
+If the starting body is unavailable, the Run leaves the PR ready for review.0 allows Self-merge. Any other exit, a missing or unstartable executable,
+or a one-minute timeout leaves the pull request ready for review. The first
+nonempty stdout line, trimmed and capped at 240 characters, becomes the
+reason. Without a line, thirdshift reports the exit status, timeout, missing
+path or start failure. The reason appears on stderr, in the Command log, in
+the Run notification and in the Inbox. The Run releases its Claim or PR reservation
+and keeps the open PR. A targeted Review that asked to Self-merge exits with
+status 1 when held. Ticket, Spec and Fix runs and author Review Passes
+exit successfully. If the body changes during the check, the Run leaves the
+pull request ready for review.no-self-merge-check or --no-self-merge-check to turn the check off for
+one Command. Use self-merge-check or --self-merge-check to require a
+configured command. If the repository has no entry, this is a usage error
+before work starts. Give at most one of these options per Command. The
+choice carries through to Runs dispatched by a Pass and to Base fixes. It
+applies to requested Self-merges into the Base branch, including the Spec PR.
+Tickets land into the Spec branch without running the check.thirdshift setup
checks the host tools for pull request Visual evidence: gh >= 2.103.2,
ffmpeg on PATH, and an installed Playwright Chromium executable. It checks
@@ -3641,8 +3688,9 @@
it. An existing fix-<base>-<sha> PR selected later gets no merge permission
from its branch name or this word; use a targeted thirdshift fix <PR> merge
to request its Self-merge explicitly. --author still skips Base branch CI
-maintenance. A Ticket run's own base-fix still always merges, as
-ADR 0008 requires.base-fix still requests Self-merge under
+ADR 0008. A configured Self-merge
+check can hold the Base fix for review.
For a crontab line that repairs the Base branch unattended while leaving feature PRs for review, whatever the User config's merge default:
*/10 * * * * cd ~/repos/widgets && thirdshift fix base master no-merge merge-base-fix
@@ -3667,7 +3715,11 @@
behind threshold, and continues to the next candidate. A Merge conflict or
other settled CI red keeps the PR eligible, with the held check left out of
the Repair's failure list. An explicit Fix run on a PR held only by a Sign-off
-hold succeeds ready for review and names the check and label it is waiting on.
+hold succeeds ready for review and names the check and label it is waiting on.
+A Fix Pass also passes over a PR whose latest Run on the machine ended at a
+Self-merge check, unless the PR has a Merge conflict or settled CI red. Use
+no-self-merge-check to let a Fix Pass consider such a PR under its usual
+eligibility rules and skip the check if it Self-merges.
The Pass skips in-progress PRs. It reserves and rechecks each candidate;
if another machine reserved it first, it continues to the next candidate.
Before and after reserving, it reads every linked closing issue and skips the
@@ -4136,6 +4188,7 @@
Pickup has no Built-in process file. It selects and reserves the Ready issue,
then starts ticket-run or spec-run as a command on that Issue URL would.
Pickup passes over an open pull request whose latest run on this machine ended at a Self-merge check hold, even if the issue has been handed back. It prints the hold reason and looks for the next Ready issue.
Which end of the issue numbers the pass takes is its order: lowest-first by default, highest-first with pickup.order = "highest-first" in the User config, or for one pass with lowest-first or highest-first on the command, which wins over the User config. Two schedules working through the same queue from opposite ends, one with each order, collide less often; the reservation below still protects either choice.
Add skip-author <login> (or --skip-author <login>) on each cron line to pass over issues written by that account, even a Trusted account. Repeat it for several accounts; logins match case-insensitively. The Pass logs #947 passed over: written by alice, whom this Pass skips and searches for the next Ready issue. A skipped Spec author excludes the whole Spec. A Spec run dispatched by this Pass also stops before a Ticket written by a skipped account, with the same failure handling as an untrusted Ticket author. These choices belong to this Pass, with no User config setting; explicitly running thirdshift <Issue URL> still runs the named issue under the usual trust checks. The word never makes an untrusted author eligible.
Pickup uses trust.authors for its repository. Add
@@ -4150,6 +4203,7 @@
base-fix or security-fix: the Ticket run that opened a Base fix's issue, or the Security run that dispatched a fix, owns it. A failed Security fix is still passed over if GitHub prevented its Claim from being made;origin and no pull request from one, open, merged or closed), or you handed it back by applying ready-for-agent at or after its last Claim ended. A Spec whose Spec run ended only waiting is handed back by thirdshift the same way, unless someone other than a Trusted account or the Spec's authorized author edited its title or body after its last Trusted Ready labelling. For started work, the full label history must show an earlier in-progress application and its removal, with ready-for-agent applied at that removal's timestamp or later. A swap made in one edit counts in either listed order; a new Claim applied at the same timestamp leaves the issue Claimed. Work never Claimed, or without that hand-back, stays with you. An eligible branch with no PR or an open PR follows the existing Continuation rule; merged or closed PRs follow ADR 0002 and start a fresh numbered branch. This is deliberate hand-back, not automatic retries;origin under ADR-0002: the latest numbered branch is present, with no PR or an open PR. The dispatched Spec run goes straight to the Spec review and the Spec PR's Delivery and Repair loop, without running a Ticket again. A PR without its branch, or a retained branch whose latest PR is closed or merged, does not qualify. Without a resumable branch, waiting never makes it a Ready issue: close it, or take its ready-for-agent off;ready-for-agent being applied to it, a sub-issue being added to it or removed, and a "blocked by" link being added to it or removed. So a Spec is not taken while its Tickets are still being attached. These are read from the issue's timeline, since adding a sub-issue does not change the issue's update time, and pickup.wait_minutes in the User config sets the window in whole minutes from 0 up, within the supported duration range; 0 disables waiting. An Architect run also waits for an issue that meets every other Ready issue condition while it is settling. A later pass takes the issue once it has settled;A running Command whose own GitHub call hits primary quota exhaustion waits until reset plus one minute and a random 0–60 seconds, then retries. If the quota has already reset, with at least 500 left, it records no wait and retries once, immediately. CI watch and Delivery share a two-hour total cap with child Ticket runs. A secondary limit gets up to five retries, 60 seconds apart. During a primary wait, status, show and the Console show Quota wait until <time>; Slow timing includes the wait. Stop interrupts ordinary waits; Claim ending and other completion work still finish within the cap. The Run notification totals primary waits in one Waited <duration> for the GitHub quota (<resource>) line. Waiting itself adds no agent-failed; agent sessions' own gh calls are unchanged.
A pull request existing is not the finish line. Delivery runs the opening session, then keeps the captured pull request mergeable and checks CI. This orchestration is thirdshift's code; a Repair is another agent session started when the branch needs work.
A configured Sign-off hold leaves a mergeable PR ready for review after a Ticket, Spec or Fix run when the named check is its only red check and the current PR carries the hold label. The Inbox names the check and label, and a requested Self-merge waits for the Day shift. User config
+A Self-merge check runs a repository or host command after CI settles and the PR is otherwise ready to Self-merge. The command can hold it for the Day shift. The reason appears in Ready for review, the Run notification and the Command log.
For an existing open pull request, thirdshift fix <PR URL or number> starts a Fix run directly at Delivery. Ready and draft PRs by Trusted accounts are accepted, with or without closing issues. It uses the PR's own Base branch, reserves the PR while running and gives each Repair trusted PR and linked-issue context. It stops before using a linked closing issue, including when started as a Pass, unless that issue's author is a Trusted account and no account that is not one has edited its title or body. The usual merge, Base fix, Harness and email defaults apply; failure preserves work and offers thirdshift fix again.
Self-merge requires recorded agent authorship or review of the adopted head. Without it, a Fix Pass, even with merge, or a targeted Fix run asked to merge only by merge.always, still repairs the PR and checks CI, then finishes successfully Ready for review (exit 0) and logs the hold. An explicit thirdshift fix <PR> merge still fails with the hold and leaves the repaired PR ready for review.
With no PR target, thirdshift fix [base <branch>] [--author <login>] is a Pass. Without --author, it first checks the Base branch's origin tip: a failed first push attempt gets one failed-jobs re-run, then PR selection continues without waiting. Persistent or non-rerunnable failures get a CI-fix session on fix-<base>-<short-sha> and a repair PR targeting the Base branch, treating every red check as its own; that Fix run ends the Pass. Existing PRs from that branch prevent duplicates, failed drafts included. Merge and email policy apply, and Self-merge closes the Base branch's CI-red reports and Base fix issues.
Use thirdshift fix base master no-merge merge-base-fix to Self-merge only a newly authored Base branch CI repair and leave selected PRs ready for review, even with merge.always = true. merge-base-fix (also --merge-base-fix) changes that new repair's merge permission alone; the usual Delivery and Self-merge gates still apply. Selected PRs follow merge, no-merge and the User config. An existing repair PR selected later or retried gains no permission from its branch name or this word; request fix <PR> merge explicitly. The word is rejected outside a Fix Pass. Omission preserves existing behavior, --author still skips Base branch maintenance, and a Ticket run's base-fix still always merges.
Otherwise the Pass selects an eligible open, non-draft, same-repository PR targeting the selected Base branch. A Merge conflict or CI red on the current head comes first, lowest PR number first. With behind <n> or the repository’s fix.behind setting, PRs at least that many commits behind also qualify, furthest behind first. The Pass skips a PR held only by a Sign-off hold even when it meets the behind threshold. A Merge conflict or other settled CI red keeps it eligible, and the held check stays out of the Repair's failure list. It skips untrusted authors and in-progress PRs, passing over busy reservations and head branches already checked out locally. Local occupancy reasons name the PR and occupying path on stderr and, when no candidate can be taken, in the Activity log. The check preserves occupied worktrees; an explicit PR target still fails and names the occupying path. At the Command limit or with no eligible PR left, it records a skip, exits successfully and sends no Run notification. Later Passes skip PRs left as drafts. A closing-issue trust stop keeps unpublished Repair work local and leaves the PR in its current state.
Use thirdshift fix base master no-merge merge-base-fix to Self-merge only a newly authored Base branch CI repair and leave selected PRs ready for review, even with merge.always = true. merge-base-fix (also --merge-base-fix) changes that new repair's merge permission alone; the usual Delivery and Self-merge gates still apply. Selected PRs follow merge, no-merge and the User config. An existing repair PR selected later or retried gains no permission from its branch name or this word; request fix <PR> merge explicitly. The word is rejected outside a Fix Pass. Omission preserves existing behavior, --author still skips Base branch maintenance, and a Ticket run's base-fix still requests Self-merge. A configured Self-merge check can hold the Base fix for review.
Otherwise the Pass selects an eligible open, non-draft, same-repository PR targeting the selected Base branch. A Merge conflict or CI red on the current head comes first, lowest PR number first. With behind <n> or the repository’s fix.behind setting, PRs at least that many commits behind also qualify, furthest behind first. The Pass skips a PR held only by a Sign-off hold or whose latest run on this machine ended at a Self-merge check hold, even when it meets the behind threshold. With no-self-merge-check, a PR held by the Self-merge check can qualify under the usual rules. A Merge conflict or other settled CI red keeps it eligible, and the held check stays out of the Repair's failure list. It skips untrusted authors and in-progress PRs, passing over busy reservations and head branches already checked out locally. Local occupancy reasons name the PR and occupying path on stderr and, when no candidate can be taken, in the Activity log. The check preserves occupied worktrees; an explicit PR target still fails and names the occupying path. At the Command limit or with no eligible PR left, it records a skip, exits successfully and sends no Run notification. Later Passes skip PRs left as drafts. A closing-issue trust stop keeps unpublished Repair work local and leaves the PR in its current state.
A Fix Pass checks every linked closing issue before and after reserving the PR. An in-progress Claim on a Spec or standalone Ticket run's issue, including on another host, makes it skip the PR and name the claimed issue on stderr. It can adopt the PR on a later Pass after the Claim ends. Unreadable links or labels fail closed; explicit PR targets keep their existing behavior. Once the Pass has selected a pull request, an untrusted author of a linked closing issue, or any title or body edit by an account that is not a Trusted account, stops the Fix run before the issue is used and does not take the next candidate.
A Fix run's Self-merge needs recorded agent authorship or review covering the exact adopted head, written by the GitHub account thirdshift acts as. Completed Ticket, Spec and Base CI Deliveries record their delivered heads for later Fix runs. Without that evidence the repaired PR stays ready for review; run thirdshift review <PR URL> before retrying Self-merge.
Pending or re-running Base branch checks, an occupied CI reservation, or an existing repair branch or PR skip only Base branch maintenance and leave PR selection available. Stderr and the Activity log record the reason, including when no eligible PR is found. Failed opening Base CI sessions publish preserved work as draft repair PRs with a Fix Recovery command; an existing repair branch also prevents another attempt if PR creation failed.
@@ -258,7 +259,7 @@Each Ticket gets a Ticket run that Self-merges into the Spec branch, not directly into main. The Spec PR gathers the result into the Base branch. Child Ticket runs verify any rendered UI changes locally in their Worktree without calling gh or uploading attachments, while the combined Spec review captures and attaches unified Before and After Visual evidence when writing the Spec PR body. A Ticket closing means its work landed on the Spec branch; the whole Spec has not shipped yet.
Each Ticket Self-merges into the Spec branch and skips the Self-merge check. A configured check runs before the Spec PR Self-merges into the Base branch. A Base fix into the Base branch also runs the check. Child Ticket runs verify any rendered UI changes locally in their Worktree without calling gh or uploading attachments, while the combined Spec review captures and attaches unified Before and After Visual evidence when writing the Spec PR body. A Ticket closing means its work landed on the Spec branch; the whole Spec has not shipped yet.
A failed Ticket stops only its dependents; other reachable Tickets can still run. Tickets marked for human work or triage also hold their dependents. An incomplete Spec leaves a draft Spec PR with a Tickets checklist. A Spec run that is only waiting, with no failed or interrupted Ticket and every undone Ticket gated, blocked behind gated Tickets or outside work, or outside the Spec's repository, puts ready-for-agent back on its Spec instead of agent-failed, unless someone other than a Trusted account or the Spec's authorized author edited it since its last Trusted labelling, which leaves needs-triage, and comments on the Spec naming each undone Ticket and what it waits on. Pickup continues it once a Ticket can start; a blocking cycle is a failure. A handed-back Spec with every Ticket closed can also be taken when its latest Spec branch is on origin, with no PR or an open PR: it goes straight to Spec review and Delivery without running a Ticket again. Its usual Ready issue gates still apply; Architect gives it priority even while it settles. A Spec PR closed, merged or retargeted mid-run starts no further Ticket, holds the Self-merge of a running Ticket started after it opened, and ends the Spec run without a Recovery command. An Unready Ticket's checklist and Command log line name its open blockers, marking those outside the Spec and those labelled ready-for-agent; outside blockers are reported but never run. Rerunning continues existing branches. Spec run controls and limits.
Eligible work ↓ Ticket run or Spec run ↓ reviewed pull request
+Pickup passes over an open pull request whose latest run on this machine ended at a Self-merge check hold, even if the issue has been handed back. It prints the hold reason and looks for the next Ready issue.
Pickup respects issue readiness, open blockers and the Failure limit: it takes nothing while three open issues, or pickup.failure_limit, carry agent-failed from a failed run, and pull requests waiting for review never count. A run that failed because the host ran out of disk space is no failure of its issue: it puts ready-for-agent back without agent-failed, even with work on origin, and says to free disk space. A Paused Command, which no route had Plan usage left for, is none either: it puts ready-for-agent back the same way, unless an untrusted edit leaves needs-triage or it is a Security fix. Any other failed run with work on origin, or a failed Security fix, swaps in-progress for agent-failed and, unless it is a Security fix, posts its Recovery on the issue as a generated comment without local paths or the continue command; putting ready-for-agent back, taking agent-failed off or closing the issue ends the failure, and the Sweep takes in-progress off any open issue that still carries both. Before choosing work, it re-runs failed jobs of the Base branch's latest push CI once, immediately. Green on re-run files a Flaky-test Ticket using the recorded failure as evidence, without requiring reproduction on demand. Red again files an ordinary bug Ticket after 30 minutes from the re-run's completion. Its title, body and later comments leave job names and log lines out, and it waits until you write the task and apply ready-for-agent. An open CI-red Ticket in needs-info does not block a new report; another open CI-red Ticket receives new failing commits as comments. CI read failures warn and let Pickup continue; red Base CI does not hold Self-merges. Architect and Security runs yield to ready human-shaped work. Gates can skip a pass without failure, and unresolved plans, ideas or findings can leave the next decision with the Day shift. This is scheduled CLI work on your machine, using your authenticated tools.
When a Security run fails before its audit starts, its requested Run notification names a fixed Cause for Base branch preparation failures, such as Base branch not found, and points to stderr on the host at the command's start time for diagnostics. Security run notifications.
Before dispatch, Pickup reserves its selected issue on origin and checks that it is still Ready. Competing Pickup runs on two machines cannot take the same issue: only the reservation's owner can dispatch it, and the other moves on to the next Ready issue in its order. An Architect run takes the same reservation for the plan it dispatches, and a Security run for its fix, before marking it ready, so a Pickup run beside either never takes it. The reservation's commit message records its host, launch path, process and start time. Before choosing work, every scheduled Pass releases its own orphaned origin reservations only on local proof of death: a missing PID, a process started after the reservation, or a host boot after it. Failed probes count as alive, and an exact observed-SHA lease protects a new owner. Stderr and Activity record the release. A reservation no host can test that blocked work and has been held over a day appears in Needs you with owner, age, blocked work and a release command. The Day shift confirms death before releasing it by hand; no reservation expires on a timer. Pickup's reservation and readiness checks.
Review Passes (review --author) and Fix Passes skip release-* pull requests targeting main, leaving their version-only heads to the Release run. Explicit thirdshift fix <pr-url> --no-merge --no-base-fix still repairs those pull requests.
Review retries recover clean retained worktrees with verified ownership and committed fixes above the same captured PR head. Author Passes skip other local conflicts, notify once per state and continue to later waiting pull requests. An explicit PR URL still fails with preservation advice.
Review runs and pull-request Custom processes record their target PR URL and title before the first session starts. It appears in thirdshift status and the Command log while the run is live, and Command log and Session trace pages show the selected Command's GitHub issue or pull request link and title below the page heading (including a Pickup or Pass run's opened pull requests). Compact Working rows, including Overview, show live Fix and Review targets as clickable PR #number links beside the repository and run type, on desktop and phone, locally and across the Fleet. Explicit and Pass-selected targets appear alike. A Base branch CI repair shows its exact Base branch before publication and keeps it beside the PR link afterwards; older records without a target keep their Command label.
thirdshift fix <PR URL or number> takes an open pull request by a Trusted account, ready or draft, straight through Delivery and the Repair loop against its own Base branch. With no PR target, thirdshift fix [base <branch>] [--author <login>] [behind <n>] is a Pass taking eligible ready PRs with a Merge conflict or CI red first, lowest number first. behind <n> or the repository’s fix.behind setting also admits PRs at least that many commits behind, furthest behind first. A Fix Pass skips a PR held only by a Sign-off hold even when it meets the behind threshold. An explicit Fix run leaves that PR ready for review and names the check and label. The Pass skips head branches checked out locally, passing over them with the PR URL and occupying path on stderr. It skips cleanly at the Command limit or when none can be taken, recording occupancy reasons in the Activity log. An explicit PR target still fails and names the occupying worktree. A Fix run skips implementation and initial code review, reserves the PR until it ends, and supplies Repairs with trusted PR and linked closing-issue context. It stops before using a linked closing issue, including when started as a Pass, unless that issue's author is a Trusted account and no account that is not one has edited its title or body. Add merge for Self-merge or base-fix for inherited failures; the usual User config defaults apply. Self-merge needs recorded agent review of the adopted head; without it a Fix Pass, or a targeted Fix run asked to merge only by merge.always, repairs the PR and finishes successfully Ready for review, logging the hold. An explicit thirdshift fix <PR> merge still fails with the hold and leaves the repaired PR ready. A closing-issue trust stop keeps unpublished Repair work local and leaves the PR in its current state. Other Delivery failures preserve work, draft the PR and offer a Fix run retry. Fix runs
thirdshift fix <PR URL or number> takes an open pull request by a Trusted account, ready or draft, straight through Delivery and the Repair loop against its own Base branch. With no PR target, thirdshift fix [base <branch>] [--author <login>] [behind <n>] is a Pass taking eligible ready PRs with a Merge conflict or CI red first, lowest number first. behind <n> or the repository’s fix.behind setting also admits PRs at least that many commits behind, furthest behind first. A Fix Pass skips a PR held only by a Sign-off hold or whose latest run on this machine ended at a Self-merge check hold, even when it meets the behind threshold. With no-self-merge-check, a PR held by the Self-merge check can qualify under the usual rules. A Merge conflict or settled CI red apart from the Sign-off hold keeps the PR eligible. An explicit Fix run facing a Sign-off hold leaves the PR ready for review and names the check and label. The Pass skips head branches checked out locally, passing over them with the PR URL and occupying path on stderr. It skips cleanly at the Command limit or when none can be taken, recording occupancy reasons in the Activity log. An explicit PR target still fails and names the occupying worktree. A Fix run skips implementation and initial code review, reserves the PR until it ends, and supplies Repairs with trusted PR and linked closing-issue context. It stops before using a linked closing issue, including when started as a Pass, unless that issue's author is a Trusted account and no account that is not one has edited its title or body. Add merge for Self-merge or base-fix for inherited failures; the usual User config defaults apply. Self-merge needs recorded agent review of the adopted head; without it a Fix Pass, or a targeted Fix run asked to merge only by merge.always, repairs the PR and finishes successfully Ready for review, logging the hold. An explicit thirdshift fix <PR> merge still fails with the hold and leaves the repaired PR ready. A closing-issue trust stop keeps unpublished Repair work local and leaves the PR in its current state. Other Delivery failures preserve work, draft the PR and offer a Fix run retry. Fix runs
A Fix Pass checks every linked closing issue before and after reserving the PR. An in-progress Claim on a Spec or standalone Ticket run's issue, including on another host, makes it skip the PR and name the claimed issue on stderr. It can adopt the PR on a later Pass after the Claim ends. Unreadable links or labels fail closed; explicit PR targets keep their existing behavior. Once the Pass has selected a pull request, an untrusted author of a linked closing issue, or any title or body edit by an account that is not a Trusted account, stops the Fix run before the issue is used and does not take the next candidate.
thirdshift fix base master no-merge merge-base-fix lets a newly authored Base branch CI repair Self-merge through the usual gates while leaving selected PRs ready for review, even with merge.always = true. The Fix-Pass-only merge-base-fix word changes only that new repair's merge permission; selected PRs keep following merge, no-merge and the User config. Existing repair PRs gain no permission from their branch names or this word; use an explicit targeted fix <PR> merge to merge one. Omission keeps the existing policy, --author still skips Base branch CI, and a Ticket run's own base-fix still always merges. Fix Pass merge policy.
thirdshift fix base master no-merge merge-base-fix lets a newly authored Base branch CI repair Self-merge through the usual gates while leaving selected PRs ready for review, even with merge.always = true. The Fix-Pass-only merge-base-fix word changes only that new repair's merge permission; selected PRs keep following merge, no-merge and the User config. Existing repair PRs gain no permission from their branch names or this word; use an explicit targeted fix <PR> merge to merge one. Omission keeps the existing policy, --author still skips Base branch CI, and a Ticket run's own base-fix still requests Self-merge. A configured Self-merge check can hold the Base fix for review. Fix Pass merge policy.
Without --author, a Fix Pass first checks Base branch CI on origin. A failed first push attempt gets one failed-jobs re-run, then PR selection continues without waiting. Pending or re-running Base checks, an occupied CI reservation, or an existing repair branch or PR skip only Base branch maintenance; stderr and the Activity log record the reason. Persistent or non-rerunnable failures get a CI-fix session on fix-<base>-<short-sha> and a repair PR targeting the Base branch, with every red check its own to fix; that Fix run ends the Pass. Failed opening sessions publish preserved work as draft repair PRs with a Fix Recovery command. An existing repair branch or PR prevents duplicates, including failed drafts. Completed Ticket, Spec and Base CI Deliveries record their exact agent-authored or reviewed heads for later Fix Self-merge. Merge and email flags and User config apply; Self-merge also closes the Base branch's CI-red reports and Base fix issues.
If the Base branch CI-fix session commits nothing, the Fix run pushes no repair branch, opens no PR and exits successfully, with the reason on stderr and in the Activity log. A local Git ref remembers that Base branch and full commit in the Launch repository, so later Passes there skip that CI-fix and can select another PR. No further Check re-run is requested.
Fix CI sessions keep command and test logs in the worktree's Git-excluded .validation-logs/ directory, which cleanup discards. They reproduce with the failing test file or filter before a full suite, without full-suite debug output or sleep-and-tail polling loops. Review sessions check whether the PR is open at most once, immediately before a multi-minute validation suite; thirdshift also checks its state around the session and before Delivery.
With run, open Start work in the Console's Pages navigation to choose a known repository labelled by its Fleet machine, an issue number or URL and shared options. Review the request and Harness, then confirm Start now. On Cron jobs, choose a machine and use Run now to confirm a Pass with its configured arguments. User config and Update also select a Fleet machine with admin there. Each machine's live scopes decide its controls, and the owning machine executes and records the action. The CLI offers start <owner/repo> <issue>, config and update with --machine <name>.
A Ticket run takes one Issue URL and delivers one pull request, ready for review. A Ticket run that Self-merges merges its own reviewed, green pull request when you ask.
+A Ticket run takes one Issue URL and delivers one pull request, ready for review. A Ticket run can Self-merge its reviewed, green pull request when you ask. A configured Self-merge check can hold it for the Day shift.
A configured Sign-off hold leaves a PR ready for review after a Ticket, Spec or Fix run while its one deliberate red check waits for a person. User config
Add skip-author <login> or --skip-author <login> to a Pickup or Triage cron line to leave that author's issues alone, even for a Trusted account. Repeat it for several logins; matching ignores case. Pickup passes over the whole Spec when its author is skipped, and its dispatched Spec run stops before a skipped author's Ticket. Each exclusion logs why. Explicit Issue URL runs keep their usual trust checks.
A Pickup run takes the lowest-numbered Ready issue by default, the highest-numbered with pickup.order = "highest-first" or highest-first, after it has settled and while the repository is below its Failure limit: fewer open issues labelled agent-failed than pickup.failure_limit, 3 by default. A pull request waiting for review never holds it back. It immediately re-runs failed Base branch push CI once: green on re-run files a Flaky-test Ticket, and red again files an ordinary bug Ticket after 30 minutes. That CI-red Ticket leaves job names and log lines out of its title, body and later comments, and waits until you write the task and apply ready-for-agent. New failing commits are added to an open CI-red Ticket; one in needs-info does not block a new report. A run the host ran out of disk space under gets ready-for-agent back instead, as a host problem, not the issue's, and so does a Paused Command that no route had Plan usage left for, unless an untrusted edit leaves needs-triage or it is a Security fix. Other failed work stays with the Day shift, labelled agent-failed in place of in-progress, with a generated comment giving its cause, where it stopped, what was preserved and the machine, until you hand it back by applying ready-for-agent again, take agent-failed off, or close the issue. A Spec run only waiting on gated, blocked or out-of-repository Tickets is no failure: its Spec gets ready-for-agent back and a comment naming each undone Ticket and what it waits on, and a later Pickup run continues it once a Ticket can start. A run that leaves its pull request ready for review takes in-progress off and puts nothing back.
A Pickup run takes the lowest-numbered Ready issue by default, the highest-numbered with pickup.order = "highest-first" or highest-first, after it has settled and while the repository is below its Failure limit: fewer open issues labelled agent-failed than pickup.failure_limit, 3 by default. Pull requests waiting for review do not count toward the Failure limit. Pickup leaves an issue for the Day shift if the latest run this machine recorded for its open pull request ended at a Self-merge check hold, then looks for the next Ready issue. It immediately re-runs failed Base branch push CI once: green on re-run files a Flaky-test Ticket, and red again files an ordinary bug Ticket after 30 minutes. That CI-red Ticket leaves job names and log lines out of its title, body and later comments, and waits until you write the task and apply ready-for-agent. New failing commits are added to an open CI-red Ticket; one in needs-info does not block a new report. A run the host ran out of disk space under gets ready-for-agent back instead, as a host problem, not the issue's, and so does a Paused Command that no route had Plan usage left for, unless an untrusted edit leaves needs-triage or it is a Security fix. Other failed work stays with the Day shift, labelled agent-failed in place of in-progress, with a generated comment giving its cause, where it stopped, what was preserved and the machine, until you hand it back by applying ready-for-agent again, take agent-failed off, or close the issue. A Spec run only waiting on gated, blocked or out-of-repository Tickets is no failure: its Spec gets ready-for-agent back and a comment naming each undone Ticket and what it waits on, and a later Pickup run continues it once a Ticket can start. A run that leaves its pull request ready for review takes in-progress off and puts nothing back.