Repository navigation
v1.92.63.0 fix(ship): a slot restamp after the docs audit keeps finish's docs check fresh (GST-906) - #3834
Merged
Conversation
…eck fresh (GST-906) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… main (red-team, ship round 1) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…an unmoved base keeps the direct rule (scoped fix-check) 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 tasks done
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 finish(Step 16 stage 3, the docs check against the Step 14.5 post-audit snapshot) now treats a slot restamp after the audit as a restamp, not a docs change.docsFreshinlib/ship-release.tsreads the audited bytes withgit cat-file blobusing the snapshot's own blob id. A path the snapshot compare reports as changed is carried when it matches one of these:changelogfile, base unmoved. The CHANGELOG at the audit's merge base and at the current one is byte-equal, and the current file normalizes equal to the audited one (normalizeChangeloginlib/changelog-check.ts, the tree receipt's own rule). Only a heading move or re-heading passes.changelogfile after the slot merged main first. The audited copy is merged with main's CHANGELOG by the same call the restamp writer makes (mergeChangelogs(audited, CHANGELOG@current merge base, CHANGELOG@audit merge base), the argument order oflib/restamp.ts:765), and the result must normalize equal to the current file. The audited copy must also survive that merge against its own base unchanged. That way the merge can only add main's sections and never hides a line the audit saw.versionAtRef(cwd, 'HEAD').rel), when both the audited and the current contents parse as a bare version.Anything else still stales the audit: an entry edit, a dropped or edited main section, a dropped audited line, a CHANGELOG git can't read at either merge base, and audited bytes git never held (never committed or staged).
Before and after: finish's DOCS line (fixture runs from the GST-906 tests, captured in this run):
Why
GST-906, reported by GBRA-258 on gbrain #8372 (gstack 1.92.47.0). A PR that lost its merge slot after the Step 14.5 snapshot gets a new slot. Under the crew's slot rule, that slot merges main and then restamps. The CHANGELOG entry is re-headed (
## [Unreleased]or the old version becomes## [<version>] - <date>), main's newly released sections come in, and VERSION moves.finishthen stopped withDOCS: stale (CHANGELOG.md). That left the lost-slot flow with only two ways out. One was a third docs audit, which the policy forbids, and the other was an owner-accepted named risk.Root cause. The issue suggested fixing it in
stampedFiles. ButstampedFilescompares against the reviewed tree, which comes before Step 13, so it never holds the CHANGELOG entry at all, and nostampOnlyLinerule there could see a re-heading. The comparison that matters is against the audited bytes, which is what this PR adds.docs/ship-policy.md'schangelogrow already says the restamp re-heads the CHANGELOG, so carrying it matches the documented policy. The first version of the fix only covered a restamp with no main merge. Review round 1's Red Team showed the lost-slot path merges main first, so the second commit adds the merge case.VERSION widening. The first test run showed that with only the CHANGELOG rule, the lost-slot case still stopped with
DOCS: stale (VERSION), since VERSION moves in the same restamp. The version-file rule is that one-rule widening, and it only accepts a bare version before and after.Proof, failing first.
handoffs/GST-906/failing-first.txtin the GStack Minder drive holds three runs:DOCS: stale (CHANGELOG.md), the line GBRA-258 reported.DOCS: freshon 6340025, the fail-open the outside voice found in round 2.Blast radius
docsFreshinlib/ship-release.ts, Step 16 stage 3 only, about 20 lines. It only adds carried paths, and only for the policy'schangelogfile and the version file. Every other path and every other stage behaves as before.test/ship-rereview-triggers.test.tsgets a new describe, "a CHANGELOG re-heading after the docs audit (GST-906, GBRA-258, gbrain #8372)", with three tests and eleven fixture cases, fresh and stale controls both.git show <merge base>:<changelog>and local files. It adds no network calls, environment reads, permission changes, workflow, setup or install edits, or dependencies.handoffs/GST-906/gbrain-note.md.Approvals
This is a bug fix assigned by GStack Minder (GSTA-36) under GST-906, with failing-first proof and no autoplan (the Captain's ruling for a bug fix). After review round 1, the Captain approved widening the fix to the main-merge restamp ("Go with A"). After round 2, the Captain granted one scoped fix-check under rule 23 ("The Captain picked A ... One scoped fix-check on fixcheck-candidate.diff, with one reviewer reading only the touched hunks").
Documentation
Scope: GST-906's change to docsFresh in lib/ship-release.ts (a slot restamp of the CHANGELOG or VERSION after the Step 14.5 audit, including one that merges the base first, is carried instead of stale). I checked it against docs/ship-policy.md, docs/unattended.md, docs/troubleshooting.md, capy/skill/gstack/*.md and Step 16 stage 3 in ship/SKILL.md.tmpl. Result: current. No doc says what a post-audit restamp does to docs freshness, and the existing changelog-restamp and DOCS_AUDIT_BLOCKED text is still accurate. The changelog.d fragment covers the release note. Debt: none.
Pre-Landing Review
REVIEW_LOOP: passes=2 blocking_found=2 deferred=0 noted=2 fixed=2 scope=frozen fix_checks=1 dispatches=8
Gate edits: none detected (1 listed, 0 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none). No hunk was tagged.
lib/ship-release.tsand the changelog fragment matched no gate pattern, so the scan says nothing about them. The review readers covered them, and the test hunks only add assertions.Review notes
verifyreports every brief and output matched in all three ledgers.failedand findings 0, because the patch it read no longer matches. Its one INFORMATIONAL finding is the first open note below. The queue'sREVIEW_TARGETEDline may readmissing. The product diff is unchanged since the fix-check: 15b3b90 adds only the fragment.Open notes (below the rule 23 floor, not fixed here)
normalizeChangelogreplaces every heading with a placeholder and sorts the sections, so renaming or re-dating a released main heading after the audit still reads fresh. That's the tree receipt's own rule, already used in this PR's first commit. At merge, the train'sownEntryAboveMainstill catches a changed main section.nowBaseis the merge base withorigin/main, so a gate-ahead slot's re-heading still reads stale. That gap predates this PR, and it fails closed.Test plan
ship-rereview-triggers,ship-release,ship-release-docs-exception,gstack-docs-candidate,module-size-ratchet,bun-entry-isolation) with theGSTACK_*launch variables unset: 64 tests, 0 failed at 15b3b90.bun run typecheckclean at 15b3b90.UBI_OWNER=gsta234) on submitted tree a1e12991 (head 15b3b90): 407 tests, 0 failed, $0.03. VM setup rebuilt two committedlib/diagram-render/distbuild files before the run, the same rebuild the CI free lane does. The VM was destroyed (left=0).gstack-ship-release finishat 15b3b90: exit 0,DOCS: fresh against the Step 14.5 post-audit snapshot,PREGATE: verify ok on the stamped tree.lib/ship-release.tsandtest/ship-rereview-triggers.test.tsauto-merged, andship-rereview-triggersplusship-releaseon the merge ran 32 tests with 0 failed. The trial merge with origin/main e259975 was also clean.Disclosures
gstack is Garry Tan's own project.