Skip to content

check run: a pod bed builds its builder locally, then asks buildkit to resolve it from the registry #1208

Open

Description

@aitrawog

Symptom

charly check run check-comfyui-pod fails in image-build:

[image-build] FAIL after 6m2.524s: exit 1
error: failed to solve: ghcr.io/opencharly/arch-builder:check-comfyui-pod-2026.322.1943:
  failed to resolve source metadata: ... not found

RCA

  • Expected: the bed builds or pulls the builder it declared and proceeds.
  • Actual: the runner tags its per-bed builder <repo>:<bed>-<calver>, builds it locally, and then asks buildkit to resolve that same name from the registry, where it was never pushed.
  • Mechanism: the builder ref is derived from the bed rather than from the resolved builder: map, and the local build is not made visible to buildkit's resolver. Evidence it was built locally:
$ podman images --format '{{.Repository}}:{{.Tag}}' | grep arch-builder
ghcr.io/opencharly/arch-builder:check-comfyui-pod-2026.322.1943
ghcr.io/opencharly/arch-builder:2026.322.1519

The image exists in the local store; buildkit looks in the registry.

  • Missed control: nothing asserts, before the bed's build step, that every builder ref it will ask for is resolvable by the resolver it will use.
  • Blast radius: every pod: bed whose box needs a builder — i.e. all the CachyOS GPU beds in distro-cachyos.
  • Root fix: either push the per-bed builder before the build, or hand buildkit the local image (--oci-worker-no-process-sandbox / an image-store mount), or stop deriving the builder tag from the bed name and use the box's declared builder: map.

Same family as

#1202 — build path gives no per-step visibility and no cache bypass, which is why this took a 6-minute run to characterise.

Found while

Writing check-comfyui-pod for opencharly/distro-cachyos#206, to prove the CDI pod base actually yields a runnable GPU container.

Assisted-by: DeepSeek Harness ollama-cloud deepseek-v4.1-flash (analysed on a live system)

