Skip to content

v1.93.7.0 fix(restamp): a branch-added stamp at the fork version moves, and every stamp check accepts it (GST-963) - #3862

Merged
capy-ai[bot] merged 6 commits into
mainfrom
gst-963-fork-version-stamp
Nov 2, 2026
Merged

capy-ai[bot] merged 6 commits into
mainfrom
gst-963-fork-version-stamp

Conversation

@garrytan

@garrytan garrytan commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner
{
  "schema_version": 1,
  "pr": 3862,
  "head": "97595f41eec3e5596e483337da424176e8b72d05",
  "version": "1.92.71.0",
  "base": "main",
  "gate": {
    "touched": {
      "pass": 80,
      "fail": 0,
      "skip": 0
    }
  },
  "session_kind": "unattended",
  "head_tree": "46e16da0d34cfaa66ae4f37d3a654ec969b924fc",
  "product_patch_id": "d32610ccb6c953de3a3b08680eb5f90ad536942d",
  "gstack_version": "1.92.66.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 194,
    "rules": "551486253e156572",
    "base": "f865cd9fc7c89f6ac64e6dcbe219a07a0ba026ad",
    "registry": "f865cd9fc7c89f6ac64e6dcbe219a07a0ba026ad",
    "gate_scan": {
      "tagged": 1,
      "head": "97595f41eec3e5596e483337da424176e8b72d05"
    },
    "reasons": [
      "gate-class",
      "risk:security",
      "runtime=194"
    ],
    "risk": [
      "security"
    ]
  },
  "pregate": "requires-remote cleared @46e16da0d34c (1 checks, current for 97595f41eec3)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/41439899142",
    "pregate.json/remote_gate: remote-gate tree=46e16da0d34c tests=5646"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "docs/, README.md, AGENTS.md, CLAUDE.md, CONTRIBUTING.md (read-only re-audit gst963-docs-4)"
  },
  "review_loop": {
    "passes": 1,
    "blocking_found": 2,
    "deferred": 0,
    "noted": 7,
    "fixed": 2,
    "scope": "frozen",
    "fix_checks": 3,
    "rounds": 1,
    "dispatches": {
      "specialist": 1,
      "red-team": 1,
      "targeted": 1,
      "outside-voice": 1
    }
  },
  "review_targeted": {
    "classes": [
      "gate"
    ],
    "rules": "c82addff6fb60fa0",
    "brief_sha": "7f92a0d0a8319c3c0e076fb3b1a4689c45120b2be2c14dfc7d4cb03aafa9d6a5",
    "product_patch_id": "d32610ccb6c953de3a3b08680eb5f90ad536942d",
    "status": "done",
    "findings": 2,
    "raised_by": "targeted"
  }
}

What changed

A version stamp row that a branch adds at its fork point's version is now treated as that branch's stale stamp once main moves past it. gstack-restamp --next rewrites it to the new version, and every check that reads a stamp commit accepts that move on the branch's own line: gstack-ship-release finish, the tree receipt behind gstack-ship-queue stamp/verify, and the merge train's stamp and verify checks. They share one stamp bound, stampOnlyLine(..., side) and branchSides() in the new lib/stamp-only.ts. A row the base carries at that version, and a row below the fork version, are still left alone and still refused, unless the base row's text duplicates a line the branch added (GST-979). The /ship receipt carry can still refuse the move, and a kept VERSION claim still routes it as behavior in carry and finish (GST-980).

Before → after on the gbrain #8425 shape (fork 1.2.3.0, branch adds since: '1.2.3.0', main moves to 1.2.4.0):

  • restamp stamp_paths stage: skipped ("no tentative mention") → done, row moves to the new version
  • finish ROUTE: behavior=1 metadata=1 → behavior=0 metadata=2
  • tree receipt on that stamp commit: TREE: changed (with only the writer fixed) → same-modulo-stamps
  • merge train with a pin claiming 1.2.4.0 and a row left at 1.2.3.0: stamped but the row stayed at 1.2.3.0 (main) → the row moves to 1.2.4.0 and stampChain accepts it

Why

On gbrain #8425 (GBRA-277, GST-963), a branch added a stamp_patterns row naming its fork point's version. After main moved, the restamp skipped the row, so the merged stamp kept the old version. Then finish counted the line as a behavior change and the docs stage flagged a product edit. Fixing only the writer would have been worse. Round-1 review showed the tree receipt and carry still floored every line at the gated VERSION. The stamp commit would read TREE: changed, and the train would refuse the PR with QUEUE_STAMP_NOT_STAMP_ONLY. So the writer and all four checks now use one bound.

Blast radius

This touches release and merge tooling, namely the restamp writer, the finish route, the tree receipt, the train stamp and verify checks, and the receipt carry. It does not touch product skills. The bound only widens on a line the branch itself added (by position for the writer, by text for the checks) and only for versions at or above the fork version, so a base row moved the same way is still refused, unless its text duplicates a branch-added line (GST-979). That was walked in the tests below and in a fixture repro by the reviewers. The Ubicloud remote pregate ran the selected free tier on the frozen tree: 5646 tests, 0 failed.

Scope note. Only the fork version itself is added. Versions below the fork point stay untouched on purpose, because a branch can legitimately add a doc line naming an older release, and the Captain ruled that stays out of scope.

Security read. No network calls, environment reads, secrets, permission changes, workflow, setup, install or dependency changes. Pure version-string comparison over git diffs the tools already read.

Approvals

No approvals recorded for branch gst-963-fork-version-stamp. The two extra fix rounds after round-1 and round-2 review (be94808, 0ead1ce) were granted by GStack Minder under crew rule 23, as relayed by the GSTA-234 lane.

Failing-first proof

  1. Writer and finish route (test/restamp-mentions.test.ts, test/ship-rereview-triggers.test.ts on origin/main code): the stage reported skipped instead of done for both the since: template and the built-in quoted form, and ROUTE counted behavior=1 docs=0 metadata=1.
  2. Tree receipt (test/restamp-mentions.test.ts before be94808): with only the writer fixed, gstack-tree-receipt printed TREE: changed for the GST-963 stamp commit; both GST-963 cases failed. The GST-895 lost-slot stamp passed the receipt in that run and still does.
  3. Merge train (test/ship-queue-train-stamp.test.ts): before 0ead1ce, QUEUE_TRAIN_STAMP_MISMATCH: S1 (#1): the stamp changed more than stamps: docs/f.md. On main 69c14b1 the train stamped, but the row stayed at // since: 1.2.3.0 instead of // since: 1.2.4.0.

GST-895 note. The GST-895 lost-slot case is still covered. Its stale stamp (newer than the fork, older than the gated VERSION) now passes the tree receipt through the same side-aware bound (the lost-slot stamp passes the tree receipt), and its finish route stays metadata.

Test Coverage

Each changed runtime file has a changed test naming it (preflight audit: deterministic coverage).
Tests ran: touched 80 (gstack-ship-release finish lane at 97595f4: restamp-mentions, ship-rereview-triggers, gstack-ship-receipt-docs, restamp-base-merge, tree-receipt-stamp-sensitive, ship-queue-train-stamp, ship-queue-train-verify; 80 pass, 0 fail)
Remote pregate (Ubicloud, owner gsta234) at 97595f4, tree 46e16da0d34c: 5646 tests, 0 failed, $0.05. Earlier runs at 0ead1ce (tree 3e87d526d728) and 5cec99e (tree 6d779508b752) were also 5646/0.

Pre-Landing Review

REVIEW_LOOP: passes=1 blocking_found=2 deferred=0 noted=7 fixed=2 scope=frozen fix_checks=3

From the tool (gstack-review-scope summary): passes=1, deferred=0, scope=frozen, rounds=1, and the specialist and red-team dispatches. Hand-written because the tool undercounts: blocking_found=2 and fixed=2 (the tool reads 0 because the pass-1 row holds the round-1 findings unclassified, and the two fix-checks have no review-log rows), noted=7 (the open notes below; the tool reads 0), fix_checks=3, and the targeted and outside-voice dispatches (the tool does not count them). The outside voice marked its three findings as blocking; GStack Minder ruled them below the rule 23 floor and they ship as open notes, so blocking_found stays 2.

Round 1 (full panel, gate class): specialist (batched) and red-team ran. Red-team CRITICAL, fixed in be94808: the tree receipt and carry did not accept the writer's new move. The voices did not run because the lane stopped at its budget for the Captain's call.
Round 2 (scoped fix-check on be94808): CRITICAL, fixed in 0ead1ce: the train stamp and verify checks passed no baseRef.
Round 3 (scoped fix-check on 0ead1ce, the Captain's last grant): no blocking finding.
Round 4 (scoped review of the one-sentence docs/ship-policy.md hunk in 97595f4, GStack Minder's last grant, after finish routed that gate doc as behavior): NO FINDINGS.
Targeted gate reader (classes=gate, the required check, run once at pin 0ead1ce on the whole frozen diff, no edits after): 2 informational findings, judged at their severity, VERIFY: clean.

Gate edits: UNAVAILABLE — the gate-edit judgment step (Phase 4) did not run under the R51 round cap; the gate-class hunks were read by the red-team and both fix-checks instead.
Outside review: GPT-6.1 Sol (cross-family outside voice, one read-only pass at 0ead1ce on the whole diff) recommended "Request changes" with three findings. GStack Minder chose to ship them as open notes (GST-979, GST-980); see below.

Review notes

Open notes (informational, below the rule 23 floor, not fixed here):

  • lib/restamp.ts (fork-version add): the fork version is added even when the base has not moved past it. A stamped branch whose base is still at its fork version X, and that adds a stamp-form line naming X, now has that line moved by --next.
  • lib/pregate/remote-receipt.ts:106: substituteStampOnlyTree still classifies without a side, so a lane stamp that moves the fork version forces a second remote gate on gate-ahead repos. It fails closed and only costs time. Filed as GST-973.
  • lib/stamp-only.ts:31: side.added holds line text, not positions. A hand edit of a base row whose text equals a branch-added row reads as a stamp (fails open). This is a narrow edge, and stampedFiles already behaved this way under GST-895. The targeted reader raised the same point for the tree receipt and train checks.
  • Outside voice docs: add README and CLAUDE.md #1 (lib/stamp-only.ts:30,51, rated High by the voice): the same text-not-position gap. A branch that adds a duplicate since: 1.2.3.0 line lets a hand edit of the base copy pass buildReceipt as same-modulo-stamps (reproduced with the copies at lines 10 and 2). Tracked in GST-979.
  • Outside voice refactor: reorganize codebase into modular structure #2 (bin/gstack-ship-receipt:511-517): the carry still counts the branch-added row as product, so a valid fork-version stamp after the reviewed VERSION moved gets RECEIPT_CARRY_PRODUCT_CHANGED. It fails closed, and a fresh /ship is the way through. Tracked in GST-980.
  • Outside voice Project-local .claude/skills/gstack install breaks /browse and setup can report false success #3 (lib/ship-receipt.ts:205, lib/ship-bin-common.ts:123): when old VERSION equals new VERSION, stampOnlyText and stampedFiles still refuse the move the writer and tree receipt now accept, so carry rejects it and finish routes it as behavior. It fails closed. Tracked in GST-980.
  • lib/ship-queue-train-verify.ts:82: plain-train mergedIn at slot 2 and later bounds at T_i's VERSION, not the lane's own fork. A pin row the lane's own restamp moved can still read as "differs from T2". This is not a regression: the fix only widens the old floor.
  • lib/tree-receipt.ts:132 (targeted reader): the new || own sends a file whose VERSION did not move (oldV === newV) into stampOnlyHunks, and stampOnlyLine's oldV-floor branch still runs on every line. So a base line that moves a newer stamp-form version down to newV (for example since: '1.3.0.0' to '1.2.4.0') reads as same-modulo-stamps. Before this diff, oldV === newV always read as changed. The restamp writer never makes that edit, so it takes a hand-made stamp commit. Suggested follow-up: when oldV === newV, accept a line only through the branch-side bound.

Issues

ISSUE_LINKS: none. Follow-ups: GST-973 (remote-receipt side), GST-979 (line positions, not text), GST-980 (carry and kept-claim routing).

TODOS

No TODO items completed in this PR.

Documentation

Status: current. Read-only audit of gst-963-fork-version-stamp at 97595f4 (base 69c14b1); no doc corrections needed. The gst963-docs-3 blocker (docs/ship-policy.md Step 4 stamp_paths contradicting the fragment) is resolved by 97595f4.

Scope: 18 committed files in the candidate, with no staged, unstaged or untracked changes. The worktree matched the candidate (head and all 152 hashes). The 135 discovered docs were inventoried; the changed contracts were verified against lib/stamp-only.ts, lib/ship-bin-common.ts and lib/ship-receipt.ts.

Documentation health:

  • changelog.d/gst-963-fork-version-stamp.md: current; matches the code and docs/ship-policy.md, including GST-979 and GST-980.
  • docs/ship-policy.md: current; Step 4 states the shared stamp bound, the GST-979 duplicate-text exception and the GST-980 carry/finish gaps.
  • docs/captain.md: current; no contradiction.
  • docs/troubleshooting.md: current; RECEIPT_CARRY_PRODUCT_CHANGED anchor is consistent.
  • Other docs: no contradiction found.

Coverage debt: No new public surface (CLI flag, command or env var); the change alters stamp semantics only. Reference coverage is in docs/ship-policy.md; no tutorial or how-to exists for the fork-version stamp, which is common-gap debt, not a blocker. No ASCII or Mermaid diagram drift found. The GST-980 gaps (carry refusal, VERSION-claim routing) stay documented debt.

The final audit (gst963-docs-4, read-only) was the fourth launch, which is past the Step 14.5 budget of one audit plus one re-audit. Attempt 1 was refused at the install check (the verdict covered another checkout) and audited nothing, but the helper counted it. Attempt 2 was current. Attempt 3 blocked on docs/ship-policy.md Step 4 still claiming the carry accepts the move, which 97595f4 corrected under GStack Minder's grant.

Test plan

  • gstack-ship-release finish lane touched at 97595f4 (7 files, git.real first on PATH to sidestep the local Capy git-shim log): 80 pass, 0 fail
  • UBI_OWNER=gsta234 gstack-pregate --stage tests --remote --spend-cap 2 --timeout 2700 --allow-repo-commands at 97595f4: 5646 tests, 0 failed on tree 46e16da0d34c
  • bun run typecheck: 0 errors

garrytan and others added 3 commits November 2, 2026 10:03
…(GST-963)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…d finish (GST-963)

A stamp row the branch added at its fork version now passes every stamp check, not only the restamp writer: stampOnlyLine takes the branch side (its own lines and fork version), and stampedFiles, the tree receipt and the receipt carry all pass it. The stamp-only checks move to lib/stamp-only.ts to keep lib/restamp.ts under the module-size ratchet.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…or as the base (GST-963)

The train restamp moves a branch-added row left at the predecessor version, so stampMismatch and the three train-verify receipts pass baseRef (the gated commit first parent), and the tree receipt applies the branch side even when the slot keeps its claimed VERSION. Failing-first: test/ship-queue-train-stamp.test.ts refused with QUEUE_TRAIN_STAMP_MISMATCH before this commit; on main the pin stamps but the row stays stale.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@trunk-io

trunk-io Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 3 commits November 2, 2026 11:37
…gaps (GST-979, GST-980)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…s (GST-979, GST-980)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@github-actions github-actions Bot changed the title fix(restamp): a branch-added stamp at the fork version moves, and every stamp check accepts it (GST-963) v1.93.7.0 fix(restamp): a branch-added stamp at the fork version moves, and every stamp check accepts it (GST-963) Nov 2, 2026
@capy-ai
capy-ai Bot merged commit fc292e2 into main Nov 2, 2026
46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant