Skip to content

feat(bin): review a pull request with a dedicated reviewer crewmate - #29

Merged
BenjaminLu merged 5 commits into
mainfrom
fm/reviewer-agent-on-pr
Sep 19, 2026
Merged

BenjaminLu merged 5 commits into
mainfrom
fm/reviewer-agent-on-pr

Conversation

@BenjaminLu

@BenjaminLu BenjaminLu commented Sep 19, 2026 •

Copy link
Copy Markdown
Owner

What this is

A dedicated reviewer agent, and the delivery path it belongs to, replacing the in-session validation pipeline as the default rigor for a direct-PR ship.

The pipeline's review happened inside a session, so nobody could see it. This one happens on the pull request.

The path, end to end

A worker implements and pushes, and opens the pull request itself. A reviewer crewmate is dispatched against that pull request and posts its findings on it. Firstmate reads the findings, rules on the ones that are its own, escalates the ones that are the captain's, and posts every ruling on the same pull request - the captain's words verbatim when the ruling is the captain's. Fixes land as commits on the same pull request, one finding per commit. The merge gate is checks green plus every finding ruled; merge authority itself is unchanged.

Red checks are the worker's to fix. The reviewer reports one as a finding so it is visible with everything else, and nothing merges red.

This is one pass, not a pipeline

One dispatch produces one review. There is no round counter, no re-review requirement, and nothing in the path counts or compares attempts. The skill says so in its own section, because the failure mode being designed against is rebuilding the thing this replaces under a new name.

What carried over from the pipeline

Each of these was paid for and is now the reviewer's contract, owned by bin/fm-brief.sh --review:

  • A finding is one instance of a class. Report the class and everywhere it occurs, not only the line that made you notice it.
  • Read the primary source - the actual script, contract, or --help output - and say what you could not verify under Not verified rather than implying you checked.
  • State severity honestly and separate a defect from a preference.
  • Never decide a finding whose fix would widen what the captain asked for. That routes to firstmate. The reviewer changing does not change who owns scope.

Changes

File What
bin/fm-brief.sh --review <github-pr-url> writes the reviewer contract; single owner of what a review owes
bin/fm-dispatch.sh --review dispatches one in a single call; refuses a brief whose review shape disagrees
.agents/skills/pr-review/SKILL.md The path's detail and firstmate's side: dispatch, read, rule, post verbatim, land fixes
AGENTS.md One bullet for the path, one trigger line for the skill

A review is scout-shaped in every mechanical respect - scratch worktree, no branch, no commit, no push, no pull request of its own - so it reuses the scout spawn, supervision, and teardown path unchanged rather than adding a fourth task kind through bin/fm-spawn.sh. It writes the local pointer that the scout teardown gate requires; the posted review stays the authoritative copy.

Boundaries honoured

The no-mistakes pipeline's code and documentation are untouched. Projects that select no-mistakes are unaffected, and that mode still owns its own rigor end to end.

Self-contained

Nothing here needs configuration beyond a GitHub login. The reviewer posts through gh-axi, which bootstrap already requires, and a GitLab merge request URL is refused at scaffold time rather than producing a brief whose deliverable could not be posted.

Vendor agnostic, and the one gap

The reviewer is not a Claude thing. It is briefed as plain Markdown and spawned as a scout, so it runs on any harness the fleet already verifies - claude, codex, opencode, pi, pi-signed, grok, kimi, cursor, omp, muse, gemini, rovo, agy. It uses gh-axi, git and echo and nothing a single vendor ships. Where it must reach a firstmate contract it reads the file by absolute path ($FM_ROOT/.agents/skills/captain-hold-lifecycle/SKILL.md) rather than invoking a skill, which is the form every agent can follow. The new pr-review skill lives in .agents/skills/, the neutral location, and Claude reaches it through the existing .claude/skills symlink like every other skill here.

