Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
f1244ab
refactor(kernel): extract phase launcher and stop publication
rochecompaan Nov 1, 2026
6c8906f
feat(kernel): run planning through an optional human channel
rochecompaan Nov 1, 2026
653ee5b
feat(kernel): hold interactive runs at planning gates and the review …
rochecompaan Nov 1, 2026
cc3e5ac
feat(kernel): publish in-memory run snapshots
rochecompaan Nov 1, 2026
e78fa91
fix(kernel): isolate run snapshot observer failures
rochecompaan Nov 1, 2026
2cb1c5c
feat(console): start implementation workers through pi-subagents RPC
rochecompaan Nov 1, 2026
2f7fe28
feat(console): stop stray implementation workers
rochecompaan Nov 1, 2026
d50ed27
fix(console): poll stray workers every 500 ms
rochecompaan Nov 1, 2026
e914d1f
feat(console): add the Patchmill console extension and tools
rochecompaan Nov 1, 2026
5f7313f
fix(console): block Issue run starts until stray workers stop
rochecompaan Nov 1, 2026
cf3f520
feat(cli): open interactive Issue runs with run-once --interactive
rochecompaan Nov 1, 2026
20ec162
fix(console): stop on Pi startup errors and test run wiring
rochecompaan Nov 1, 2026
6b3f63c
feat(console): unblock implementation workers in place
rochecompaan Nov 1, 2026
6089a93
test(console): prove a session runs another issue after one ends
rochecompaan Nov 1, 2026
88f60c2
docs: describe interactive Issue runs
rochecompaan Nov 1, 2026
8841b55
fix(console): reject incomplete worker status during cleanup
rochecompaan Nov 1, 2026
a1c8cee
fix(kernel): publish review wait failures as a new stop
rochecompaan Nov 1, 2026
7d61dbe
fix(console): drain in-flight launches when closing
rochecompaan Nov 1, 2026
ce5383a
fix(console): enforce local execution deadlines after resume
rochecompaan Nov 1, 2026
dc149fc
fix(console): settle runs before pi-subagents teardown
rochecompaan Nov 1, 2026
fa80ead
fix(console): reject prepared launches once shutdown starts
rochecompaan Nov 1, 2026
930473b
fix(console): verify worker exit before closing transport
rochecompaan Nov 1, 2026
84a5f75
fix(console): keep workers whose exit is unproven
rochecompaan Nov 1, 2026
74929d5
fix(console): retry proof for workers whose cleanup settles late
rochecompaan Nov 1, 2026
1947b44
fix(console): share one exit proof per unproven worker
rochecompaan Nov 1, 2026
fa07cc8
fix(console): wait for pending exit proofs before shutdown succeeds
rochecompaan Nov 1, 2026
df858fa
feat(cli): let run-once --interactive pick the next issue
rochecompaan Nov 1, 2026
c088832
fix(console): record planning usage from the console session
rochecompaan Nov 1, 2026
51aade6
feat(console): remove the issue worktree after a confirmed merge
rochecompaan Nov 1, 2026
e6ca27b
fix(console): record zero usage for empty planning spans
rochecompaan Nov 1, 2026
8ee5125
fix(console): label empty planning usage as no reply
rochecompaan Nov 1, 2026
80782bf
docs(spec): keep one console session per issue
rochecompaan Nov 1, 2026
e0ec241
feat(console): keep one console session per issue
rochecompaan Nov 1, 2026
e410e71
fix(console): persist the issue start before forking workers
rochecompaan Nov 1, 2026
307b097
fix(console): end the console when a session switch fails after teardown
rochecompaan Nov 1, 2026
1370083
docs(spec): describe /patchmill-issue in the answers table
rochecompaan Nov 1, 2026
273c892
fix(console): exit the process after the console ends
rochecompaan Nov 1, 2026
209e47c
fix(console): load the installed skill pack in the console
rochecompaan Nov 1, 2026
2e40dc6
feat(console): clean up spec and plan workspaces after a merge
rochecompaan Nov 1, 2026
3faf84e
docs(spec): approve planning gates in the chat
rochecompaan Nov 2, 2026
9a8da6b
feat(console): approve planning gates in the chat
rochecompaan Nov 2, 2026
3a1cc01
fix(console): push later gated documents only after approval
rochecompaan Nov 2, 2026
664e5c1
fix(console): return publication failures to the planning chat
rochecompaan Nov 2, 2026
9dc089f
fix(console): ask for planning approval only in the submit dialog
rochecompaan Nov 2, 2026
a4b136a
feat(console): show a clear planning approval dialog
rochecompaan Nov 2, 2026
3b209cc
fix(console): keep approval choices visible on small terminals
rochecompaan Nov 2, 2026
073f6b9
fix(console): size the approval dialog to the terminal
rochecompaan Nov 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions CONTEXT.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,22 @@ safety, policy, and human-control boundaries.
## Language

**Spec gate**: A required pause until a human merges the specification pull
request. Review approval alone does not unlock it. _Avoid_: Approval label
request, or approves it without a PR in an Interactive Issue run, which puts the
document on the pushed implementation branch. Review approval alone does not
unlock it. _Avoid_: Approval label

**Plan gate**: A required pause until a human merges the implementation-plan
pull request. Review approval alone does not unlock it. _Avoid_: Approval label
pull request, or approves it without a PR in an Interactive Issue run, which
puts the document on the pushed implementation branch. Review approval alone
does not unlock it. _Avoid_: Approval label

**Planning pull request**: A pull request for documents that must merge before
the next required stage. It does not complete the issue. _Avoid_: Implementation
PR

**Issue branch**: The implementation branch for one issue. Ungated planning
documents accompany its code. Required planning gates use separate branches.
documents and documents approved without a PR in an Interactive Issue run
accompany its code. Required planning gates otherwise use separate branches.
_Avoid_: One branch for every stage

**Run-once workflow**: The atomic processing of one selected issue from claim
Expand Down Expand Up @@ -46,6 +51,18 @@ through any resumptions to a terminal outcome. _Avoid_: Run attempt
**Run attempt**: One process entry into the run-once workflow for an Issue run.
A later Run attempt may resume the same Issue run. _Avoid_: Issue run

**Interactive Issue run**: An Issue run that takes human input through a console
instead of issue comments. It uses the same Run-once workflow.

**Console session**: The Pi session that holds the maintainer's conversation for
one or more Interactive Issue runs. It never decides a phase.

**Console agent**: The agent in the Console session. It plans with the
maintainer and calls Patchmill tools, but never chooses a phase.

**Review wait**: The part of an Interactive Issue run after the implementation
pull request is verified and labeled `agent-done`, and before it is merged.

**Normalized run outcome**: The small coordinator-facing result of one Run
attempt — completed, no work, deferred, cancelled, or failed — produced from a
rich Run-once workflow result. _Avoid_: Pipeline status
Expand Down
61 changes: 55 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,16 @@ narrow race between separate clones remains possible. The lock file and its
parent directory must stay in place, even after a crash.

Phase derivation reads git and the issue host. Spec and plan gates are optional
and default off. Each required gate uses a separate planning pull request. Only
merging that pull request unlocks the next stage. Logs, result files, and
approval labels never decide what happens next.
and default off. A required gate passes when its planning pull request is merged
into base, or its document is on the pushed implementation branch after an
interactive approval without a PR. Logs, result files, and approval labels never
decide what happens next.

Outcome verification checks facts after Pi finishes. Planning needs the pushed
branch and required documents. A gated stage also needs its planning pull
request. Implementation needs an open, non-draft pull request whose head matches
the branch and whose body closes the issue. `agent-done` means that this pull
request unless the maintainer approved it without a PR in an interactive run.
Implementation needs an open, non-draft pull request whose head matches the
branch and whose body closes the issue. `agent-done` means that this pull
request exists, not that it merged.

Stable names give humans and agents the same paths. Branches use
Expand Down Expand Up @@ -74,7 +76,10 @@ gate. The issue stays `in-progress` while waiting, and no Pi session runs then.
With both gates enabled, merge the spec PR, then the plan PR, before
implementation. Each later branch starts from the fetched base with the merged
documents. Ungated documents go into the next gated PR or the implementation PR.
The kernel never deletes these worktrees.
After a confirmed implementation PR merge, interactive runs remove the issue's
implementation, spec, and plan worktrees and local branches when each worktree's
`git status --porcelain` is empty. Dirty worktrees are kept, with the reason
shown in chat. Non-interactive runs leave them in place.

## Commands

Expand All @@ -90,6 +95,50 @@ The kernel never deletes these worktrees.
| `patchmill version` | Print the version. |
| `patchmill setup-test-repo` | Development tool for the end-to-end CI (#320). Outside the kernel. |

## Interactive Issue runs

```sh
patchmill run-once --issue 225 --interactive
```

This opens a Pi console for planning with you and running implementation in a
background worker, using the same Run-once workflow. `--issue N` (a positive
integer) is optional: without it, the CLI selects the next eligible issue before
opening the console. If none is eligible, it exits successfully without opening
the console. `--interactive` cannot be combined with `--dry-run` or
`--plan-only`. The console agent calls four tools:

- `patchmill_submit_planning_result`: submit a planning outcome after your
review in one dialog; requesting changes or Escape keeps planning open.
- `patchmill_continue_issue_run`: recheck a waiting merge and continue the run.
- `patchmill_run_status`: show the current run, worker, wait, and estimated
cost.
- `patchmill_confirm_block_guidance`: send guidance to a blocked worker after
your confirmation.

The planning dialog names the issue and document, shows the files and branch
with a short commit, and lists 2–5 key decisions rather than the agent's full
summary. A required gate offers **Approve and open a planning PR**, **Approve
without a PR (continue now)**, or **Request changes** in one dialog. Choosing PR
waits for its merge; choosing no PR lets Patchmill push the approved planning
head to the implementation branch and continue at once. Later documents stay on
that branch. A later required gate offers **Approve (continue now)** or
**Request changes** and explains which earlier document prevents a planning PR.
Ungated planning asks whether you have reviewed the spec, plan, or both, with
**Reviewed, continue** and **Request changes**. Requesting changes or Escape
keeps planning open and pushes nothing through Patchmill. A restart derives
approvals from the pushed documents, never saved workflow state.

Type `/patchmill-issue <N>` to start another issue once the current run ends. It
switches to that issue's conversation without a confirmation dialog. Sessions
live under `<runsDir>/issue-<N>/console/`; reopening an issue resumes its newest
session, while a new issue gets a fresh conversation.

Quitting the console stops the worker. At startup, Patchmill checks for stray
workers and stops them before starting an Issue run; if cleanup fails, it will
not start the run. Do not launch this command inside a pi-subagents child
process: `PI_SUBAGENT_CHILD=1` disables pi-subagents.

## Configuration

`patchmill.config.json` accepts only these keys. Each key has a default. Unknown
Expand Down
Loading
Loading