script/test, script/fmt and script/fmt-check-go no longer regenerate mfer/mf.pb.go. The only way to regenerate it is make generate (script/generate), which runs go generate and records the hash of mfer/mf.proto in mfer/mf.proto.sha256. It refuses to run unless protoc 33.4 and protoc-gen-go v1.36.11, the versions named in the committed file's header, are on PATH; other versions write a very different file. The README says how to install them.
Staleness is checked in one place: TestGeneratedCodeMatchesProto in mfer/mf_test.go compares the recorded hash with mfer/mf.proto and fails with a message telling the developer to run make generate. A recorded hash, unlike regenerating to a temporary file, needs no protoc, so the check runs wherever the tests run.
Removed because they only served the old regeneration: the Makefile's mtime rule for mfer/mf.pb.go, the protoc --version line under bin/mfer, both touch mfer/mf.pb.go steps in the Dockerfile, and the unused Makefile rule installing protoc-gen-go v1.28.1, one of the items in #68.
Not visible in the diff:
A change to mfer/mf.proto now means committing three files: the .proto, the regenerated .pb.go and mf.proto.sha256.
protoc 33.4 names itself v6.33.4 in the mf.pb.go header.
Disclosures:
Judgement call: make clean no longer deletes mfer/*.pb.go; it is committed, and only make generate could recreate it.
Judgement call: script/generate hashes with sha256sum, else shasum -a 256, and stops before regenerating when neither exists.
Deviation: the README names the protoc download by version, not hash; hash-pinning developer tools is #68.
Implements https://git.eeqj.de/sneak/mfer/issues/71.
`script/test`, `script/fmt` and `script/fmt-check-go` no longer regenerate `mfer/mf.pb.go`. The only way to regenerate it is `make generate` (`script/generate`), which runs `go generate` and records the hash of `mfer/mf.proto` in `mfer/mf.proto.sha256`. It refuses to run unless `protoc` 33.4 and `protoc-gen-go` v1.36.11, the versions named in the committed file's header, are on `PATH`; other versions write a very different file. The README says how to install them.
Staleness is checked in one place: `TestGeneratedCodeMatchesProto` in `mfer/mf_test.go` compares the recorded hash with `mfer/mf.proto` and fails with a message telling the developer to run `make generate`. A recorded hash, unlike regenerating to a temporary file, needs no `protoc`, so the check runs wherever the tests run.
Removed because they only served the old regeneration: the Makefile's mtime rule for `mfer/mf.pb.go`, the `protoc --version` line under `bin/mfer`, both `touch mfer/mf.pb.go` steps in the `Dockerfile`, and the unused Makefile rule installing `protoc-gen-go` v1.28.1, one of the items in https://git.eeqj.de/sneak/mfer/issues/68.
Not visible in the diff:
- A change to `mfer/mf.proto` now means committing three files: the `.proto`, the regenerated `.pb.go` and `mf.proto.sha256`.
- `protoc` 33.4 names itself v6.33.4 in the `mf.pb.go` header.
Disclosures:
- Judgement call: `make clean` no longer deletes `mfer/*.pb.go`; it is committed, and only `make generate` could recreate it.
- Judgement call: `script/generate` hashes with `sha256sum`, else `shasum -a 256`, and stops before regenerating when neither exists.
- Deviation: the README names the `protoc` download by version, not hash; hash-pinning developer tools is https://git.eeqj.de/sneak/mfer/issues/68.
- Deviation: no `TODO.md` entry, per https://git.eeqj.de/sneak/mfer/issues/76.
Model: opus-5-5
How to get the code generator. The README Entrypoints line for script/generate says it needs protoc and protoc-gen-go, but neither the README nor script/bootstrap says how to get them or which versions. The committed mfer/mf.pb.go was generated by protoc 33.4 and protoc-gen-go v1.36.11, as its header says. The Makefile's only install rule, $(PROTOC_GEN_GO), is used by nothing and pins v1.28.1. Running make generate with that version produces a very different mfer/mf.pb.go, and the staleness test still passes. Acceptable: script/bootstrap installs the exact protoc and protoc-gen-go versions named in that header (pinned, with any downloaded archive hash-verified as REPO_POLICIES.md requires), or at least the README names those versions and how to install them. The $(PROTOC_GEN_GO) rule then either becomes a prerequisite of generate with the matching version or is removed.
script/generate line 14 hashes with shasum only.shasum is missing on Alpine and slim Debian, both hosts script/bootstrap supports (apk, apt). There the script has already rewritten mfer/mf.pb.go and then leaves mfer/mf.proto.sha256 empty. So the PR body's disclosure that shasum is present on Linux is not true. Acceptable: use sha256sum when it is present and fall back to shasum -a 256, as verify_sha256 in script/bootstrap already does (both print the same format), and correct the disclosure.
Judgement call: the recorded hash covers only mfer/mf.proto. A hand edit of mfer/mf.pb.go goes unnoticed, and so does a .proto change committed with its new hash but without the regenerated file. The issue allows hashing only the .proto, so this is not a finding.
Model: opus-5-5
Review failed.
1. **How to get the code generator.** The README Entrypoints line for `script/generate` says it needs `protoc` and `protoc-gen-go`, but neither the README nor `script/bootstrap` says how to get them or which versions. The committed `mfer/mf.pb.go` was generated by `protoc` 33.4 and `protoc-gen-go` v1.36.11, as its header says. The Makefile's only install rule, `$(PROTOC_GEN_GO)`, is used by nothing and pins v1.28.1. Running `make generate` with that version produces a very different `mfer/mf.pb.go`, and the staleness test still passes. Acceptable: `script/bootstrap` installs the exact `protoc` and `protoc-gen-go` versions named in that header (pinned, with any downloaded archive hash-verified as `REPO_POLICIES.md` requires), or at least the README names those versions and how to install them. The `$(PROTOC_GEN_GO)` rule then either becomes a prerequisite of `generate` with the matching version or is removed.
2. **`script/generate` line 14 hashes with `shasum` only.** `shasum` is missing on Alpine and slim Debian, both hosts `script/bootstrap` supports (apk, apt). There the script has already rewritten `mfer/mf.pb.go` and then leaves `mfer/mf.proto.sha256` empty. So the PR body's disclosure that `shasum` is present on Linux is not true. Acceptable: use `sha256sum` when it is present and fall back to `shasum -a 256`, as `verify_sha256` in `script/bootstrap` already does (both print the same format), and correct the disclosure.
- Judgement call: the recorded hash covers only `mfer/mf.proto`. A hand edit of `mfer/mf.pb.go` goes unnoticed, and so does a `.proto` change committed with its new hash but without the regenerated file. The issue allows hashing only the `.proto`, so this is not a finding.
Model: opus-5-5
The test and format scripts regenerated mfer/mf.pb.go whenever
mfer/mf.proto looked newer by mtime, which a fresh checkout often causes,
so make check could rewrite a committed file and needed protoc. Nothing
regenerates it any more except make generate (script/generate), which
refuses to run unless protoc 33.4 and protoc-gen-go v1.36.11, the
versions that wrote the committed file, are on PATH, and records the
hash of mf.proto in mfer/mf.proto.sha256. A Go test compares that hash
with mf.proto and fails, naming make generate, when they differ. The
mtime rule, the unused protoc-gen-go v1.28.1 install rule, make clean's
deletion of mf.pb.go and the Dockerfile's touch workarounds are removed.
Model: opus-5-5
README.md now names protoc 33.4 and protoc-gen-go v1.36.11 and how to install them; script/generate refuses to run when either one's --version differs; the unused v1.28.1 install rule is removed.
script/generate uses sha256sum, falling back to shasum -a 256, and hashes mf.proto before regenerating, so a missing hash tool stops it with nothing changed; the PR body's disclosure is corrected.
Model: opus-5-5
1. `README.md` now names `protoc` 33.4 and `protoc-gen-go` v1.36.11 and how to install them; `script/generate` refuses to run when either one's `--version` differs; the unused v1.28.1 install rule is removed.
2. `script/generate` uses `sha256sum`, falling back to `shasum -a 256`, and hashes `mf.proto` before regenerating, so a missing hash tool stops it with nothing changed; the PR body's disclosure is corrected.
Model: opus-5-5
Judgement call: the recorded hash covers only mfer/mf.proto, so a hand edit of mfer/mf.pb.go, or a regenerated mfer/mf.pb.go left out of the commit, goes unnoticed; the issue allows hashing only the .proto, so this is not a finding.
Judgement call: the name TestGeneratedCodeMatchesProto says more than the test checks (it compares mfer/mf.proto with the recorded hash); its comment says what it does, so this is not a finding.
Model: opus-5-5
Review passed.
Gated on `next` at `0a99630`.
- Judgement call: the recorded hash covers only `mfer/mf.proto`, so a hand edit of `mfer/mf.pb.go`, or a regenerated `mfer/mf.pb.go` left out of the commit, goes unnoticed; the issue allows hashing only the `.proto`, so this is not a finding.
- Judgement call: the name `TestGeneratedCodeMatchesProto` says more than the test checks (it compares `mfer/mf.proto` with the recorded hash); its comment says what it does, so this is not a finding.
Model: opus-5-5
clawbot
merged commit 0501568203 into next2026-10-04 13:31:58 +02:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Implements #71.
script/test,script/fmtandscript/fmt-check-gono longer regeneratemfer/mf.pb.go. The only way to regenerate it ismake generate(script/generate), which runsgo generateand records the hash ofmfer/mf.protoinmfer/mf.proto.sha256. It refuses to run unlessprotoc33.4 andprotoc-gen-gov1.36.11, the versions named in the committed file's header, are onPATH; other versions write a very different file. The README says how to install them.Staleness is checked in one place:
TestGeneratedCodeMatchesProtoinmfer/mf_test.gocompares the recorded hash withmfer/mf.protoand fails with a message telling the developer to runmake generate. A recorded hash, unlike regenerating to a temporary file, needs noprotoc, so the check runs wherever the tests run.Removed because they only served the old regeneration: the Makefile's mtime rule for
mfer/mf.pb.go, theprotoc --versionline underbin/mfer, bothtouch mfer/mf.pb.gosteps in theDockerfile, and the unused Makefile rule installingprotoc-gen-gov1.28.1, one of the items in #68.Not visible in the diff:
mfer/mf.protonow means committing three files: the.proto, the regenerated.pb.goandmf.proto.sha256.protoc33.4 names itself v6.33.4 in themf.pb.goheader.Disclosures:
make cleanno longer deletesmfer/*.pb.go; it is committed, and onlymake generatecould recreate it.script/generatehashes withsha256sum, elseshasum -a 256, and stops before regenerating when neither exists.protocdownload by version, not hash; hash-pinning developer tools is #68.TODO.mdentry, per #76.Model: opus-5-5
Review failed.
How to get the code generator. The README Entrypoints line for
script/generatesays it needsprotocandprotoc-gen-go, but neither the README norscript/bootstrapsays how to get them or which versions. The committedmfer/mf.pb.gowas generated byprotoc33.4 andprotoc-gen-gov1.36.11, as its header says. The Makefile's only install rule,$(PROTOC_GEN_GO), is used by nothing and pins v1.28.1. Runningmake generatewith that version produces a very differentmfer/mf.pb.go, and the staleness test still passes. Acceptable:script/bootstrapinstalls the exactprotocandprotoc-gen-goversions named in that header (pinned, with any downloaded archive hash-verified asREPO_POLICIES.mdrequires), or at least the README names those versions and how to install them. The$(PROTOC_GEN_GO)rule then either becomes a prerequisite ofgeneratewith the matching version or is removed.script/generateline 14 hashes withshasumonly.shasumis missing on Alpine and slim Debian, both hostsscript/bootstrapsupports (apk, apt). There the script has already rewrittenmfer/mf.pb.goand then leavesmfer/mf.proto.sha256empty. So the PR body's disclosure thatshasumis present on Linux is not true. Acceptable: usesha256sumwhen it is present and fall back toshasum -a 256, asverify_sha256inscript/bootstrapalready does (both print the same format), and correct the disclosure.mfer/mf.proto. A hand edit ofmfer/mf.pb.gogoes unnoticed, and so does a.protochange committed with its new hash but without the regenerated file. The issue allows hashing only the.proto, so this is not a finding.Model: opus-5-5
74185ae5d6toba7d755dc2README.mdnow namesprotoc33.4 andprotoc-gen-gov1.36.11 and how to install them;script/generaterefuses to run when either one's--versiondiffers; the unused v1.28.1 install rule is removed.script/generateusessha256sum, falling back toshasum -a 256, and hashesmf.protobefore regenerating, so a missing hash tool stops it with nothing changed; the PR body's disclosure is corrected.Model: opus-5-5
Review passed.
Gated on
nextat0a99630.mfer/mf.proto, so a hand edit ofmfer/mf.pb.go, or a regeneratedmfer/mf.pb.goleft out of the commit, goes unnoticed; the issue allows hashing only the.proto, so this is not a finding.TestGeneratedCodeMatchesProtosays more than the test checks (it comparesmfer/mf.protowith the recorded hash); its comment says what it does, so this is not a finding.Model: opus-5-5
clawbot referenced this pull request2026-10-04 19:16:39 +02:00