Two dependencies that are real, stated rather than hidden:

  • The forge is GitHub. gh-axi speaks GitHub only, so a review targets a GitHub pull request. A GitLab merge request URL is refused at scaffold time with a message naming why, rather than scaffolding a brief whose deliverable could not be posted. A clone whose project lives on GitLab gets a refusal it can act on, not a silent half-feature.
  • One inherited Claude path. When a reviewer must stop for a decision, the packet's figures are drawn through ~/.claude/skills/diagram-design. That line is not new here - it is the existing packet contract, already identical in the scout brief and in bin/fm-dod-lib.sh's ship definition of done, and this branch copies it rather than forking a fleet-wide contract in one brief kind. A clone without that skill installed gets a reviewer that works normally and, on the decision path only, a worker that escalates the missing skill as a blocker instead of writing a packet without figures. Making that path vendor-neutral is a change to the packet contract's single owner and belongs in its own pull request.

Replace the in-session validation pipeline as the default rigor for a
direct-PR ship with a reviewer that posts its findings on the pull
request, where the captain can read them.

bin/fm-brief.sh --review <github-pr-url> writes the reviewer contract and
is its single owner: the four disciplines carried over from the pipeline
(a finding is one instance of a class, read the primary source and name
what you could not verify, separate a defect from a preference, and never
decide a finding that would widen what the captain asked for), the
numbered finding format, and the requirement that the review be posted
and read back. A review is scout-shaped in every mechanical respect, so
it is spawned and torn down as a scout and writes the local pointer the
scout teardown gate requires.

bin/fm-dispatch.sh --review dispatches one in a single call and refuses a
brief whose review shape disagrees with the call.

The new pr-review skill owns the path end to end - who pushes, when the
pull request opens, who reviews, the merge gate, and what happens when
checks are red - plus how firstmate rules on findings, posts the captain's
words verbatim, and lands fixes one finding per commit. It states
explicitly that this is one pass and not a pipeline: no rounds, no
counters, no re-review requirement.

AGENTS.md states the path in one bullet and points at the skill. The
no-mistakes pipeline's code and documentation are untouched; projects that
select it are unaffected.

@BenjaminLu BenjaminLu left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vendor-behaviour verification for this change, run against this pull request on 2026-09-19.

gh-axi pr review <n> --approve on a pull request opened by the same account is refused by GitHub:

error: "failed to create review: GraphQL: Review Can not approve your own pull request (addPullRequestReview)"

gh-axi pr review <n> --comment is accepted - this comment is that review. So the reviewer agent posts a COMMENT review and carries its verdict in the body text, which is what the generated brief instructs. An approve or request-changes verdict is not available to a single-account fleet and the brief says so rather than letting a reviewer discover it as a failure.

A project clone commonly carries an `upstream` fork parent beside
`origin`, and gh-axi may resolve that one. Verified against this clone:
`gh-axi pr view 29` returned kunchenguid#29 - a different,
already merged pull request by another author - instead of the
#29 under review, with no error and entirely
plausible output. `gh-axi pr checks 29` reported that other pull
request's checks the same way. The mismatch surfaces only on a write,
and then as a confusing message about blank shas.

A reviewer following a brief built on bare commands would read a
stranger's pull request, review it, and post findings on the wrong
repository. Every gh-axi command the review brief generates and the
pr-review skill prints now carries -R <owner>/<repo>, taken from the
reviewed pull request's own URL, which is the only authority on where
that pull request is. The head checkout goes through `gh-axi pr checkout`
rather than a hand-written fetch from `origin`, for the same reason.

docs/verification/pr-review.md records this and the two other vendor
facts the contract states: GitHub refuses an approve review on a pull
request opened by the same account, so the reviewer posts a comment
review carrying its verdict in the body, and that review reads back
through `gh-axi pr view --reviews`.

Tests cover the new brief kind and its dispatch, including a direct
assertion that no gh-axi command in a generated review brief omits its
repository. Each new assertion was confirmed to fail against a mutated
source before being trusted.
fm-dispatch.sh's own contract is to validate every input before touching
anything, but --review was checked only by bin/fm-brief.sh. A brief that
already exists is reused without calling it, so on that path nothing
stood between a malformed or non-GitHub URL and the backlog note that
records it. The check now runs at step 1 through the shared PR parser,
where the contract says it belongs, and a test drives the reuse path
specifically.
… it names

The discipline said to mark a finding `widens scope: yes` while the
template field is `Widens scope:`, so the instruction did not name the
field the reviewer is filling in.

Also split a two-sentence line in the pr-review skill to keep the repo's
one-sentence-per-line rule.
@BenjaminLu
BenjaminLu merged commit d1a707f into main Sep 19, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant