fix(restamp): quoted since: rows and stale base-version mentions on branch-added lines when VERSION equals the base (gbrain #7640)

A PR that stamped X, lost its slot and merged a base that had reached X on
its own had no branch stamp, and the mention scanner could not pass the
opening quote of a quoted row, so gstack-restamp --next left the PR's
{ since: 'X' } rows at X while the release shipped as X+1.

- tentativeMentions and rewriteStamps accept since: 'X' / since: "X" /
  (was 'X') / (was "X") and keep the quote style; the scanner also reads
  the policy's stamp_patterns templates.
- With no branch stamp and no --was, a stamp-form mention of the base
  version on a line the branch added moves; the same version on a base
  line stays. The stamp_paths stage detail names both counts per file.
- test/restamp-mentions.test.ts (pure forms + the reporter's state rebuilt
  with the real bin), stamp-templates pin updated, docs/ship-policy.md,
  --was help line, CHANGELOG [Unreleased].

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This commit is contained in:
garrytanandcapy-ai[bot] committed 2026-10-26 20:01:54 +00:00
1 parent 4d48d39e51
commit e27c79902a
6 files changed
+294 -57

No files matched your search

+1 -1
View File
@@ -31,7 +31,7 @@ const HELP = `gstack-restamp — stamp the version, release tool, CHANGELOG and
--bump <level> micro|patch|minor|major (default: policy bump, else micro)
--queue-mode <mode> stamp-at-merge | claim-at-open (default: policy queue_mode, else claim-at-open)
--pr <n> this PR, for --expect-order and the gate-ahead record
--was <X> the version the branch's docs mention today (default: the branch's own stamp, else base + bump)
--was <X> rewrite X on every line of every stamp file, the base's own lines included (default: the branch's own stamp everywhere, else only the stale mentions on lines the branch added)
--expect-base <sha> refuse with QUEUE_STALE when origin/<base> moved
--expect-order <pr,...> refuse with QUEUE_STALE when a predecessor is unmerged or a successor merged
--policy-from base|head base (default, reviewed) or head (unreviewed; needs --allow-repo-commands)