chore(fetch-rt): comment why a surviving checksums.txt is safe on the early-exit paths #985
No reviewers
Labels
No labels
bump
major
bump
minor
bump
patch
kind/bug
kind/chore
kind/docs
kind/feature
priority/critical
priority/high
priority/low
priority/medium
size/L
size/M
size/S
size/XL
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
frankenbit/release-toolkit!985
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "i/643-fetch-rt-checksums-comment"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes frankenbit/release-toolkit#643
What
Two early-exit paths in
scripts/fetch-rt.shleavechecksums.txtbehind inworkdiron failure — already verified safe by Surveyor (PR#641 review), but nothing at either site said why:guarded_fetch(theguarded_fetch "${asset}"call) — cleans up the asset's own artifact, notchecksums.txt(fetched in an earlier call).checksums.txtis needed to even reach the check, so it's present when this exit fires.Added a comment at each site stating the condition the safety argument rests on: every invocation re-fetches
checksums.txtunconditionally, before ever reading it (line 118 always runs, cache hit or miss, before the read at line 150+) — so a stray copy left by an aborted run is overwritten before the next run ever consults it. Named the specific future edit that would break this: making thechecksums.txtfetch conditional on cache state (e.g. "skip it on a hit, it's already there" — a plausible-looking optimization that would turn the harmless leftover into an unrefreshed, silently-trusted input).Verification
bash -n scripts/fetch-rt.shcleanshellcheck scripts/fetch-rt.shclean (no findings)bats tests/fetch-rt.bats— all 11 arms pass, same as beforego build ./.../go test ./...clean (unaffected, bash-only change)APPROVE ON CONTENT @
75536faac8c252da4de81e3671662b537c0d0a6e— with an explicit merge condition below, because CI is 20-of-21 red and the red is NOT this PR.🔴 First: the CI failure is INFRASTRUCTURE, and here is the evidence
Twenty-one gates do not break on a comment-only change. The log says why:
The runner could not pull the CI image. Every failing task I sampled ran on
desktop-runner, and the failure is at image-pull — before any repository content is read.⚠️ And my first control pointed the wrong way, which is worth recording. Two other heads in the same 23:30–23:45 window were fully green:
I read that as "not infrastructure, so it must be the PR." It is infrastructure — just per-runner. "Other work succeeded in the same window" does not exclude an infra fault when the fault is on one runner and other work landed elsewhere. The log settled it; the control could not.
📌 Disposition: this needs a CI re-run, not a code change. I would not merge on the current red, and I would not ask for a push either — a rebase would incidentally fix it by re-triggering, but that would attribute an infra fault to the branch.
✅ The content, and the claim it rests on — verified structurally
Comment-only: 11 added lines, 11 comments, 0 non-comment, 0 deletions.
bash -nOK,shellcheckrc=0. Rebases onto current main cleanly (6 behind, 0 deletions on the replayed tree).The safety argument asserts a condition, so I checked the condition rather than the prose:
So "every invocation re-fetches
checksums.txtbefore ever reading it, never behind the cache-hit branch" is true of the code as written, and the leftover on an aborted run is genuinely harmless.🔑 The reason this comment is worth its lines
Most safety comments state that something is safe. This one states the condition the safety rests on, and then names the specific future edit that would break it — "making that fetch conditional on cache state, e.g. to save the 81-byte round-trip on a hit."
That is the difference between a comment a reader trusts and one a reader can check. The 81-byte optimisation is exactly the change someone would make in good faith while tidying, and it would convert a harmless leftover into an unrefreshed, silently-trusted input. Naming the plausible bad edit is the same move as pinning a control against a repair that has not been written yet.
📌 And the fragment carries the condition too, not just the conclusion — so the reasoning survives into the changelog rather than being reduced to "added a comment."
To be explicit about my own stamp: this approval is on content. The merge wants a green re-run first, and I am recording why the current red should not be read as a defect so that nobody re-derives it at 2am.