Skip to content

v1.94.16.0 fix(stamp): declared placeholder restamps are stamps; carry records HEAD's version (GST-1026, GST-1030) - #3892

Merged
capy-ai[bot] merged 19 commits into
mainfrom
gst-1026-1030-stamp-placeholders
Nov 3, 2026
Merged

capy-ai[bot] merged 19 commits into
mainfrom
gst-1026-1030-stamp-placeholders

Conversation

@garrytan

@garrytan garrytan commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner
{
  "schema_version": 1,
  "pr": 3892,
  "head": "13601c0440f391744b70e651c7acc284f86978cf",
  "version": "1.94.10.0",
  "base": "main",
  "session_kind": "unattended",
  "run": "jam_01M6EV3JGX0S2X6J81A9PA7MNN",
  "head_tree": "f3b93f3886e2660488dc0ee5dff9b491a02faa74",
  "product_patch_id": "babeec1c0fda66dddf1f71327fd6970734531e84",
  "gstack_version": "1.94.4.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 140,
    "rules": "18dcd562316f56ed",
    "base": "f6d6215f4e3aa155e3843d56123c9f262f523b5e",
    "registry": "f6d6215f4e3aa155e3843d56123c9f262f523b5e",
    "gate_scan": {
      "tagged": 0,
      "head": "13601c0440f391744b70e651c7acc284f86978cf"
    },
    "reasons": [
      "gate-class",
      "runtime=140"
    ],
    "risk": []
  },
  "pregate": "requires-remote cleared @f3b93f3886e2 (7 checks, current for 13601c0440f3)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/41609300552/attempts/1",
    "windows-smoke.yml/windows-smoke: https://github.com/garrytan/gstack/actions/runs/41609300594/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=f3b93f3886e2 tests=34703 skipped=76 runs=41609300552/1 profiles=ci-reuse/free-tests heads=13601c0440f3 verified=2026-11-03T09:20:28.372Z"
  ],
  "docs": {
    "status": "current",
    "scope": "16 selected files on gst-1026-1030-stamp-placeholders (base 40a3170, head 666efd3): committed docs, changelog fragments and the lib/bin/test changes that drive them"
  },
  "review_loop": {
    "passes": 2,
    "blocking_found": 3,
    "deferred": 0,
    "noted": 2,
    "fixed": 0,
    "scope": "frozen"
  }
}

What changed

  • New policy key stamp_placeholders (default []). A repo can declare literals such as ["TBD"]. On a line the branch added itself, a placeholder inside a stamp_patterns template (gbrain's since: 'TBD') may become the new version, and finish's route, the receipt carry and the tree receipt read that as a stamp. They share one predicate, stampOnlyLine in lib/stamp-only.ts (GST-1026, gbrain #8444).
  • The receipt carry now records HEAD's version, read the way write reads it, instead of copying the old receipt's version after a main merge and a restamp (GST-1030 point 1).

Was stacked on #3889 (GST-979/980), which landed as b42ad1e (v1.93.42.0). One rule 19 main merge (1039996) took main's landed text for every #3889 hunk, so this diff against main is now only GST-1026, GST-1030 and GBEV-3.

Why

gbrain's finish refused a receipt whose only change since review was its own restamp of a BEHAVIOR_CHANGES row from since: 'TBD' to since: '<version>'. The carry and the tree receipt would have refused the same row. GGST-1 reported that carried receipts showed a stale version.

Reproduction (failing tests first)

  • GST-1026: 9 new tests failed before the predicate change, covering the shared predicate, the carry classifier, finish's route, the tree receipt and the carry. They pass after it. Negative controls stay refused: an undeclared placeholder, a base row, a base row whose text duplicates a branch row, a built-in form, and a line no template matches.
  • GST-1030 point 1 reproduces on main 4b43d4f: after a main merge and a restamp, the carried receipt kept 1.2.4.0 when HEAD was 1.2.5.0. This PR fixes it.
  • GST-1030 point 2, EVIDENCE.md counted as product, reproduces on main (a version-only restamp of an EVIDENCE.md declared in stamp_files got RECEIPT_CARRY_PRODUCT_CHANGED) but not on the v1.93.42.0 fix(stamp): name branch lines by position; carry and finish accept a kept VERSION claim (GST-979, GST-980) #3889 base: GST-980's own-row carry already accepts it. This PR adds the test as proof and changes no code for it. An undeclared EVIDENCE.md stays product (tested).
  • GST-1030 third case (GBEV-3, gbrain-evals docs: v0.9.8.0 — deploy pipeline docs + pre-merge readiness gate #306) reproduces on this branch: after a main merge and a restamp, a pin-bump PR's carry refused with RECEIPT_CARRY_PRODUCT_CHANGED although package.json had moved only in its version field. Fixed in 5923767: the carry compares that package.json at all four sides with only version masked. The negative control (the pin moved since review) still refuses.

Blast radius

Nothing changes for a repo that leaves stamp_placeholders unset, including gstack itself. The carry's version change touches every carried receipt. No queue or ready code compares receipt.version, and a receipt with no version stays versionless.

Security read

No network calls, environment reads, permission changes, workflow, setup or install edits, and no new dependencies.

Open in Capy

Pre-Landing Review

Pre-Landing Review: 5 issues: 3 auto-fixed, 0 asked, 0 deferred, 2 noted.

  • Round 1 ran the full panel: the batched specialist (testing, security, state-machines), red-team, a hand-rendered --classes gate targeted reader, the native adversarial reader and the gpt-6.1-sol outside voice. The first three found nothing. The adversarial reader and the outside voice found three CRITICAL-labelled issues, fixed in one batch in 1b02200, each with a test that fails without the fix:
    • the carry refused a receipt written with --version when HEAD has no version source; it now keeps that version;
    • a branch line that needs both a placeholder fill and a stamp-form version move was refused; the two now compose;
    • a bare {version} template let a placeholder anywhere on a branch line move, and a blank placeholder validated; both are refused now.
  • Round 2 was a range pass (specialist, red-team, targeted). It found two below-floor notes, listed below.
  • GBEV-3 fold-in (GStack Minder's grant for GST-1030): one scoped fix-check reader read the new hunks and the fix list. It found two INFORMATIONAL notes and nothing at the floor.

Gate edits: none detected (8 listed, 2 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)

Review notes (open, below the blocking floor)

  • bin/gstack-ship-receipt carry: in a repo whose HEAD has no VERSION, no package.json version, no stamp files and no CHANGELOG, receiptVersion returns none, which replaces a version write --version recorded. The new test covers the CHANGELOG-only case.
  • scripts/train-gate.ts stampFreeText does not collapse a declared placeholder. So on a train whose slot is stamped after the gate, a placeholder the slot's restamp_command fills gives main a different stamp-free digest, and the backstop dispatches its own gate on main. Exact-tree trains are not affected, and gstack declares no placeholders.
  • lib/pregate/remote-receipt.ts classifies without a branch side, so a remote pregate receipt does not accept a placeholder restamp. That costs a rerun, not a bypass.
  • bin/gstack-ship-receipt carry, pin-bump mask (fix-check): a failed git show, or JSON that is not an object, masks to {} instead of refusing. If the read fails on both sides of a pair, package.json is left out of the rest comparison.
  • Same hunk (fix-check): a masked package.json is recorded in the receipt as "a stamp on the branch's own rows", a claim the masked path did not check. The decision is unaffected.

Documentation

Scope: I audited 16 selected files on gst-1026-1030-stamp-placeholders (base 40a3170, head 666efd3), with nothing staged, unstaged or untracked. That covers committed docs, changelog fragments and the lib/bin/test changes that drive the docs. I searched the other docs for stamp_patterns and stamp_placeholders mentions.

Result: The docs already match the code. docs/ship-policy.md has a new stamp_placeholders policy-key row (default, limits, behavior, min_gstack_version note). It also has a new receipt-carry row and an updated restamp stage 4 paragraph on position-based branch lines and the kept-VERSION rule. docs/troubleshooting.md lists the new carry case. Both changelog fragments describe the changes accurately. No edits were made.

Debt: None found. The since: 'TBD' behavior is documented only in the policy-key row, not in the stage 4 prose. That is acceptable, and I'm not treating it as debt.

Tests and pregate

  • Local finish lane: 127 tests across the 8 touched or adjacent files, 0 failed.
  • Remote pregate (--stage tests --remote, us-east-a2) at tree f47b1f7, first run: 10,712 tests with 5 failed, all in files this PR does not touch. They are flaky: rule 16 allows one rerun at the same tree, and all 5 passed:
    • autoplan-compaction-preserved-segment: hook budget
    • autoplan-run-api: timed-out reservation
    • pregate-supervise: stall kill
    • docsync fault callbacks: the fault controls and the legacy controls
  • CI's free-suite also passes them at 666efd3.
  • After the GBEV-3 fix, remote pregate at tree 303d261 (head 5923767): 10,714 tests, 2 failed, both docsync fault-interface wrappers timing out. Rerun once at the same tree: the fault controls passed (flaky, rule 16). The legacy controls wrapper failed again; its only failing children were rejects legacy-third (5009 ms) and rejects mutate-index (5058 ms). rejects legacy-third also fails on main 9cc40e0 (5005 ms). This PR touches no docsync file.
  • A fresh remote run at tree 303d261 (GStack Minder's ruling) failed again on docsync timing. v1.93.34.0 test: docsync fault replays and the runShadow deadline test fit loaded remote VMs (GST-1103) #3896's fix (54606c5) then came in through one rule 19 main merge (35f3150; the single lib/ship-policy.ts conflict was resolved by keeping both keys, and the scoped carry reviewer called it clean). The merged lib/ship-policy.ts was 821 lines, over the 800-line ratchet, so 20a525a moves the stamp key validation into lib/ship-policy-stamps.ts with no behavior change (one scoped fix-check: no findings).
  • Pregate at tree 6c2a22e (head 20a525a), cleared from CI instead of a VM, per GStack Minder's ruling: the dispatched Free Tests run 41567539730 cleared remote_gate (34,477 tests, 76 skipped), 41566476201 cleared macOS and 41566476211 cleared windows-smoke. PREGATE_VERIFY: ok. The VM-only reds from the merged-tree run (red-team, seed-submission, session-runner, docsync) are not in this PR's files; GStack Minder is recording them in the flaky ledger.
  • At 20a525a: typecheck passes, the 6 focused files ran 111 pass, 0 fail, and all CI checks pass.
  • Main merge after v1.93.42.0 fix(stamp): name branch lines by position; carry and finish accept a kept VERSION claim (GST-979, GST-980) #3889 landed (GStack Minder rule 19 grant): merge 1039996 of main b42ad1e. The 8 product paths the carry flagged are byte-identical to 20a525a except main's own docs/troubleshooting.md text, and this PR's own diff against main has the same patch-ids as before the merge. The carry refused (RECEIPT_CARRY_PRODUCT_CHANGED, because the base now holds v1.93.42.0 fix(stamp): name branch lines by position; carry and finish accept a kept VERSION claim (GST-979, GST-980) #3889), so one scoped fix-check (Opus) read the resolution: VERDICT: clean. Pregate at tree 8860c42 (head 1039996) cleared from CI: the dispatched Free Tests run 41573389861 cleared remote_gate (34,541 tests, 76 skipped), 41573340949 cleared macOS and 41573340993 cleared windows-smoke; PREGATE_VERIFY: ok.
  • Key version fix (train 99 red, GStack Minder rule 19 grant): train 99's Free Tests run 41579677233 failed test/gstack-ship-policy.test.ts "a released key names the heading whose entry introduces it": stamp_placeholders named 1.94.0.0, which shipped as v1.94.0.0 ship: CI is the one full test run (CI carry, tree cache, /ship beside CI) #3901 without the key. Reproduced in-tree after one main merge (082543f of 5f705f3): 19 pass, 1 fail. Fix ef8ed53 moves STAMP_PLACEHOLDERS_KEY_VERSION to the next minor, 1.95.0.0; the slot stamp moves it through stamp_paths. Then 70 pass, 0 fail across gstack-ship-policy, module-size-ratchet, tree-receipt-stamp-sensitive and restamp-mentions; typecheck clean. One scoped fix-check (Opus): VERDICT: clean. Pregate at tree 82f90d7 (head ef8ed53) by CI carry: Free Tests 41581032557 (34,603 tests) cleared remote_gate, the same run cleared macOS and 41581032561 cleared windows-smoke; PREGATE_VERIFY: ok.
  • Windows exec-bit test and unstamp (left train 100, GStack Minder ruling): windows-scoped-tests run 41605458416 failed the GST-980 case "the carry refuses a mode change on a stamp file" because Windows git ignores the exec bit (core.fileMode=false). d00794b sets the bit through the index (git update-index --chmod=+x), so the case keeps its coverage on Windows: the windows-scoped-tests dispatch 41607849069 ran test/restamp-mentions.test.ts (31 tests, 0 failed), and it passes on Linux. One scoped fix-check (Opus): VERDICT: clean. 13601c0 then returns VERSION, package.json, CHANGELOG and the digest to main f6d6215's values, restores the changelog fragment, and puts the tentative key version back at 1.95.0.0, because the Version Gate refuses a stamped head that isn't a stamp commit. This PR's own diff against main is the reviewed one plus that test hunk. Pregate at tree f3b93f3 (head 13601c0) by CI carry: Free Tests 41609300552 (34,703 tests), macOS from the same run, windows-smoke 41609300594; PREGATE_VERIFY: ok.
  • Local carry and restamp suites at 5923767: 59 tests across 7 files, 0 failed. Typecheck passes. All CI checks pass at 5923767.

Approvals

None needed beyond the crew's standing rules (rule 5 spend, rule 22 /ship before READY).

garrytan and others added 9 commits November 2, 2026 17:29
…kept VERSION claim (GST-979, GST-980)

BranchSide carries the positions of the branch-added lines and stampOnlyLine takes the removed line position, so a base line whose text duplicates a branch line keeps the old-version floor. At equal versions only the branch own lines may move. stampOnlyText and stampedFiles accept a kept claim for those lines, and the carry leaves a stamp file out of the product comparison when its only change since the reviewed head is a stamp on the branch own rows and the base did not touch it. Failing-first: all five new tests fail on main fc292e2.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…e by line at the branch's positions, and keeps its mode)

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>
…-980)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ence already states the carry rule

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…980 sentence already states the carry rule"

This reverts commit f926ccb.
…is a stamp; the carry names HEAD's version (GST-1026, GST-1030)

stamp_placeholders (default []) lets a repo declare literals such as TBD that its
restamp replaces with the new version inside a stamp_patterns template. stampOnlyLine
accepts that move only on a branch line named by position; finish's stampedFiles,
the receipt carry and the tree receipt share it. The carried receipt's version is
HEAD's, read the way write reads it.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…s version without a version source; a placeholder fill composes with a stamp move; a bare {version} template and a blank placeholder take no placeholder)

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>
@trunk-io

trunk-io Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

…p PR (GST-1030, GBEV-3)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
garrytan and others added 6 commits November 3, 2026 01:52
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

# Conflicts:
#	lib/ship-policy.ts
…stamps.ts for the module-size ratchet

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

Rule 19 grant (GStack Minder). #3889's hunks take main's landed version; this PR's own diff is unchanged (same patch-ids against main as against #3889+54606c52).
1.94.0.0 shipped as #3901 without the key, so the released-key test reds once main's CHANGELOG is in the tree. The slot stamp moves the tentative value through stamp_paths.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@github-actions github-actions Bot changed the title fix(stamp): declared placeholder restamps are stamps; carry records HEAD's version (GST-1026, GST-1030) v1.94.11.0 fix(stamp): declared placeholder restamps are stamps; carry records HEAD's version (GST-1026, GST-1030) Nov 3, 2026
garrytan and others added 2 commits November 3, 2026 09:02
…ex so the mode-change carry case holds on Windows

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
f6d6215's values and restore the changelog fragment after #3892 left train 100

The tentative STAMP_PLACEHOLDERS_KEY_VERSION goes back to 1.95.0.0 for the next slot stamp to move.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@github-actions github-actions Bot changed the title v1.94.11.0 fix(stamp): declared placeholder restamps are stamps; carry records HEAD's version (GST-1026, GST-1030) v1.94.16.0 fix(stamp): declared placeholder restamps are stamps; carry records HEAD's version (GST-1026, GST-1030) Nov 3, 2026
@capy-ai
capy-ai Bot merged commit 94771d9 into main Nov 3, 2026
50 checks passed
garrytan added a commit that referenced this pull request Nov 3, 2026
Resolve lib/ship-policy.ts against #3892: keep both POLICY_KEY_INTRODUCED
entries (release_gate and stamp_placeholders); main's stamped
STAMP_PLACEHOLDERS_KEY_VERSION is kept as is.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
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