Let an owner's ruling ship a small edit made after /ship's final review (GST-3775) (#4818)

An owner can now rule that a small edit made after /ship's read-only
final review ships as a disclosed note, and finish accepts exactly that
file at exactly the ruled bytes instead of forcing a whole new /ship.

This unblocks teams that hit "behavior, tests or build inputs changed
since review" over a one-line test change (garrytan/gbrain#10256), while
keeping the review stop for every other edit.

Nothing to do on merge; the changelog fragment is in
changelog.d/edit-ruling-fixes.md.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Review-Finding: p1/red-team#1 reader=red-team
Review-Finding: p1/red-team#2 reader=red-team
Review-Finding: p2/outside-voice#2 reader=outside-voice
This commit is contained in:
Garry Tanandcapy-ai[bot] authored and GitHub committed 2026-11-25 01:52:24 +00:00
1 parent e38a1782ae
commit 66b8f84376
9 files changed
+232 -2

No files matched your search

+1 -1
View File
@@ -292,7 +292,7 @@ the same grant, whichever row records it:
| a light pass 1 whose below-floor fixes change no runtime lines | done |
| round 2 that fixed anything, blocking or below the floor | one read-only full review of the final head, with no fix round (R51) |
| round 2 on a light diff whose below-floor fixes change no runtime lines | done: notes in the PR body |
| a fix after that read-only review | stop: the lane's Captain rules it a note, or the fix goes to a new /ship run's read-only full review |
| a fix after that read-only review | stop: the lane's Captain rules it a note (one `gstack-approvals rule --finding edit:<path>` per edited path, which finish then routes as `RULED_EDIT`: [ruled edits](ship-policy.md#ruled-edits)), or the fix goes to a new /ship run's read-only full review |
| a full pass that leaves a blocking finding open (fixed or not) | stop: name it for the owner |
| a fix-check (granted before GST-3562) that found nothing blocking | done |
| a fix-check (granted before GST-3562) that found a blocking finding | stop: name it for the owner |
+41
View File
@@ -1927,6 +1927,47 @@ base to save with the reviewed tree for finish's `--reviewed-base`.
An own edit, a conflict resolution, an edit inside a merge, base context moved
beside the branch's hunks or an uncommitted change reads `STALE` and says which.
<a id="ruled-edits"></a>
**Ruled edits after the final review (GST-3775).** An edit after the read-only
final review stops finish (`behavior, tests or build inputs changed since review`),
and `gstack-review-plan --post-review` then stops for the owner: ship the edit as
a ruled note, or keep it and run /ship again for one more read-only full review.
The owner's "ship it with the note" is a ruling per edited path, with `edit:<path>`
as the finding and the stop head as the head; the stop line prints the edited
paths and the head:
```bash
gstack-approvals rule --finding 'edit:<path>' --head <stop head> --reason '<why it ships as a note>' \
--by '<the owner>' --words '<their exact words>' --owner-ref <thread code>:<message id>
```
The stop line prints one such command per edited path, with each `edit:<path>`
shell-quoted, so a path with quotes, `$`, `;` or backticks pastes as one argument.
finish then routes a changed path as `RULED_EDIT: <path> (ruled at <head12> by <who>,
approval <id>)` instead of stopping, when a ruling `edit:<path>` names HEAD or an
ancestor of it, the path's entry in the tree finish routes (mode and bytes, untracked
files included) equals that head's, and no commit after that head touches the path.
Both trees must hold the path as one file under exactly the spelling finish routes:
a path git cannot read (`git ls-tree` fails) or holds under another spelling (a
filename that is not UTF-8 reaches finish with a replacement character), a path
whose spelling holds a replacement character (U+FFFD) at all, since it may name
another file than the one git changed, and a deleted path never match, so a
ruling cannot clear them. A ruling that does not
clear its path prints `RULED_EDIT_REFUSED: <path> (<why>; …)` and finish stops.
A gate-class path, and a test the gate scan promotes to a behavior change, can be
ruled like any other: the ruling is the owner's call on that exact edit. The stop
line lists only the PR's own edits since the final review, never a path only a
base merge moved, and names deletions apart, because a deletion cannot be ruled.
One ruling never covers another path, and a path edited again after its ruling
stops finish again, even when a later commit restores the ruled bytes. A path with
whitespace cannot be ruled, so an edit there keeps the fix and runs /ship again.
The ruling clears only the review stop: a changed file the documentation audit
hashed still needs the stage 3 recovery finish's stop names. The ruling is an ordinary
ruled note, so it prints as `RULED_NOTE:`, marked `(no RULED_EDIT at this head; not
applied)` when it cleared no path, the receipt records it and the PR body lists its
`Ruled note:` line.
<a id="security-findings-stay-private"></a>
**Security findings stay private (GST-3076).** A PR body keeps every earlier
version in its edit history, and a ruled, dispositioned, deferred or noted