Repository navigation
fix(container): confirm an image-resolution miss against a fresh list - #82
Merged
github-actions[bot] merged 1 commit intoAug 30, 2026
Merged
Conversation
A group bed with two image-backed members cannot check its second member.
ListLocalImages serves a 5-minute persistent cache, and ResolveLocalImage
resolves a short name from it. The bed phase order is: build A, check A, build
B, check B. Checking A repopulates the cache from a snapshot taken BEFORE B was
tagged, so checking B — a separate process, and now a cache HIT — cannot see its
OWN freshly built image:
charly: error: image "punktfunk-host:check-punktfunk-fleet-2026.242.1217"
is not available locally.
Reproduced deterministically on consecutive runs of check-punktfunk-fleet, with
the tag demonstrably present in the store and in the build log
("Successfully tagged ghcr.io/opencharly/punktfunk-host:check-punktfunk-fleet-…"
113ms earlier). The discriminator is in the two members' logs: the PASSING
member logs "listing local images (first run — may take a moment)" — a cache
miss, so a fresh list — and the FAILING one logs nothing, a cache hit.
A stale HIT is harmless: it names an image that exists. A stale MISS is not — it
reports "not available locally" for an image built seconds ago. So confirm a
miss against reality before believing it: drop the cache and gather once more.
The candidate gather is split into gatherResolverCandidates so the resolver can
run it twice, and the election into electResolvedImage. Both families are
returned because the newest-BUILD staleness probe spans them.
The retry cannot mask a real absence (the second gather is authoritative) and
does not slow the fast path (a hit never re-fetches) — both properties are
tested, not merely asserted.
Claude-Session: https://claude.ai/code/session_016fnPmYiC6ZkqXSi6D8PAP6
Review — PASSHead SHA: Security screen: PASS — no secrets, exfiltration, scope mismatch, weakened guardrails, or supply-chain changes. The diff only adds a cache-invalidation + re-gather on resolution miss and extracts two helpers; no embedded directives aimed at the reviewer. Checklist: All applicable rules PASS or NA.
No comments on the thread to disposition. Verdict: PASS ollama/deepseek-v4-flash — pi-review-action. |
github-actions Bot
pushed a commit
that referenced
this pull request
Aug 30, 2026
…mage (#83) main is red. #82 split ResolveLocalImage into a gather and an election, and the election kept a shortName parameter it never reads — the name filtering all happens in gatherResolverCandidates, before election. container/local_image_coneb.go:505:82: electResolvedImage - shortName is unused (unparam) Caught by the golangci-lint gate added in #78, one commit after it landed, on its own author. That is the gate working exactly as intended: without it this would have sat on main until it blocked whoever touched this repo next, because the pre-commit hook lints the WHOLE repo rather than the diff. I ran `go build ./container/`, `go vet ./container/` and `go test ./container/` before #82 but not `golangci-lint run ./...` — the one check that would have seen it. Claude-Session: https://claude.ai/code/session_016fnPmYiC6ZkqXSi6D8PAP6 Co-authored-by: atrawog <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A group bed with two image-backed members cannot check its second member. That is why no such bed exists yet — the existing multi-member beds (
check-group,check-builder-vm) uselocal:members with no image, so nothing had ever exercised this path.ListLocalImagesserves a 5-minute persistent cache, andResolveLocalImageresolves a short name from it. The bed phase order is build A → check A → build B → check B. Checking A repopulates the cache from a snapshot taken before B was tagged, so checking B — a separate process, and now a cache hit — cannot see its own freshly built image:A stale hit is harmless — it names an image that exists. A stale miss is not. So a miss is now confirmed against reality before it is believed: drop the cache, gather once more.
How the cause was established
The failure is deterministic — two consecutive runs of
check-punktfunk-fleet, same failure at the same step,FAIL after 113ms(far too fast to be a real check).The image was demonstrably present. From the host member's own build log, 113ms before the failure:
and afterwards, from the store:
So neither the build nor the tag nor podman's short-name resolution was at fault. The discriminator is in the two members' check-image logs:
The passing member fetched a fresh list; the failing one was served the snapshot the passing member had just written. Confirmed by inspecting the cache at
~/.config/charly/cache/images.json, which holds nopunktfunk-host:check-punktfunk-fleet-*entry.How tested
New guards, and the negative control reproduces the production error text exactly:
Negative control — retry removed:
That is the same error, on the same ref, that killed the bed.
The other two guards exist so the fix cannot drift into something worse.
GenuineAbsenceStillFailskeeps "confirm the miss" from becoming "retry until something turns up" — a real absence still reportsErrImageNotLocal, after exactly one confirmation.CacheHitDoesNotRefetchkeeps the fast path fast: a hit never triggers a second enumeration, which matters because that enumeration is ~9s on a large store.Build, vet and the full package on the committed tree:
End to end: the bed that could not get past step 4
Built
charlyagainst this branch (go mod edit -replace github.com/opencharly/spec => …) and re-ran the same bed. Before, on two consecutive runs:After:
Both members now build, check and come up. 25.9s versus 113ms is the difference between running the checks and failing to find the image.
Rulebook compliance
check-punktfunk-fleet; fixed here rather than worked around in the bed.Change classification
fully tested and validated— the defect was reproduced deterministically, the changed path executed live in the bed that exposed it, and the guard fails without the fixAssisted-by: Claude Code Anthropic Opus 5 (fully tested and validated)