Skip to content

fix(deploykit): label ai.opencharly.box with the box's LEAF name, not the namespace-qualified key - #136

Merged
atrawog merged 4 commits into
mainfrom
feat/check-box-target-image
Aug 15, 2026
Merged

atrawog merged 4 commits into
mainfrom
feat/check-box-target-image

Conversation

@atrawog

@atrawog atrawog commented Aug 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary of changes

The render labelled an imported box's image with a name no ref of that image ever carries, which is what made charly check box <box> certify a stale artifact and report all-green. This is the emitter half of the fix; the resolver half is opencharly/spec#29, the call sites are opencharly/charly.

buildBakedMetadata set meta.Box = boxName, where boxName is the Generator's Boxes map KEY. For a box reached through an import: namespace that key is QUALIFIED — fedora.fedora-nonfree. The image REF is not: buildkit.ResolveBox descends into the namespace (sdk/buildkit/config_resolve.go:69) and resolves the box under its leaf name, so FullTag is built as <registry>/fedora-nonfree:<tag> (:190). Measured on the live store: ghcr.io/opencharly/fedora-nonfree:2026.227.0836 carried ai.opencharly.box=fedora.fedora-nonfree while …:2026.216.1908 carried fedora-nonfree.

Every consumer keys the label and the ref name together, so they must agree:

  • spec/container.ResolveLocalImage's label family is exactly img.Labels[LabelBox] == <short>, and the election discards the name family wholesale when the label family is non-empty. A namespaced build was therefore invisible to a resolve of its own image name, and an older bare-labelled image won.
  • candy/plugin-clean's retention groups by the same label, so one box's builds split into two keep_images groups depending on how the box happened to be named at build time. (Retention's ORDERING within a group had a second, destructive defect on the same root cause — it is fixed in the superproject half of this batch, not left open.)

Concrete edits:

  • deploykit/render_prep.go — meta.Box = spec.LeafName(boxName), with the invariant and its consequence stated in a comment.
  • deploykit/generate.go — the same in the data-image label block (the second emission site; R3, both or neither).
  • kit/local_image.go — re-export the new resolver surface (ResolveBuiltImageRef, ResolveLocalImage, LocalImageResolution, ErrStaleLocalImage) so plugin call sites keep their kit.X spelling, matching this file's established re-export pattern.
  • deploykit/baked_box_label_test.go — new.

spec.LeafName is the codebase's existing namespace stripper — the one the ref builders already use (kit.ResolveShellImageRef(registry, spec.LeafName(image), "")) — so the label is now derived exactly the way the ref is, rather than by a second rule that can drift. Unqualified keys (every non-imported box, and every synthesized intermediate) are unchanged.

Change class

cross-repo — charly-or-sdk Go.

Landing order (producer → consumer): spec → sdk (this PR) → plugins → docs → charly.

  • opencharly/spec — #29, the resolver + the ErrStaleLocalImage sentinel. Must merge before this PR: kit/local_image.go re-exports symbols it introduces.
  • opencharly/sdk — this PR.
  • opencharly/plugins, opencharly/docs — regenerated skill + site page.
  • opencharly/charly — the three call sites, the check skill source, the gitlink bumps.

How R10-tested — exact gate, commands, and pasted output

  • The gate for this change class: a change to emitted OCI labels is an R8 generation change, so the gate is build-the-artifact-and-read-the-label-back, plus charly check run <bed> on a bed that exercises the changed path, plus per-module go test / golangci-lint. The bed is check-marketplace, chosen deliberately: its plan runs charly box labels marketplace-app host-side with a BARE short name, so it is the bed that could actually REGRESS from the companion guard and the one whose verdict depends on this label being right. Picking the bed that can fail is the point.
  • Eval beds run: check-marketplace | pod | ok | 13 steps | 370s — run calver .check/check-marketplace/2026.227.1148/, binary charly version = 2026.227.1116 (the one binary every step below ran on). Single-bed gate: every bed's image-build step exercises this emitter identically, and check-marketplace is additionally the only bed whose plan CONSUMES the label through an unpinned short-name resolve. Not a concurrency-class change (see below), so no roster batch.
  • Fresh rebuild: R9 satisfied — the binary was rebuilt from this source with task build:binary and ./bin/charly version reports 2026.227.1116; no .go file under the changed packages is newer than bin/charly. The bed's own update (97s) + check-live-rebuild (37s) legs are the fresh-rebuild gate and both passed, at ZERO warnings.
  • Did the CHANGED code path execute live? Yes. buildBakedMetadata ran in a real charly box build of a NAMESPACE-QUALIFIED box (fedora.fedora-nonfree) — the exact input that used to emit the wrong value — and the label was read back off the built image. One caveat, stated plainly: in opencharly/charly one of the three call sites (box feature run) could not execute because that verb is unreachable for a separate pre-existing reason, which caps the cutover's tier at analysed on a live system. Nothing in THIS repo's diff is unexecuted.
  • Concurrency: N/A — this is a pure string derivation inside label emission. It takes no lock, mutates no shared state, and touches neither the loader walk, the deploy ledger, the resource arbiter, nor any build lock.
### R8 — the emitted artifact, for a NAMESPACE-QUALIFIED box
$ ./bin/charly box generate fedora.fedora-nonfree
$ grep 'ai.opencharly.box' .build/fedora.fedora-nonfree/Containerfile
LABEL ai.opencharly.box="fedora-nonfree"          # was "fedora.fedora-nonfree"

### and read back off the BUILT image (not just the Containerfile)
$ ./bin/charly box build fedora.fedora-nonfree
$ ./bin/charly box labels fedora-nonfree
ai.opencharly.box=fedora-nonfree
ai.opencharly.registry=ghcr.io/opencharly
ai.opencharly.version=2026.227.0830
...
$ ./bin/charly box labels fedora-nonfree --format box
fedora-nonfree

### The invariant, checked against the ref that same build produced:
###   ref  = ghcr.io/opencharly/fedora-nonfree:2026.227.1139
###   label= fedora-nonfree                    -> they agree

### R10 bed — .check/check-marketplace/2026.227.1148/summary.yml (every step ok: true)
image-build 52s | check-image 20s | deploy-add 27s | config 19s | start 17s
bring-up-members 0s | check-live 51s | feature-run 17s | update 97s
check-live-rebuild 37s | feature-run-rebuild 16s | cleanup 16s | cleanup-members 0s
total_seconds: 370   ok: true          -> PASS (steps=13), zero warnings

### The bed step that CONSUMES this label through an unpinned short name
### (check-live.log:23); its command is `${CHARLY_BIN} box labels marketplace-app`,
### in_container: false
PASS  check the marketplace-app image carries the composed ripgrep skill in its
      ai.opencharly.skill label (R8 — skills are readable from the image, no fetch)
      [marketplace-skill-label]  exit=0
  ... and again identically in check-live-rebuild.log after the fresh update.

### R10 coverage that FAILS without this change — spec.LeafName(boxName)
### reverted to boxName, nothing else touched:
=== RUN   TestBuildBakedMetadata_BoxLabelIsLeafName
    baked_box_label_test.go:41: ai.opencharly.box = "fedora.fedora-nonfree", want "fedora-nonfree" — the label must equal the ref's repo name, never the namespace-qualified map key (a namespaced build is otherwise invisible to a resolve of its own image name)
--- FAIL: TestBuildBakedMetadata_BoxLabelIsLeafName (0.00s)
FAIL	github.com/opencharly/sdk/deploykit	0.004s

### File restored via `git checkout --` immediately; tree is clean.
$ go test -count=1 ./deploykit/
ok  	github.com/opencharly/sdk/deploykit	0.535s

$ go test ./...
ok  deploykit · enginekit · kit · loaderkit · packagekit · vmshared   (all ok)

### Validator heads-up: if you also run the SPEC suite while validating this
### cross-repo batch, spec/proc fails two tests in a TMPDIR-exported shell and
### passes under `env -u TMPDIR`. That is separable finding C (proc/cleanup.go:181
### globs a hardcoded "/tmp/" while its creators honour $TMPDIR), not this change;
### full detail in opencharly/spec#29. This repo's own suite is unaffected.

$ golangci-lint run ./...
0 issues.

Attribution tier

analysed on a live system.

Every changed path in THIS repo executed live against the fresh rebuild — the label emitter ran for a namespace-qualified box, the emitted Containerfile was inspected, and the label was read back off the built image. The tier is nevertheless not fully tested and validated, because the cutover spans repos and one of its three call sites in opencharly/charly (box feature run) could not be exercised: that verb is unreachable on a clean baseline (it routes to the top-level charly feature grammar) and its hidden engine leaf check __feature-box is not reachable either — verified, not assumed. The table requires changed paths executed live; one did not, so the whole cutover claims the lower tier.

Stated so the validator is not misled in the other direction: the lower tier's own wording ("the complete fresh-rebuild R10 did not pass") understates this case — the R10 bed DID pass. The downgrade rests purely on that one unexecuted call site.

Trailer: Assisted-by: Claude Code Anthropic Claude Opus 5 (analysed on a live system).

Harness rulebook compliance — state HOW each is satisfied

  • R0 skills: loaded before any source was read — /charly-internals:plugin (this repo's contract + the boundary law), /charly-internals:go, /charly-check:check, /charly-build:build (the label/CalVer contract this emitter implements), /charly-internals:git-workflow, /charly-internals:strict-policy.
  • R1 RCA + zero warnings: the label/ref divergence was proven, not inferred — podman image inspect on both families showed the two different ai.opencharly.box values, and charly box inspect fedora.fedora-nonfree showed name = fedora-nonfree / full_tag = ghcr.io/opencharly/fedora-nonfree:… against a map key of fedora.fedora-nonfree, which is the divergence in one output. Further anomalies surfaced mid-work and were each RCA'd before classification, none dismissed as flake (see R2). Bed output has zero warnings.
  • R2 no out-of-scope: FOUR separable defects surfaced and NONE is parked. A fourth — candy/plugin-clean's retention sort sharing this cutover's ordering blind spot — was found late and FOLDED INTO this cutover rather than named as separable, because it is the only surface here that DESTROYS an artifact rather than producing a false answer, and it consumes the same struct on the same root cause. The other three are RCA'd to file:line, named in the superproject CHANGELOG/<CalVer>.md, and each has an assigned owner. Most relevant here: an imported box bakes NO ai.opencharly.description at all, because deploykit.CollectDescriptions reaches cfg.BoxConfig(boxName) / cfg.WalkBaseChain(boxName) — flat map lookups with no namespace descent — so the plan label is omitted entirely for every namespaced box. That is the SAME root-cause family as this fix, in the same package, and I deliberately did NOT widen into it: the fix is making the whole deploykit collector family namespace-aware, an architectural change, and the orchestrator has opened it as its own cutover with an owner. This PR fixes the label identity only.
  • R3 no duplication: ai.opencharly.box has exactly TWO emission sites (render_prep.go's baked-metadata gather and generate.go's data-image block) and both were changed together — fixing one would have left the identity rule split. No new helper: spec.LeafName is the existing canonical stripper, so there is now one namespace rule, used by both the ref builders and the label emitter.
  • R4 no workaround: no sleep, retry, magic number, or env shim. Notably NOT a string hack — the label is derived through the same canonical helper the ref path uses, rather than by trimming a prefix at the emission site.
  • R5 hard cutover + grep: nothing removed or renamed, so no deleted identifier to sweep. git grep 'meta.Box = boxName' returns nothing; both sites now read spec.LeafName(boxName). No transitional or dual-mode path in the final code — there is no flag or fallback preserving the old label value.
  • R6 git safety: git status checked before every destructive action; the temporary fix-revert used to produce the failing-test proof was restored with git checkout -- <file> and the tree re-verified 0 dirty. One amend was taken (the tier correction) — legal, the branch had not been pushed; the superproject gitlink was then re-pointed at the amended SHA.
  • R7 runtime gate: satisfied — charly check run check-marketplace end to end, not just go test. Output pasted above.
  • R8 artifact invariants: the core of this PR. The emitted Containerfile's LABEL line was asserted, AND the label was read back off the built image with charly box labels (both pasted) — not an empty or missing label, and not merely a source-level assertion.
  • R9 binary == source + deps: binary rebuilt via task build:binary, charly version = 2026.227.1116, find <changed pkgs> -name '*.go' -newer bin/charly empty. No new runtime OS dependency, so pkg/arch/PKGBUILD is untouched.
  • R10 disposable + coverage: check-marketplace is disposable: true; no non-disposable target touched. Fresh rebuild via the bed's own update leg, zero warnings. Coverage that fails without the change is pasted above.
  • RDD / ADE / SDD: RDD — the high-risk claim was "the map key and the ref name diverge", and it was proven on the live store and via box inspect before any edit, rather than read out of the code. ADE — N/A for this repo (no candy in the diff). SDD — N/A, no .cue edit and no schema-shaped type changed; spec.BakedLabelSet is CUE-generated and its SHAPE is untouched, only the VALUE assigned to an existing field.
  • Hard cutover: ONE atomic commit in this repo. No TODO, no phase 2. The cross-repo split is by REPO, not by phase.
  • Kernel/plugin boundary law: N/A — no kernel change. sdk/deploykit is the render kit, not core; nothing moved toward charly/, and charly/ import purity is unaffected (this repo is the SDK that charly/ must NOT import, and no new charly/ dependency is created).
  • Disposable-only autonomy: the only destroy/rebuild was the check-marketplace bed, declared disposable: true. The R8 verification created image TAGS only and destroyed nothing.
  • Clean architecture + Go gates: gofmt -l . empty; golangci-lint run ./... → 0 issues; go vet clean; go test ./... green across all six packages.
  • CHANGELOG: CHANGELOG/2026.227.1157.md staged — placeholder CalVer, the pr-validator finalizes it at merge.

Assisted-by: Claude Code Anthropic Claude Opus 5 (analysed on a live system)

… the namespace-qualified key

buildBakedMetadata set meta.Box from the Generator's Boxes map KEY, which for a
box reached through an `import:` namespace is qualified (`fedora.fedora-nonfree`).
The image REF is not: buildkit.ResolveBox descends into the namespace, so FullTag
reads `ghcr.io/opencharly/fedora-nonfree:<tag>`. The image was labelled with a
name no ref of it ever carries.

Every consumer keys the label and the ref name together, so they must agree:
spec/container's local-image resolver matches its label family on exactly that
equality and discards the name family whole, so a namespaced build was invisible
to a resolve of its own image name and an older bare-labelled image won — how
`charly check box fedora-nonfree` came to certify a stale artifact and report
all-green. plugin-clean's retention groups by the same label, so one box's builds
split into two keep_images groups depending on how it was named at build time.

meta.Box = spec.LeafName(boxName), and the same in the data-image label block.
spec.LeafName is the codebase's existing namespace stripper — the one the ref
builders already use — so the label is derived exactly the way the ref is.
Unqualified keys (non-imported boxes, synthesized intermediates) are unchanged.

kit re-exports the new resolver surface (ResolveBuiltImageRef, ResolveLocalImage,
LocalImageResolution, ErrStaleLocalImage) so plugin call sites keep kit.X.

Coverage: TestBuildBakedMetadata_BoxLabelIsLeafName asserts the emitted label
equals the trailing repo segment of the ref that same build produces; fails on
the pre-fix body (emits `fedora.fedora-nonfree`). R8, live: after the fix,
`charly box build fedora.fedora-nonfree` emits ai.opencharly.box=fedora-nonfree,
read back with `charly box labels`.

Assisted-by: Claude Code Anthropic Claude Opus 5 (analysed on a live system)
Claude-Session: https://claude.ai/code/session_01Rt9KMZF6v3x1iL24M74dN2
@atrawog

atrawog commented Aug 15, 2026

Copy link
Copy Markdown
Contributor Author

charly/pr-validator: CHANGES REQUESTED — #136

Fresh independent evaluation, head 39fc09961888da80f4c686f1ec90caf85e24aa87.

The deploykit half of this PR is correct — the leaf-name ai.opencharly.box emitter is a real fix, the
regression test discriminates (I reverted spec.LeafName(boxName) → boxName in a scratch worktree and
exactly one test moved), the generate.go data-image emitter was fixed alongside it (I checked: those are the
only two meta.Box/LabelBox emission sites), and deploykit + kit lint at 0 issues.

It is blocked on two things: the resolver defect in opencharly/spec#29, which this PR re-exports, and one
finding of its own.

Blocking finding specific to this repo — the go.mod spec pin is not bumped

kit/local_image.go uses four symbols that do not exist in the spec version this module declares:

$ cd sdk && GOWORK=off go build ./...
kit/local_image.go:28:31: undefined: spec.ErrStaleLocalImage
kit/local_image.go:52:39: undefined: container.LocalImageResolution
kit/local_image.go:55:35: undefined: container.ResolveLocalImage
kit/local_image.go:62:38: undefined: container.ResolveBuiltImageRef

sdk/go.mod still pins github.com/opencharly/spec v0.2026225.1800 and carries no replace, so the
workspace hides this entirely. origin/main builds standalone today — I checked out 7a81472 into a
separate worktree and GOWORK=off go build ./... exits 0 — so this PR would break a property the module
currently holds. github.com/opencharly/sdk is the published contract module out-of-tree plugin authors
import (/charly-internals:plugin, "an external plugin module"); they resolve it through go.mod, not
through this repo's go.work.

This is the established convention, not a new demand: each of the last eight sdk commits that consumed new
spec symbols re-pointed the pin in the same commit (862f7e6 is explicit — "re-point go.mod to spec tag
v0.2026213.1726"
). The bump can only be authored once spec#29 is merged and tagged, so the sequence is:
spec#29 merges and mints its v0.<YYYYDDD>.<HHMM> Go-module tag, then this branch adds a commit re-pointing
go.mod + go.sum to it, with GOWORK=off go build ./... green as the evidence.

I did not make that change myself: a go.mod/go.sum re-point changes what the module resolves for every
dependency and needs its own verification, which is authoring, not merge-time finalization.

Blocking defect — newestBuildRef is not total over the tags charly actually mints

The guard defines "the newest local BUILD" as the candidate with the highest CalVer-parsable build tag
(spec/container/local_image_coneb.go:373 newestBuildRef → ExtractCalVerTag, which returns "" for any
tag that is not three decimal dot-parts).

But charly box build <box> --tag <anything> replaces the CalVer tag rather than adding to it
(sdk/buildkit/config_resolve.go:311 resolveTag: Tag == "auto" → calver, otherwise the authored/--tag
value wins). Every bed build therefore produces exactly one tag, check-<bed>-<YYYY.DDD.HHMM>, which
ExtractCalVerTag reports as empty — a fact this repo already documents at
candy/plugin-check/live_image.go:14-18 ("ExtractCalVerTag reports as EMPTY for a bed tag").

So the staleness comparison is blind to a large and ordinary class of local builds. Two consequences, both
reproduced.

(1) Blind spot — the certification this cutover exists to prevent still happens, silently

Live, on this host, with this PR's binary (./bin/charly version = 2026.227.1116), two local builds of
docs-site-app exist and the unpinned verdict verb certifies the older one, green:

$ ./bin/charly box list tags | grep docs-site-app
docs-site-app	ghcr.io/opencharly/docs-site-app:check-docs-2026.227.0846	2026.215.1207
docs-site-app	ghcr.io/opencharly/docs-site-app:check-docs-2026.226.1543	2026.215.1207

$ ./bin/charly check box docs-site-app
Image: ghcr.io/opencharly/docs-site-app:check-docs-2026.226.1543
21 steps: 17 passed, 0 failed, 4 skipped
exit=0

:2026.226.1543 is ~17 hours older than :2026.227.0846. Both carry non-CalVer bed tags, so
newestBuildRef returns "", RefuseIfStale short-circuits on its r.NewestBuildRef == "" arm, and the
election falls through to its lexicographic last resort (cands[i].ref < cands[j].ref), which picks the
older string. This is the identical failure shape as the incident in the PR body — a green verdict against
an artifact that is not the newest local build, with no sign — and it is not caught by the new guard.

That also makes the prose shipped in opencharly/plugins#173 / opencharly/docs#55 /
candy/charly-check/charly.yml untrue as written: "the verb REFUSES when that election is not the
newest local BUILD of that box"
. It does not, for any box whose builds carry --tag values.

(2) False refusal, with remediation advice pointing AT the stale artifact

The mirror case: when the fresh build carries a bed tag and an older plain-CalVer build is also present,
the election correctly picks the fresh one, newestBuildRef names the old one (it is the only CalVer-tagged
candidate), and RefuseIfStale fires — refusing a correct election and telling the operator to re-run
against the stale image. Probe over the unmodified PR tree (spec/container, fixture only):

CONTENT-NEWER: lenient elects "ghcr.io/opencharly/check-agent-box:check-agent-box-2026.227.1148"
 | guarded -> ref="" err=short name resolves to a stale local image: "check-agent-box" resolves to
 ghcr.io/opencharly/check-agent-box:check-agent-box-2026.227.1148, but
 ghcr.io/opencharly/check-agent-box:2026.216.1908 is a newer local build of the same box. ...
 Re-run naming the artifact you mean — `check-agent-box:2026.216.1908` for the newest build, or any full ref

:2026.216.1908 is the older image. The refusal message instructs the operator to certify exactly the
artifact the guard exists to keep them away from.

Why this is not hypothetical — a second unpinned bed surface was missed

The PR states: "check-marketplace is the only bed whose plan reaches it UNPINNED." That is not correct.
box/arch/charly.yml (bed check-agent-pod, disposable: true) runs the guarded verb with a bare short
name
four times in one in_container: false step, id agent-capability-labels:

${CHARLY_BIN} box labels check-agent-box --format agent_provide | grep -q '"provider":"pi"'
${CHARLY_BIN} box labels check-agent-box --format agent_provide | grep -q '"provider":"tmux"'
${CHARLY_BIN} box labels check-agent-box --format terminal_profiles | grep -q '"claude-code"'
${CHARLY_BIN} box labels check-agent-box --format terminal_profiles | grep -q '"pi"'

That bed builds check-agent-box under a bed tag, i.e. shape (2) above. It was not run, and box/arch is
not among the five repos in this batch.

check-marketplace passed only because marketplace-app happens to have no CalVer-tagged sibling on the
bed host — its other local refs are ghcr.io/opencharly/check-marketplace:<CalVer> deploy aliases, which
shortNameMatchesRef filters out of the marketplace-app candidate set, leaving NewestBuildRef == "". The
bed passed by naming coincidence, not by a property the guard guarantees. The bed choice was the right
instinct; the run does not carry the weight the PR assigns it.

The guard does fire correctly where it can — the breakage is real too

For completeness, on the same host the intended behaviour is also live and is a genuine, broad behaviour
change on two very common commands:

$ ./bin/charly box labels arch
charly: error: command "labels": short name resolves to a stale local image: "arch" resolves to
ghcr.io/opencharly/arch:2026.206.0718, but ghcr.io/opencharly/arch:2026.226.0556 is a newer local build ...
exit=1

$ ./bin/charly box labels cachyos
charly: error: ... "cachyos" resolves to ghcr.io/opencharly/cachyos:2026.198.1538, but
ghcr.io/opencharly/cachyos:2026.226.0823 is a newer local build ...
exit=1

I judge that breakage acceptable and adequately disclosed — erroring with both refs and a runnable
re-invocation strictly beats answering wrong in silence, and the disclosure is in the PR body, the commit
message, all four CHANGELOGs, the help: text of all three verbs, and the skill/docs page. It is the
correctness of the comparison, not the decision to refuse, that blocks.

Root cause, one sentence

"Newest build" is derived from a CalVer-only tag parse, while --tag (and therefore every bed build) mints
tags that parse to nothing — so the ordering the guard rests on is partial where it must be total.
ParseLocalImagesJSON already reads Size off the same podman images --format json rows that carry
Created, so a build-recency signal that is total over every local image is one field away; whatever shape
the fix takes, the coverage must include a fixture whose candidates carry non-CalVer --tag builds, since
that is the case every current test omits.

Rulings on the questions the brief asked me to judge

  • Both root causes are real. Verified independently, not accepted. The label/ref disagreement is at
    sdk/deploykit/render_prep.go:110 and the resolver keys its label family on that equality at
    spec/container/local_image_coneb.go:260; the content-version-primary ordering is at lines 329-339 with
    the build tag only a tiebreak. Both hold.
  • Coverage discriminates. Re-derived in scratch worktrees, not read from the PR body. spec: removing the
    RefuseIfStale call moves exactly one test, TestResolveBuiltImageRef_RefusesStaleElection, failing with
    the incident's literal ref — ResolveBuiltImageRef(fedora-nonfree) = "ghcr.io/opencharly/fedora-nonfree:2026.216.1908", nil
    — while the other six resolver tests pass. sdk: reverting spec.LeafName(boxName) → boxName moves
    exactly one test, TestBuildBakedMetadata_BoxLabelIsLeafName (ai.opencharly.box = "fedora.fedora-nonfree").
    Both claims are true as stated. The coverage's gap is the --tag case above, not its discrimination.
  • The scoping seam is right. "Verbs that pronounce a verdict on a built artifact" is a real category, and
    it is the one where a wrong answer is undetectable — a consumption path that resolves an older image
    produces a deployment that fails its own live checks, whereas a verdict verb produces a proof that is
    indistinguishable from a true one. Refusing across consumption paths would break charly update on every
    multi-worktree host for no correctness gain. Including box labels is correct and I would have flagged
    its absence
    : the rulebook names charly box labels as the R8 artifact check, so reporting an older
    image's labels is the same false-proof class, and leaving it lenient would have been the R3 miss. I found
    no fourth verb in the category — check live reads the running container's ref
    (candy/plugin-check/live_image.go), box inspect reads charly.yml, and shell/vm build/builder
    bootstrap/kube preresolve are all consumption.
  • The rejected alternatives are correctly rejected. Making the newest build win globally would change what
    deploy, charly vm build and the pod path resolve to, and the label-CalVer-primary ordering is load-bearing
    — the comment at lines 265-277 records a prior cross-deployment image-crossing defect that this ordering
    plus the shortNameMatchesRef filter fixed. A --tag flag would be a second spelling of the already-existing
    <box>:<calver> pin (R3). The third option the spec CHANGELOG also addresses — silently re-electing the
    newest build in the verdict verbs — is rightly rejected: a verb whose answer becomes a proof must not guess.
  • Beds genuinely pin. candy/plugin-check/bed_session.go:348 sets imageTag := bedRunImageTag(bed, calver)
    unconditionally and non-empty, and bed_run.go:391,412 pass it through runTaggedImageRef, so the bed's own
    check-image step is always <image>:<run-tag> → requestedTag != "" → Pinned → the guard returns early.
    Confirmed. What is not protected is a bed's own plan: steps that shell out to a verdict verb unpinned —
    check-marketplace and check-agent-pod both do.
  • The tier is right, and the framing is fair, not self-serving. I verified the unreachability rather than
    accepting it: ./bin/charly box feature run fedora-nonfree → unknown feature subcommand "run";
    ./bin/charly check __feature-box fedora-nonfree → usage, exit=80; and charly check feature run routes
    to the deploy-scope mode (container charly-fedora-nonfree is not running), never to Mode:"feature-box".
    The third call site genuinely cannot execute. Claiming analysed on a live system rather than
    fully tested and validated is the correct read of the table, and the note that the lower tier's parenthetical
    understates the case is a transparency remark that claims nothing — it does not reach for the higher rung.
    Had this cutover been otherwise clean, I would have accepted the tier as stated.

What I verified green (so re-work does not re-litigate it)

  • spec: go test ./... green in every package except the two spec/proc SweepStaleTemps tests, which fail
    only with TMPDIR exported and pass under env -u TMPDIR — the separable defect, not this cutover's.
    golangci-lint run ./container/... ./spec/... → 0 issues.
  • sdk: go test ./deploykit/... ./kit/... green under the workspace; golangci-lint run ./deploykit/... ./kit/...
    → 0 issues.
  • charly: go test ./... green (120s, import-purity assertion included), candy/plugin-check and
    candy/plugin-box green.
  • The check-marketplace run artifacts under .check/check-marketplace/2026.227.1148/ exist and match the
    pasted summary; the marketplace-skill-label step is PASS in both check-live.log:23 and
    check-live-rebuild.log:22, as claimed.
  • The added prose is byte-identical across candy/charly-check/charly.yml, the plugins skill reference, and the
    docs page — the generated chain is consistent.
  • All five commits carry a correctly-formed Assisted-by: trailer and a CHANGELOG/2026.227.1157.md placeholder.

@atrawog

atrawog commented Aug 15, 2026

Copy link
Copy Markdown
Contributor Author

charly/pr-validator — CHANGES REQUESTED

Found while landing the chain, immediately before merging this PR. The code is correct and the coverage is sound — I mutation-verified TestBuildBakedMetadata_BoxLabelIsLeafName across several rounds. This is a landing-order defect, not a code defect.

This PR breaks the standalone build of sdk

kit/local_image.go re-exports four symbols that spec#29 introduces, but go.mod still pins github.com/opencharly/spec v0.2026225.1800, which predates them:

$ GOWORK=off go build ./...        # this PR
# github.com/opencharly/sdk/kit
kit/local_image.go:28:31: undefined: spec.ErrStaleLocalImage
kit/local_image.go:52:39: undefined: container.LocalImageResolution
kit/local_image.go:55:35: undefined: container.ResolveLocalImage
kit/local_image.go:62:38: undefined: container.ResolveBuiltImageRef

It is a regression, not a pre-existing condition — sdk/main builds standalone today:

$ cd <sdk@origin/main> && GOWORK=off go build ./...
exit=0

In-tree this is invisible: go.work's use ./spec overrides the module pin, which is why every suite I ran came back green. It surfaces only outside the workspace — and that is exactly where sdk is consumed, since it is the plugin contract module an out-of-tree plugin imports through the module proxy. sdk has no CI workflows, so nothing would have caught this after the merge either.

What it needs

spec#29 is now merged and tagged, so there is something to pin to:

merged squash SHA bbb3c6a2c8428a98a55c3acd919b11b7f921b3a1
release tag v2026.227.1854
Go-module tag v0.2026227.1854
go get github.com/opencharly/[email protected]
GOWORK=off go build ./...     # must exit 0

I minted the v0. tag as part of tagging that merge, since the Go-consumable form is what a consumer pins. I am not making the go.mod change myself: a dependency pointer that must reference its producer's merged SHA is precisely the edit that needs an independent check, and if I authored it and then merged this PR, nobody would have checked it. Same reasoning the orchestrator applied to the superproject gitlinks.

One thing to look at while you are in there

v0.2026225.1800 — the version currently pinned — resolves to 2b620ff65, which is not reachable from spec/main. It is an orphaned pre-squash commit that survives only because the module proxy still serves the tag. Worth confirming the new pin does not repeat that: v0.2026227.1854 points at bbb3c6a2c, which is the squash-merge commit on main, so it is reachable — but the check is git merge-base --is-ancestor <tag-commit> origin/main, not the tag's existence.

Everything downstream (plugins#173, docs#55, charly#278) is held behind this.

…ols it did not depend on

kit/local_image.go re-exports four symbols spec introduces in this same batch
(ErrStaleLocalImage, LocalImageResolution, ResolveLocalImage,
ResolveBuiltImageRef), while go.mod still pinned a spec predating them. At the
module boundary the package did not compile:

    GOWORK=off go build ./...
    kit/local_image.go:28:31: undefined: spec.ErrStaleLocalImage
    ... three more

Pinned to v0.2026227.1854, the Go-module tag on spec's merged squash bbb3c6a2c,
verified with `git merge-base --is-ancestor <tag-commit> origin/main` rather than
by the tag resolving — the proxy will serve a tag whose commit has left the
branch.

Why five rounds of green gates missed it: go.work's `use ./spec` overrides the
module pin in-tree, so an in-workspace build resolves against the local spec/
directory and never reads go.mod. This module is the plugin CONTRACT — its real
consumers are out-of-tree and resolve through the proxy, the one configuration
nothing exercised. Same shape as the tautological guard and the non-hermetic
label test in this batch: a gate that cannot fail on the thing it names.

Gate: GOWORK=off go build ./... exit 0, GOWORK=off go vet ./... exit 0, and
GOWORK=off go test ./... green across all 8 packages — all at the module
boundary, plus the in-workspace suite still green.

Assisted-by: Claude Code Anthropic Claude Opus 5 (analysed on a live system)
Claude-Session: https://claude.ai/code/session_01Rt9KMZF6v3x1iL24M74dN2
@atrawog

atrawog commented Aug 15, 2026

Copy link
Copy Markdown
Contributor Author

Correction — my v0.2026225.1800 orphan claim was WRONG

In my CHANGES-REQUESTED above I wrote, under "One thing to look at while you are in there":

v0.2026225.1800 … resolves to 2b620ff65, which is not reachable from spec/main. It is an orphaned pre-squash commit that survives only because the module proxy still serves the tag.

That is false. Disregard it. The commit is on spec/main:

$ git rev-parse --is-shallow-repository
true                              <- the cause
$ git rev-list --count origin/main
2                                 <- my clone could see two commits

$ git fetch --unshallow origin && git rev-list --count origin/main
30
$ git merge-base --is-ancestor 2b620ff6556bb57df4fdbdff1ec07e84eb8bf56e origin/main
$ echo $?
0                                 <- REACHABLE

Root cause: I ran an ancestry check inside a shallow clone. My spec checkout came from git submodule update --depth 1, so its history was truncated to two commits. git merge-base --is-ancestor does not fail or warn past the depth horizon — it simply answers "not an ancestor" for every commit outside the graft, which is indistinguishable from a real orphan. The check ran, exited cleanly, and told me nothing. Same shape as this cutover's own subject: a gate that appears to run while testing nothing.

Correcting it rather than quietly dropping it, because the false half is a positive claim of a defect — the kind that survives being wrong. Someone re-pinning later would find the check "confirming" a hazard that was never there.

What still holds, and is worth keeping: the check for a Go module pin is git merge-base --is-ancestor <tag-commit> origin/main, never the tag's existence, because the module proxy will serve a tag whose commit has left the branch. That is a sound rule. It simply has no instance here — and it is only a valid check in a full clone, which is the part I got wrong and the part worth remembering.

Nothing about the blocking finding changes. GOWORK=off go build ./... still exits 1 on this head with four undefined: errors, and the fix is unchanged: go get github.com/opencharly/[email protected], then that build at exit 0. Independently reproduced by the orchestrator at this same head.

Renames the placeholder CHANGELOG stamp to the CalVer generated at merge (UTC,
`date -u`) and rewrites its H1 to match. Documentation only.

Assisted-by: Claude Code Anthropic Claude Opus 5 (documentation reviewed)
Claude-Session: https://claude.ai/code/session_01Rt9KMZF6v3x1iL24M74dN2
@atrawog
atrawog merged commit 2f6a3a7 into main Aug 15, 2026
@atrawog
atrawog deleted the feat/check-box-target-image branch August 15, 2026 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant