Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ Do not edit `CONTRIBUTING.md`, `assets/CONTEXT.md`, `assets/AGENTS.md`, or
shims, or cleanup of what earlier versions wrote.
- Starting or spawning quests stops at PR creation. It merges only on a
/quest-merge pick: the user's, the one /quest-plan's interview gives its own
PR, or the standing one /quest-run gives a PR with no user-facing behavior
change that adds or expands no quests, or a trivial PR such as a dependency
bump once Pullfrog approves its head; and only after repository checks and
reviews pass.
PR, or the standing one /quest-run gives a low-risk PR in a class
`RISK.md` lists under `## Automatic` that adds or expands no quests, or a
trivial PR such as a dependency bump once Pullfrog approves its head; and
only after repository checks and reviews pass.
- A change to the reviewers in `src/cli/models.ts`, the review prompts in
`src/cli/review.ts`, or a `REVIEW.md` runs `quest eval run` with the base's
build and the head's, and puts both scores and their cost in its PR's
Expand Down
75 changes: 67 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,7 @@ merge-state dirty
review-decision -
review-record diff-identical 5f1c2e9a8b7d6c5e4f3a2b1c0d9e8f7a6b5c4d3e
risk medium diff-identical low It changes when quest gate admits a command.
class -
auto-merge -
merge-queue -
landing-stopped -
Expand All @@ -569,6 +570,7 @@ comes last, and a missing value prints as `-`:
| `mergeable`, `merge-state`, `review-decision` | GitHub's values, lowercased. |
| `review-record` | Whether the PR body's [`## Review` record](#review-locally) still covers the head, and the head it names last: `current` when it is the head, `diff-identical` when `git diff <base>...<head>` prints the same as for it, `stale` otherwise, or `unknown` when GitHub cannot compare them, such as a diff too large; `-` when the record names no full SHA. Whose record counts is the reader's call. |
| `risk` | The record's [risk tier](#risk-tiers), `low`, `medium`, or `high`; the same state as `review-record` for the head it names; the tier its classifier set before any reviewer raised it; and the reason. `-` when the record names none. |
| `class` | The `## Automatic` class of the base's `RISK.md` the record's classifier found the change in, or `-`. |
| `auto-merge` | Method, who enabled it, when, and the head it was enabled on. |
| `merge-queue` | Queue state, position, and when it was enqueued. |
| `landing-stopped` | The reason the latest merge-queue entry, auto-merge, or [`quest land`](#the-watchers-own-queue) queue entry ended (such as `merge_conflict`, `failed_checks`, `manual`, `manually_disabled`, or `merged`), who ended it, and when; `-` once the PR has entered the merge queue or auto-merge again since. |
Expand Down Expand Up @@ -1697,36 +1699,58 @@ own retries, which also counts as the limit there.

Each head also gets a risk tier, `low`, `medium`, or `high`: what could break,
for whom, and how hard it is to undo, set from the change and never from who
wrote it. Nothing acts on the tier yet; `quest status` and `quest usage` report
it.
wrote it. The tier scales the PR's guardrails:

| Tier | Local review | CI | Lands on |
|---|---|---|---|
| Low | None; the online reviewer only | The checks its diff reaches | Its own, once its class is in `RISK.md`'s `## Automatic` list; else the maintainer's pick |
| Medium | The size's pick | The checks its diff reaches | The maintainer's pick |
| High | The size's pick and a second reviewer on another model | The full suite [`quest suite`](#run-the-full-suite) names | The maintainer's pick, with the full brief |

`/quest-run` carries the picks.

A change is `high`, with no model, when a changed path on either side of a
rename matches a pattern held high: `RISK.md` itself, everything under
`.github/workflows/` and `.github/actions/`, and each pattern in the `## High`
list of the base's `RISK.md`, at the repository's root:

```markdown
````markdown
# Risk

Customers run the relay and the player; the CLI is for contributors.

## Automatic

- `tests` - only tests and their fixtures change

## High

- `src/billing/` - charges customers, and refunds are manual
- `**/*.proto` - peers on older releases read the wire format

## Full suite

```sh
just gate --all
```
````

Each item is a backticked path from the root, where `*` and `?` stay within one
segment, a whole `**` segment spans any number, and a matched directory covers
everything under it, then ` - ` and why changing it is high. The rest of the
file is prose for the classifier, such as what is customer-facing. `quest
file is prose for the classifier, such as what is customer-facing, except
`## Automatic`, whose items are each a backticked class name of lowercase
words joined by hyphens, ` - `, and the rule over the diff a change meets to
fall in it, and `## Full suite`, one fenced block holding the command that
runs the whole test suite. Each section appears at most once. `quest
review` reads the file from the base's tip, so a change cannot lower its own
tier, and fails on one it cannot read, which the repository's own `quest check`
reports first. A base with no `RISK.md` makes every change no path holds high
`medium`.

Otherwise a classifier reads the diff and the base's `RISK.md` in one read-only
turn and replies with a tier and one sentence on why: Claude Code
turn and replies with a tier, one sentence on why, and the `## Automatic`
class every changed file falls in, or none: Claude Code
`claude-haiku-5-5` at low effort, or Codex `gpt-6.1-sol` at low when Claude
Code is missing, logged out, has its login rejected, or hit its usage limit.
When neither can run, the review fails on the limit that resets first if both
Expand All @@ -1744,7 +1768,38 @@ the reason of the first to judge it so. The record names it after the base:

`Classified:` names `the always-high paths` or `default` when no model set the
tier, and a reviewer that raised it adds `- Raised the risk to high: <reason>`
to its block.
to its block. A `- Class:` line follows when the classifier named a class.

A low head with no finding left to settle runs no local reviewer, unless
`--harness`, `--model`, or `--effort` names one: the record names the head in
full, adds `- Local review: none, since a low-risk head needs only the online
reviewer`, and `next done` says so. A high head also gets a second reviewer:
the first of the size's list on a model other than the pick's that can run,
marked `second`, in a session of its own that reviews every head while the
tier is high and settles its findings after. `--model` and `--effort` change
only the pick, so the second reviewer still runs; the one reviewer `--harness`
names runs alone, with none. A round that raises the tier to
high saves its rounds and runs the second reviewer at once; when that review
fails, as when none can run, it prints those rounds before the error, so their
findings can be answered. When every other model is avoided, as
with no `## Models` record under a harness the list has one model of, the run
fails as a usage error; when they cannot run, as an outage.

`--override <tier> --reason <text>` records the maintainer's tier for the
branch in place of the reviewed one, as `- Risk: <tier>, <reason>` and
`- Overridden: from <tier> by the maintainer`. It holds across heads until
the reviewed tier grows riskier than the one overridden, and `quest usage`
counts overrides as a reading of the tier's accuracy.

### Run the full suite

`quest suite <pr>` prints the base's `## Full suite` command when the PR's
head needs it: its record names it high, or names no tier that covers the
head. It prints nothing otherwise, so a repository's gate runs the command it
prints beside its scoped checks. The tier is the PR body's, which its author
writes, so a gate runs the full suite itself for an author without write
access. `--base` names the branch whose `RISK.md` it reads, fetched first,
by default origin's default branch.

### Score the reviewer

Expand Down Expand Up @@ -1867,8 +1922,12 @@ the record names, or its sub-agent, goes to that reviewer. Spend still left
fitting several, such as a routed and a shadow reviewer at one effort whose
sessions no record names, is split evenly among them and reported as `split`.
Each risk tier's PRs, how many merged,
how many a reviewer raised, and how many a later PR's `## Caused by` names
show whether the tiers predict what breaks. Each breakage a merged PR in the
how many a reviewer raised, how many the maintainer overrode, how many a later
PR's `## Caused by` names, and how long they waited on a person show whether
the tiers predict what breaks and what each costs. Each `## Automatic` class
the classifiers named gets the same numbers, and how many of its PRs were low,
to argue for or against merging the class without a pick. A local reviewer
row marked `second` shows what the high tier's second review catches. Each breakage a merged PR in the
window names under `## Caused by` follows on its own line, by culprit, even one
older than the window, which is read from GitHub: the culprit's tier, size,
writers, and local reviewers, who found it and the incident it closes when
Expand Down
15 changes: 15 additions & 0 deletions RISK.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,21 @@ alone, or a routine dependency or pin bump.
Tests, plans under `quest/`, and documentation change nothing others rely
on, so they are low.

## Automatic

A low PR whose author has write access lands without the maintainer's pick
when its whole diff falls in one class below. Only a PR the maintainer
picks changes this list, proposed with `quest usage`'s numbers for the
class: its PRs merged, the culprits among them, and their wait on a person.

- `tests` - only tests, their fixtures, or benchmarks change
- `internal-docs` - only comments, plans under `quest/`, or documentation
no user, contributor, or other repository reads change
- `refactor` - code changes that keep every behavior and output the same,
such as a rename inside a module or a simplification
- `trivial` - a dependency or pin bump, or another change as small, from
any author, which lands at any tier once Pullfrog approves its head

## High

- `assets/CONTEXT.md` - every agent session in every repository using
Expand Down
1 change: 1 addition & 0 deletions assets/skills/merge.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Otherwise, the changes since the reviewed head need no new review only when they
The repository's review policy decides whose record counts and may require more, such as a maintainer's review.
Where it says nothing, only a record on a PR whose author has write access counts: anyone else writes their own PR body, so their head needs a local review that rewrites the record.
On a trivial PR that `/quest-run`'s standing pick covers, Pullfrog's approval of the head stands in for that record unless that policy requires more.
A low head's record counts without a local reviewer; a later head's rise in tier ends the pick: tell the user.

Queue the head with `quest merge <pr> --land <full 40-character head SHA>`, adding `--squash` or `--rebase` when the repository's root instructions name that method for the PR's base.
Run a `quest` the PR cannot modify, such as an installed release rather than a build from the head's checkout: it refuses a head that leaves its quest inaccurate, a check the head's own code could skip.
Expand Down
3 changes: 3 additions & 0 deletions assets/skills/review.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ Pass `--exclude-model` or `--size` only for a PR whose body cannot hold the reco
Where the repository's root instructions name other reviewers, pass them with `--harness`, `--model`, and `--effort`, which runs that reviewer alone.
Each round rewrites the PR body's `## Review` section, so add context only after it, and write a round's record by hand only when it printed `record skipped`.

`quest review` sets the head's risk tier before any reviewer runs: a low head gets no local reviewer, only a record saying so, and a high one gets a second reviewer on another model, which a round that raises the tier runs at once.
When the user overrides the tier, pass it with `--override <tier> --reason <their reason>`.

Each round ends with a `next` line: follow it until a round of the head reports no finding you have not refuted; never block on the score.
Fix in the PR every review finding relevant to it that you do not refute and every gap the change exposes; in other code you read, fix easy findings and suggest the rest as follow-ups.
Refute a finding only with evidence the reviewer cannot rebut: a `path:line`, a command's output, or a recorded maintainer decision.
Expand Down
8 changes: 4 additions & 4 deletions assets/skills/run.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ A PR with open decisions, its `## Waiting` section's or an issue you would solve
A PR you would skip or delete rather than fix, such as a superseded one, gets that question instead.
Leave a PR whose required checks are still running for a later round; an automated reviewer is not waited on, since the queue waits for an approval the base requires.

A PR whose author has write access and that changes no user-facing behavior carries a standing `/quest-merge` pick, unless the repository's `CONTRIBUTING.md` opts out: run `/quest-merge` on it without asking, and name it as auto-picked in the summary.
That covers only tests, benchmarks, CI, internal docs or comments, and behavior-preserving code. Anything users or other repositories get, such as CLI behavior or output, shipped skills or rules, user-facing docs, dependencies, or release artifacts, needs the user's pick, as does adding or expanding quests.
A trivial PR, such as a dependency bump, carries it too whatever its author, under the same opt-out, but merges only once Pullfrog has approved its head; in a repository without Pullfrog, it needs the user's pick.
Judge the diff, not the title, before every `/quest-merge` run, and ask when unsure: the standing pick ends at the first head that does not qualify, or once a person takes the PR out of the queue.
A PR whose author has write access carries a standing `/quest-merge` pick, unless the repository's `CONTRIBUTING.md` opts out, when `quest status` shows it low for the head, in a class the base `RISK.md` lists under `## Automatic`, adding or expanding no quests: run `/quest-merge` on it without asking, and name it as auto-picked in the summary.
A trivial PR, such as a dependency bump, carries it too whatever its author and tier, under the same opt-out, but merges only once Pullfrog has approved its head; in a repository without Pullfrog, it needs the user's pick.
Judge the diff against the class's rule before every `/quest-merge` run, and ask when unsure: the standing pick ends at the first head that does not qualify, or once a person takes the PR out of the queue.
Ask about a high PR with both reviews and the full suite's result.

Ask about every other PR in a question of its own that summarizes it and picks only the action, with `/quest-merge`'s pick options; none covers several PRs.
Ask about each of its follow-ups in a question of its own beside it, as the guide's Creation section describes; the answers count only on a `/quest-merge` pick, and go in the brief of the `/quest-iterate` it dispatches.
Expand Down
6 changes: 3 additions & 3 deletions quest/m0/afk-and-waits.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

Reduce repeated manual prompts during interactive, mobile/travel, and AFK sessions across three coordinated improvements:

1. **`/quest-afk` modes (`assets/skills/afk.md`):** Keep bare `afk` conservative (standing picks only, deferring other merges until [risk-tier guardrails](/quest/m0/benchmark/guardrails.md) earn wider auto-merge), and add two explicit modes: `afk merge` (merge any non-high-risk PR the agent strongly recommends with a clean review and no open decisions, still deferring high-risk or uncertain PRs and quest deletions) and `afk soon` (flush pending decisions in one batch, then automatically enter `afk`).
1. **`/quest-afk` modes (`assets/skills/afk.md`):** Keep bare `afk` conservative (standing picks only, deferring other merges until classes in [`RISK.md`](/RISK.md)'s `## Automatic` list earn wider auto-merge), and add two explicit modes: `afk merge` (merge any non-high-risk PR the agent strongly recommends with a clean review and no open decisions, still deferring high-risk or uncertain PRs and quest deletions) and `afk soon` (flush pending decisions in one batch, then automatically enter `afk`).
2. **PC-local vs tap-anywhere waits (`src/core/waiting.ts`, `quest waiting`, `quest check`, `assets/AGENTS.md`, `assets/skills/run.md`):** Distinguish local/PC maintainer actions (such as password-manager unlocks, hardware checks, or local logins) from decisions answerable from any device, with filtering on `quest waiting` so remote/travel sessions skip PC-local waits and `"at my PC"` sessions batch them.
3. **Pending-CI waiting in `/quest-run` (`assets/skills/run.md`):** When no sub-agent is running and every current question is asked, also block with `quest wait` on open PRs whose required checks are still pending (in addition to queued PRs whose merge unblocks a quest) so those PRs get picked in the same session instead of ending early.

Non-goal: changing risk-tier definitions or automatic low-risk merge classes on bare `afk` (owned by [Scale review, CI, and approval to a PR's risk tier](/quest/m0/benchmark/guardrails.md)).
Non-goal: changing risk-tier definitions or automatic low-risk merge classes on bare `afk` (set by [`RISK.md`](/RISK.md) and the README's Risk tiers section since [moq-dev/quest#802](https://github.com/moq-dev/quest/pull/802)).

## Plan

Expand Down Expand Up @@ -42,4 +42,4 @@ Agent's choices, for the implementer to revisit:

## Related

- [Scale review, CI, and approval to a PR's risk tier](/quest/m0/benchmark/guardrails.md) - risk tiers define the `high` boundary `afk merge` defers and will widen standing auto-merge separately
- [`RISK.md`](/RISK.md) and the README's Risk tiers section, since [moq-dev/quest#802](https://github.com/moq-dev/quest/pull/802) - risk tiers define the `high` boundary `afk merge` defers and will widen standing auto-merge separately
Loading