question: why does REPO_POLICIES use no-cache? #176

Open
opened 2026-11-16 21:56:31 +01:00 by clawbot · 1 comment
Collaborator

sneak, chat, 16 November about 20:55 UTC: "why are we using no-cache?" about https://git.eeqj.de/sneak/prompts/src/branch/main/prompts/REPO_POLICIES.md

Task

Answer his question; change nothing.

  • Find every place REPO_POLICIES.md (on main and next) and the canonical files it points to (Dockerfiles, script/ entrypoints, Makefile) use or require no-cache (docker build --no-cache, --pull --no-cache, Cache-Control: no-cache, or similar).
  • For each: what it does, when and why it was added (git log -S, the commit message and any linked issue), and who ordered it (a quote of sneak if there is one).
  • What it costs (build time, network) and what dropping it would risk.
  • A recommendation: keep, narrow, or drop.

Post the answer as one comment here, in plain language a reader who never opened the repo can follow, with full URLs to the lines and commits. Then stop; the issue stays open for sneak.

Definition of done

  • One comment here answering the above.

Model: opus-5-5

sneak, chat, 16 November about 20:55 UTC: "why are we using no-cache?" about https://git.eeqj.de/sneak/prompts/src/branch/main/prompts/REPO_POLICIES.md ## Task Answer his question; change nothing. - Find every place `REPO_POLICIES.md` (on `main` and `next`) and the canonical files it points to (Dockerfiles, `script/` entrypoints, Makefile) use or require `no-cache` (`docker build --no-cache`, `--pull --no-cache`, `Cache-Control: no-cache`, or similar). - For each: what it does, when and why it was added (`git log -S`, the commit message and any linked issue), and who ordered it (a quote of sneak if there is one). - What it costs (build time, network) and what dropping it would risk. - A recommendation: keep, narrow, or drop. Post the answer as one comment here, in plain language a reader who never opened the repo can follow, with full URLs to the lines and commits. Then stop; the issue stays open for sneak. ## Definition of done - One comment here answering the above. Model: opus-5-5
Author
Collaborator

Answer: main builds with --no-cache because you asked on 10 August for lint and test builds with no caching. next stopped using it on 15 October, on your later rulings. The page you opened is the main copy, which is behind next.

Nothing is changed by this comment. Line links are pinned to main at ed5ed23 and next at 69d38ba.

What the flag does and why it was added

Docker stores the result of every build step and reuses it when the step's inputs are unchanged. Lint and tests are build steps. On a tree unchanged since the last build, Docker reused their stored results: the build exited 0 in about 0.3 seconds, and nothing had been linted or tested. That bug was reported in #26. docker build --no-cache makes Docker ignore every stored result, so every step executes.

Where it is on main

Who ordered it

You did, for the lint and test builds, in #40 (comment) on 10 August:

  • "Then the linting script entry point can just run that single build phase in Docker using no caching."
  • "then both testing and linting happen inside docker and you can simply disable all caching."

The body of that issue also has you saying the day before: "We don't need a cache. That's okay." An agent transcribed that one; it is not a comment of yours.

How it landed:

  • The first fix for the cached-build bug did not use --no-cache. It passed a build argument that changes on every build. The bug report itself said --no-cache "also works but is wasteful".
  • A review failed that version for not following your instruction: #34 (comment).
  • The rework switched all four scripts to --no-cache. For script/lint and script/test that follows your words. For script/docker and script/cibuild it was the implementer's judgement call, with no instruction of yours behind it: #34 (comment).
  • The commits are 58f7514 for the two image builds and c4d5546 for lint and test. You merged them into main on 9 September in #34.

What it costs

--no-cache discards more than the lint and test results. Every build also reinstalls the system packages, downloads every dependency again and compiles all of it from nothing, in each stage. CI builds the lint and test phases twice: once as checks, once inside the image build. The base image is not downloaded again.

Figures on the tracker, from Go repositories on the shared build host:

  • bsfirehose: make test took 158 seconds and script/cibuild 454 seconds, against the 60-second and 5-minute limits (#112).
  • The same repository's test step took 127 seconds from nothing and 8 seconds with compiled packages kept. Its lint step took 131 against 15.
  • homoicon: make test took about three minutes (#113 (comment)).
  • Network: each Go stage downloaded the modules again, 5 to 16 seconds each (#130). pixa spent all but 12 of its 95 test seconds reinstalling libvips-dev and its 289 packages (#113 (comment)).

What next does instead

  • 15 October: you ruled in chat that Go's compile cache may survive between check builds. An agent recorded it at #113 (comment); no comment of yours carries it.
  • --no-cache empties that cache, so the scripts dropped the flag in e3f79c4. They now pass --build-arg CACHEBUST= with a new value on every build, and each Dockerfile stage has an ARG CACHEBUST line. Every step below that line executes on every build. The steps above it are reused.
  • 16 October: you answered "yes to all 3" in #130 (comment). Check builds then also kept Go's downloaded modules, the linter's cache and the system-package install, in 0653579.
  • 21 October: you approved keeping a Python install from the lockfile in sneak/rfscan#80 (comment). That is 279b101.
  • The current text is prompts/REPO_POLICIES.md lines 301 to 341 on next. Lines 334 to 338 say why the scripts do not pass --no-cache.

main has none of this. The pull request of next into main, #68, is open and assigned to you.

The other --no-cache in these files

apk add --no-cache is an unrelated flag of Alpine's package installer. It stops the installer from leaving its package index in the image. It has no effect on Docker's stored build results.

Neither branch has a Cache-Control header requirement, a --pull or a --no-cache-filter.

What dropping it risks

  • With nothing in its place, the original bug returns: an unchanged tree reports success without linting or testing. An unchanged tree is common: a rebuild after a flaky test, or a merge commit with the same content as its branch.
  • With CACHEBUST in its place, as on next, the build depends on two things --no-cache did not need:
    • Every Dockerfile stage must carry the ARG CACHEBUST line above its checks. A stage without it is reused silently, and nothing detects that. The policy answers it with two requirements: scripts and ARG lines land in one commit, and a planted defect proves a changed check.
    • Each kept cache must be unable to return an old result. Tests carry -count=1. The linter reuses a finding only for identical files, settings and version. Modules and Python packages are checked against their lockfile hashes.
  • The pull request of next into main records one unverified point: the kept caches have not yet been tried on the shared CI runner.

Recommendation

  • docker build --no-cache: drop. next already did, on your rulings, and nothing more needs building. main shows the flag until next is merged into main.
  • apk add --no-cache: keep. It is unrelated and costs nothing.

Not checked:

  • Which consuming repositories still build with --no-cache. #78 tells them to copy from main, so any that did still pass the flag.
  • I ran no builds. The timings, and the statement that --no-cache empties the compile cache, come from the linked issues.

Model: fable-5-2

**Answer:** `main` builds with `--no-cache` because you asked on 10 August for lint and test builds with no caching. `next` stopped using it on 15 October, on your later rulings. The page you opened is the `main` copy, which is behind `next`. Nothing is changed by this comment. Line links are pinned to `main` at `ed5ed23` and `next` at `69d38ba`. ## What the flag does and why it was added Docker stores the result of every build step and reuses it when the step's inputs are unchanged. Lint and tests are build steps. On a tree unchanged since the last build, Docker reused their stored results: the build exited 0 in about 0.3 seconds, and nothing had been linted or tested. That bug was reported in https://git.eeqj.de/sneak/prompts/issues/26. `docker build --no-cache` makes Docker ignore every stored result, so every step executes. ## Where it is on `main` - The policy text: [`prompts/REPO_POLICIES.md` lines 149 to 158](https://git.eeqj.de/sneak/prompts/src/commit/ed5ed236b1b1ad4b5d3f351d6d168f19ed4d65c5/prompts/REPO_POLICIES.md#L149-L158) says any build that runs checks is built with `--no-cache`. The same file repeats it in three places: - the lint and test commands, [lines 117 to 118](https://git.eeqj.de/sneak/prompts/src/commit/ed5ed236b1b1ad4b5d3f351d6d168f19ed4d65c5/prompts/REPO_POLICIES.md#L117-L118) - the CI paragraph, [lines 233 to 236](https://git.eeqj.de/sneak/prompts/src/commit/ed5ed236b1b1ad4b5d3f351d6d168f19ed4d65c5/prompts/REPO_POLICIES.md#L233-L236) - the image build example, [line 380](https://git.eeqj.de/sneak/prompts/src/commit/ed5ed236b1b1ad4b5d3f351d6d168f19ed4d65c5/prompts/REPO_POLICIES.md#L380) - The four scripts that build: - [`script/lint` line 18](https://git.eeqj.de/sneak/prompts/src/commit/ed5ed236b1b1ad4b5d3f351d6d168f19ed4d65c5/script/lint#L18) - [`script/test` line 14](https://git.eeqj.de/sneak/prompts/src/commit/ed5ed236b1b1ad4b5d3f351d6d168f19ed4d65c5/script/test#L14) - [`script/docker` line 20](https://git.eeqj.de/sneak/prompts/src/commit/ed5ed236b1b1ad4b5d3f351d6d168f19ed4d65c5/script/docker#L20) - [`script/cibuild` line 24](https://git.eeqj.de/sneak/prompts/src/commit/ed5ed236b1b1ad4b5d3f351d6d168f19ed4d65c5/script/cibuild#L24) - `README.md`, both checklists and the Go style guide restate it. - The `Makefile` and the CI workflow only call the scripts. The `Dockerfile` has no cache setting. ## Who ordered it You did, for the lint and test builds, in https://git.eeqj.de/sneak/prompts/issues/40#issuecomment-54891 on 10 August: - "Then the linting script entry point can just run that single build phase in Docker using no caching." - "then both testing and linting happen inside docker and you can simply disable all caching." The body of that issue also has you saying the day before: "We don't need a cache. That's okay." An agent transcribed that one; it is not a comment of yours. How it landed: - The first fix for the cached-build bug did not use `--no-cache`. It passed a build argument that changes on every build. The bug report itself said `--no-cache` "also works but is wasteful". - A review failed that version for not following your instruction: https://git.eeqj.de/sneak/prompts/pulls/34#issuecomment-91777. - The rework switched all four scripts to `--no-cache`. For `script/lint` and `script/test` that follows your words. For `script/docker` and `script/cibuild` it was the implementer's judgement call, with no instruction of yours behind it: https://git.eeqj.de/sneak/prompts/pulls/34#issuecomment-91891. - The commits are [`58f7514`](https://git.eeqj.de/sneak/prompts/commit/58f75147bed9aa78bf06716db7d67f80e303e56e) for the two image builds and [`c4d5546`](https://git.eeqj.de/sneak/prompts/commit/c4d5546e867f5ce0e687e77fae40a218d3e2668d) for lint and test. You merged them into `main` on 9 September in https://git.eeqj.de/sneak/prompts/pulls/34. ## What it costs `--no-cache` discards more than the lint and test results. Every build also reinstalls the system packages, downloads every dependency again and compiles all of it from nothing, in each stage. CI builds the lint and test phases twice: once as checks, once inside the image build. The base image is not downloaded again. Figures on the tracker, from Go repositories on the shared build host: - `bsfirehose`: `make test` took 158 seconds and `script/cibuild` 454 seconds, against the 60-second and 5-minute limits (https://git.eeqj.de/sneak/prompts/issues/112). - The same repository's test step took 127 seconds from nothing and 8 seconds with compiled packages kept. Its lint step took 131 against 15. - `homoicon`: `make test` took about three minutes (https://git.eeqj.de/sneak/prompts/issues/113#issuecomment-131596). - Network: each Go stage downloaded the modules again, 5 to 16 seconds each (https://git.eeqj.de/sneak/prompts/issues/130). `pixa` spent all but 12 of its 95 test seconds reinstalling `libvips-dev` and its 289 packages (https://git.eeqj.de/sneak/prompts/issues/113#issuecomment-143586). ## What `next` does instead - 15 October: you ruled in chat that Go's compile cache may survive between check builds. An agent recorded it at https://git.eeqj.de/sneak/prompts/issues/113#issuecomment-142370; no comment of yours carries it. - `--no-cache` empties that cache, so the scripts dropped the flag in [`e3f79c4`](https://git.eeqj.de/sneak/prompts/commit/e3f79c49daf7cc5b29134427db4ae7298a4a63c0). They now pass `--build-arg CACHEBUST=` with a new value on every build, and each `Dockerfile` stage has an `ARG CACHEBUST` line. Every step below that line executes on every build. The steps above it are reused. - 16 October: you answered "yes to all 3" in https://git.eeqj.de/sneak/prompts/issues/130#issuecomment-144933. Check builds then also kept Go's downloaded modules, the linter's cache and the system-package install, in [`0653579`](https://git.eeqj.de/sneak/prompts/commit/065357920a0a09bd736bf33d4cb5ce935fdc2328). - 21 October: you approved keeping a Python install from the lockfile in https://git.eeqj.de/sneak/rfscan/issues/80#issuecomment-153437. That is [`279b101`](https://git.eeqj.de/sneak/prompts/commit/279b10164dcb5a6bb1c0c5239511603b2c78693e). - The current text is [`prompts/REPO_POLICIES.md` lines 301 to 341 on `next`](https://git.eeqj.de/sneak/prompts/src/commit/69d38ba6decdc7be27e53b96653e36fee3a23354/prompts/REPO_POLICIES.md#L301-L341). [Lines 334 to 338](https://git.eeqj.de/sneak/prompts/src/commit/69d38ba6decdc7be27e53b96653e36fee3a23354/prompts/REPO_POLICIES.md#L334-L338) say why the scripts do not pass `--no-cache`. `main` has none of this. The pull request of `next` into `main`, https://git.eeqj.de/sneak/prompts/pulls/68, is open and assigned to you. ## The other `--no-cache` in these files `apk add --no-cache` is an unrelated flag of Alpine's package installer. It stops the installer from leaving its package index in the image. It has no effect on Docker's stored build results. - On `main`: [`script/bootstrap` line 52](https://git.eeqj.de/sneak/prompts/src/commit/ed5ed236b1b1ad4b5d3f351d6d168f19ed4d65c5/script/bootstrap#L52), since [`3d8d1c0`](https://git.eeqj.de/sneak/prompts/commit/3d8d1c060077bf34658591dbbdd37c719f5af935) of 6 July. - On `next`: - [`script/bootstrap` line 55](https://git.eeqj.de/sneak/prompts/src/commit/69d38ba6decdc7be27e53b96653e36fee3a23354/script/bootstrap#L55) - [`Dockerfile` line 15](https://git.eeqj.de/sneak/prompts/src/commit/69d38ba6decdc7be27e53b96653e36fee3a23354/Dockerfile#L15), and the same line in the other two stages, since [`86c7617`](https://git.eeqj.de/sneak/prompts/commit/86c7617f86ea2e74e8381df01b3e43eadeb75c93) of 4 November, which took node and yarn from the distribution - the Go example at [`prompts/REPO_POLICIES.md` line 409](https://git.eeqj.de/sneak/prompts/src/commit/69d38ba6decdc7be27e53b96653e36fee3a23354/prompts/REPO_POLICIES.md#L409), since [`507a57e`](https://git.eeqj.de/sneak/prompts/commit/507a57e813d2f2d80f970d32f33f5c279a27d263) of 2 October, whose build stage needs `git` - No instruction of yours is on record for it. It is the usual form of that command. Neither branch has a `Cache-Control` header requirement, a `--pull` or a `--no-cache-filter`. ## What dropping it risks - With nothing in its place, the original bug returns: an unchanged tree reports success without linting or testing. An unchanged tree is common: a rebuild after a flaky test, or a merge commit with the same content as its branch. - With `CACHEBUST` in its place, as on `next`, the build depends on two things `--no-cache` did not need: - Every `Dockerfile` stage must carry the `ARG CACHEBUST` line above its checks. A stage without it is reused silently, and nothing detects that. The policy answers it with two requirements: scripts and `ARG` lines land in one commit, and a planted defect proves a changed check. - Each kept cache must be unable to return an old result. Tests carry `-count=1`. The linter reuses a finding only for identical files, settings and version. Modules and Python packages are checked against their lockfile hashes. - The pull request of `next` into `main` records one unverified point: the kept caches have not yet been tried on the shared CI runner. ## Recommendation - `docker build --no-cache`: drop. `next` already did, on your rulings, and nothing more needs building. `main` shows the flag until `next` is merged into `main`. - `apk add --no-cache`: keep. It is unrelated and costs nothing. Not checked: - Which consuming repositories still build with `--no-cache`. https://git.eeqj.de/sneak/prompts/issues/78 tells them to copy from `main`, so any that did still pass the flag. - I ran no builds. The timings, and the statement that `--no-cache` empties the compile cache, come from the linked issues. Model: fable-5-2
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/prompts#176