Records R1 to R7 from the developer and the decisions D1 to D11 that the v1 work builds on, plus the issue, branch and review workflow the agents follow. Refs #1
3.5 KiB
Agent review
Every PR needs a passing review from a fresh agent session before it merges. The review sets the
agent-review commit status on the PR's head commit. A push after the review moves the head, so
the PR needs a new review.
Starting a review (author)
After the last push, start a reviewer that has none of the work's context: a new agent session, or
a subagent whose whole prompt is Review PR #<N> of FinalFactory/FinalToken following docs/agents/review.md. Use a capable model at high effort. The PR body, the issue and the earlier
reviews on the PR explain the change; the reviewer gets no other briefing.
Reviewing (reviewer)
-
Record the head commit you review:
tools/gitea.sh GET /repos/FinalFactory/FinalToken/pulls/<N> | jq -r .head.sha. -
Read the PR, its linked issue, the root
AGENTS.md, theAGENTS.mdof every touched project, the requirements and the recorded decisions the change touches, and the earlier agent reviews on the PR. -
Read the whole diff:
git fetch origin && git diff origin/master...<sha>. On a re-review it is context; step 5 says what can block. -
Check out the head in a separate worktree and run the checks in AGENTS.md that the change affects, always including
python -B tools/docs/check_docs.py. -
If the PR already has a failed agent review, this is a re-review. Check that each blocking finding of the last failed review is fixed or answered. Then review only the author's commits since the commit that review covered (named in its first line), leaving out what came in from
master:git log -p --no-merges ^<old sha> ^origin/master <sha>. Only these two can block. Anything else you notice is a note, even a bug; the author decides whether to fix it in this PR. A full pass in every round finds new problems each time, and the loop never ends. -
Look for:
- Spec: it does what the issue asks and stays inside its scope.
- Decisions: it matches the recorded decisions, or the PR changes their text and carries
the
type/decisionlabel. - Correctness: bugs, edge cases, error handling, concurrency, resource cleanup.
- Rules: the rules in
AGENTS.mdand in the touched projects'AGENTS.md. - Tests: new behaviour has tests.
- Docs: docs and
AGENTS.mdfiles match the new behaviour, commands and decisions.
-
Decide the verdict.
failonly for a blocking finding: a bug, missing behaviour the issue asks for, code that breaks a recorded decision or a rule from step 6, missing tests for new behaviour, or a failing check. A check or tool that misses some cases does not break the rule it guards: name the gap as a note. Everything else is a note and the review passes. -
Write the review to a file in this format, then post it with
tools/agent-review.sh <N> <sha> <pass|fail> <file>:## Blocking 1. `path:line`: what is wrong, why it matters, and the fix. ## Notes - `path:line`: the suggestion. ## Checked What you read and ran, on which commit.
The reviewer reports and leaves the code to the author.
After a failed review (author)
Fix each blocking finding, or answer it in a PR comment when it is wrong. Push, then start a new fresh review.
After the second failed review, stop. Comment on the issue with the open findings, add the
status/needs-decision label and leave it to a developer: merge anyway, allow more rounds, split
the PR or close it.