Skip to content

From Ticket to merge ​

Nobody watches a Run, so nothing may merge on a single session's word. Every Ticket goes through the same gates in the same order: a second session that tries to prove the work wrong, and the pull request's CI, which the Target sets up. The pipeline runs no Check on the branch itself. A failure a fresh session could mend buys exactly one fix Stage; anything else goes to a human. The Tickets of a Run are implemented side by side, but they land one at a time, so what CI graded is what reaches the base branch. A Target that merges by hand has each green Ticket handed off instead, and a human merges it.

This page follows one Ticket from its claim to its merge. What happens when it stops short, whether by a Hand-off, a Release, a Stop or a Run that never came back, is on Hand-offs, stopping and resuming.

StepWhat happensWho decides
ClaimGuards, state file, assign, ready-for-agent → in-progressthe pipeline
Worktreeagent/<n> in .worktrees/ticket-<n>, named agent/<n>-<slug> after the implement Stagegit, and the implement Stage's slug
implement Stage/mattpocock-skills:implement in the worktree, then nothing left uncommittedan agent
verify StageAdversarial grading of the Acceptance Criteria, and of defects the branch madethe pipeline, from the verdict
fix StageOne fresh session given the failure, once per Ticket, and once more for criteria added after a Hand-offthe fix budget
pr StageOnly on a Ticket handed back with commits made since its Hand-off: one fresh session revises the pull request's title, body, problem and solution, once verify passesan agent, once each hand-back
LandingRebase, conflict Stage, pull request, CI, squash mergeone Lane at a time
After the mergeTick met criteria, clean upthe pipeline

Every edge to the fix Stage is taken at most once per Ticket. A second failure of any kind, or any failure the fix Stage cannot act on, is a Hand-off, except a verdict failing on criteria added after a Hand-off, whose fix Stage spends no budget. The pr Stage never ends the Ticket: one that does not finish goes on with the answers already recorded. A Stage stopped by the rate limit, an API failure or the API budget, a failure the base branch shares (below), and GitHub or the git remote failing at any step, leave this diagram entirely: they release the Ticket.

A Hand-off undoes the claim, puts ready-for-human on, comments the failure and where the work is, and puts an open pull request back into draft. The branch and the state file stay on the Target's remote, since the Host the work was done on may be gone by the time a human looks. The handed-off Stages' transcripts are kept beside them or on the Host, as keepTranscripts decides, and the hand-off comment says where. A human who relabels the Ticket ready-for-agent hands it back, and it carries on from what it reached rather than paying for the implement Stage again. On a Target that merges by hand, a Ticket whose CI is green is handed off at merge with nothing failed. A Hand-off at setup that leaves no work of the pipeline's removes the state file: the Ticket started fresh and either failed before its worktree existed, or found a branch in the way that the Run would not branch over. No Stage of this Run worked there, so nothing is the pipeline's to resume.

The claim ​

The claim marks a Ticket as taken, so no other Run picks it: the Frontier leaves out every assigned Ticket. The guards run before anything is written. An issue the pipeline will not take is never marked as taken.

Then, in this order:

  1. The state file is written: the Ticket's branch, the state it reached (claimed) and whether the fix budget is spent.
  2. The Ticket is assigned to the gh user, in-progress goes on and ready-for-agent comes off. A Stranded Ticket already wears this claim, so it is not written again.
  3. Any hand-off comment still current on the Ticket is marked as history (Handing a Ticket back).

The worktree and branch ​

Value
Branchagent/<n> at the claim. Once the implement Stage has finished with commits, agent/<n>-<slug>, with the slug the Stage answered
Worktree.worktrees/ticket-<n> under the Target's root, gitignored
Branched fromThe remote's base branch, freshly fetched, with no upstream set

A branch of that name that already exists is never reused. The Ticket is handed off at setup, and the comment says whose branch it is and the command that clears it. A resumed Ticket carries on in the branch its state file names instead; see Hand-offs, stopping and resuming.

Nothing is cut from the Ticket title, which says nothing in a branch name when it is not written in English. The implement Stage, which has read the Ticket, answers a branch slug instead: at most 40 characters matching ^[a-z0-9]+(-[a-z0-9]+)*$, in English words saying what the Ticket does, whatever language the Target writes in. When the Stage finishes with commits, before the branch is first pushed, the Run records agent/<n>-<slug> in the state file, renames the branch, then pushes it under that name, so the remote never holds agent/<n> for it. Every later write names the new branch: the progress comment, the pull request and any hand-off.

The branch keeps agent/<n> when the slug is empty, in silence, and, logging #<n> keeps agent/<n> · <why>, when the slug is out of shape, the state file write fails, a branch of the new name is on the Host or on the remote, or agent/<n> already reached the remote, which an implement Stage that did not finish pushed. A Ticket whose state file already names another branch keeps it. A Host that dies between the state file write and the rename leaves its next Run there a branch in the way, and the Ticket is handed off at setup with the worktree it is in; a Run on another Host takes it from the top, since nothing was pushed.

How a Stage runs ​

A Stage is one claude -p child process with one job (ADR-0002).

Every Stage runs in the Ticket's worktree with --permission-prompts none, the configured permissionMode, and its own model, effort, maxTurns and maxMinutes (see Configuration). The wall-clock limit is enforced by killing the process and everything it started.

What a Stage sees. The branch's files, the Target's CLAUDE.md among them, so what init wrote reaches a Stage once it is on the base branch. No MCP server, the claude.ai connectors included, no auto memory, and none of the tools that act beyond the session, such as scheduling. Work that needs an MCP server cannot be done by a Stage.

StagePrompt opens withStructured answer
implement/mattpocock-skills:implement <issue URL>optional title, body, problem, solution, notes and noCommitReason
verifyTicket: <issue URL> and the criteria by number, no skillthe verdict, optional notes
fixTicket: <issue URL>, no skill but /mattpocock-skills:proptional title, body, problem, solution, notes and noCommitReason
conflictTicket: <issue URL>, no skillnone
prTicket: <issue URL>, no skill but /mattpocock-skills:prtitle, body, problem and solution, each blank to keep the one recorded

The prompt ends with the Stage's extraPrompt.

What a Stage writes, and in what language. title titles the pull request and the squash commit; body is the pull request body below Closes #<n>; problem and solution open the squash commit. A Target's own shapes come first:

AnswerShape
title, commit subjects<type>[(<scope>)]: <summary>, with the types, scopes and wording the contributing guide sets for a commit subject or pull request title; where it sets none, the shape alone. A fix Stage answers the title blank, which keeps the one before it, unless its fix changes what it says, and a pr Stage unless the branch no longer fits it
bodyWhat the Target's contributing guide or .github/PULL_REQUEST_TEMPLATE.md sets beyond the Closes line; where neither does, written by invoking /mattpocock-skills:pr
problem, solutionWhat the contributing guide sets for a commit body; where it sets none, the state before the change and its effect, and what the change does and why, each in at most two sentences, readable without the Ticket

None of body, problem and solution carries a title, a closing keyword before an issue reference, a screenshot or a local path. Every Stage that answers writes its Notes, its verdict's evidence and these answers in the language the Target's contributing guide sets for issues and commits, or else in the language the Ticket is written in; a criterion's text stays as the Ticket writes it. The lines the pipeline writes itself, such as the progress table, stay in English.

What a Stage is billed to. A Stage runs on the Claude login, with the Host's ANTHROPIC_API_KEY taken out of its environment, unless the Run was started with --api-key, when it runs on that key. When the session's apiKeySource says otherwise, the Run's log and summary name the Stage.

What each Stage leaves on disk is on Logs and transcripts.

How a Stage can end. The runner reads the session's last result event, never what the session talked about:

FailureProgress cellMeaning
timed-out❌ timed outKilled at maxMinutes
turn-capped❌ turn cappedReached maxTurns
out-of-budget⏸ out of API budgetThe API key's credit or spend limit, met only on an --api-key Run. Releases the Ticket
rate-limited⏸ rate limited, ⏸ API rate limited on an --api-key RunThe plan's rate limit, or the API's on an --api-key Run. Releases the Ticket
api-error⏸ API failureA transient API failure the CLI gave up retrying. Releases the Ticket
nonzero-exit❌ exited non-zeroAny other failed session
invalid-result❌ invalid resultThe verify Stage answered no verdict at all

On the pr Stage the failures that release nothing read ⚠️ rather than ❌, such as ⚠️ turn capped: the Ticket goes on.

The implement Stage ​

The implement skill reads the Ticket, builds it and reviews it. Once the review's fixes are committed, the Stage answers title, body, problem and solution for the whole branch, and the branch slug (above). It is told not to push. When the session ends, the pipeline routes its Notes and records each answer that is not blank in the state file. Then:

  • A Stage that did not finish pushes its commits, if it has any, on agent/<n>, so a Run on another Host can resume from them, and is a Hand-off at implement. Nothing is renamed.
  • A branch with no commits beyond the base branch is a Hand-off: an agent that gave up silently leaves nothing to grade. The hand-off comment quotes the reason the Stage gave in noCommitReason, when it gave one.
  • Otherwise the branch is named and pushed, the Run prints #<n> implemented · <branch>, and the state file moves to implemented, so no later Run pays for this Stage again.

Nothing uncommitted ​

After an implement or fix Stage, a worktree holding changes no commit carries fails, naming every path, and spends the fix budget before anything grades the branch: the Stage's row reads ❌ uncommitted work in place of ✅ committed. Gitignored files, such as installed dependencies, do not count. The same guard runs on a resumed Ticket's worktree, as a setup row, and after a conflict Stage, before the pull request.

The pipeline runs no Check on the branch, after a Stage or when a Run resumes a Ticket: verify starts once the code Stage's work is pushed. The implement and fix Stages are told to run only the tests their change touches while they work and the full Checks once after committing, but nothing grades the branch with them. What gates the merge is the pull request's CI, which the Target's owner sets up. The commands, checks, are what the Stage prompts name and what grades a red CI at the branch's merge-base (below). A Target with no CI merges with its ci row reading ⚠️ no checks or ⚠️ no workflow runs, so nothing ran the code it merges.

The verify Stage and its verdict ​

No human reviews the code before it merges, and the session that wrote it is the last one to trust on whether it works. So a fresh session, with no plugin skill, tries to prove each Acceptance Criterion is not met. The pipeline lists the Ticket's unticked criteria by number, each with the indented lines under its box (Planning the work), and the session runs the code, may write throwaway tests, and must not commit. Where Check commands are configured, it is told the pipeline does not run them and not to run them to grade the branch, but to spend its turns on targeted tests and probes. A criterion that cannot be met without overturning a documented decision or another criterion is unmet, with evidence saying a human decision is needed. An unmet criterion's evidence states the failure: where it sits, what was run or read, what was expected, what came back, and the counterexample. It proposes no fix, though it may quote a limit the Ticket, a documented decision or another criterion sets, naming where it comes from. Its scratch files are discarded afterwards, so they never reach the pull request.

It also grades the branch itself. A defect the branch introduced, or one in code it added, shown with the evidence an unmet criterion needs, goes in the verdict's defects rather than a Note, unless the Ticket leaves it out of scope or a documented decision accepts it. The session is shown the Notes this Ticket's implement and fix Stages wrote in the Run, so such a defect among them is graded too. Anything else it finds leaves the session as a Note.

The verdict answers each criterion by its number, met, unmet, unverifiable or ci, with evidence, and lists the defects of the branch. The agent's own pass or fail is advisory; the pipeline decides for itself: no criterion unmet, no defect of the branch, and at least one criterion met or ci. Wherever a criterion is shown afterwards, in the fix and retry verify prompts, the hand-off and the squash commit, it is its checkbox line as the Ticket reads, never the verdict's copy.

VerdictProgress cellResult
Passes✅ <k> met, followed by · <c> to CI and · <u> unverifiable when there are anyOn to the Landing
Some unmet❌ <u> unmetSpends the fix budget, unless one was added in a comment after a Hand-off; the fix Stage gets each unmet criterion with its evidence
A defect the branch made❌ <d> defects, or ❌ <u> unmet · <d> defectsAs unmet: spends the fix budget, and the fix Stage gets each defect with its evidence
A listed number left out, answered twice, or one answered that was not listed❌ misnumberedHand-off: it has not graded the Ticket
All unverifiable❌ no evidenceHand-off: there is nothing to merge on
Missing or malformed❌ no verdictHand-off

A criterion left to CI. A criterion that asks for nothing but the pull request's CI, or some commands, to pass, such as "The checks pass.", is answered ci when a workflow under .github/workflows/ runs on this pull request, its triggers and paths filters admitting the branch's changes, and runs every command the criterion names, whole or split across jobs; its evidence names the workflow and its steps. GitHub counts a skipped job as passed, so a workflow whose paths filter skips the branch is not one that runs it. Otherwise the session grades the criterion itself, running the commands it names. A ci criterion is ticked once CI passes. When the wait for CI ends in ⚠️ no checks or ⚠️ no workflow runs, it stays unticked and is named wherever an unverifiable criterion is, and a Ticket with no met criterion is then handed off, since no criterion has evidence to merge on.

A verify after a fix for unmet criteria or defects gets the first verdict's unmet criteria and defects with their evidence, and is told such a criterion is met only when that counterexample is gone and the whole criterion holds. A defect it finds in the fix's own code is a Hand-off like any second failure, so the gate cannot loop. The one exception is a Ticket handed back with criteria added in a comment after its Hand-off, which gets one fix more, once each time it is handed back.

The fix Stage and the fix budget ​

The fix budget is one fix Stage per Ticket, and whatever still fails after it goes to a human, bar the one fix criteria added after a Hand-off get besides. The fix Stage is a fresh session on the same branch, with no plugin skill but /mattpocock-skills:pr, given the failure and its evidence to mend that one defect. It is also given the latest title, body, problem and solution answered for the branch: one its fix changes it answers again, revised for the whole branch, and one it leaves true it answers blank, which keeps the earlier one. Sent in for unmet criteria or defects of the branch, it commits nothing and says why in noCommitReason when one cannot be met or fixed without overturning a documented decision or another criterion, which hands the Ticket to a human. Otherwise it takes a fix the evidence proposes as a lead, not the answer: it finds the cause itself, looks for a fix of that cause within the Ticket's scope before settling for a narrower one, and before committing tests its fix with inputs built from that cause, not only with the counterexample it was given.

Only a defect a fresh session could mend spends the budget:

FailureAtSpends the budget?
Changes no commit carriesimplement, fix, rebase after a conflict Stage, or setup on a resumed TicketYes
A criterion unmetverifyYes
A criterion unmet that a comment added after the last hand-off comment, the first such verdict since the Ticket was handed backverifyNo, a fix Stage of its own (below)
A defect the branch madeverifyYes
The conflict Stage did not finish the rebaserebaseYes
A pull request check failedciYes
A pull request check failed, and the merge-base fails a CheckciNo, a Release
A Stage that did not finish (timed out, turn-capped, non-zero, invalid result)its StageNo, Hand-off
implement left no commitsimplementNo, Hand-off
A verdict with no evidence, or none at allverifyNo, Hand-off
A verdict that leaves out a listed number or adds oneverifyNo, Hand-off
The conflict Stage could not be run, or git could not be askedrebaseNo, Hand-off
The base branch could not be pulledrebaseNo, Hand-off
The pr Stage did not finish, or left changes behindprNo, and no Hand-off: the Ticket goes on with the answers already recorded
Pushing or opening the pull request failedprNo, Hand-off
CI timed out or found conflictingciNo, Hand-off
No check ran on the pull request, and no criterion is metciNo, Hand-off
The merge failedmergeNo, Hand-off
A rate limit, a transient API failure or an API key out of budget, anywhereanyNo, a Release
GitHub failing on its own side, or git unable to reach or log in to the remote, anywhereanyNo, a Release

After a fix Stage, the Ticket starts again at verify. Every gate grades the fix, so a fix is held to the same bar as the first attempt. A fix Stage whose branch did not grow is a Hand-off straight away: re-grading an untouched branch could only fail the same way. A squashed or amended branch counts as not grown. Its hand-off comment carries the evidence the fix Stage was sent in with, and quotes the reason the Stage gave in noCommitReason for committing nothing, whatever it was sent in for.

A fix Stage stopped by the rate limit, an API failure or the API budget spends nothing. The fix budget is one fix Stage each time the pipeline takes the Ticket up: a Release carries a spent budget over to the next Run, having changed nothing about the Ticket, and a Hand-off restores it, because the Ticket only comes back through a human's hands and whatever they did to it is what the fresh budget is for. A Ticket handed back with criteria added in a comment gets one fix besides, which spends none of it (below). More on Handing a Ticket back.

Criteria added after a Hand-off ​

A human who hands a Ticket back often adds a criterion first, or replaces one, in a decision comment, without writing code. The first verify then grades a criterion no Stage has worked on yet. So a verdict that leaves unmet a criterion listed from a comment posted after the Ticket's last hand-off comment sends a fix Stage that spends no fix budget, and the budget the Ticket came back with is still there for a later failure. That happens once each time the Ticket is handed back: a later verdict that leaves the same criteria unmet spends the budget as any failure does.

verify still runs first, since a human may have implemented the new criteria already. A criterion edited into the body gets no exemption, because only a comment's place below the hand-off comment says when it was added. A verdict whose unmet criteria are all the body's or come from comments before that hand-off comment, or that fails on defects alone, spends the budget as usual. A Release does not buy the fix twice: the state file records that it was spent, and a fix Stage the Release stopped is still owed to the Run that resumes the Ticket. A fix Stage of this kind that commits nothing is a Hand-off, as any other is.

The pr Stage ​

A human who hands a Ticket back may commit on its branch first. No Stage answers for those commits, so the title, body, problem and solution in the state file still describe the branch as it stood at the Hand-off, and since every publish rewrites the pull request from them, editing the pull request by hand does not last either. So the pr Stage revises them.

Whether it is owed. A Hand-off that keeps the state file records the branch's head there, unless the file already holds a head no pr Stage has answered for since, whose later commits are still undescribed. When a Run takes the Ticket back, before any of its Stages runs, it compares that head with the branch's: a head that moved owes a pr Stage, and one that did not is forgotten. Settling it first means the Run's own fix commits never count as a human's, and the state file records the answer, so a Run resuming after a Release or a kill keeps it. No pr Stage runs on a Ticket never handed off, on one whose branch is where the Hand-off left it, or on one whose implement Stage runs in the Run that takes it back, which answers everything afresh.

What it is given. It runs once verify passes and before the Landing, at most once each time the Ticket is handed back. It is a fresh session with no plugin skill but /mattpocock-skills:pr, given the recorded title, body, problem and solution, the recorded head, the base branch and the passing verdict. It reads the commits since that head and their diff itself, and writes its answers by the rules above, the body included, each blank answer keeping the recorded one. Where the recorded head is no longer an ancestor of the branch, as after a rebase, a squash or an amend, or is not in the repository at all, it is given the whole branch against the base branch instead. It commits nothing and answers no Notes.

What the Stage didProgress cellResult
Finished with an answer its schema accepts, blank answers included✅ revisedIts answers replace the recorded ones, as a code Stage's do; the pull request and the squash commit carry them, and the recorded head is cleared
Left a commit or uncommitted changes⚠️ left changesThe worktree is reset to the head it started on and its answers are dropped, since they may describe what was discarded; the Ticket goes on
Did not finish⚠️ <why the Stage did not finish>The recorded answers stand and the Ticket goes on: a missing answer is no reason for a Hand-off
Stopped by the rate limit, an API failure or the API budget⏸ rate limited, ⏸ API rate limited, ⏸ API failure, ⏸ out of API budgetA Release; the Stage is still owed to the Run that resumes the Ticket

Why a Stage revises the prose, and why at this point of the Ticket's way, is in ADR-0004.

Lanes and the Frontier refill ​

A Run holds one Ticket per Lane and refills a Lane the moment its Ticket ends. While another Lane is busy, a free Lane also looks at the Frontier again at intervals, so a Ticket that joins it mid-Run need not wait for a busy Lane to end. The order it fills them in is on Running, when more Lanes help on lanes, and what keeps two Tickets out of each other's way on Blockers.

The Landing ​

The Landing, from the pull of the base branch before the rebase to the pull after the merge, holds one Ticket at a time, in arrival order, so the base branch cannot move between a Ticket's rebase and its merge, and what CI graded is what lands (ADR-0005). implement and verify, where the time goes, stay parallel. The cost is that one Lane's conflict Stage or slow CI holds the others' Landing. A Target that merges by hand leaves the Landing without a merge, so there the guarantee holds only as far as its configuration page says.

A Ticket also leaves the Landing for a fix Stage, a Hand-off or a Release, so nobody waits behind a session; one back from a fix Stage rejoins at the back. A Ticket released over a failing base branch passes through the Landing once when a later Run takes it up, for the pull and the rebase alone, before anything else, and leaves it again at once, since nothing is merged behind them.

Rebase ​

The base branch is first brought up to the remote's, then git rebase <base> runs in the worktree. A clean rebase goes straight to the pull request. A conflict is left exactly where git stopped, for the conflict Stage.

The conflict Stage ​

A conflict is not a defect in the branch: the base branch moved on underneath it. So one conflict Stage runs in the stopped rebase with git's output and no plugin skill, and it does not spend the fix budget. It is told to finish the rebase and never abort it, to keep both intents where they are compatible and the Ticket's where they are not, and to change a file the conflict did not touch only to repair what the merge broke, such as a renamed name or a moved field. It implements nothing new and changes no behaviour the criteria cover.

The worktree decides, not the session's exit. The rebase counts as resolved only when it has finished, the branch sits on top of the base branch with no merge commit between them, and no unmerged path or conflict marker is left.

What the worktree showsResult
Resolved, however the session ended (even rate-limited or stopped by an API failure)✅ rebased; push, then the pull request
Resolved, with changes no commit carries❌ uncommitted work; spend the fix budget
Unresolved, session rate-limited or stopped by an API failure or the API budgetAbort the rebase, Release
Unresolved otherwise❌ unresolved; abort the rebase, spend the fix budget
The Stage could not run, or git could not be asked❌ unknown; abort the rebase, Hand-off

The pipeline runs no Check on the resolution: the Stage is told to run the type checker and the tests covering the files it resolved, not the whole suite, and the pull request's CI grades it next. verify is not asked again: the Stage changes no behaviour the criteria cover. An unresolved rebase hands the fix Stage the conflict and what is still wrong as its evidence. The abort always happens, so a fix Stage or a human never inherits a half-finished rebase.

Pull request ​

The branch is pushed with --force-with-lease, since the rebase rewrote it. The pipeline opens a ready (non-draft) pull request against the base branch, or updates the one it already has: a new title and body, and out of draft (a draft often runs no workflows, so a draft left from a Hand-off would read as "no checks"). A pull request already open on the branch counts as the one it has, since an attempt GitHub failed to answer may have opened it all the same.

The title is the first of these in the commit convention's shape, <type>[(<scope>)]: <summary> on one line (a trailing (#<n>) is dropped):

  1. The latest title the implement, fix or pr Stage answered for the whole branch, in this Run or recorded in the state file by an earlier one.
  2. The branch's first commit subject.
  3. The Ticket title, as it is.

The body is Closes #<n>, a blank line, and the latest body the implement, fix or pr Stage answered, in this Run or recorded in the state file by an earlier one; with none, Closes #<n> alone. The pipeline adds nothing else: the verify row of the progress comment carries the verdict, and the merge ticks the met criteria. A draft pull request a Hand-off leaves keeps its own body until a Run publishes it again.

CI wait and grace period ​

The pipeline polls the head commit's check runs and commit statuses until they settle or ciTimeoutMinutes runs out.

What GitHub showsProgress cellResult
Every check passed or skipped✅ passedMerge, or on a Target that merges by hand a Hand-off whose merge row reads 👤 left to a human
A check failed, was cancelled, timed out, needs action or could not start❌ failedSpends the fix budget
The same, and the merge-base fails a Check command⏸ `<command>` fails on the base branchA Release (below)
GitHub still failing on its own side after a minute of tries⏸ GitHub failureA Release
Checks still pending at the timeout, or never listed❌ timed outHand-off
No checks, and GitHub finds the pull request conflicting❌ conflictingHand-off at once
No checks after the grace period⚠️ no checksMerge, with the warning row
No checks at the first reading, and no workflow can run on the pull request⚠️ no workflow runsMerge at once, with the warning row

A failed check hands the fix Stage the tail of the failing Actions jobs' logs. A conflicting pull request is handed off without waiting, because GitHub runs no checks on it; only a human merging meanwhile can cause it. A reading where GitHub would not list the check runs or statuses is no answer, and is asked again like a pending one.

