Skip to content

guard: regenerating a screen touches the ones that changed, and a version stays linkable - #50

Merged
donislawdev merged 1 commit into
mainfrom
guard/references-and-changelog-links
Sep 3, 2026
Merged

guard: regenerating a screen touches the ones that changed, and a version stays linkable#50
donislawdev merged 1 commit into
mainfrom
guard/references-and-changelog-links

Conversation

@donislawdev

Copy link
Copy Markdown
Owner

Two things that went wrong while closing 0.3.0-rc1. Neither was broken code, and both were found by reading a diff rather than by anything red.

Regenerating the stored screens rewrote all twenty five

Only one had changed - About, because it draws the version. The other twenty four came back with byte identical pixels and files 12.6% to 28.9% larger.

The cause is the compiler, and it was measured rather than inferred:

stored (1.26.7) today (1.27.0)
generate.png 60 726 B 77 956 B (+28.4%)
preset.png 77 706 B 94 952 B (+22.2%)
recipe-refused.png 119 329 B 135 735 B (+13.7%)
twenty four files 1 866 203 B 2 278 108 B (+22.1%)

Re-encoding a committed file with today's compiler produces exactly the regenerated size. about.png, already written under 1.27, round trips byte for byte - one file under the new toolchain and twenty four under the old, in one run on one machine, so the measurement carries its own control.

So 402 kB of pure encoder churn across twenty four binary files went into the release commit, where git diff --stat says only Bin. What took it back out was somebody reading.

The writer now asks the guard's own question - does the stored reference still stand - rather than whether the bytes match. Byte equality was written here first and measured wrong on the spot: it rewrites every picture once on the first regeneration after a compiler update, which is the churn it was meant to stop. One judgement (judgePicture) now serves both the comparison and the writing, so the two cannot drift apart about what changed.

Measured after: twenty five of twenty five left alone and nothing written, while a reference replaced by a different picture is still the one and only file rewritten.

The changelog's link definitions had nothing holding them

A ## [0.3.0-rc1] heading went in without its definition, so it rendered as literal square brackets, and [Unreleased] still compared from v0.2.0 - showing the release's own changes as if they were still coming. A wrong target is worse than a missing one, because the link works.

Keep a Changelog is declared in the file's own header and in the project's git conventions, so this was a written convention with nothing behind it. Same class as the README table guard closed the same day. The guard also catches the drift running the other way, a definition left behind with no section.

Proof

Six mutations, all caught. Two of them are the two faults themselves. Full suite green, preflight --quick green on all twelve checks including staticcheck, lint and govulncheck.

🤖 Generated with Claude Code

…sion stays linkable

Two things that went wrong while closing 0.3.0-rc1, neither of them broken
code, both found by reading a diff rather than by anything red.

Regenerating the stored screens rewrote all twenty five whether or not any
had changed. Only About had: it draws the version. The other twenty four came
back with byte identical pixels and files 12.6% to 28.9% larger, because Go
1.27 encodes PNG less tightly than 1.26.7, which wrote them - measured by
re-encoding a committed file with today's compiler and getting the regenerated
size exactly, while About, already written under 1.27, round trips byte for
byte. So 402 kB of pure encoder churn across twenty four binary files went
into the release commit, where `git diff --stat` says only "Bin".

The writer now asks the guard's own question - does the stored reference still
stand - rather than whether the bytes match. Byte equality was written here
first and measured wrong on the spot: it rewrites every picture once on the
first regeneration after a compiler update, which is the churn it was meant to
stop. One judgement now serves both the comparison and the writing, so the two
cannot drift apart about what changed. Measured after: twenty five of twenty
five left alone, nothing written, and a reference replaced by another picture
is still the one and only file rewritten.

And the changelog's link definitions had nothing holding them. A
"## [0.3.0-rc1]" heading went in without its definition, so it rendered as
literal brackets, and Unreleased still compared from v0.2.0 - showing the
release's own changes as if they were still coming. Keep a Changelog is
declared in the file's own header and in GIT.md, so the convention was
written down and unguarded. Same class as O178.

Six mutations, all caught. Two of them are the two faults themselves.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@donislawdev
donislawdev merged commit 763c537 into main Sep 3, 2026
18 checks passed
@donislawdev
donislawdev deleted the guard/references-and-changelog-links branch September 3, 2026 23:48
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