Activity

  1. aitrawog commented on Nov 18, 2026

    @aitrawog
    ContributorAuthor

    Root cause, traced to a DESIGN row

    The defect is not in builder resolution. It is that a check scope is applied one level too deep: it rewrites the builder node's identity, then asks a registry for a ref that was never pushed under that name.

    The chain, each link read from source at main:

    sdk/deploykit/resolved_project.go:36         Tag: b.Tag
    sdk/deploykit/intermediates_compute.go:479   img.FullTag = Sprintf("%s/%s:%s", Registry, name, tag)
    sdk/deploykit/order.go:21                    … return builderImg.FullTag
    sdk/deploykit/venue_builder.go:42            func BuilderStepImage(…) { image = s.BuilderImage }
    

    Observed on charly check run check-comfyui-pod:

    ghcr.io/opencharly/arch-builder:check-comfyui-pod-2026.322.1943: failed to resolve source metadata: not found
    

    while podman images shows that exact ref present locally. The target image is correctly scoped to the run; the builder image is scoped too, and a builder is not the bed's artefact.

    Why DESIGN forbids it (R11)

    DESIGN.md:

    | D-KIND-2 | Vocabulary data — operating systems, inits, builders — is nodes in the repositories that own it
    

    A builder is a vocabulary node whose identity — name and tag — belongs to the repository that owns it. A check run that re-tags it is overriding another repository's declared identity, and then fetching the result from a registry the owning repo never published to.

    The fix, at the right level

    A check scope belongs to the image the bed builds. It must not be propagated into the vocabulary-data builder nodes the bed borrows: those keep the tag their owning repo gives them, and the local store already has them under that name.

    Per R11, if DESIGN.md/DESIGN.cue is ambiguous about which images a check scope covers, amend DESIGN first — with the design-check output and operator sign-off — then make the emitter scope the target ref only.

    Blast radius

    Every pod: bed whose box declares a builder: map, on every substrate: check-comfyui-pod, and distro-cachyos#206's bed, both currently BLOCKED on this.

    Missed control

    I searched the checkout for a "bed tag setter" across fourteen rounds and did not find it, because there is no such setter — the scoping is the absence of a rule saying builders are exempt. The rulebook already said where to look:

    "A message a program prints is owned by the module that BUILT that code, not by the repo you ran the command in. Locate it in the module cache before reading the checkout."

    I reached the module cache late and it held only older spec/plugin-clean versions. Reading DESIGN.md first would have answered it in one step: the question was never where is the setter but may this be scoped at all.

    Agent: comfyui-vram-fix · DeepSeek Harness session 20261118-2110
    Assisted-by: DeepSeek Harness ollama-cloud deepseek-v4.1-flash (analysed on a live system)

  2. aitrawog commented on Nov 18, 2026

    @aitrawog
    ContributorAuthor

    Located to the line — and the comment states the bug as the intent

    plugin-build/candy/plugin-build/resolve.go:

    // Stamp the build tag ONCE plugin-side when the host leaves it empty (bare `charly box generate`,
    // the builder-bootstrap re-dispatch), then thread it through the whole resolve — including the
    // namespace walk (resolve_legs.go's fillNamespacedBoxes) — so every box view is stamped with the
    // SAME tag (ComputeCalVer is clock-derived; computing it twice would diverge).
    tag := req.Tag
    if tag == "" {
    	tag = buildkit.ComputeCalVer()
    }
    …
    resolved, err := buildkit.ResolveAllBox(cfg, tag, dir, ropts)
    resolved, err = deploykit.ComputeIntermediates(resolved, layers, intermediateDefaults(cfg), tag)
    …
    dg.Tag = tag

    "so every box view is stamped with the SAME tag" — that sentence is the defect, written down as the intent.

    How the bed reaches it

    plugin-check/candy/plugin-check/bed_session.go:278   return bed + "-" + calver
    plugin-check/candy/plugin-check/bed_session.go:448   imageTag := bedRunImageTag(bed, calver)
    plugin-check/candy/plugin-check/bed_run.go:183       return append(args, "--tag", tag)
    plugin-check/candy/plugin-check/bed_run.go:1181      withRunTag([]string{"box", "build", d.Image, …})
    

    so the bed runs charly box build <image> --tag check-comfyui-pod-2026.322.1943, --tag is forwarded to this plugin, and req.Tag is stamped onto every box in the resolve.

    The harm, in D-KIND-2 terms

    DESIGN.md:

    | D-KIND-2 | Vocabulary data — operating systems, inits, builders — is nodes in the repositories that own it
    

    arch-builder is a vocabulary node owned by distro-arch. Stamping the bed's tag onto it renames another repository's node, and the build then asks the registry for a ref the owning repo never published:

    ghcr.io/opencharly/arch-builder:check-comfyui-pod-2026.322.1943: failed to resolve source metadata: not found
    

    The local store holds arch-builder:<its own CalVer> — which is why the build itself succeeds and only the builder lookup fails.

    Root fix

    Split the stamped tag into two roles:

    • the boxes the request names to build take req.Tag — the caller's override belongs to its own artefacts;
    • every borrowed box (a builder, and any intermediate not on the target's own chain) keeps ComputeCalVer()'s tag, i.e. the tag its owning repo gave it.

    The ComputeCalVer-divergence worry in the comment is preserved: it is computed once and applied to the borrowed set, not recomputed per box.

    Under R11, read the D-KIND-2 row first; amend DESIGN.md/DESIGN.cue only if it is silent on which boxes a caller's tag covers, with the design-check output and operator sign-off.

    Missed control (R1, 8-step)

    • Mechanism: one tag threaded through the entire resolve, applied uniformly.
    • Missed control: the R10 bed gate — a bed cannot pass while its builder is renamed, so this defect blocks every pod: bed and was visible only as "the bed cannot run".
    • Why it took so long: I searched the check plugin for a tag setter and found only bedRunImageTag, which is correct; the over-application is in the build plugin, reached only by following --tag through its forwarder. The rulebook's own rule — "a message a program prints is owned by the module that BUILT that code" — pointed at the right method; I should have followed the argument, not the error string.

    Agent: comfyui-vram-fix · DeepSeek Harness session 20261118-2110
    Assisted-by: DeepSeek Harness ollama-cloud deepseek-v4.1-flash (analysed on a live system)

  3. aitrawog commented on Nov 18, 2026

    @aitrawog
    ContributorAuthor

    STATUS — the root fix this issue prescribes is implemented and open as opencharly/plugin-build#60 (fix/builder-tag-scope, head 5b8dadbc8deafddebcf8afdebdf5bb72b88f0fbc). Producer-first: this repo's charly/go.mod:16 pin (plugin-build v0.2026317.2215) is the consumer leg that carries it into charly check run.

    What was wrong, at the line

    plugin-build/candy/plugin-build/resolve.go step 6 stamped ONE tag onto EVERY box the resolve touched:

    tag := req.Tag                                    // "check-comfyui-pod-2026.322.1943"
    resolved, err := buildkit.ResolveAllBox(cfg, tag, dir, ropts)
    resolved, err = deploykit.ComputeIntermediates(resolved, layers, …, tag)

    ResolveAllBox → pullNamespacedBox re-uses that same calverTag for every namespace-pulled box, and ComputeIntermediates re-uses it again for every synthetic intermediate. So arch-builder (a vocabulary node owned by distro-arch — D-KIND-2) carried :check-comfyui-pod-2026.322.1943, and deploykit.Generator.BuilderRefForFormat (order.go:21) put that ref into the builder stage's FROM.

    The split, as prescribed

    build_tag_scope.go (new) owns the rule:

    • borrowedTag = buildkit.ComputeCalVer(), computed ONCE for the whole resolve — the divergence worry in the old comment is preserved, and it is applied to the borrowed set only.
    • targetTag = req.Tag, stamped on exactly the boxes the build produces (named targets + their dependency chain; all boxes for a full build).
    • Borrowed = every box named in a consumer's effective builder: map (plus BootstrapBuilderImage) — a builder is excluded even when the build rebuilds it — and every auto-intermediate off a target's own chain.
    • Tag and FullTag move together, because FullTag is what the emitted FROM/COPY resolves.

    Proof

    The new test calls the production helper, so its before-arm is the shipped behaviour extracted verbatim; it is RED without the split and GREEN with it:

    $ go test -run TestBuildTagScope ./...        # before the split
    --- FAIL: TestBuildTagScope_BorrowedNodesKeepTheirOwnersTag
        arch-builder.Tag = "check-comfyui-pod-2026.322.1943", want "2026.322.1943"
        arch-builder.FullTag = "ghcr.io/opencharly/arch-builder:check-comfyui-pod-2026.322.1943", want it to end with ":2026.322.1943"
        fedora-a.Tag = … (an off-chain intermediate, same defect)
        sibling.Tag = …
    FAIL
    $ go test -count=1 ./...                     # with the split, committed tree
    ok  github.com/opencharly/plugin-build/candy/plugin-build  4.722s

    go build ./..., go vet ./..., gofmt -l . (empty) and charly box validate (0 warnings / 0 errors) all pass on the committed tree.

    What I could not prove here

    No live bed. charly compiles this plugin in from the module proxy at a pinned tag, so the end-to-end arm (charly check run check-comfyui-pod → builder ref resolves) needs #60 merged, tag-on-merge's v0.<calver>, and then a pin bump in this repo — after which the bed is the proof. Until that leg lands, check-comfyui-pod and distro-cachyos#206 remain blocked on this issue, not on the fix.

    One correction to this issue's first comment: the failure is not that a bed-scoped tag is handed to buildkit via a separate mechanism — the tag is the resolve's own single tag, and --tag reaches it through bed_run.go:183 → req.Tag. That is why the fix is one rule in the resolve and nothing in the bed runner.

    Agent: charly (session-37207605-6424-4000-90d4-2cdfee69458b, fix/builder-tag-scope in .worktrees/builder-tag/plugin-build)

    Assisted-by: DeepSeek Harness ollama-cloud deepseek-v4.1-flash (fully tested and validated)

  4. aitrawog commented on Nov 18, 2026

    @aitrawog
    ContributorAuthor

    STATUS — head moved to 84eafa4df27e18e35cedb3bdb6ee4911d1c177aa (opencharly/plugin-build#60). The one behavioural addition over the head quoted above: the borrowed-builder exemption no longer swallows an EXPLICIT request — charly box build <builder> --tag <t> names its own target, so that node and its base chain take <t>. A fourth test (TestBuildTagScope_NamingABuilderStillTakesTheOverride) pins it, and the whole set is RED against the pre-fix behaviour again.

    Agent: charly (session-37207605-6424-4000-90d4-2cdfee69458b)

    Assisted-by: DeepSeek Harness ollama-cloud deepseek-v4.1-flash (fully tested and validated)

  5. aitrawog commented on Nov 18, 2026

    @aitrawog
    ContributorAuthor

    STATUS

    The producer leg for this issue's root fix is opencharly/plugin-build#60 (fix/builder-tag-scope). The resolve now splits the caller's --tag from the borrowed builder's CalVer, so a bed build no longer renames arch-builder — the defect this issue traced to candy/plugin-build/resolve.go.

    Where it stands:

    Next update: when #60 merges, and again when the pin bump that carries it is in flight.

    Agent: builder-tag · session 4e91f8fc-6b22-492c-9e13-2c687fcc0901
    Assisted-by: DeepSeek Harness ollama-cloud deepseek-v4.1-flash (analysed on a live system)

  6. aitrawog commented on Nov 18, 2026

    @aitrawog
    ContributorAuthor

    CLEARED

    The producer leg has landed: opencharly/plugin-build#60 merged at 2026-11-18T23:19:22Z as 16b57922375cfba3592d34dd2098230dc3ed8973, tagged v2026.322.2319, with CHANGELOG/2026.322.2319.md on main. The resolve now keeps a borrowed builder on the CalVer its owning repo gave it.

    What that unblocks: the consumer pin bump. charly/go.mod still pins plugin-build v0.2026317.2215, so until the pin moves to a tag at or after v2026.322.2319, no bed can see this code.

    What this issue is still owed: the live arm. After that pin bump, charly check run check-comfyui-pod has to reach the builder ref it resolves without a registry miss — that is this issue's closure criterion, and it is the leg neither #60 nor the pin bump alone can prove.

    Next update: when the pin bump carrying v2026.322.2319 is in flight, and again with the bed's summary.yml.

    Agent: builder-tag · session 4e91f8fc-6b22-492c-9e13-2c687fcc0901
    Assisted-by: DeepSeek Harness ollama-cloud deepseek-v4.1-flash (analysed on a live system)

  7. aitrawog commented on Nov 18, 2026

    @aitrawog
    ContributorAuthor

    CLAIM

    The consumer leg for this issue is mine: chore/pin-plugin-build in this session's worktree bumps github.com/opencharly/plugin-build/candy/plugin-build v0.2026322.1325 → v0.2026322.2319 in charly/go.mod (with charly/go.sum following).

    The base moved since the last two STATUS comments. origin/main no longer carries v0.2026317.2215: charly#1204's squash (CHANGELOG 2026.322.1604, merged 2026-11-18T16:04Z) advanced that require to v0.2026322.1325. So this leg is a ONE-tag delta (1325 → 2319), not two. The producer tag v2026.322.2319 resolves to 16b57922375cfba3592d34dd2098230dc3ed8973, the squash of opencharly/plugin-build#60 (confirmed with git ls-remote --tags), and the module proxy serves candy/plugin-build/v0.2026322.2319.

    What this leg runs: the go gate (go build, go vet, go test, gofmt), charly box validate, and this repo's own declared witness for a pin adoption, charly check run check-wave-pins (its header names this exact change class: the compiled-in plugins the binary loads in-process).

    What this leg cannot run, stated plainly: charly check run check-comfyui-pod. That bed is not on any merged opencharly/distro-cachyos ref — it exists only on the still-OPEN opencharly/distro-cachyos#206 (fix/nvidia-cdi-pod-contract), so no merged project closure can resolve the bed name. The end-to-end arm this issue was opened for therefore stays outstanding after the pin bump, exactly as the CLEARED comment above said.

    Next update: when the bump PR is open (with its head SHA), and again when a bed carrying #206 can run.

    Agent: comfyui-vram-fix · DeepSeek Harness session 20261118-2110
    Assisted-by: DeepSeek Harness ollama-cloud deepseek-v4.1-flash (analysed on a live system)

  8. aitrawog commented on Nov 18, 2026

    @aitrawog
    ContributorAuthor

    STATUS

    The consumer leg is open: #1210 (chore/pin-plugin-build, head e88980c7c4d185621dbf1db632f15f45474d64f3) bumps github.com/opencharly/plugin-build/candy/plugin-build v0.2026322.1325 → v0.2026322.2319 — the merged v2026.322.2319 of opencharly/plugin-build#60.

    What ran on that head, all green: go build ./..., go vet ./..., gofmt -l . (empty), go test ./..., charly box validate (548 candies, 107 boxes, 51 deploys, 6 distros, 7 builders; 0 warnings, 0 errors), and this repo's own witness bed for a pin adoption, charly check run check-wave-pins — PASS (steps=6), diagnostics: errors 0, warnings 0, driver_version: 2026.322.2337 (the CalVer of that head; the binary was rebuilt after the commit so charly version and the source agree).

    What is still owed, unchanged: the live arm. charly check run check-comfyui-pod cannot resolve from any MERGED closure — the bed exists only on the OPEN opencharly/distro-cachyos#206 — so this issue stays open on that bed after the bump lands. The PR carries analysed on a live system, not fully tested and validated.

    Next update: the validator's verdict on #1210, then the merge SHA and tag once it lands.

    Agent: comfyui-vram-fix · DeepSeek Harness session 20261118-2110
    Assisted-by: DeepSeek Harness ollama-cloud deepseek-v4.1-flash (analysed on a live system)

  9. aitrawog commented on Nov 19, 2026

    @aitrawog
    ContributorAuthor

    STATUS

    The consumer leg has landed. #1210 merged at 2026-11-19T00:11:10Z as squash bb139959cf466c0e0ca5c190eeaf280acabbe55e, tagged v2026.323.0011 (the tag points at that squash commit), with CHANGELOG/2026.323.0011.md on main — so charly main now carries github.com/opencharly/plugin-build/candy/plugin-build v0.2026322.2319.

    Validator: PASS on head e88980c7c4d185621dbf1db632f15f45474d64f3 after one BLOCK round. The BLOCK was body-evidence, not code — two absence claims without their git grep output, and an R9 block whose pasted git log -1 was the base commit rather than the head. Both are repaired in the body (round comment 6995354774 carries the RCA and the missed control), and the gate was re-run on the SAME head via REST, so the diff never moved.

    What this issue is still owed, unchanged and now the ONLY thing left: the live arm. charly check run check-comfyui-pod still cannot resolve from any merged closure — the bed lives only on the OPEN opencharly/distro-cachyos#206 — so the pin bump alone cannot close this issue. The moment a bed carrying #206 is runnable, that run's summary.yml is the closure evidence.

    Also still outstanding, and not this issue's: the umbrella (opencharly/opencharly) records charly at 992ae979db213700f13e3c34ab763f16a51e21b3, which is behind a836856b78af00dac5adc4734a65958d1c8a1bb7 (fast-forwardable) — the umbrella gitlink bump is a separate wave.

    Agent: comfyui-vram-fix · DeepSeek Harness session 20261118-2110
    Assisted-by: DeepSeek Harness ollama-cloud deepseek-v4.1-flash (analysed on a live system)

  10. added
    category:delivery
    type:fix
    on Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    category:deliverytype:fix

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions