chadtmiller.com/knotless
git that lives in your Atmosphere account
1
10
knotless-agent: a merge of the base into a pull spends no review round
Merged Approved
This makes the reviewer carry its last verdict to a new head when git patch-id --stable of the -U0 diff from the merge base is unchanged. That covers a plain merge of the base into the branch. The carried review begins Carried forward:, is dropped from earlier and the round count, and a head the thread already has a review at is skipped.
I read the control flow in Reviewer::review and found nothing that must change:
- The head is re-checked before the carried comment is written.
postedis set after it, so the same head is not carried twice.- A review with no
commit, or an old head that is gone, falls through to a full review. - A real change after a carry reads as round 2 with only the real review in
earlier, which the new test checks. - The docs the repository's AGENTS.md asks for (guide, CLI reference, collaboration design) are updated. The change touches only
knotless-agent, so it needs no changeset.
Two things to know, neither of which blocks:
- A
-U0patch-id ignores context. A merge resolution that keeps the pull's added lines but changes how they interact with new base code is carried as unchanged. You list this as a shortcoming, and I think it is acceptable for the cap's purpose. same_changeuses?on the mirror sync,head_ofand thenowdiff. A transient failure there makes the sweep note a warning and retry, rather than falling back to a full review. That seems fine.
Nothing was built or run, so I'm relying on CI for fmt, clippy and the tests.
All checks have passed
8 passed, 2 skipped
Merged as f8227a8
What changes
A head that brings nothing of its own is not reviewed again. Before reading a pull, the reviewer compares what the pull changes against its base at the new head with what it changed at the last head reviewed. Each is the
git patch-id --stableof a-U0diff from the merge base, so the comparison ignores where the hunks fall in each file. If they match, as after a merge of the base into the branch, no command runs. The last verdict is written at the new head in a review beginningCarried forward:, which says which head it was carried from. A carried review is not counted toward--rounds, and the command is not given it amongearlier. A real change after it is read as the next round.Never twice at one head. The reviewer also skips a head that its own thread already has a review at, even when the appview's view of the pull has not heard of that review yet. Without this, a carried review that the appview hasn't heard of yet would be read again as a fresh round.
The deploy reviews up to five rounds (
KNOTLESS_REVIEW_ARGS: --all --rounds 5).The reviews guide, the CLI reference and the collaboration design note say how carrying works.
Why
grain's move off hatk runs as a feature branch with several pulls open into it at once. Each time one lands, the others merge the branch in, and each merge was a new head that spent a round. One pull spent all three rounds on heads like that. The commits that came after them (a cursor fix, and writes stored at each commit's revision) were never read by the reviewer, and were read by hand instead.
Raising the cap alone would pay for more re-reads of merges. Carrying the verdict keeps the cap meaning "reviews of this pull's own change".
How it was checked
an_agent_reviews_pullsgains a case:changesto the merge without running the command, writes no line comments, and does not count it as a round.earlier.Nothing was built or run locally. CI runs fmt, clippy and the tests.
Shortcomings
changesverdict stayschangesuntil the author pushes a real change. Nothing outside the pull's own change is reconsidered.Review
Start at
Reviewer::reviewandsame_changeincrates/knotless-agent/src/lib.rs.🤖 Generated with Claude Code