A pull request with no checks merges: whether one runs CI is a fact about it, such as a docs-only change a paths filter skips, and a Target that needs CI before a merge says so on GitHub (Requiring CI before a merge). The pipeline runs no Check on the branch, so such a pull request merges code nothing ran.

The grace period. Right after a pull request opens, GitHub reports no checks for a while, so "no checks" counts only after ciGraceMinutes. Under ciGraceMinutes: 0, a pull request merges before a slow check run registers.

No grace when no workflow can run. Before the wait, the Run reads the workflow files in .github/workflows/ as the pull request's branch has them, and the wait skips ciGraceMinutes when none of them can run on the pull request. Checks already registered at the first reading are still waited for. A Target with no workflow file is one where none can run. A workflow cannot run when each of its events is one of these:

EventCannot run on the pull request when
schedule, workflow_dispatch, repository_dispatch, workflow_callalways
pull_requestbranches or branches-ignore excludes the base branch, or paths or paths-ignore excludes every changed file, a renamed file counting under both paths
pushbranches or branches-ignore excludes the pull request's branch

Patterns are read as GitHub's filter pattern cheat sheet reads them, not as shell globs: **.js matches src/js/app.js. Anything the Run cannot rule out for certain counts as a workflow that can run, and the grace applies: a file that does not parse, any other event, a filter it does not read (types, a push paths, tags) unless one it reads rules the event out, a pattern with ?, +, [] or a leading !, a path written from / or ./ or ending in /, and a wildcard that would have to match a name starting with .. Wrong that way, it costs the grace; wrong the other way, a pull request would merge before its CI registers.

A failure the base branch shares ​

A test on the base branch that starts failing, one that reads the wall clock say, fails on every branch at once. Charged to each Ticket, it costs every one its fix budget, and each fix Stage mends it differently in its own pull request. So before a red CI is charged, the pipeline asks whether the branch brought it or inherited it: it runs every Check command at the branch's merge-base with the base branch, stopping at the first that fails.

The merge-base, as the remote holds it, is checked out clean, and the commands run there under the same checkTimeoutMinutes, once per Run however many Lanes fail on it. Nothing is installed there: a command finds its dependencies in the main checkout, as a Ticket's worktree does, so a command that needs an install or a build step of its own fails there too, and the Note's output shows why.

The merge-baseProgress cellResult
passes❌ failedSpends the fix budget
fails too⏸ `<command>` fails on the base branchA Release; the budget stays as it was, spent or not, and the Run claims no more Tickets
could not be checked out or runas if it passedSpends the fix budget, and the Run log says why

The Release posts the pipeline's own Note on the standing Notes issue, naming the command and quoting the tail of its output, once per Run and merge-base commit however many Tickets it releases. Nothing compares the two failures, so CI that went red over something else is released all the same; the Note quotes the branch's own failure beside the merge-base's, marked as the branch's: the failing jobs' logs a fix Stage would have been handed. It is the failure of the Ticket that posted the Note; a Ticket released later over the same commit adds nothing. What to do next is on Release over a failing base branch.

Squash merge and its commit ​

The pipeline squash-merges through GitHub's REST API with a commit message it composed itself:

text
<title> (#<pr>)

Closes #<n>

<problem>

<solution>

Unverified:
- <criterion> — <evidence>

Co-authored-by: <name> <email>

The subject is the pull request title. <problem> and <solution> are the latest the implement, fix or pr Stage answered, each line wider than 72 columns broken at its spaces, a wide character such as Hangul counting as two; the lines the Stage wrote stay, so a list stays a list. With no solution answered, the branch's commit subjects stand in for it as - <subject> lines, after the problem when there is one; nothing is made up for a missing answer. Unverified: appears only when a criterion was unverifiable, or ci with no check run on the pull request, one line each with its evidence joined into one line, since nowhere else keeps that reason. Commit subjects and Co-authored-by trailers are read after the rebase, since those are the commits that land. On a Target that merges by hand none of this is composed: the human merging gets the Target's own default message.

After the merge ​

The Ticket is merged, so nothing below can hand it off. Each step's failure is logged and the next step still runs:

  1. Remove the state file, so the Ticket never looks resumable again.
  2. Tick the met criteria and, once CI passed, those left to CI (below).
  3. Remove in-progress. The merge closed the issue.
  4. Pull the base branch. This ends the Landing, and the next Lane's Ticket rebases onto a base branch that already carries this one.
  5. Remove the worktree and the local branch, and delete the remote branch unless GitHub already did.

What the board is told ​

The progress comment. A Ticket gets one progress comment, found again by a hidden marker and rewritten in place as each step ends, so only the first write notifies anyone. It is posted when the first row is recorded. Each Run that works the Ticket has its own section below earlier Runs' sections, headed by the version, the Run id and the branch:

text
**ticket-runner** `0.4.0` · run `2026-09-17T09-00-00-000` · `agent/4-planning-guards`

| Stage | Outcome | Turns | Duration |
|---|---|---|---|
| implement | ✅ committed | 46 | 21m 14s |
| verify | ❌ 1 unmet | 11 | 5m 3s |
| fix | ✅ committed | 12 | 6m 2s |
| verify | ✅ 5 met · 1 to CI · 1 unverifiable | 9 | 4m 31s |
| ci | ✅ passed | – | 2m 40s |
| merge | ✅ #31 | – | – |

Rows carry a few words only. Anything a human has to act on is its own comment, since those are worth a notification: a hand-off, a guard warning, a Note. The exception is a green Ticket handed off with nothing failed and no criterion unverifiable, which gets no comment.

Ticking met criteria. After the merge, every criterion the verdict marked met, and every ci one once CI passed, is ticked by its number (- [ ] → - [x]) wherever it is written: the body, or any comment, such as the one triage posted its brief in. The box ticked is the unticked line, across the body and every comment together, that still reads as the line the number named when verify got the list. When no line, or more than one, reads so, because the Ticket was edited in between, none is ticked and the Run log names the criterion: an untouched box is safer than a wrong one. An unverifiable criterion stays unticked, because nobody gathered evidence for it, and so does a ci one when no check ran on the pull request.

Notes ​

A Stage keeps meeting defects that are not its Ticket's. Fixing them widens the Ticket past what verify grades; ignoring them loses them in a transcript. So the implement, verify and fix Stages end with a list of Notes, and the pipeline posts each one where a human will meet it. A Note is a defect outside the Ticket, something that behaves wrongly or breaks, never a preference, a refactor or a test that would be nice to have, and never acted on in it. What the Ticket's own deliverable already records, such as a report section the Ticket asks for, is not a Note either. A defect the branch itself introduced, one that behaves correctly on the base branch and wrongly on the branch or sits in code the branch added, belongs to the Ticket: the implement and fix Stages fix it rather than note it, and verify, which fixes nothing, reports it in its verdict, failing it. Notes are routed before the Stage's own outcome is judged, so a Stage that ran out of turns still reports what it noticed.

The Note namesWhere it goes
An open, unclaimed Ticket that is not a SpecA comment on that Ticket
No Ticket, or the Stage's own Ticket (about to close)The standing Notes issue
A closed, claimed (in-progress) or Spec issueThe standing Notes issue, saying which Ticket it was meant for and why it did not go there
A number that will not take the comment (invented, locked)The standing Notes issue, with the number it was meant for

The standing Notes issue is one open needs-triage issue, titled "Notes from the pipeline", that collects Notes as comments. It is found by a marker in its body, not by its title, so renaming it opens no second one. It is opened by the first Note that needs it and shared by every Lane of the Run. Work through it as triage does: turn each Note worth doing into a Ticket, or a comment on one, then close the issue. The next Note opens a fresh one. When one is open, each noting Stage's prompt carries its number, so the Stage can read what is already reported and add only what would change a reader's action.

A - [ ] at the head of a line in a Note is escaped, so a Note is never read as Acceptance Criteria. The Run summary lists each Note as a noted row under the Ticket that made it.

  • Planning: the guards that run before the claim, and how to write Acceptance Criteria verify can grade.
  • Running: starting a Run, --lanes, --api-key, a narrowed Run, the summary, exit codes and transcripts.
  • Configuration: checks, the Stage limits, ciTimeoutMinutes, ciGraceMinutes, and requiring CI before a merge.
  • Hand-offs, stopping and resuming: Hand-off, Release, Stop, Stranded Tickets and handing a Ticket back.
  • Internals: the ports and adapters behind each step.

References ​