Moves the warning not to copy .gitignore patterns into .dockerignore
next to the .dockerignore rule, splits the two long paragraphs into
lists, and cuts the history "since consuming repos receive the file
and not the tracker"; every pattern rule stays.
Model: opus-5-5
Splits the one long paragraph into the four workflow settings, what
script/cibuild does, and the separate-workflow rule; merges the two
descriptions of script/cibuild and drops the sentence that names it,
which Entrypoints states; every setting and its reason stays.
Model: opus-5-5
Cuts the fetch-depth sentence, which the CI section states, and moves
the reason ARG VERSION sits in the stage that compiles next to the
sentence saying it has no default; every rule stays.
Model: opus-5-5
Cuts the Python make test recipe, which repeats the command in
examples/python-test-phase.Dockerfile, and lists how such a target
behaves on a host; drops the no-node sentence, stated under node and
yarn, and the shared-timeout sentence, which the example's comment
states; trims two sentences; every rule stays.
Model: opus-5-5
Cuts the Go make test recipe, which repeats the command in
examples/go.Dockerfile, and turns its notes into three key points;
drops key points stated elsewhere (the no-op copies and the last
stage under Dockerfile, when Docker installs again under Docker's
cache, the Python layer under the Python section) and "BuildKit runs
stages in parallel"; every rule stays.
Model: opus-5-5
Cuts history ("Both have produced wrong verdicts"), an example given
for a stated reason (the Go image's toolchain), the tag sentence that
the version snippet's comment states, and the short cache list that
the Go section gives in full; takes in the rule to keep the stage that
ships last, which the Go section's commit removes; every rule stays.
Model: opus-5-5
The POSIX sh rule joins the list of what the canonical form does, and
two sentences lose filler ("installing into a clean image", "which
then succeeds while no caller sees any change"); each step of the
canonical form and the go install rule stay.
Model: opus-5-5
States once that a stage with no yarn.lock gets no node and no yarn,
which two paragraphs here said; puts the short lists of yarn settings
and of the files a yarn stage copies inline; joins the two sentences
on Alpine's and Debian's yarn; every setting, file and condition
stays.
Model: opus-5-5
Merges the two statements that a distribution tool is installed only
when missing into one bullet that also says where such tools come
from; the exact-version rule for other tools is the second bullet;
nothing else was there.
Model: opus-5-5
States once, under the rerun pattern, that a timed-out first run gets
no rerun and a hung package uses the backstop once, which three rules
each said; splits the timeout rule from the 60-second rule and trims
wording; names the examples that carry the command, and that a
Makefile writes each $ as $$, since the Go and Python recipes go in
their sections' commits; every limit stays.
Model: opus-5-5
One list now pairs each required target with its script, and one
lists the three scripts with no required target, absorbing the list
of extensions and the pre-commit hook rule; the README sentence goes,
since the README section requires the same; every target, script and
condition stays.
Model: opus-5-5
Only a heading and a comma before "because" in the build-artifact
exception: the reorder already put these five rules together, and
none is cut.
Model: opus-5-5
Merges the list of what is pinned with each one's hash, the two
warnings with the untrusted sources, the version comment and the
double-check, and the distribution's tools with what is ruled out;
every item is kept.
Model: opus-5-5
Moves whole bullets, and whole paragraphs inside them, into the order
of the sections that the next commits add. No line changes:
git show --color-moved shows every changed line as moved, and the
sorted lines of the file are identical before and after.
Paragraphs that later join another section sit under the nearest
bullet until that section's commit.
Model: opus-5-5
Each fenced dockerfile block moves byte for byte into its own file
under examples/, and one sentence links the file where the block
stood, as sneak ruled at
#159 (comment).
Phrases that pointed at a block by position now name the file, here
and in both checklists. README.md names the folder. No rule changes.
Model: opus-5-5
Drop the CACHEBUST build argument from script/lint, script/test,
script/docker, script/cibuild and every Dockerfile stage. REPO_POLICIES
now says check builds use Docker's normal cache: an unchanged tree reuses
each step's stored result, which Docker keeps only for steps that
succeeded. The rules on placing ARG CACHEBUST and re-vendoring it in one
commit are gone; the rule that a planted defect proves a new or changed
check stays. The README, the Go style guide and both checklists restated
the cache-busting rules and are updated to match. The existing-repo
checklist asks that no script pass --no-cache or CACHEBUST.
Model: opus-5-5
Proposal for the naming-rules issue, #174: a Naming section in `prompts/CODE_STYLEGUIDE_GO.md`, twenty-seven rules, each with its reason. Nothing is renamed in any repo until sneak approves or amends them.
Where each rule comes from:
- Package names
- Named for what the package provides; lowercase with words run together; only familiar abbreviations: Effective Go and the Go blog post "Package names".
- No `model`, `util`, `common`, `types`, `helpers`, `api` and the like, and splitting such packages: sneak on `model`; "Package names"; Go Code Review Comments; the Go Style Guide, which also lists `model`.
- No name a caller wants for a variable or a standard package has: "Package names"; the Go Style Guide.
- Directory named as the package: Effective Go.
- Test-support packages named like `storetest`; import names: the Go Style Guide.
- Exported names
- No package name repeated; the same plain name in two packages: Effective Go; "Package names"; Code Review Comments.
- Types in a name; noun or verb; `Fetch` for a getter that reads from a database or the network: the Go Style Guide.
- No `Get`; `er` interfaces; well-known method names: Effective Go.
- Initialisms; MixedCaps constants: Code Review Comments; the Go Style Guide.
- `ErrNotFound` and `NotFoundError`: the Go wiki page "Errors", which is not one of the four sources.
- Local names (length by scope; receivers): Code Review Comments; the Go Style Guide.
The first comment lists the renames and the judgement calls.
Model: fable-5-2 (proposal); opus-5-5 (rework)
Reviewed-on: #175
Co-authored-by: clawbot <35+clawbot@noreply.example.org>
Every repository the section linked returned 404 to a signed-out
reader: `template-app-js` and `template-app-python` do not exist, and
`template-app-go` is private. The section is gone, intro included.
Model: opus-5-5
The comments said a phase that is not the last stage is built only when
--target names it. The canonical Dockerfile's last stage copies from both
phases, so a plain build builds them too. The comments now say what
--target does in every repository: it builds that phase and the stages
it depends on, nothing else. The headers no longer say each script
builds its phase alone, which is false wherever the phase depends on
another stage.
Model: opus-5-5
The rule and its comment existed only so concurrent PRs could each add a
Completed Steps entry to `TODO.md`. That work log is gone; `TODO.md` now
holds only open work, so it merges normally again.
Model: opus-5-5
Drop the Completed Steps log and the finished "commit this TODO.md"
item. Git keeps the history. The Workflow section now says to delete
the finished Next Step, as the standard Workflow block does.
Model: opus-5-5
One command fetches the policy files a repo vendors from `prompts`, keeps the repo's own entries, commits them by name and pushes. A line the canonical file has never held stops the script before anything is written, as does a failed fetch. The canonical `.dockerignore` gains the closing comment the script needs. `test/update-policy.sh` runs in the `test` phase of `Dockerfile`.
Judgement call: `.gitea/workflows/check.yml` and `.prettierrc` are replaced whole.
Limitation: a repo with its own `.golangci.yml` settings, such as `sneak/homoicon`, stops until those are dealt with.
Model: opus-5-5
Follows sneak's ruling at
#149 (comment). This
repository now carries yarn 4.18.1 under .yarn/releases. The
distribution's yarn only starts that file, and that file does the work.
yarn.lock is converted once, and script/bootstrap installs with
--immutable instead of stopping on yarn's major version. Node is the
distribution's newest Node package: nodejs-current on Alpine and
nodejs_latest on nix. Every Dockerfile stage that needs yarn also copies
.yarnrc.yml and .yarn/releases/. The policies and both checklists say
so, with the steps for converting and for a new repository.
Model: opus-5-5
Follows sneak's ruling at
#51 (comment). An agent
whose work is confined to one package may run `go test` directly on that
package's suite, or on individual tests in it, while iterating. `go build`,
`go vet` and the linter still go through make targets. The full `make check`
is still required before every push. The `Makefile` gains nothing.
The rule on Docker now says the lint and test gates run there, because a run
while iterating is not a gate.
Model: opus-5-5
Follows sneak's ruling at
#146 (comment). Runtimes
and the installer tools bundled with python come from the distribution,
with no version and no hash. Third-party packages stay pinned by hash.
script/bootstrap drops nvm and corepack. It installs node, yarn and the
node packages only when yarn.lock is in the tree, and stops there when
yarn's major version is not 1. This repository's Dockerfile starts from
Alpine 3.24. The Python example starts from debian:trixie-slim, keeps
pipenv at $HOME/.pipenv on a host and in an image, and sets
PIP_ONLY_BINARY=:all:, so pip downloads no build tools without a hash
check.
Model: opus-5-5
Rewrites every sentence of `prompts/REPO_POLICIES.md` against the sentence rules, for #136. No rule's meaning, `must`/`should` or order changed. Code blocks, digests, URLs and commands are byte-identical. Both checklists carry the same rewrite of the paragraph they quote.
## For sneak
Kept as they are: each looks false or contradicts another rule. Line numbers are this branch's.
- Lines 196-197: the final stage carries the `COPY --from=` lines; in the `Dockerfile` (345-346) the build stage does, the runtime stage none.
- Lines 629-641 and 670-675: `make test` runs `go test` and `pytest` on the host; 80-81 make targets shims, 183-185 make `script/test` a Docker build.
- Lines 23-37 pin by hash; 103-112 install node (nvm) and yarn (corepack) by version. Tracked at #146.
- Line 131 counts four extensions; `script/lint`, `script/fmt`, `script/fmt-check`, `script/docker` (85-89) are not in the standard either.
- Lines 149-151: the Makefile is the single source of truth; 80-81 (implementation in `script/`), 211 (tool invoked in a phase), 616 (test command in the `Dockerfile`).
- Lines 64-68 require `make test` and `make lint`, which 183-185 make Docker builds; line 167 only says a repo should have a `Dockerfile`.
- Line 759 says byte-identical; the block at 767 has `tag="$(script/projectname)"`, both scripts have `tag="$("$SCRIPT_DIR/projectname")"`.
- Lines 834-839: `script/bootstrap` never tests presence, 860 excepts only node; `ensure_yarn` in the canonical `script/bootstrap` skips the install when yarn is present, without a version check.
## Disclosures
- Judgement call: short name lists stay inline under about 15 words.
Model: fable-5-1
Co-authored-by: sneak <sneak@sneak.berlin>
Reviewed-on: #147
Co-authored-by: clawbot <35+clawbot@noreply.example.org>
Moves the pin to v2.15.0 and enables canonicalheader again, because that
release fixes the random misses behind
#105.
The depguard exemption reached every directory below one ending in test,
and a whole checkout under such a directory. It now covers only the files
directly inside, and the directory a repository is cloned into does not
count. gomodguard_v2 also blocks github.com/go-redis/redis/v9, whose
pre-releases can still be imported.
uniq-by-line is now false, so a line that trips two linters reports both
findings.
Three comments are corrected. A new comment says the file has no
formatters section, so golangci-lint run does not run gofmt.
Model: opus-5-5
A package from the distribution's own package index now needs no version
and no hash, and pulling that index is allowed, on sneak's answer at
#72 (comment). The
distribution is the pinned base image's in a Dockerfile and the host's
on a host. It is trusted, and everything else stays pinned by hash. A
package source that a Dockerfile adds itself does not get the exception.
The pinning rule of REPO_POLICIES.md and both checklists say so, and the
canonical Go Dockerfile's apk add line has a comment saying why it is
allowed.
Model: opus-5-5
A hung test used the 90-second backstop twice, because the verbose
rerun waited for the same hang. The Go recipe now looks in the first
run's output for the lines Go prints for a hang, and exits 1 with no
rerun. A failure with neither line in its output still reruns with -v.
The Python make test example takes the same timeout wrapper as its
Dockerfile example. The 60 and 90 second rule and the 5-minute rule say
a hung package uses the backstop once. The Go item in both repo
checklists now asks for this.
Model: opus-5-5
prompts/API_POLICIES.md states sneak's rule from
sneak/routewatch#199: a value in an API
response is never a string with a label or unit in it. A native value
is sent as that type, with its unit in the field name.
The list at the top of REPO_POLICIES.md and the two code style
commands in the README now name the new file.
Model: opus-5-5
A Python `test` phase that installs its packages from `Pipfile.lock` now does so above `ARG CACHEBUST`, through `script/bootstrap`, in a layer of its own. Check builds keep that layer as they keep Go's modules, and the tests still run after the line on every build. In that step `script/bootstrap` installs only system packages, pipenv and its dependencies by hash, and the lockfile's packages. The policy, both checklists and the README list the steps above the line the same way; the policy has a short example. This writes down sneak's ruling at sneak/rfscan#80 (comment).
rfscan installs pipenv by version, not by hash, so its `script/bootstrap` does not meet this rule yet.
Model: opus-5-5
sneak decided that homoicon keeps a local copy of sobek, its JavaScript
engine, and fixes it in its own tree
(sneak/homoicon#1759 (comment)).
homoicon's go.mod now replaces sobek with ./third_party/sobek, which
gomoddirectives refuses. The canonical .golangci.yml gains an exclusion
for exactly that report: a local replace of github.com/grafana/sobek in
a repository's root go.mod. Every other local replace is still refused.
It is an exclusion rather than a replace-allow-list entry because
gomoddirectives does not check that list for a replace that points at a
local path. TODO.md records the change.
Model: opus-5-5
On sneak's ruling in #130, check
builds keep three more things besides Go's build cache. In each stage of
the canonical Go Dockerfile, the system-package install and the module
download come before ARG CACHEBUST, so Docker keeps those layers until
the base image, the install line, go.mod or go.sum changes. Modules are
kept as a layer, not a cache mount, because Go does not check a cache
mount's files again. golangci-lint run also mounts golangci-lint's cache.
Every step that lints, tests or compiles still comes after ARG CACHEBUST,
both go test runs keep -count=1, and a step that also installs node
packages stays below the line. The policy, checklists, Go style guide,
README and script comments say the same.
Model: opus-5-5
The script/ builds pass a new CACHEBUST build argument on every run in
place of --no-cache, which also emptied Go's build cache mount. Every
Dockerfile stage declares ARG CACHEBUST first, so every RUN step still
reruns on an unchanged tree. The canonical Go Dockerfile mounts only
Go's build cache, on the steps that compile, so compiled packages
survive between check builds; both go test runs carry -count=1, so no
test result is reused. golangci-lint's own cache and the module cache
are not kept.
A repository re-vendors the scripts and adds the ARG lines in one
commit: a stage without the line is served from cache with no warning.
Unverified: not yet tried on the shared CI runner.
Model: opus-5-5
script/bootstrap used whatever node was installed, so on the CI runner
image, which ships node 24, the pinned yarn 1.22.22 printed the
deprecation warning DEP0169 on every bootstrap. It now uses the
installed node only when its major version is the pinned one, and
otherwise installs the pinned node with nvm, as it already did when node
was missing, with yarn and the packages under it. It prints the node
version it uses. Only the major is compared because the Dockerfile
stages use a node 22 alpine image that nvm cannot replace. script/fmt
and script/fmt-check carry the same test to pick their yarn: the yarn on
PATH, or yarn under the pinned node loaded through nvm.
Model: opus-5-5
The new-repository checklist gave script/cibuild's image build without a
tag, so a repository written from it left a dangling image behind on
every run, and it used $version without saying where it comes from. The
item now gives the build as the canonical script/cibuild runs it, with
-t "$tag", and names the two steps the script runs before it, each on
its own line: the version from git describe --tags --always --dirty
(unknown if empty) and the tag from script/projectname. The other docker
build commands the checklists and REPO_POLICIES.md give for script/
already matched their scripts.
Model: opus-5-5
script/lint and script/test build their Dockerfile phase with
--output type=cacheonly in place of a tag. The phase still runs
uncached and a failing step still fails the build, but no image is
written: nothing used those images, and writing one out took about 16
seconds of a Go repository's test build. script/cibuild and
script/docker keep their tags. REPO_POLICIES.md, both checklists and
the README now say the gate builds write no image.
Model: opus-5-5
The canonical check workflow gave its job no time limit, so a hung
script/cibuild held the shared runner until the runner's own default.
The check job now sets timeout-minutes: 20. script/cibuild runs three
Docker builds (the test phase, the lint phase, then the image, which
runs both again), each held to the 5-minute build limit, plus the
bootstrap. REPO_POLICIES.md and both checklists name the limit among
what the workflow sets.
Model: opus-5-5
Repositories copy package.json to get prettier, and with "license": "MIT"
each of them declared MIT whatever its own licence is. "private": true
keeps yarn from printing "No license field" and makes no licence claim.
This repository's LICENSE and README License section are unchanged.
Model: opus-5-5
The policy said a repository whose version comes from git tags needs `fetch-depth: 0` on its CI checkout, because the checkout action clones shallow with no tags; every repository's version comes from `git describe --tags --always`, but the canonical `.gitea/workflows/check.yml` did not set it, so CI stamped a bare short commit id where a local build of a tagged repository stamps the tag. The checkout step now sets `fetch-depth: 0` with a one-line comment, and the workflow bullet of `prompts/REPO_POLICIES.md` and both checklists name it beside `persist-credentials: false` and the `concurrency` block, as part of what the workflow does.
Unverified: a live run, which waits on the shared runner.
Model: opus-5-5
`pkg_install` in the canonical `script/bootstrap` ran `apt-get install` with no `apt-get update` before it. The Gitea runner image starts with empty package lists, so a repository's own `pkg_install` of anything the image lacks, Go included, failed with "Unable to locate package". The apt branch now refreshes the lists once, before the first install of a run, in the same `$SUDO env DEBIAN_FRONTEND=noninteractive` form, and skips the refresh on later calls. nix, brew and apk are unchanged. Repositories that refresh in their own section, or changed their copy, drop that at their next re-vendor.
Model: opus-5-5
A plain `docker build .` from a checkout whose `.git` is a file (a linked worktree, or a repository checked out as a submodule) stops at the version check of the canonical `Dockerfile` example: that file points to a git directory outside the build context, so `git describe` prints nothing. The check is right to refuse an empty version; what was missing is what to do. `prompts/REPO_POLICIES.md` and both checklists now say such a build is given its version with `--build-arg VERSION=...`, as `script/docker` and `script/cibuild` already do. The check itself is unchanged.
Model: opus-5-5
The canonical `.gitea/workflows/check.yml` lacked two settings `dnswatcher` had added, so a byte-identical re-vendor removed them. A `concurrency` block grouped by workflow and branch, with `cancel-in-progress: true`, makes a new push cancel the older run on the same branch and leaves every other branch's runs alone; on 2026-10-02 45 stale runs had queued on the one shared runner. `persist-credentials: false` on the checkout step keeps the job's token out of `.git/config`; `script/cibuild` needs no token. Each has a one-line comment, and the policy's workflow bullet and both checklists describe the file as it now is.
Unverified: the two live checks, which wait on the shared runner.
Model: opus-5-5
In golangci-lint v2.14.0, `canonicalheader` misses findings at random in a package that also calls `ResponseWriter.Header()`: on the same tree, repeated runs sometimes reported a non-canonical header key and sometimes reported nothing. So one commit could fail lint on one run and pass on the next, in every Go repository that vendors this file. Reproduced with the pinned image and the canonical config.
The canonical `.golangci.yml` now disables it, with a comment saying it comes back once a pinned golangci-lint release fixes it. New `.golangci.yml` sha256: `e49052a1418127b54b20cea530dfd3cc6ddfc126a9fd27fd570ccca1a3f18bc7`.
Model: opus-5-5