Repository navigation
fix(ensure): pull an external base as written, and never build a box as its own base - #62
Conversation
…as its own base plugin-build#61: from clean storage every debian- and ubuntu-family box deadlocked on its own image lock (`box build debian`, `base: debian:13`). Two defects, both fixed at their source: resolveImageRefPlugin returned "" for a ref that is not a project box, so an external image like debian:13 was never pulled; and buildableShortNamePlugin mapped any ref onto a box by leaf name, so Docker Hub's debian:13 became the box being built. Now an external image is pulled as written, a ref maps onto a box only when it NAMES that box (its bare key or its own published registry/name), and the ensure path for a box's base refuses a fallback onto that same box (selfBaseError — the invariant, which also holds for a registry-less project). Each rule is tested and mutation-checked. Claude-Session: https://claude.ai/code/session_01Tvdn3vtn8FoWTMqGwqn4ZT Agent: kde-cstream · Claude Code session 25c0bf9d-28ad-4716-bc1b-5ca2118cc942 Assisted-by: Claude Code Claude Opus 5.5 (analysed on a live system)
Review — PASSHead SHA: Security screen: PASS — T1 (rules read from Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
Summary
Fixes #61. From clean local storage, every debian- and ubuntu-family box deadlocked on its own image lock:
charly box build debian(base: debian:13) andcharly box build ubuntu(base: ubuntu:26.04) waited the full 30m on a lock that the same process held, then gave up. There were two defects incandy/plugin-build/ensure.go, and each is fixed at its source:resolveImageRefPluginreturned""for a ref that is neither a project box key nor a "full ref" (LooksLikeFullRefrequires a slash), so the pull branch was skipped entirely. Now a ref that is not a box of this project is an external image, pulled as written; the engine normalizesdebian:13.buildableShortNamePluginturned Docker Hub'sdebian:13into the project boxdebian, which is the box being built. Now a ref maps onto a box only when it names that box: its bare key, or the box's own published repository (registry/name, computed from the config with no local-store probe).ghcr.io/opencharly/fedora:<calver>still buildsfedora.Plus the invariant, stated where the build would start: the ensure path for a box's base carries that box (
self), andselfBaseErrorrefuses a fallback onto that same box with a clear error instead of a self-wait. This also holds for a registry-less project, where rule 2 alone cannot telldebian:13fromdebian. Thebuild:ensureword passes noself, so its behaviour is unchanged.candy/plugin-build/ensure.gorepositoryOf,publishedRepository),selfBaseError,selfthreadedcandy/plugin-build/buildkit.goensureBaseImagepasses the box whose base it ensurescandy/plugin-build/ensure_base_resolve_test.gocandy/plugin-build/base_image_test.goHow tested
Head
39620228b3fe802e5ad54f98e1f9ac95d5c82fb0;git diff --stat --diff-algorithm=myers origin/main...HEAD:4 files changed, 152 insertions(+), 19 deletions(-). This repo's gate (AGENTS.md), on that tree (GOTOOLCHAIN=go1.26.8):Before, with the current binary (2026.324.2014) on a pristine
opencharly/distro-debianateb7dc2c:The same happened for
opencharly/distro-ubuntu(base: ubuntu:26.04).After, with a worktree-local dev build of charly
mainplus this branch, on the same pristine tree:R7: each rule was reverted by a mutation the harness verified had applied, and its test failed:
Rulebook compliance
/charly-build:build,/charly-build:generate,/charly-image:image,/charly-internals:plugin,/charly-internals:git-workflow(this repo'sAGENTS.mdlist), plus/charly-internals:strict-policy,/charly-internals:root-cause-analyzer,/charly-internals:goand/charly-check:check.registryfieldsresolveImageRefPluginreads.box buildnow does what it says for an external base.git statusclean; branchfix/ensure-external-baseoff freshorigin/main; PR-only, no force-push, no hook bypass.2026.324.2014from charlymainplus this branch; the gate ran on this exact commit.Change classification
Bug fix in the build plugin's ensure contract, with no wire or schema change. Behaviour change for one input class only: an unqualified external image that shares a project box's leaf name is now pulled, where before it was misbuilt as that box.
Filed issues
none — the defect fixed here is #61 itself.
Closes #61 · found while proving opencharly/sdk#598 (tracking opencharly/opencharly#1201).
https://claude.ai/code/session_01Tvdn3vtn8FoWTMqGwqn4ZT
Agent:
kde-cstream· Claude Code session25c0bf9d-28ad-4716-bc1b-5ca2118cc942Assisted-by: Claude Code Claude Opus 5.5 (analysed on a live system)