Repository navigation
v1.92.55.0 fix(ship): finish routes a restamped stale stamp as metadata after a lost slot (GST-895) - #3827
Merged
Conversation
…line as a stamp after a lost slot (GST-895) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…p's rule, and its moved version must be newer than the fork point (GST-895 review) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
6 of 7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
gstack-ship-release finishnow routes a branch's own restamped stale stamp as release metadata after a lost slot, instead of stopping for a full re-review. The change is instampedFiles(lib/ship-bin-common.ts). A removed line still counts as a stamp when every version it moves is at or above the reviewed tree's VERSION, as before. When that check fails, the line gets a second chance only if the branch added it itself, judged bygstack-restamp's own rule (branchAddedLines: added since the merge base oforigin/<base>and HEAD, and not added byorigin/<base>since). On such a line, a moved version must be strictly newer than the version at the branch's fork point (forkVersion), the same bound the restamp'sstamp_pathsstage uses. Onlystamp_filespaths count, andstampOnlyLine's byte-for-byte rewrite rule still applies, so nothing else on the line may differ.releasePathsandstampedFilestakebase, andfinishpasses its--baseat all three call sites.Before and after: finish on the lost-slot fixture (
test/ship-rereview-triggers.test.ts, "a restamp after a lost slot"). The branch stamps 1.0.1.0 and adds asince: '1.0.1.0'row; main moves to 1.0.2.0 with another PR's row at 1.0.1.0; the branch merges main and is reviewed at VERSION 1.0.2.0; the restamp to 1.0.3.0 moves the branch's row.The same fixture still stops when the restamp also moves main's own 1.0.1.0 row, when main later edits the text of a row the branch merged and that row is moved, when the branch's row sits at the fork version (1.0.0.0), and when it predates the fork (0.9.5.0).
Why
GST-895, from GBRA-218 (gbrain #8134 on gstack 1.92.46.0). After a lost slot,
gstack-restamp --nextcorrectly moved the branch's ownsince: '0.60.538.0'rows to 0.60.543.0. But finish floored every moved version at the reviewed tree's VERSION, which was 0.60.542.0 from master after the merge, so it read the rows as a behavior change and stopped with "insert 5–11.5 → 12–14 → 16". Every lost-slot branch that follows "Restamp after a lost slot" hits this.Proof, failing first. With
lib/at main 35a676f, the new test fails withbehavior=1(captured in the GStack Minder drive,handoffs/GST-895/failing-first.txt). Mutation checks: removing the ownership check, or the strict fork bound, each fails the test (at the moved-base-row case and the fork-version case), and swapping ownership back to "the line's text is missing fromorigin/<base>" fails the edited-base-row case.Design notes. The Captain suggested reusing restamp's journal or a form-only rule. The journal (
.gstack/tmp/restamp-journal.json) records written files and their hashes, not which lines moved, so it can't tell a restamped line from a hand edit. A form-only rule would let a hand-moved base release row through, which is exactly the control case. Ownership by restamp's own rule keeps finish and the writer in agreement. The first cut decided ownership by whetherorigin/<base>still carried the line's exact text; review showed that a base edit after the merge, or a stale tracking ref, broke that, so it now usesbranchAddedLinesfrom the merge base.Blast radius
stampedFilesandreleasePathsinlib/ship-bin-common.ts, and their three call sites infinish(lib/ship-release.ts). They have no other callers. The relaxed floor applies only after the old check fails and only tostamp_filespaths, so a repo withoutstamp_files(gstack included) sees no change.git merge-baseper finish call and twogit diffruns per stamp file that reaches the fallback, cached per file.Known limits
origin/<base>and HEAD. If HEAD merges a newer base after review and that merge deletes a row the reviewed tree still carries, a later hand edit that brings the row back with only its version moved could route as metadata (round 2 targeted reader, INFORMATIONAL, confidence 4). Restamp never writes that edit. This is unreproduced and accepted as an open note at the 2-round review cap.tentativeMentions: on a branch-owned line, any version newer than the fork may move, including a base release published after the fork that the line cites in a stamp form. Restamp moves those too;docs/ship-policy.md'sstamp_pathsstage describes the same limit.Approvals
None needed. This is a bug fix assigned by GStack Minder (GSTA-36) under GST-895, with failing-first proof and no autoplan (the Captain's ruling for a bug fix).
Pre-Landing Review
REVIEW_LOOP: passes=2 blocking_found=3 deferred=0 noted=2 fixed=3 scope=frozen dispatches=8
Gate edits: 2 listed, 1 read. The one read hunk (RH-16) is the
stampedFilesfloor itself. The targeted gate reader read it at 3ab917a (one CRITICAL, fixed in c892cf1) and at c892cf1 (one INFORMATIONAL, under Known limits).Review notes
origin/<base>'s current text rather than restamp's merge-base rule. Each has a new test row and a mutation check. A third finding labeled CRITICAL (one uncachedgit showper changed line, a cost issue the reader itself rated Low) went away with the same rewrite.Documentation
Status: current. No doc edits were needed for GST-895.
Scope: the diff 35a676f...HEAD (lib/ship-bin-common.ts, lib/ship-release.ts, the test and the changelog fragment) against AGENTS.md, CLAUDE.md, CONTRIBUTING.md, README.md, capy/ and docs/. Files read: docs/ship-policy.md, docs/troubleshooting.md, docs/pregate.md, docs/captain.md, capy/skill/gstack/SKILL.md, ship/SKILL.md.tmpl, changelog.d/gst-895-stale-stamp.md.
Result: docs/ship-policy.md's
stamp_pathsstage (~1487) and slot-stamp text (~860) already describe the fork-point ownership rule finish now reuses; the ~1363 paragraph covers the receipt carry's tree-receipt rule, which this change does not touch. Finish's old floor at the reviewed VERSION was never documented, so nothing goes stale.Debt: none new.
Test plan
ship-rereview-triggers,ship-release,stamp-templates,restamp-*,tree-receipt-*,ship-receipt-*,module-size-ratchet) with theGSTACK_*launch variables unset and Capy's git guard off PATH: 119 tests, 0 failed at tree 26a7051e.bun run typecheckandbun run typecheck:test(814 known diagnostics, none new).UBI_OWNER=gsta234) at tree 0ca1768d: 405 tests, 0 failed, $0.03; the VM was destroyed.Trail note (accepted by GStack Minder): row 7 of the decision trail binds the Step 11 adversarial result STALE because the row was logged after the fix commit. The review read the fixed tree, finish doesn't check that binding, and R51's two-round cap ruled out a rerun.