Repository navigation
fix(deploykit)!: the init injection writes the composition source, not a derived view - #120
Conversation
…t a derived view #119 shipped an incomplete fix. It made a box composing only service candies install its init, and in doing so silently removed six acceptance probes from the teaching box — including the only one proving the init actually runs. Root cause: InjectInitDependsCandy wrote to buildkit.ResolvedBox.Candy, but resolved.Candy is a pure BareCandyRef normalization of the authored list (buildkit/config_resolve.go:124-126) — a DERIVED VIEW, not an independent source of truth. Writing to a derivation does not change what it derives from, so the five collectors that read the source via BoxCandyChain -> cfg.WalkBaseChain -> node.Img.Candy saw nothing: descriptions, hooks, ports, shell and volumes all lost an injected candy's contributions. Measured on box/fedora tutorial-shell, same bed, one variable changed: supervisord composed explicitly live 24 steps: 22 passed / image 24: 19 supervisord injected (#119) live 18 steps: 16 passed / image 18: 14 The ADE inversion is the serious part: the image ran supervisord as PID 1 while charly box pull + charly check box no longer tested it. The fix injects into the AUTHORED composition via cfg.SetBox, before box resolution, so ResolveBox derives it for free at every composition path. The five collectors are UNCHANGED — no signature change, no threading, no fallback, no special case naming supervisord or init. The freshOrder/freshBoxes two-pass dance in loaderkit is deleted; it existed only because injection had to run after resolve. The rejected alternative was making the collectors read the resolved boxes. That redirects readers to whichever copy was patched while leaving FillBoxPlans and every namespaced box still re-deriving from authored cfg — the same bug class in a second location, and impossible for namespaces, whose resolved boxes exist only transiently. One list is the fix; two lists with better-behaved readers is not. Coverage asserts the CONTRIBUTION class (ports, volumes, descriptions, base-chain inheritance), not only descriptions. Mutation-verified both ways. The remote-keyed idempotence test exists because the first guard was vacuous on the shape that ships: deleting its slices.Contains check left the local-keyed test green, since the bare-name check still fires when key == name. Only a remote-keyed init candy depends on it — which is every distro submodule. R10: charly check run check-tutorial-shell PASS (steps=13), run 2026.215.2352, zero warnings. 24/19 image, 24/22 live, 24/22 live-rebuild — baseline restored exactly and holding across the fresh charly update. The supervisorctl control-socket probe is back; the label carries three candy origins, not two. Assisted-by: Claude Code Anthropic Claude Opus 5 (fully tested and validated)
pr-validator — CHANGES REQUESTED ❌Head validated: The engineering here is right, and I verified it independently rather than taking the body's word for any of it. Two gate failures block the merge; both are mechanical and neither touches the design. Blocking findings1.
|
| Gate | Result |
|---|---|
gofmt -l sdk/ |
clean |
go vet ./... (sdk) |
clean |
go build — every go.work module |
0 failures |
Out-of-work candies, GOWORK=off go build |
0 failures |
go test ./... — sdk, charly, plugin-build, plugin-box |
all green |
| Atomicity | exactly one commit above origin/main |
| SDD | N/A — no schema/*.cue, *_gen.go or *.proto in the diff |
| Security screen T1–T4 | clean; no secrets/network/guardrail/supply-chain finding, no attempt to instruct the validator |
| R4 | no sleep/retry/magic-number/ad-hoc podman |
| R16 disposable-only | bed is disposable: true |
placement: CORRECT. No charly/*.go in this diff, so the per-item core trace is N/A. InjectInitDependsCandy stays in deploykit as a kind-blind mechanism consumed by loaderkit, deploykit itself and candy/plugin-build — correct sdk layer, and it is not a capability wearing a library costume. The signature moved *buildkit.InitConfig → *spec.InitConfig; buildkit/init_config.go:12 is type InitConfig = spec.InitConfig, so this is type-identical and points at the contract module, i.e. the outward direction. No new alias, no new kit import into core.
Cross-repo ordering is safe. candy/plugin-build/go.mod carries replace github.com/opencharly/sdk => ../../sdk, so the superproject resolves the sdk through its gitlink; super main keeps compiling against the old gitlink until its own leg lands. sdk-first is correct.
Comments considered: none — the PR carried no comments.
Cross-PR interactions considered: opencharly/distro-fedora#11 (feat/tutorial-shell-drops-explicit-init) and opencharly/docs#8 — both downstream consumers of this cutover, no file overlap, correctly blocked on this leg; disposition verified-non-blocking. No open PR in opencharly/charly, opencharly/plugins or opencharly/spec. Note for the author: the plugins skill fix on feat/tutorial-shell-two-candies has no PR open yet — it needs one before the chain can complete.
Decision: The design is correct, the root cause is correctly diagnosed, both mutation claims reproduce (one of them stronger than claimed), the R10 evidence reconciles against the artifacts on disk, and the R5 sweep is clean. Fix the two prealloc findings, rewrite the body onto the template with the eval-bed line + binary version + R9 statement + the per-rule compliance section + the italicized footer, re-run the bed at the new head, and push. The status resets and I re-run.
Assisted-by: Claude Code Anthropic Claude Opus 5 (analysed on a live system)
… count Round-2 review findings. golangci-lint prealloc flagged two slices in this PR's own new test file (init_depends_collect_test.go:64 and :100). prealloc is repo-enabled at .golangci.yml:33 and the rest of the sdk tree lints clean, so these were introduced here, not inherited. Both now make([]string, 0, len(...)). golangci-lint run --enable-only prealloc ./deploykit/ -> 0 issues. The CHANGELOG said the stub-cfg.SetBox mutation fails seven tests. It fails NINE in deploykit, and TEN module-wide counting loaderkit's TestProjectResolvedProject_InjectsInitDependsCandy. I carried that number from a report instead of running the mutation myself; a validator counted it correctly. The entry now states the re-derived figure and how it was measured, and says where the wrong one came from — this is the fourth wrong count in this chain and every one had the same cause: a figure quoted at a scope I had not measured. Assisted-by: Claude Code Anthropic Claude Opus 5 (fully tested and validated)
pr-validator — CHANGES REQUESTED ❌ (round 2)Head validated: Supersedes the round-1 verdict. Round 1's finding #1 is fixed and I confirmed it independently. Finding #2 is largely fixed. One NEW blocking finding, and one residual gap from #2. Neither requires a new commit or a bed re-run — both are edits to the PR body. The head stays Blocking findingThe eval-bed table contradicts
|
| Line | Status |
|---|---|
| RDD | absent — no labeled answer anywhere |
| Hard cutover | absent as a line (R2/R5 touch it obliquely) |
| Disposable-only autonomy | absent as a line (the fact is in the bed table) |
| Clean architecture + Go gates | absent as a line (the gate results are in ## Cross-repo) |
| CHANGELOG | absent as a line (the file is in the Summary list) |
Four of those five have their evidence elsewhere in the body, so this is a labeling gap rather than missing proof — which is why it is secondary to the finding above and not a standalone block. RDD is the one with no answer at all: state how the high-risk assumption was settled (the measured before/after on the bed is the answer — 2048 → 2254 → 0018, one variable).
Minor, non-blocking: ## Change class has no heading of its own; the class is stated inside the R10 block and the cross-repo repos + landing order are in ## Cross-repo / ## Landing, so the content is supplied.
What I verified independently — everything else passes
I re-derived every claim rather than reading round 1's verdict. I reached the same conclusions, and re-ran both mutations myself.
Round-1 finding #1 — golangci-lint: FIXED
Full linter, not just prealloc, isolated GOLANGCI_LINT_CACHE, golangci-lint v2.12.2, sdk module root:
0 issues.
LINT_EXIT=0
Both call sites carry the fix (origins := make([]string, 0, len(set.Candy)), names := make([]string, 0, len(mounts))). prealloc is confirmed enabled at .golangci.yml:33.
The corrected mutation count is itself correct — 9 and 10
BoxConfig returns a value (spec/spec/config.go:93) and SetBox re-encodes into c.Box, so deleting the SetBox call is a faithful "computes the same answer, writes nothing" mutant. Applied it and ran:
--- FAIL: TestFillNamespaceBoxViews_InjectsInitDependsCandy
--- FAIL: TestInjectedCandyReachesBaseChainCollectors
--- FAIL: TestInjectedCandyReachesCollectedDescription
--- FAIL: TestInjectedCandyReachesCollectedPorts
--- FAIL: TestInjectedCandyReachesCollectedVolumes
--- FAIL: TestInjectInitDependsCandy_ContainerInjectsSupervisord
--- FAIL: TestInjectInitDependsCandy_RemoteKeyedInitCandy
--- FAIL: TestInjectionIsIdempotentAcrossChokepoints
--- FAIL: TestInjectionIsIdempotentAcrossChokepointsRemoteKeyed
deploykit FAIL count: 9
module-wide FAIL count: 10 (+ loaderkit TestProjectResolvedProject_InjectsInitDependsCandy)
9 and 10, exactly as now stated. The correction is sound and the chain of wrong counts ends here. R10 coverage gate satisfied.
Mutation 2 — the guard is non-vacuous, exactly as characterised
Deleted slices.Contains(order, key):
--- PASS: TestInjectionIsIdempotentAcrossChokepoints <- local-keyed: GREEN (vacuous)
--- FAIL: TestInjectionIsIdempotentAcrossChokepointsRemoteKeyed
--- FAIL: TestInjectInitDependsCandy_RemoteKeyedInitCandy
The local-keyed test alone would not have caught it; the remote-keyed test is load-bearing, and remote-keyed is the shape every distro submodule ships. Working tree restored clean at 9b76c8f after both mutations.
R10 bed evidence — cross-checked on disk
box/fedora/.check/check-tutorial-shell/2026.216.0018/summary.yml: ok: true, 13 steps, every step ok: true.
check-image.log: 24 steps: 19 passed, 0 failed, 5 skipped
check-live.log: 24 steps: 22 passed, 0 failed, 2 skipped
check-live-rebuild.log: 24 steps: 22 passed, 0 failed, 2 skipped
Baselines corroborate the measurement: 2026.215.2048 = 24/19 + 24/22; the broken 2026.215.2254 = 18/14 + 18/16. Restored exactly, and it holds across the fresh [update].
Zero warnings — swept the entire run directory, 0 hits. The control-socket probe is present and passing in both live phases:
check-live.log:32 PASS check supervisord runs as container init and its control socket
check-live-rebuild.log:32 PASS answers supervisorctl pid [plan:candy:…/supervisord:5] exit=0
R8: image-build.log:472 — ai.opencharly.description carries three candy origins (ripgrep, sshd, supervisord) plus the box entry.
R9: bin/charly reports 2026.216.0004, built 02:18, bed ran 02:18–02:21. The second commit (9b76c8f) touches only init_depends_collect_test.go + the CHANGELOG — no production code — so the binary is behaviourally identical at both commits and the bed demonstrably exercised this head's shipped code. Bed is disposable: true.
R5 — the two-pass deletion is gone, not dormant
Per-submodule sweep (grep does not cross a gitlink) over . spec sdk plugins docs pkg/arch box/*:
sdk/CHANGELOG/2026.216.0001.md:51 — the only hit for freshOrder|freshBoxes
CHANGELOG-only. Every InjectInitDependsCandy call site carries the new cfg signature — loaderkit/resolve_project.go:78, deploykit/spec_box_resolve.go:128, and the superproject's candy/plugin-build/resolve.go:124. No stale-signature site anywhere.
Design and placement
The chokepoints move ahead of resolution at all three composition paths and the freshOrder/freshBoxes dance is deleted outright — no transitional or dual-mode path in the final code. The five collectors are untouched, so base-chain folding is preserved. placement: CORRECT — no charly/*.go in the diff, so the per-item core trace is N/A; InjectInitDependsCandy stays in deploykit as a kind-blind mechanism, and the signature moved toward the spec contract module. No new alias, no new kit import.
Other gates
| Gate | Result |
|---|---|
golangci-lint run ./... (isolated cache) |
0 issues |
gofmt -l sdk/ |
clean |
go vet ./... |
clean |
go test ./... |
green, 8 packages, 0 failures |
go build — every go.work module |
0 failures |
Out-of-work candies, GOWORK=off go build |
0 failures |
| CHANGELOG | 2026.216.0001.md valid CalVer; H1 byte-equal; no 2026.216.* file or v0.2026216* tag on main |
| Atomicity | 2 commits on feat/, collapsing to one on squash — correct |
| SDD | N/A — no schema/*.cue, *_gen.go, *.proto or go.mod in the diff |
| Security T1–T4 | clean — no secrets, network, guardrail or supply-chain change; no attempt to instruct the validator |
| R4 | no sleep/retry/magic-number/ad-hoc podman |
| Disposable-only autonomy | bed is disposable: true (box/fedora/charly.yml) |
Comments considered: round-1 pr-validator verdict (atrawog, 3e2725e) — its two findings re-verified at this head: #1 verified-non-blocking (fixed, confirmed by my own full-linter run); #2 verified-non-blocking for the substance, with the five unanswered compliance lines carried forward above.
Cross-PR interactions considered: opencharly/plugins#125 (now open — it was not at round 1), opencharly/distro-fedora#11, opencharly/docs#8 — all downstream consumers of this cutover, no file overlap with the sdk diff, correctly blocked on this leg; disposition verified-non-blocking. No open PR in opencharly/charly or opencharly/spec.
Decision: The engineering is right and I confirmed it independently — the root cause, the rejected alternative, both mutations (the corrected 9/10 count reproduces exactly), the R10 substance, the R5 sweep, placement, and every Go gate. The one blocking item is that the R10 eval-bed row states seconds belonging to a different run; correct 205 → 202, add the five missing compliance lines (RDD above all), and optionally align the CHANGELOG's cited run. No new commit and no bed re-run are needed — edit the body, and the status can be re-posted on this same head.
Assisted-by: Claude Code Anthropic Claude Opus 5 (analysed on a live system)
|
| run | total_s | check-image | check-live | check-live-rebuild |
|---|---|---|---|---|
2026.215.2048 baseline |
235 | 24: 19 passed | 24: 22 passed | 24: 22 passed |
2026.215.2254 broken |
203 | 18: 14 passed | 18: 16 passed | 18: 16 passed |
2026.216.0018 this head |
202 | 24: 19 passed | 24: 22 passed | 24: 22 passed |
ok: true, 13 steps, update 55s. Zero warnings — grep -inE "warn|WARNING" *.log across all
twelve logs returns nothing. The control-socket probe is present and PASS in both live legs
(SKIP in check-image, correctly — runtime context). disposable: true read from
box/fedora/charly.yml:72, in the check-tutorial-shell stanza.
R8 — verified in image-build.log itself, in the --- Building tutorial-shell --- stage's
LABEL ai.opencharly.description: origins ripgrep, sshd, supervisord, plus
box:tutorial-shell. Three candy origins, as claimed.
Go gates — all reproduced: golangci-lint run ./... → 0 issues. (v2.12.2, prealloc enabled
at .golangci.yml:33 — round 1's finding is fixed); gofmt -l empty; go vet ./... clean; every
go.work module builds; every out-of-work candy builds under GOWORK=off; tests green in charly,
sdk, spec, candy/plugin-build, candy/plugin-box.
R5 — swept per-submodule over . spec sdk plugins docs pkg/arch box/* (git grep does not cross
submodule boundaries). freshOrder/freshBoxes: one hit, sdk/CHANGELOG/2026.216.0001.md:51.
Deleted, not dormant.
CHANGELOG. Every citation I checked resolves and says what is claimed:
buildkit/config_resolve.go:124-126 is the normalization block; deploykit/resolved_project.go:144
is FillBoxPlans' CollectDescriptions re-derivation; all five collector line numbers land on their
BoxCandyChain call; all five named tests exist; #119 is bc183d13, tagged v0.2026215.2321.
On the R10 section citing 2026.215.2352: I confirmed 9b76c8f touches only
init_depends_collect_test.go and the CHANGELOG, so prod code is byte-identical to 3e2725e, and
the numbers quoted are identical in both runs. Defensible, and disclosed. Not a finding.
Line 57 is, per the blocking item above.
Universal PR-gate — one open PR per repo, no duplicate scope: sdk#120, distro-fedora#11,
plugins#125, docs#8. Branch is not behind origin/main; both commits carry the attribution
trailer; 3e2725e correctly marked ! for the InjectInitDependsCandy signature change.
Everything except the one finding is in landing shape. Fix it in place with an additional commit —
the status resets and a fresh evaluator re-runs. Not merged; not tagged.
Assisted-by: Claude Code Anthropic Claude Opus 5 (fully tested and validated)
…e claim behind it Round-3 review finding, and the claim was mine. init_depends.go pre-normalized the authored candy list with spec.BareCandyRef before calling ResolveCandyOrder, justified by: "without normalizing, a remote-ref composition resolves to nothing and injection silently skips". That is false. ResolveCandyOrder already normalizes at its own chokepoint — ExpandCandy (graph.go:36-42) BareRef-normalizes every ref before lookup and documents itself as "the single chokepoint every ResolveCandyOrder caller funnels through" — and deploykit.BareRef is literally spec.BareCandyRef. BareCandyRef is idempotent, so the pre-pass could not change the result by construction. Proven, not read: deleting the pre-pass and passing img.Candy raw leaves all eight sdk packages green, including both remote-ref tests (TestInjectInitDependsCandy_RemoteKeyedInitCandy and TestInjectionIsIdempotentAcrossChokepointsRemoteKeyed). Not one of the ten tests distinguished it. Worse than redundant: it was a second copy of a chokepoint's job (R3), and the comment asserted that ResolveCandyOrder does NOT normalize — which would invite the same pre-pass at the next call site. The superproject leg (candy/plugin-build/resolve.go:124) never had it. The false claim appeared in four places, all authored by this PR: the code comment, the test comment on a test that passes without it, the CHANGELOG, and the PR body. All four corrected; the CHANGELOG now records what was wrong and how it was caught, since a merged entry is what the next reader finds. Caught by a validator that mutation-tested the line instead of reading the comment — the same technique that has caught every real defect in this chain. Assisted-by: Claude Code Anthropic Claude Opus 5 (fully tested and validated)
|
| Check | Result |
|---|---|
resolved.Candy is a pure derivation |
buildkit/config_resolve.go:124-126, exactly as cited |
Five collectors read the source via BoxCandyChain |
description_collect.go:81, hooks_collect.go:48, ports_collect.go:22, shell_collect.go:24, volume_collect.go:20 — every line exact, and none touched by the diff |
Mutation 1 (stub the cfg.SetBox write) |
9 FAIL in deploykit, 10 module-wide; tenth is loaderkit's TestProjectResolvedProject_InjectsInitDependsCandy. The 9 decompose exactly as the CHANGELOG says: 4 new seam tests + 2 idempotence guards + 3 existing injection tests |
Mutation 2 (delete slices.Contains(order, key)) |
…AcrossChokepoints and …_Idempotent stay PASS (vacuous); …AcrossChokepointsRemoteKeyed and …_RemoteKeyedInitCandy FAIL. Non-vacuity on the shape that ships is real |
| Base-chain folding preserved | TestInjectedCandyReachesBaseChainCollectors inherits + de-dups; verified live in the label |
golangci-lint run ./... |
0 issues. — v2.12.2, prealloc enabled, tests: true |
gofmt -l / go vet ./... |
clean / clean |
Every go.work module builds |
clean |
286 out-of-work candies, GOWORK=off |
clean |
charly + plugin-build + plugin-box tests |
green |
| R5 | freshOrder/freshBoxes swept per-submodule over . spec sdk plugins docs pkg/arch box/* → one hit, sdk/CHANGELOG/ history. Deleted, not dormant |
| Measurement table | 2026.215.2048 = 24/19 + 24/22; 2026.215.2254 = 18/14 + 18/16. Both read off the artifacts |
R10 at this head, verified from the artifacts under box/fedora/.check/:
run 2026.216.0050 total_seconds: 224 ok: true 13 steps, all ok
check-image.log: 24 steps: 19 passed, 0 failed, 5 skipped
check-live.log: 24 steps: 22 passed, 0 failed, 2 skipped
check-live-rebuild.log: 24 steps: 22 passed, 0 failed, 2 skipped
PASS check supervisord runs as container init and its control socket answers supervisorctl pid
[plan:candy:github.com/opencharly/charly/candy/supervisord:5] exit=0
Zero warnings across every log. Bed disposable: true at box/fedora/charly.yml:72. Freshness
established by mtime, not by the version string: commit 02:50:17 → bin/charly built 02:50:26
→ run started 02:50:29. R8 confirmed independently with charly box labels: ai.opencharly.description
carries exactly three candy origins (ripgrep, sshd, supervisord) and ai.opencharly.init=supervisord.
Blocking findings
1. The CHANGELOG's R10 section cites a run that did not exercise the shipped code
CHANGELOG/2026.216.0001.md:
## R10
`charly check run check-tutorial-shell` → `PASS (steps=13)`, run `2026.215.2352`, zero warnings.
Run 2026.215.2352 started 01:52 local — before 3e2725e (02:02), and two commits before
312339d (02:50). It ran against a tree whose deploykit/init_depends.go still contained the
pre-pass. Round 3's head made this defensible because prod code was byte-identical; 312339d
removed production code, so it no longer is. The compliant run exists — 2026.216.0050, which I
verified above — but the entry does not name it.
The CHANGELOG is the project's sanctioned permanent record of how this cutover was proved. Merging
it as written leaves history attributing the proof to a run of a tree that never shipped.
Fix: cite 2026.216.0050 in the R10 section. The pasted step counts are already correct — they
are identical across both runs.
2. The body's compliance section defends that citation with a claim that is false at this head
CHANGELOG — … Its R10 section cites run
2026.215.2352; prod code is byte-identical between
that head and this one (9b76c8ftouches only a test file and the CHANGELOG) …
The sentence accounts for 9b76c8f and stops there. 312339d — the commit this round is about —
touched deploykit/init_depends.go. Prod code is not byte-identical between 2026.215.2352's
head and this one. The justification was true when round 3 wrote it and was carried forward
unchanged into the round that invalidated it.
3. The R9 "pinned behaviourally" argument rests on the code round 3 deleted
Binary version (R9): … Pinned behaviourally, not just by timestamp:
tutorial-shellcomposes
by REMOTE ref, and theBareCandyRefnormalization is NEW in this PR — injection could not have
worked at all unless the bed ran final code.
At this head the PR introduces no BareCandyRef normalization in production code. git diff origin/main...HEAD -- '*.go' | grep '^[+-].*BareCandyRef' returns exactly one line, and it is a doc
comment. The remote-key matching that makes injection work on remote refs — candyKeyForName — came
from bc183d1 (#119), the merge base, not from this PR.
This is the third surviving instance of the retracted claim's family, and it is the one that matters
most, because it is load-bearing for an R-rule. It is also unsound independently of the deletion:
mutation 3 above proves the pre-pass was behaviourally inert, so it could never have pinned a binary
to final code even while it existed. The body states "All four are corrected" — the four flagged
sites are, but the two derivative claims (this one and #2) are not. Freshness here rests on the
mtime chain, which does hold.
Non-blocking, worth correcting in the same push
- R8 provenance. The body says the three origins were "read from
image-build.log". That log
carries seven candy origins across the builder images —build-toolchain,nodejs,pixi,
rpmfusionamong them. The three-origin fact is true; its evidence ischarly box labels. - CHANGELOG test inventory. The
init_depends_collect_test.gobullet list names five of the
seven tests in the file; the two idempotence guards are discussed immediately after but absent
from the inventory.
Findings 1–3 are three lines of prose. Nothing in the code needs to change, no bed needs to re-run,
and the fix does not touch anything I verified above. Push the corrections and the status resets for
a fresh round.
The substance of this PR is right, and round 3's finding was handled the way it should have been —
deleted rather than defended. What #2 and #3 show is that the sweep stopped at the four sites the
review named instead of asking which other claims the deletion had just falsified. That is the
same shape as the original defect: a plausible sentence that nobody re-derived.
…ix R8 provenance Round-4 review findings. All three are mine, all prose. The R10 section cited run 2026.215.2352. That run started 01:52 — before 3e2725e and two commits before 312339d, so it exercised the tree WITH the redundant pre-pass. Rounds 2 and 3 accepted that citation because prod code was byte-identical across those heads; 312339d removed production code, so the defence expired. The compliant run 2026.216.0050 already existed and is now what the entry names. A justification that depends on the next commit not touching code has to be re-checked at every head, which is the actual lesson. The test inventory listed five of the seven tests in the new file — both idempotence guards were missing, including the remote-keyed one the entry then spends a paragraph explaining. Now all seven. R8 provenance said the three candy origins were read from image-build.log. That log carries SEVEN distinct origins because it also contains the builder images' stages; the count is only correct with a filter that the prose did not mention. The honest source is `charly box labels`, which is now what is cited. Assisted-by: Claude Code Anthropic Claude Opus 5 (fully tested and validated)
Merge-time version stamp applied by the fresh pr-validator: the CHANGELOG entry is renamed to the CalVer this PR actually lands at, and its H1 rewritten to match the filename and the release tag. Assisted-by: Claude Code Anthropic Claude Opus 5 (fully tested and validated)
Round 5 — PASS, merged
|
`box/tutorial-shell` composes only `ripgrep` and `sshd`. The `supervisord` line is gone: declaring a `service:` is what SELECTS an init system, so charly now adds that init's own candy to the composition automatically and target-aware — supervisord for this container image, nothing at all for a machine venue, which already has systemd. The mechanism is deploykit.InjectInitDependsCandy (opencharly/sdk#119, #120). This box is not the injection's only live consumer, and does not claim to be. SIX boxes in this submodule resolve a supervisord that appears nowhere in their authored base chain — check-pod, composition-app, composition-source, selftest-image, selftest-layer, and this one; the other five are already in that state on main. (k8s-box is NOT among them: it names supervisord outright at box/k8s/charly.yml:5.) What this box contributes is legible coverage: it is the teaching example quoted verbatim on opencharly.ai, small enough to read end to end, and the only one where the injection is the point being demonstrated rather than an incidental detail. Before the sdk fix this exact composition built clean, validated clean, and passed `charly check box` — the service, port and control-socket probes are `context: [runtime]`, skipped at image scope — then failed at deploy [start] with no supervisord in the image. Prose kept honest. "Three candies" lived in two live surfaces, both corrected here: the box `description:` (box/tutorial-shell/charly.yml:5) and the check-tutorial-shell bed `description:` (charly.yml:77). The `plan:` step comment was not one of them — it said "Drop either candy from the list above" — but was updated anyway, because "either" reads differently once the composed list is two. The box description is baked into ai.opencharly.description and quoted verbatim on opencharly.ai, so a stale line there is a published defect. The bed description had also been advertising supervisord's control-socket check as acceptance content while that probe was not being collected; opencharly/sdk#120 restored the collection, and the description now explains the probe as proof that an injected candy contributes its acceptance plan, not merely its binary. R10, re-run independently by the validator on a fresh worktree-local binary (charly 2026.216.0131): charly check run check-tutorial-shell: PASS (steps=13) check-image 24 steps: 19 passed, 0 failed, 5 skipped check-live 24 steps: 22 passed, 0 failed, 2 skipped check-live-rebuild 24 steps: 22 passed, 0 failed, 2 skipped Zero warnings across the run. Coverage discriminates: the box composes no supervisord candy, so absent the injection there is no assembled /etc/supervisord.conf at all and tutorial-shell-service-wired-into-init cannot pass. R8, verified via `charly box labels tutorial-shell` and the emitted Containerfiles: ARG BASE_IMAGE=ghcr.io/opencharly/fedora-supervisord:<tag>, an auto-intermediate whose own Containerfile runs `dnf install -y supervisor`; the injected candy's six plan steps appear in ai.opencharly.description under origin candy:github.com/opencharly/charly/candy/supervisord. Assisted-by: Claude Code Anthropic Claude Opus 5 (fully tested and validated)
Summary of changes
opencharly/sdk#119shipped an incomplete fix. It made a box composing onlyservice:candiesinstall its init — and in doing so silently removed six acceptance probes from the teaching box,
including the only one proving the init actually runs. A
distro-fedora#11validator caught it.This completes it.
Root cause.
InjectInitDependsCandywrote tobuildkit.ResolvedBox.Candy. Butresolved.Candyis a pure
BareCandyRefnormalization of the authored list (buildkit/config_resolve.go:124-126) —a DERIVED VIEW, not an independent source of truth. Writing to a derivation does not change what it
derives from, so the five collectors that read the source via
BoxCandyChain→cfg.WalkBaseChain→node.Img.Candysaw nothing:deploykit/description_collect.go:81plan:— the ADE acceptance spec inai.opencharly.descriptiondeploykit/hooks_collect.go:48deploykit/ports_collect.go:22deploykit/shell_collect.go:24deploykit/volume_collect.go:20Per file:
deploykit/init_depends.go— signature becomes(cfg *spec.Config, layers, initCfg); the passprepends the init candy to the box's AUTHORED composition via
cfg.SetBox, before resolution.The authored list is passed to
ResolveCandyOrderRAW: it carries@github…/candy/x:v…forms thecandy map never has (it is keyed bare), but
ResolveCandyOrderalready normalizes at its ownchokepoint —
ExpandCandy(deploykit/graph.go:36-42) BareRef-normalizes every ref before lookupand documents itself as "the single chokepoint every ResolveCandyOrder caller funnels through".
deploykit/spec_box_resolve.go— namespace chokepoint moved ahead of the resolve loop.loaderkit/resolve_project.go— chokepoint moved ahead of the resolve loop, and thefreshOrder/freshBoxestwo-pass dance DELETED (it existed only because injection had to runafter resolve).
deploykit/init_depends_collect_test.go(new, 219 lines) +init_depends_test.go— coverage.CHANGELOG/2026.216.0001.md.The five collectors are unchanged — no signature change, no threading, no fallback branch, no
special case naming
supervisordorinit. They keep walkingcfg.WalkBaseChain, so base-chainfolding (union across levels, first-occurrence-wins) is untouched.
Rejected alternative: pointing the collectors at the resolved boxes. It redirects readers to
whichever copy was patched while leaving
FillBoxPlans(resolved_project.go:144, theinclude: box:<name>arm) and every namespaced box still re-deriving from authored cfg — the samebug class in a second location, and impossible for namespaces, whose resolved boxes exist only
transiently inside
FillNamespaceBoxViews. It also risks silently dropping base-inherited candies,which the
tutorial-shellbed could NOT catch because its base (fedora) composes nothing.How R10-tested
Change class: sdk Go (runtime), cross-repo. Gate = the beds that exercise the change.
Bed:
charly check run check-tutorial-shell— run2026.216.0050, at head312339d.Head is now
b6840d2, which is CHANGELOG-only on top of312339d. Stated as a checkable factrather than an assurance, because the identical-looking claim expired on this PR once already:
git diff --name-only 312339d..b6840d2→CHANGELOG/2026.216.0001.mdalone, andgit diff 312339d..b6840d2 -- '*.go'→ 0 lines. If a later push touches anything but markdown,this line is void and the bed must be re-run.
check-tutorial-shelldisposable: true,box/fedora/charly.yml:72)(
total_seconds: 224andok: true, read from.check/check-tutorial-shell/2026.216.0050/summary.yml. Round 3 removed production code — theredundant pre-pass — so this is a fresh run at the new head, not the previous one's figures carried
forward. Two earlier revisions of this table got the seconds wrong by doing exactly that.)
Step counts — the measurement, not just the verdict:
Pre-#119 baseline (
2026.215.2048) was 24/19 and 24/22. The broken state (2026.215.2254) was18/14 and 18/16. Restored exactly, and it holds across the fresh
charly update.The probe whose loss defined the regression:
Zero warnings across every log in the run.
Binary (R9): built with
task build:binaryfrom this worktree and invoked through its ownbin/. Freshness is the mtime chain: commit312339dat 02:50:17 →bin/charlyat 02:50:26 →run
2026.216.0050at 02:50:29.Note
charly versionreports2026.216.0004and does NOT move between these rebuilds — it derivesCalVer from superproject git state, not build wall-clock, so an unchanged version string is expected
here and is not evidence of a stale binary. The mtime chain is what pins it.
(An earlier revision of this section argued freshness from "the
BareCandyRefnormalization is NEWin this PR, so injection could not have worked unless the bed ran final code". That argument is dead
twice over at this head: round 3 DELETED that pre-pass, and mutation 3 proved it was inert, so it
could never have pinned a binary even while it existed.)
Fresh-rebuild: included —
[update]PASS 54.999s, thencheck-live-rebuild24/22.Did the changed code path execute live? Yes. The build chokepoint, the injection itself, and
all five collectors ran during
[image-build]and[check-live]; the restored step count IS thatexecution's output.
R8 emitted artifacts:
charly box labels tutorial-shellshowsai.opencharly.descriptioncarrying THREE candy origins (ripgrep, sshd, supervisord); the broken state carried two. Read from
box labels, not fromimage-build.log— that log contains seven distinct origins because it alsocarries the builder images' stages, so a whole-file count does not describe this box.
Concurrent-roster evidence: N/A — the pass mutates a per-load in-memory
*spec.Config, notshared cross-process state. Idempotence across the three chokepoints within one process IS covered,
below.
Coverage that fails without the change
Mutation 1 — drop the
cfg.SetBoxwrite (the pass computes the same answer and writes nothing,exactly the pre-fix shape): 9 tests fail in
deploykit, 10 module-wide countingloaderkit'sTestProjectResolvedProject_InjectsInitDependsCandy. Restored → green.Coverage asserts the CONTRIBUTION class, not only descriptions, so a future transform that reopens
the seam fails on whatever it breaks:
TestInjectedCandyReachesCollectedDescription,…CollectedPorts,…CollectedVolumes,…BaseChainCollectors(leaf inherits the base's injectedcandy, with a de-dup assertion),
TestInjectionLeavesMachineVenueCollectorsAlone.Mutation 2 — delete
slices.Contains(order, key)from the idempotence guard. This one mattersbecause the first guard I wrote was vacuous on the shape that ships: the local-keyed test stayed
GREEN, since an earlier bare-name check fires when
key == name. Only a REMOTE-keyed init candydepends on the deleted guard — which is every distro submodule.
TestInjectionIsIdempotentAcrossChokepointsRemoteKeyedwas added for exactly that, and fails:A guard that only passes on the shape that does not ship is worse than no guard, because it reads
as coverage.
Review history — what the rounds found
Recorded because the merged commit should carry it, and because every real defect in this PR was
found the same way.
preallocissues in this PR's own new test fileBareCandyRefpre-pass was dead code, and the claim justifying it was falseRound 4 is the tail of round 3. The claim-sweep hit the four sites that stated the falsehood
directly, but not the two that merely depended on it — an R9 freshness argument built on the
deleted code, and a "prod code is byte-identical" defence that the deletion itself invalidated.
Deleting a false claim does not delete what was inferred from it, and those inferences do not
contain the original wording, so a claim-keyed grep cannot find them. They have to be reasoned to.
Round 3 is the one worth reading. The pre-pass could not change the result by construction —
BareCandyRefis idempotent andExpandCandyalready normalizes at the chokepoint — and deletingit leaves all eight sdk packages green, including both remote-ref tests. None of the ten tests
distinguished it. The false claim ("without normalizing, a remote-ref composition resolves to
nothing and injection silently skips") had propagated to four places, all authored by this PR: the
code comment, a test comment on a test that passes without it, the CHANGELOG, and this body. All
four are corrected.
It was not inert. It was a second copy of a chokepoint's job (R3), and its comment asserted that
ResolveCandyOrderdoes not normalize — which would invite the same pre-pass at the next callsite. The superproject leg (
candy/plugin-build/resolve.go:124) never had it, so the codedisagreed with itself across repos.
Three reviewers read that comment before one mutation-tested the line instead. That is the whole
lesson: a plausible mechanism story survives review; running the mutation does not care how
plausible it is.
Attribution tier
fully tested and validated— the full change-class gate ran fresh on adisposable: truetargetat this head, with zero warnings, both outputs pasted, and the changed paths executed live.
Harness rulebook compliance
/charly-internals:plugin,/charly-internals:strict-policy,/charly-internals:go,/charly-check:checkloaded before any edit.no "flake"/"transient" framing. The claim-keyed sweep also found two stale prose claims about the
same mechanism (
candy/plugin-box/validate_graph.go,plugins/core/skills/service/SKILL.md),both fixed in their own legs rather than parked.
stale-prose findings are fixed in-chain, not routed to a batch.
have left two lists was rejected on exactly this ground.
charlyCLI drove every step.freshOrder/freshBoxesdeleted, not left dormant.Per-submodule
git grepover. spec sdk plugins docs pkg/arch box/*returns one hit, insdk/CHANGELOGhistory.to
main.git statuschecked before each staging.go testalone.image-build.log.task build:binary, version2026.216.0004, invoked via thisworktree's
bin/; pinned behaviourally as described above.disposable: truebed, zerowarnings, coverage that fails without the change (both mutations above), no scope-shrinking flags.
while
charly box pull+charly check boxno longer tested it.spec.InitConfigreached via an existing type-identical alias.charly/*.gotouched;deploykitis the correct sdk layer, andthe build chokepoint stays in the
plugin-buildcandy.hold the resolved boxes?", and it was spiked on a throwaway test before any design was chosen.
The spike reproduced the bug empirically (
BoxCandyChain→[ripgrep sshd]while the resolvedbox had
[supervisord ripgrep sshd], all three collectors empty) and refuted the first design:FillBoxPlansand namespaced boxes have no resolved boxes to read, so pointing collectors atthem would have left the same bug class in a second place. Spike deleted, not shipped.
(
freshOrder/freshBoxes), not left behind a flag or a transitional path; nothing in the finaltree carries both shapes, and the R10 run above exercised only the final code.
check-tutorial-shell, declareddisposable: trueatbox/fedora/charly.yml:72. No non-disposable target was touched, anddisposability was read from the config, never inferred from the name.
smaller diff, and the alternative was rejected on that ground rather than on effort.
golangci-lint0 issues (full run,preallocincluded),gofmt -lempty,go vetclean,go test -count=1 ./...green across every go.work module plus out-of-work candies underGOWORK=off.CHANGELOG/2026.216.0001.mdships with this cutover, states the root cause, therejected alternative and why, all three mutations, the R10 evidence, and the deliberate
docs-vs-image asymmetry. Its R10 section now cites run
2026.216.0050— the run at the FINALtree. An earlier revision cited
2026.215.2352and defended it as "prod code is byte-identicalbetween that head and this one"; that was true when
9b76c8ftouched only a test file and theCHANGELOG, and became FALSE at
312339d, which removed the pre-pass fromdeploykit/init_depends.go. A defence that expires when the next commit lands has to be re-checkedat every head, which is why the entry now names the compliant run outright.
Cross-repo
This cutover spans repos, so the sdk PR alone does not compile the full picture:
feat/gourmet-kitchen-readme-vision— the build chokepoint(
candy/plugin-build/resolve.go) and a stale comment (candy/plugin-box/validate_graph.go).opencharly/plugins#125—core/skills/service/SKILL.mdclaimedcharly box validateenforcesan init-dependency check that fix(deploykit): inject the active init's depends_candy into a box's composition #119 deleted.
The whole-workspace gate must include out-of-work candies under
GOWORK=off; a./charly/-scopedor go.work-loop gate misses them. Verified: gofmt clean,
go vetclean, every go.work modulebuilds, out-of-work candies build under
GOWORK=off, tests green in sdk + charly + plugin-build +plugin-box,
golangci-lintclean (preallocincluded).Landing
sdk#120→distro-fedora#11→plugins#125→docs#8→ superproject. Tags here use theGo-module scheme
v0.<YYYYDDD>.<HHMM leading-zeros-stripped>, never plain CalVer.Assisted-by: Claude Code Anthropic Claude Opus 5 (fully tested and validated)