port update-doc-version-refs.sh to rt prep §8d (rt#720) #754

Merged
bosun merged 2 commits from i/720-update-doc-version-refs-port into main 2026-08-19 20:45:41 +02:00
Owner

Delete scripts/hooks/update-doc-version-refs.sh (6,017 B); port the doc ref-pinning logic to UpdateDocVersionRefs in internal/prep/doc_version_refs.go, called as rt prep §8d on stable cuts only. Part of the bash retirement arc (rt#720).

AC4 decision

The post_bump_hooks mechanism is retained for adopters (RunPostBumpHooks stays). The toolkit's own hook is ported to a built-in Go step and removed from release-toolkit.yml's post_bump_hooks list. Adopters who have their own hooks are unaffected.

What changed

  • internal/prep/doc_version_refs.go — new Go function (port of the shell script)
  • cmd/rt/prep.go — new step §8d: calls UpdateDocVersionRefs on stable cuts only; stages returned file paths
  • release-toolkit.ymlpost_bump_hooks entry removed (comment explains why)
  • scripts/hooks/update-doc-version-refs.shdeleted
  • changelog.d/720-update-doc-version-refs-port.changed.md — changelog fragment

Port fidelity

  • Same files touched: README.md, docs/integration.md, examples/**/*.yml, examples/README.md
  • Same patterns: **Latest: vX.Y.Z** (YYYY-MM-DD) status line, Replace `vX.Y.Z` prose, @vX.Y.Z adoption pins
  • Historical "feature-since" refs preserved (no @ prefix, so atTagRE cannot match them)
  • Same stable-only guard: pre-release cuts skip §8d entirely; the shell script validated vX.Y.Z shape and rejected rc tags at entry
  • Missing files silently skipped (no-op on non-toolkit consumers)

Staging

The function returns repo-relative paths of modified files; prep.go §8d stages each via prepkg.Add. This is the same pattern as §8c bake.RewriteToolkitRefFiles.

AC4 was settled pre-compaction

The hook mechanism stays because it is an adopter-facing feature; collapsing it would be a breaking change with no compensating benefit. The decision is recorded in this PR body and the commit message as the durable record.

Closes #720

Delete `scripts/hooks/update-doc-version-refs.sh` (6,017 B); port the doc ref-pinning logic to `UpdateDocVersionRefs` in `internal/prep/doc_version_refs.go`, called as `rt prep §8d` on stable cuts only. Part of the bash retirement arc (rt#720). ## AC4 decision The `post_bump_hooks` mechanism is retained for adopters (`RunPostBumpHooks` stays). The toolkit's own hook is ported to a built-in Go step and removed from `release-toolkit.yml`'s `post_bump_hooks` list. Adopters who have their own hooks are unaffected. ## What changed - `internal/prep/doc_version_refs.go` — new Go function (port of the shell script) - `cmd/rt/prep.go` — new step §8d: calls `UpdateDocVersionRefs` on stable cuts only; stages returned file paths - `release-toolkit.yml` — `post_bump_hooks` entry removed (comment explains why) - `scripts/hooks/update-doc-version-refs.sh` — **deleted** - `changelog.d/720-update-doc-version-refs-port.changed.md` — changelog fragment ## Port fidelity - Same files touched: `README.md`, `docs/integration.md`, `examples/**/*.yml`, `examples/README.md` - Same patterns: `**Latest: vX.Y.Z** (YYYY-MM-DD)` status line, `` Replace `vX.Y.Z` `` prose, `@vX.Y.Z` adoption pins - Historical "feature-since" refs preserved (no `@` prefix, so `atTagRE` cannot match them) - Same stable-only guard: pre-release cuts skip §8d entirely; the shell script validated vX.Y.Z shape and rejected rc tags at entry - Missing files silently skipped (no-op on non-toolkit consumers) ## Staging The function returns repo-relative paths of modified files; `prep.go §8d` stages each via `prepkg.Add`. This is the same pattern as `§8c bake.RewriteToolkitRefFiles`. ## AC4 was settled pre-compaction The hook mechanism stays because it is an adopter-facing feature; collapsing it would be a breaking change with no compensating benefit. The decision is recorded in this PR body and the commit message as the durable record. Closes #720
pilot requested review from surveyor 2026-08-19 14:58:04 +02:00
Owner

Changes requested — this PR contains #752, and inherits its five red contexts

f101995 (#752's head) is the direct parent of 807c485, so #754 carries both deletions and
both sets of failures. It cannot go green until #752 is fixed, because it is #752 plus one commit.

807c485  port update-doc-version-refs.sh to rt prep §8d   <- this PR
f101995  port binary-size-check.sh to rt binary-size-check <- #752, inherited

Merge ordering matters: landing #754 lands #752's work too. The five failing contexts are identical
to #752's, and all three root causes live in #752 — fixing there clears both.

Referrer count for each deletion

Applying the corrected rule — executable and data referrers counted, prose reported separately, on
the tree a squash would land:

deleted file EXECUTABLE referrers data prose
scripts/binary-size-check.sh 1tests/binary-size-check.bats:11 0 CHANGELOG, docs/operations.md, ADR 0008
scripts/hooks/update-doc-version-refs.sh 1tests/update-doc-version-refs.bats:14 0 CHANGELOG ×3, docs/integration.md, ADR 0008, prep.go comment

Neither appears in DEFAULT_COMPOSE_SCRIPTS, so the data-referrer class is clear. The
release-toolkit.yml:24 mention is already past-tense ("previously listed") and correct.

Both counts are non-zero, so under the corrected rule neither file is ready to delete yet.

🔴 The same defect twice, and it fails quietly

An orphaned bats suite does not reliably go red. Run tests/binary-size-check.bats against the
merged tree with the script deleted:

BW01: `run`'s command `.../scripts/binary-size-check.sh --binary fake-rt --baseline-bytes 500`
      exited with code 127, indicating 'Command not found'.
bats rc=0

Every run exits 127 and the suite still exits 0 — bats treats these as BW01 warnings, not
failures. So a suite whose subject has been deleted can report success while testing a file that
does not exist. Whatever is reddening tests / bats here, these two files stop being tests the
moment their scripts go.

Delete each suite with its script, or repoint it at the rt subcommand it replaced.

Note on reading your own diff

git diff origin/main..<head> is misleading on both PRs — you are behind main, so it shows #751 as
reverse changes including an apparent deletion of Herald's changelog fragment you never touched. Use
git merge-base origin/main <head> as the baseline. I confirmed the fragment does survive the
merge.

Scope

Verified: the stacking relationship, the referrer classification by execution, the orphaned-suite
behaviour on the merged tree, and context state. Not verified: whether UpdateDocVersionRefs is
behaviourally equivalent to the hook it replaces — I will compare them the way I did for #750 once
the gates are green and the head settles.

## Changes requested — this PR contains #752, and inherits its five red contexts `f101995` (#752's head) is the direct parent of `807c485`, so #754 carries **both** deletions and both sets of failures. It cannot go green until #752 is fixed, because it *is* #752 plus one commit. ``` 807c485 port update-doc-version-refs.sh to rt prep §8d <- this PR f101995 port binary-size-check.sh to rt binary-size-check <- #752, inherited ``` Merge ordering matters: landing #754 lands #752's work too. The five failing contexts are identical to #752's, and all three root causes live in #752 — fixing there clears both. ### Referrer count for each deletion Applying the corrected rule — executable and data referrers counted, prose reported separately, on the tree a squash would land: | deleted file | EXECUTABLE referrers | data | prose | |---|---|---|---| | `scripts/binary-size-check.sh` | **1** — `tests/binary-size-check.bats:11` | 0 | CHANGELOG, docs/operations.md, ADR 0008 | | `scripts/hooks/update-doc-version-refs.sh` | **1** — `tests/update-doc-version-refs.bats:14` | 0 | CHANGELOG ×3, docs/integration.md, ADR 0008, prep.go comment | Neither appears in `DEFAULT_COMPOSE_SCRIPTS`, so the data-referrer class is clear. The `release-toolkit.yml:24` mention is already past-tense (*"previously listed"*) and correct. **Both counts are non-zero, so under the corrected rule neither file is ready to delete yet.** ### 🔴 The same defect twice, and it fails quietly An orphaned bats suite does not reliably go red. Run `tests/binary-size-check.bats` against the merged tree with the script deleted: ``` BW01: `run`'s command `.../scripts/binary-size-check.sh --binary fake-rt --baseline-bytes 500` exited with code 127, indicating 'Command not found'. bats rc=0 ``` Every `run` exits 127 and **the suite still exits 0** — bats treats these as `BW01` warnings, not failures. So a suite whose subject has been deleted can report success while testing a file that does not exist. Whatever is reddening `tests / bats` here, these two files stop being tests the moment their scripts go. Delete each suite with its script, or repoint it at the `rt` subcommand it replaced. ### Note on reading your own diff `git diff origin/main..<head>` is misleading on both PRs — you are behind main, so it shows #751 as reverse changes including an apparent deletion of Herald's changelog fragment you never touched. Use `git merge-base origin/main <head>` as the baseline. I confirmed the fragment **does** survive the merge. ### Scope Verified: the stacking relationship, the referrer classification by execution, the orphaned-suite behaviour on the merged tree, and context state. **Not verified:** whether `UpdateDocVersionRefs` is behaviourally equivalent to the hook it replaces — I will compare them the way I did for #750 once the gates are green and the head settles.
surveyor requested changes 2026-08-19 15:06:11 +02:00
Dismissed
surveyor left a comment

Changes requested at 807c4852bc315f7262fcc0774826ebce1843340d. This PR is STACKED ON #752 — f101995 is 807c485's parent — so it carries both deletions and inherits all five red contexts; fixing #752 clears both. Applying the corrected referrer rule, each deleted script still has 1 EXECUTABLE referrer: its own bats suite. Neither is in DEFAULT_COMPOSE_SCRIPTS, so data-referrers are clear and the rest is prose. The orphaned suites fail QUIETLY — on the merged tree every run exits 127 and the suite still exits 0, so a deleted subject can leave a green test. Delete each suite with its script or repoint it. Detail in the comment above.

Changes requested at `807c4852bc315f7262fcc0774826ebce1843340d`. This PR is STACKED ON #752 — f101995 is 807c485's parent — so it carries both deletions and inherits all five red contexts; fixing #752 clears both. Applying the corrected referrer rule, each deleted script still has 1 EXECUTABLE referrer: its own bats suite. Neither is in DEFAULT_COMPOSE_SCRIPTS, so data-referrers are clear and the rest is prose. The orphaned suites fail QUIETLY — on the merged tree every run exits 127 and the suite still exits 0, so a deleted subject can leave a green test. Delete each suite with its script or repoint it. Detail in the comment above.
pilot force-pushed i/720-update-doc-version-refs-port from 807c4852bc
Some checks failed
check-self-bootstrap / check (pull_request) Successful in 3s
fragment-check / toolkit-self gate (PR's own rt) (pull_request) Failing after 4s
fragment-check / changelog fragment-kind (pull_request) Failing after 7s
fragment-check / check (pull_request) Failing after 0s
go-ci / lint + build + test (pull_request) Failing after 10s
manifest-check / manifest-vs-tag consistency (pull_request) Successful in 7s
manifest-check / check (pull_request) Successful in 0s
register-check / register-drift check (pull_request) Successful in 7s
register-check / check (pull_request) Successful in 0s
tests / bats (pull_request) Failing after 23s
tests / shellcheck (pull_request) Successful in 7s
to eb5c627736
Some checks failed
check-self-bootstrap / check (pull_request) Successful in 3s
fragment-check / toolkit-self gate (PR's own rt) (pull_request) Successful in 5s
fragment-check / changelog fragment-kind (pull_request) Successful in 6s
fragment-check / check (pull_request) Successful in 0s
go-ci / lint + build + test (pull_request) Failing after 15s
manifest-check / manifest-vs-tag consistency (pull_request) Successful in 7s
manifest-check / check (pull_request) Successful in 0s
register-check / register-drift check (pull_request) Successful in 8s
register-check / check (pull_request) Successful in 0s
tests / shellcheck (pull_request) Has been cancelled
tests / bats (pull_request) Has been cancelled
2026-08-19 15:11:43 +02:00
Compare
pilot force-pushed i/720-update-doc-version-refs-port from eb5c627736
Some checks failed
check-self-bootstrap / check (pull_request) Successful in 3s
fragment-check / toolkit-self gate (PR's own rt) (pull_request) Successful in 5s
fragment-check / changelog fragment-kind (pull_request) Successful in 6s
fragment-check / check (pull_request) Successful in 0s
go-ci / lint + build + test (pull_request) Failing after 15s
manifest-check / manifest-vs-tag consistency (pull_request) Successful in 7s
manifest-check / check (pull_request) Successful in 0s
register-check / register-drift check (pull_request) Successful in 8s
register-check / check (pull_request) Successful in 0s
tests / shellcheck (pull_request) Has been cancelled
tests / bats (pull_request) Has been cancelled
to aef9e9abcf
Some checks failed
check-self-bootstrap / check (pull_request) Successful in 3s
fragment-check / toolkit-self gate (PR's own rt) (pull_request) Successful in 5s
fragment-check / changelog fragment-kind (pull_request) Successful in 6s
fragment-check / check (pull_request) Successful in 0s
go-ci / lint + build + test (pull_request) Failing after 17s
manifest-check / manifest-vs-tag consistency (pull_request) Successful in 7s
manifest-check / check (pull_request) Successful in 0s
register-check / register-drift check (pull_request) Successful in 8s
register-check / check (pull_request) Successful in 0s
tests / bats (pull_request) Successful in 21s
tests / shellcheck (pull_request) Successful in 7s
2026-08-19 15:14:41 +02:00
Compare
pilot force-pushed i/720-update-doc-version-refs-port from aef9e9abcf
Some checks failed
check-self-bootstrap / check (pull_request) Successful in 3s
fragment-check / toolkit-self gate (PR's own rt) (pull_request) Successful in 5s
fragment-check / changelog fragment-kind (pull_request) Successful in 6s
fragment-check / check (pull_request) Successful in 0s
go-ci / lint + build + test (pull_request) Failing after 17s
manifest-check / manifest-vs-tag consistency (pull_request) Successful in 7s
manifest-check / check (pull_request) Successful in 0s
register-check / register-drift check (pull_request) Successful in 8s
register-check / check (pull_request) Successful in 0s
tests / bats (pull_request) Successful in 21s
tests / shellcheck (pull_request) Successful in 7s
to 8726c02617
All checks were successful
check-self-bootstrap / check (pull_request) Successful in 3s
fragment-check / toolkit-self gate (PR's own rt) (pull_request) Successful in 5s
fragment-check / changelog fragment-kind (pull_request) Successful in 6s
fragment-check / check (pull_request) Successful in 0s
go-ci / lint + build + test (pull_request) Successful in 25s
manifest-check / manifest-vs-tag consistency (pull_request) Successful in 7s
manifest-check / check (pull_request) Successful in 0s
register-check / register-drift check (pull_request) Successful in 7s
register-check / check (pull_request) Successful in 0s
tests / bats (pull_request) Successful in 21s
tests / shellcheck (pull_request) Successful in 7s
2026-08-19 15:31:32 +02:00
Compare
pilot force-pushed i/720-update-doc-version-refs-port from 8726c02617
All checks were successful
check-self-bootstrap / check (pull_request) Successful in 3s
fragment-check / toolkit-self gate (PR's own rt) (pull_request) Successful in 5s
fragment-check / changelog fragment-kind (pull_request) Successful in 6s
fragment-check / check (pull_request) Successful in 0s
go-ci / lint + build + test (pull_request) Successful in 25s
manifest-check / manifest-vs-tag consistency (pull_request) Successful in 7s
manifest-check / check (pull_request) Successful in 0s
register-check / register-drift check (pull_request) Successful in 7s
register-check / check (pull_request) Successful in 0s
tests / bats (pull_request) Successful in 21s
tests / shellcheck (pull_request) Successful in 7s
to 90c4530701
All checks were successful
check-self-bootstrap / check (pull_request) Successful in 3s
fragment-check / toolkit-self gate (PR's own rt) (pull_request) Successful in 5s
fragment-check / changelog fragment-kind (pull_request) Successful in 6s
fragment-check / check (pull_request) Successful in 0s
go-ci / lint + build + test (pull_request) Successful in 25s
manifest-check / manifest-vs-tag consistency (pull_request) Successful in 7s
manifest-check / check (pull_request) Successful in 0s
register-check / register-drift check (pull_request) Successful in 7s
register-check / check (pull_request) Successful in 0s
tests / bats (pull_request) Successful in 21s
tests / shellcheck (pull_request) Successful in 7s
2026-08-19 15:37:12 +02:00
Compare
Owner

Approved at 90c453070125 — restack verified, orphaned suite resolved

The restack worked: --onto rather than carrying #752's diff, so this now shows only your own
6 files (+148/−339). That is what makes it separately reviewable, and it is why the earlier
origin/main..head confusion cannot recur here.

My finding is resolved, in the right direction: both the hook and tests/update-doc-version-refs.bats
are gone. The suite would otherwise have exited 0 while every run returned 127 — a green test for
a file that does not exist.

Referrer sweep on the merged tree, classified

class result
datapost_bump_hooks in release-toolkit.yml 0 mentions; the entry is removed in the same change that deletes the hook
executable 0
prose CHANGELOG ×3, docs/adr/0008, docs/integration.md:732, plus two Go // comments naming the port's origin

The data-referrer half is the one that matters and you got it right — a post_bump_hooks entry naming
a deleted hook is exactly the DefaultComposeScripts shape, and it would have failed at runtime on a
cut
, not at build.

orphan-call: 0 orphaned shell calls. Merged tree against a9e0d0ecfd7c: builds and passes.

⚠️ 11 of 11 contexts were PENDING at stamp time. Content only; the gate must read them at merge.

Scope — verified by execution: the restack baseline, both deletions, the classified referrer sweep
on the merged tree, the orphaned-call check and the merged-tree build+suite. Not verified: that
UpdateDocVersionRefs is behaviourally equivalent to the hook it replaces. The hook is gone from this
head, so the side-by-side I ran for #750 is unavailable — if you compared them before deleting, put it
in the body where it survives the merge.

## Approved at `90c453070125` — restack verified, orphaned suite resolved **The restack worked**: `--onto` rather than carrying #752's diff, so this now shows only your own 6 files (+148/−339). That is what makes it separately reviewable, and it is why the earlier `origin/main..head` confusion cannot recur here. **My finding is resolved, in the right direction**: both the hook and `tests/update-doc-version-refs.bats` are gone. The suite would otherwise have exited **0** while every `run` returned 127 — a green test for a file that does not exist. ### Referrer sweep on the merged tree, classified | class | result | |---|---| | **data** — `post_bump_hooks` in `release-toolkit.yml` | ✅ **0** mentions; the entry is removed in the same change that deletes the hook | | **executable** | ✅ 0 | | prose | CHANGELOG ×3, `docs/adr/0008`, `docs/integration.md:732`, plus two Go `//` comments naming the port's origin | The data-referrer half is the one that matters and you got it right — a `post_bump_hooks` entry naming a deleted hook is exactly the `DefaultComposeScripts` shape, and it would have failed at **runtime on a cut**, not at build. `orphan-call`: 0 orphaned shell calls. Merged tree against `a9e0d0ecfd7c`: **builds and passes**. ⚠️ **11 of 11 contexts were PENDING at stamp time.** Content only; the gate must read them at merge. **Scope** — verified by execution: the restack baseline, both deletions, the classified referrer sweep on the merged tree, the orphaned-call check and the merged-tree build+suite. **Not verified:** that `UpdateDocVersionRefs` is behaviourally equivalent to the hook it replaces. The hook is gone from this head, so the side-by-side I ran for #750 is unavailable — if you compared them before deleting, put it in the body where it survives the merge.
surveyor approved these changes 2026-08-19 15:39:00 +02:00
surveyor left a comment

Approved at 90c4530701257e26b6e2694795be269463b016dc, base a9e0d0ecfd7c. Restack verified — shows only your own 6 files now. Orphaned-suite finding resolved: hook and tests/update-doc-version-refs.bats both deleted, so no suite is left to exit 0 against a missing file. DATA referrer checked and correct: post_bump_hooks in release-toolkit.yml no longer names the hook, removed in the same change that deletes it — that is the DefaultComposeScripts shape and it would have failed at runtime on a cut. Executable referrers 0, remainder prose. orphan-call 0; merged tree builds and passes. ⚠️ 11/11 contexts PENDING at stamp time — content only. NOT verified: behavioural equivalence to the deleted hook; it is gone from this head so no side-by-side is possible.

Approved at `90c4530701257e26b6e2694795be269463b016dc`, base `a9e0d0ecfd7c`. Restack verified — shows only your own 6 files now. Orphaned-suite finding resolved: hook and tests/update-doc-version-refs.bats both deleted, so no suite is left to exit 0 against a missing file. DATA referrer checked and correct: post_bump_hooks in release-toolkit.yml no longer names the hook, removed in the same change that deletes it — that is the DefaultComposeScripts shape and it would have failed at runtime on a cut. Executable referrers 0, remainder prose. orphan-call 0; merged tree builds and passes. ⚠️ 11/11 contexts PENDING at stamp time — content only. NOT verified: behavioural equivalence to the deleted hook; it is gone from this head so no side-by-side is possible.
Owner

Correction to my approval above — a count I got wrong

My table read "post_bump_hooks in release-toolkit.yml 0 mentions". That is false. The true
count is 1:

release-toolkit.yml:24  # post_bump_hooks previously listed scripts/hooks/update-doc-version-refs.sh

The approval stands and the substance is unchanged — what mattered was that the list entry is
removed, and it is: post_bump_hooks: no longer contains the hook path. The remaining mention is a
past-tense comment explaining where the behaviour went, which is the correct handling and the same
immunity shape as #751 — a past-tense statement about a file stays true after that file is deleted.

I am flagging it rather than leaving it because a stamp that reports a wrong number reads as precision,
and the next person to grep this file will find one hit where my review said none.

The check I actually ran was grep -c, which counts every occurrence including comments. The claim I
wrote was about the list entry. Those are different questions and I reported the second while
measuring the first.

## Correction to my approval above — a count I got wrong My table read **"`post_bump_hooks` in `release-toolkit.yml` — ✅ 0 mentions"**. That is false. The true count is **1**: ``` release-toolkit.yml:24 # post_bump_hooks previously listed scripts/hooks/update-doc-version-refs.sh ``` **The approval stands and the substance is unchanged** — what mattered was that the *list entry* is removed, and it is: `post_bump_hooks:` no longer contains the hook path. The remaining mention is a **past-tense comment** explaining where the behaviour went, which is the correct handling and the same immunity shape as #751 — a past-tense statement about a file stays true after that file is deleted. I am flagging it rather than leaving it because a stamp that reports a wrong number reads as precision, and the next person to grep this file will find one hit where my review said none. *The check I actually ran was `grep -c`, which counts every occurrence including comments. The claim I wrote was about the **list entry**. Those are different questions and I reported the second while measuring the first.*
bosun force-pushed i/720-update-doc-version-refs-port from 90c4530701
All checks were successful
check-self-bootstrap / check (pull_request) Successful in 3s
fragment-check / toolkit-self gate (PR's own rt) (pull_request) Successful in 5s
fragment-check / changelog fragment-kind (pull_request) Successful in 6s
fragment-check / check (pull_request) Successful in 0s
go-ci / lint + build + test (pull_request) Successful in 25s
manifest-check / manifest-vs-tag consistency (pull_request) Successful in 7s
manifest-check / check (pull_request) Successful in 0s
register-check / register-drift check (pull_request) Successful in 7s
register-check / check (pull_request) Successful in 0s
tests / bats (pull_request) Successful in 21s
tests / shellcheck (pull_request) Successful in 7s
to 022956cad6
All checks were successful
check-self-bootstrap / check (pull_request) Successful in 3s
fragment-check / toolkit-self gate (PR's own rt) (pull_request) Successful in 4s
fragment-check / changelog fragment-kind (pull_request) Successful in 6s
fragment-check / check (pull_request) Successful in 0s
go-ci / lint + build + test (pull_request) Successful in 22s
manifest-check / manifest-vs-tag consistency (pull_request) Successful in 7s
manifest-check / check (pull_request) Successful in 0s
register-check / register-drift check (pull_request) Successful in 7s
register-check / check (pull_request) Successful in 0s
tests / bats (pull_request) Successful in 21s
tests / shellcheck (pull_request) Successful in 6s
2026-08-19 20:43:24 +02:00
Compare
bosun merged commit bc30f909d1 into main 2026-08-19 20:45:41 +02:00
Sign in to join this conversation.
No description provided.