Repository navigation
fix(build): bind every locally-built stage ref, not only the final base - #54
Conversation
A multi-stage Containerfile names its builder stages by registry reference too
(`FROM ghcr.io/opencharly/arch-builder:<tag> AS python-pixi-build`). When that
builder was itself built in the same run it exists only in the charly image
store, and the drive bound just ONE reference — the final stage's `ARG
BASE_IMAGE` — so the builder stage fell through to the registry, where a
check-run tag does not exist.
Measured on the openwebui pod bed, and identically on the UNMODIFIED main tree
(so it is not a pin regression):
[image-build] FAIL after 27.353s
#3 [internal] load metadata for ghcr.io/opencharly/arch-builder:check-openwebui-pod-<tag>
#3 ERROR: ... not found
The drive now collects the ARG base plus every explicit FROM reference
(deduplicated, ARG-driven and scratch forms excluded) and binds each one the
store can answer, so a locally-built builder resolves from --oci-layout. A ref
absent from the store is still left to the registry — unchanged fallback.
Proof: the same openwebui pod bed then built and passed end to end —
[image-build] ... --- openwebui: ghcr.io/opencharly/arch-builder:check-openwebui-pod-2026.317.2100 from the charly image store ---
[image-build] PASS, [check-image] PASS, [deploy] PASS, [check-live] PASS,
[update] PASS, [rebuild] PASS, [check-live-rebuild] PASS, [cleanup] PASS
PASS (steps=16) — including `openwebui-served-version` PASS at 0.13.3
The extractor is unit-tested (order, dedupe, ARG/scratch exclusion).
Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)
Review — BLOCKHead SHA: Change class: code/config — Blocks
Notes (non-blocking)
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
…actor Review follow-up on #54's non-blocking notes: a Dockerfile allows any whitespace after an instruction and may carry flags before the reference (`FROM --platform=linux/amd64 <ref> AS stage`). The extractor now splits on whitespace, requires the instruction word to be FROM, and skips leading `--flag` tokens; a bare stage alias still enters the candidate list and is harmlessly dropped by storeLookup, which now says so in a comment. New unit cases cover the flag and tab forms. Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)
Review — BLOCKHead SHA: Change class: code/config — Security screen: PASS (no secrets, no egress, no guardrail weakening, no injected instructions; T4 N/A — no security-machinery touched). Blocks
Notes (non-blocking)
Comment dispositions
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
…describes Review follow-up: the previous commit inserted the flags/TAB case between the "no explicit FROM ref" comment and TestContainerfileStageRefsEmpty, so that comment annotated the wrong function. Moved it back; no behaviour change. Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)
Review — BLOCKHead SHA: Change class: code/config — Security screen: PASS (no secrets, no egress, no guardrail weakening, no injected instructions; T4 N/A — no security machinery touched). Blocks
Comment dispositions
The single finding above is newly derived from the CURRENT diff, not inherited from either prior round. Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
…n declaration Review follow-up (same class as the test-file fix in 163aef2): inserting the two new helpers between `containerfileBaseRef`'s doc comment and its function merged three doc blocks into one, leaving baseRef and fromRefs undocumented and stageRefs documented by prose about the other two. The three definitions now run stageRefs -> fromRefs -> baseRef, each with its own comment immediately above it, separated by a blank line. No behaviour change. Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)
Review — BLOCKHead SHA: Change class: code/config — Security screen: PASS (no secrets, no egress, no guardrail weakening, no injected instructions; T4 N/A). Blocks
The diff itself is otherwise correct: Comment dispositions
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
RCA — the missed control (round 3)The previous round named a doc comment attached to the wrong declaration in the TEST file. I fixed
Root fix in this head: the region was rewritten so each of the three helpers carries its own A durable control would be a |
Review — PASSHead SHA: Security screen: PASS Comment dispositions: Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
The compiled-in `build:box`/`build:generate` drive advances to the merged `candy/plugin-build/v0.2026317.2215` (opencharly/plugin-build#54), which binds EVERY locally-built stage reference from the charly image store, not only the final stage's `ARG BASE_IMAGE`. Why it matters here: a multi-stage Containerfile names its builder stages by registry reference too (`FROM ghcr.io/opencharly/arch-builder:<tag> AS python-pixi-build`). When that builder was itself built in the same run it exists only in the charly image store, so binding only the base left the builder stage to be resolved from the registry, where a check-run tag does not exist: #3 [internal] load metadata for ghcr.io/opencharly/arch-builder:check-openwebui-pod-<tag> #3 ERROR: ... not found Measured on the openwebui pod bed, and identically on unmodified main. The module version is what the go.mod `require` resolves; `scripts/bootstrap-charly.sh` regenerates the compiled-in wiring from it. Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)
Summary
The build drive bound only ONE locally-built reference — the final stage's
ARG BASE_IMAGE—so a multi-stage Containerfile's BUILDER stages (
FROM ghcr.io/opencharly/arch-builder:<tag> AS python-pixi-build) fell through to the registry, where a check-run tag does not exist.Head
ef28a9c69d440d7384827fed9bdba2fd5d1982c5, 3 files, +165/−13 (buildkit.go+25/−13,containerfile_refs_test.go+72/−0,imagestore.go+68/−0) — parsed fromgit diff --stat origin/main...HEADon this head.Measured before (openwebui pod bed, and identically on unmodified
origin/main— so it isnot a pin regression):
Change.
containerfileStageRefs= theARG BASE_IMAGEvalue plus every explicitFROMreference (deduplicated; ARG-driven
${…},scratchand leadingFROMflags excluded). Eachref the charly image store can answer is bound as a named context
(
--opt context:<ref>=oci-layout://…), all sharing ONEOCILayout; a ref absent from thestore is still left to the registry, so the fallback is unchanged. The extractor is pure and
unit-tested: file order, dedupe across forms, ARG/scratch exclusion,
--platform=<p>and TABseparators (Dockerfile-legal forms the first cut missed), empty input.
How tested
Unit (this head):
Live (R10), the bed that was failing —
check-openwebui-pod, on a charly binary built fromthis tree (CalVer
2026.317.1918, a temporary localreplacein a scratch worktree):That grid is a warning-STRIPPED summary of the step statuses; the run's raw update line is
charly check run check-openwebui-pod: [update] PASS after 1m16.827s [warnings=1] (log: …).That single warning is the pre-existing
krun-host/layer-containerdcomposition warning,measured on unmodified main, filed as opencharly/distro-cachyos#163, and dispositioned under
Filed issues. The same bed on unmodified
origin/mainfails at the same image-build stage in27 s — that is the before/after pair.
Not claimed: this repo's own suite has no disposable bed; the proof of the changed path IS a box
build, and the openwebui bed exercises it end to end (build → deploy → live → update → rebuild).
Rulebook compliance
build,generate,image,plugin,git-workflowloaded first.warning is filed (#163) and its disposition stated; every prior round's findings are fixed in this
head (stale counts, the test comment that annotated the wrong function, and the production doc
comments that merged into one block), and this round carries the RCA that names the missed
control — see the PR comment and the "RCA" section below.
hand-built URL.
restored empty-input case); the live bed is the changed path's proof.
deepseek-v4.1-flash: that is the model this harness sessionreports at runtime, and the validator's own run for this PR is attributed
ollama-cloud/deepseek-v4.1-flash, so the trailer names the actual authoring model.Change classification
The build drive resolves locally-built stage references it previously left to the registry.
Every box build gains the correct resolution; a single-stage Containerfile is unaffected (its
ref set is the same one binding as before). Breaking change + rollback: none — the
previously-bound base is still bound first, the registry fallback for absent refs is unchanged,
and rollback is reverting this commit.
RCA — the missed control (round 3)
The previous round named a doc comment attached to the wrong declaration in the TEST file. I fixed
that instance, re-ran the same gate that had missed it, and pushed — and the same defect was still
present in the production file. Two misses, named:
gofmt -l+go vet+go build+go test. None of them models comment-to-declaration attachment: gofmtpreserves comments wherever they sit,
go vethas no such analyzer, and this repo runs no linter.Running the same gate a second time therefore could not catch the recurrence — the control I used
had no coverage of the property I claimed to have fixed.
merged across declarations" — and I repaired only the instance I was shown. The production file
carried the identical shape because the insertion point was the same (my helper landed between
containerfileBaseRef's doc comment and its function), which a one-line sweep of every file thediff touched would have shown.
Root fix in this head: the region was rewritten so each of the three helpers carries its own
comment immediately above its own declaration, ordered
containerfileStageRefs→containerfileFromRefs→containerfileBaseRef, each separated by a blank line. The sweep is nowexplicit and repeatable:
grep -n '^func containerfile' -A1lists three definitions, each precededby its own block.
A durable control would be a
go/doc-based check (for every exported/unexported func, thedoc
go/docassociates with it must exist and must not name a different symbol); this repo does notrun one today, and adding a linter is its own change, so it is recorded here rather than smuggled
into this fix. Until then the class is covered by review, and this RCA is the record of why.
Filed issues
krun-hostcomposition oflayer-containerdwarns onevery validate/check run, and
box validatecounts0 warningswhile printing the warning.Disposition: pre-existing on
origin/main, not on this change's path (a box composition inanother repo), so filed rather than fixed here; it is the only warning in the pasted run and
it is counted (
warnings=1), not hidden.Agent: lead
Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)