Repository navigation
fix(review skill): re-compose suggestion blocks after a base merge - #1083
tend-agent wants to merge 2 commits into
Conversation
…ped delta #1082 made inline-comment re-verification unconditional whenever a `base merge:` line appears, because the scoped log names no file on an "Update branch" click while the merge re-scopes every file's hunks. The suggestion bullet one line down kept the narrow scoping: "on a file the delta touched" reads "the delta" as that same scoped log, so a base-merge-only push re-composes nothing. The block still holds the tree the session reviewed, so posting it at the re-anchored line writes base's merged-in lines back out on one click, which is the failure the bullet exists to prevent. Reproduced both merge shapes in a scratch repo. Base adds two lines above the flagged one: scoped log empty, `git show --cc` empty, the reviewed line moves 7 -> 9. Base edits a line inside the suggestion's range, still a clean auto-merge: scoped log still empty, and a three-line suggestion composed at the reviewed head reproduces the pre-merge `L4`, so applying it deletes base's `L4-MAIN-FIX`. Pinned in `test_cross_file_contracts.py` beside the re-verify clause, which is how that one went missing in the first place.
tend-agent
left a comment
There was a problem hiding this comment.
The fix is right: a clean base merge re-scopes hunks in files the scoped log cannot name, so a suggestion block composed against the reviewed head writes base's merged-in lines back out on one click. uv run pytest generator/tests/test_cross_file_contracts.py passes here and CI is green.
One structural point, not a defect. The base-merge override now lives in two bullets. The Read the two git log outputs as a pair bullet already exists to say that the narrow "file the delta didn't touch" scoping does not hold once a base merge: line appears, and this PR adds a second copy of that same exception to the suggestion bullet. Widening the existing override bullet to cover suggestion blocks alongside inline comments would keep the exception in one place, and the contract test could pin that one sentence. As it stands two bullets have to be kept in sync — which is the shape that produced this PR, since the preceding change widened one bullet and left its neighbour narrow. There is a fair case for the placement chosen here (a reader looking at suggestion mechanics finds the rule locally), so this is a judgment call rather than something to fix.
|
Wording fix applied in 393538d. Keeping the two-bullet placement, for a reason narrower than locality: the duplication the review names is a consequence of each bullet stating its own scoping condition, and only one of those is removable. The What was missing was the sync check, not the single home. Both strings are now pinned by asserts sitting one line apart in |
|
Closing as superseded by #1107. The useful rule here—recompose every carried
|
#1082 made inline-comment re-verification unconditional whenever a
base merge:line appears — the scoped log names no file on an "Update branch" click, while the merge re-scopes every file's hunks. The suggestion bullet one line down kept the narrow scoping: "on a file the delta touched" reads "the delta" as that same scoped log, so a base-merge-only push re-composes no suggestion at all. The block still holds the tree the session reviewed, so posting it at the re-anchored line writes base's merged-in lines back out on one click — the failure that bullet exists to prevent. Verified withuv run pytest(760 passed).Repro — both merge shapes, scratch repo
Author edits
L7; base then moves and the author clicks "Update branch".HEAD_SHAis the reviewed head,CURRENT_HEADthe merge.Base adds two lines at the top, clean auto-merge:
Base edits a line inside the suggestion's range, still a clean auto-merge and still an empty scoped log:
A three-line suggestion composed at the reviewed head reproduces
L4, so applying it deletesL4-MAIN-FIX. Nothing in the pre-change bullet asks for the re-compose, because the scoped log named no file.The new assert sits beside the one #1082 added for the re-verify clause — that clause went missing silently once already, and the suggestion half has the same exposure.