Repository navigation
fix(deploykit): inject the active init's depends_candy into a box's composition - #119
Conversation
…omposition Declaring a `service:` in a candy is what SELECTS an init system and assembles its config — but nothing installed the selected init's own binary. A box composing only service candies validated clean, built clean, baked ai.opencharly.init="supervisord" and a fully assembled /etc/supervisord.conf, and then failed at deploy `[start]` with no supervisord in the image. `fallback_entrypoint: [sleep, infinity]` did not mask it. The init vocabulary already declared the dependency correctly (supervisord → depends_candy: supervisord; systemd → none, since every machine venue has one). `DependsCandy` was decoded and carried through the resolve envelope, then read by exactly ONE consumer — a validator that WAIVED itself for dual-init candies, which is the shape the layer skill recommends everywhere. Nothing injected it into composition. New deploykit.InjectInitDependsCandy is the ONE shared pass (R3). It mirrors ComputeIntermediates's (boxes, layers) shape and lives beside it because the decision needs BOTH the box set and the candy graph: which candies trigger which init is a whole-composition question, so it cannot live in buildkit.ResolveBox, which resolves ONE box in isolation and deliberately carries no candy map. Target-awareness is structural, not a flag: the active init comes from InitConfig.ResolveInitSystem — the SAME resolution that decides ai.opencharly.init and drives the render. A container resolves to supervisord (injected); a preserve_user / bootc machine venue resolves to systemd, which declares no depends_candy, so nothing is added. A blanket require-supervisord on service candies would be the WRONG fix for exactly that reason: target-blind, it would install supervisord onto systems that already have an init. Wired at all three box-composition paths. buildkit.ResolveBox is the ONLY place a box's Candy list is set, so every path funnels through one of: - ResolveAllBox's returned map — injected by candy/plugin-build's resolveBuildEngine in the superproject leg, which also covers the pullNamespacedBox and resolveNamespacedBases entries that land in that same map; - ProjectResolvedProject's fresh-box loop in loaderkit — feeds validate, inspect and bundle-deploy. Its fresh arm now projects views in a SECOND pass, because the injection rewrites img.Candy and ProjectResolvedBox copies that list into the view; - FillNamespaceBoxViews in deploykit — an import namespace's boxes are resolved from the namespace's OWN config and reach neither of the other seams; without this a namespaced box would have its init RESOLVED by the following RenderPrepBox while its init candy was never added. ResolveSpecBox, ResolveAllSpecBoxes and WrapSpecBoxes have no production consumers. Two properties the pass must have, both pinned by tests: it is IDEMPOTENT, so it can run at every chokepoint without double-injecting, and it injects the candy's own MAP KEY rather than its bare name — BareCandyRef strips only the leading marker and the version suffix, so a REMOTE candy is keyed by its full repo path while the init vocabulary names it bare. Resolving by key alone silently no-opped on every distro submodule, where the init candy is always a remote ref; that was caught by reading the emitted Containerfile under R8, not by the unit tests. Assisted-by: Claude Code Claude Opus 5 (fully tested and validated)
|
| Call site | Covered by |
|---|---|
candy/plugin-build/resolve.go:117 (ResolveAllBox) |
seam 1 — superproject leg (resolve.go:126, verified present in the super tree) |
candy/plugin-build/resolve_legs.go:300 → loaderkit.ProjectResolvedProject |
seam 2 — this PR |
sdk/deploykit/spec_box_resolve.go:125 (inside FillNamespaceBoxViews) |
seam 3 — this PR |
buildkit/config_resolve.go:74,362,468 |
internal recursion; pullNamespacedBox writes into ResolveAllBox's map → seam 1 |
deploykit/spec_box_resolve.go:43,56 (ResolveSpecBox/ResolveAllSpecBoxes) |
no production consumers — confirmed (see N2) |
3. Target-awareness is structural, exactly as claimed. InjectInitDependsCandy calls initCfg.ResolveInitSystem(layers, order, ""). The render path calls g.InitConfig.ResolveInitSystem(g.Candies, candyOrder, "") at deploykit/render_prep.go:69 (sets img.InitSystem) and :187 (bakes ai.opencharly.init) — the same function with the same empty explicit-override argument. There is no flag and no second resolution to drift. systemd declares no depends_candy, so a machine venue injects nothing.
4. Idempotence. Sound by construction: the second call's ResolveCandyOrder(img.Candy, …) sees the just-prepended key, so slices.Contains(order, key) short-circuits. Pinned by TestInjectInitDependsCandy_Idempotent.
5. Remote-candy keying. candyKeyForName falls back to GetName(); the direct-key hit answers the local case. Correct, and the determinism note (globally-unique candy names ⇒ at most one map match) is right.
6. The stubbed-implementation claim. Reproduced: stubbing the body to a no-op fails 3 tests —
--- FAIL: TestInjectInitDependsCandy_ContainerInjectsSupervisord
init_depends_test.go:86: container composition must gain the supervisord candy, got [ripgrep sshd]
--- FAIL: TestInjectInitDependsCandy_RemoteKeyedInitCandy
init_depends_test.go:208: remote init candy must be injected by its MAP KEY, got [github.com/opencharly/charly/candy/sshd]
--- FAIL: TestFillNamespaceBoxViews_InjectsInitDependsCandy
init_depends_test.go:276: namespaced box must gain the init candy, got [sshd]
7. Hygiene. gofmt -l . empty; go build ./... clean; go test ./... green across all 8 sdk packages. PR-body attribution is correctly formed (*Assisted-by: Claude Code Anthropic Claude Opus 5 (fully tested and validated)*).
B1 — BLOCKING: seam 2 has zero coverage anywhere
loaderkit/resolve_project.go:117 — deploykit.InjectInitDependsCandy(freshBoxes, layers, initCfg) — is one of the two seams this PR adds, and it is completely unproven. I replaced that single line with a no-op (_ = initCfg), left everything else intact, and ran:
sdk go test -count=1 ./... → ok × 8 packages (sdk, agentkit, buildkit,
deploykit, enginekit, kit, loaderkit, vmshared)
superproject go test ./charly/... → ok github.com/opencharly/charly/charly 156.669s
ok .../charly/internal/pluginsgen 0.009s
candy/plugin-build → ok
candy/plugin-bundle → ok
candy/plugin-box → ok
Everything green with the seam deleted. The R10 beds do not close this either: the build path goes through seam 1, and the superproject leg removes validateInitDependencies, so nothing downstream would notice seam 2 silently no-opping.
This is not a cosmetic gap. Seam 2 is the arm the PR body names as feeding validate, inspect, and bundle-deploy — and candy/plugin-bundle's resolveBoxSelection reads rp.Boxes[req.BoxRef], so it drives real deploy behaviour, not just display. It is also precisely the failure shape this PR's own RCA identifies:
The deleted code had zero test coverage … That is part of why the defect survived: the guard was never exercised.
R10 requires check coverage that fails without the change; half this PR's production wiring can be deleted with the suite green. Seam 3 was verified this way by the author and seam 1 is exercised live by the bed — seam 2 needs the same treatment.
Required: a test that FAILS when line 117 is removed — assert that a fresh-resolved box (the non-preResolvedBoxes arm) comes back with the init candy in rp.Boxes[<box>].Candy. loaderkit has no ProjectResolvedProject test today, so this is a new one there (a stub seams.ResolveBox closure over buildkit.ResolveBox is enough — charly/resolved_project_host_test.go:226's testProjectResolvedProjectWithBoxes is a working template). It belongs in this leg, since the seam is sdk code.
B2 — BLOCKING (one line): the doc comment overstates the presence check
InjectInitDependsCandy's doc comment says it injects when the dependency candy "is not already in its resolved chain". The check is ResolveCandyOrder(img.Candy, layers, nil) — parentCandies is nil, so the base chain is not part of that closure. Measured, with a child whose base installs supervisord and which composes only sshd:
PROBE parent.Candy = [supervisord]
PROBE child.Candy = [supervisord sshd] ← injected although the base already installs it
The emitted image is unaffected — GlobalOrderForBox(img.Candy, parentCandies) filters the parent-provided candy back out at render (ResolveCandyOrder's parentCandies[name] → skip), so no duplicate install is emitted. But rp.Boxes[child].Candy (and therefore charly box inspect and the bundle-deploy selection) now lists a candy that box does not install, and the comment as written asserts otherwise. Per R1 this is a doc-vs-reality divergence on a surface this cutover authors.
Required: either make the pass parent-aware, or correct the comment to state that the presence check is scoped to the box's OWN candy closure and that a base-chain-provided init candy is re-listed and filtered back out by GlobalOrderForBox at render. The one-line comment fix is a perfectly good resolution — the behaviour itself is benign.
N2 — non-blocking, needs a named exit
The PR body and CHANGELOG state that ResolveSpecBox / ResolveAllSpecBoxes / WrapSpecBoxes "have no production consumers". Verified true (whole-tree, per-submodule): only the definitions plus two prose mentions inside charly/kernel_manifest_floor_test.go's manifest strings — no call sites. That makes three exported sdk functions dead code surfaced by this cutover. Deleting them is a ! breaking sdk-API change with a superproject prose sweep attached, so it is reasonably separable from this fix — but the standing radical-dead-code-removal rule needs an exit named, not a bare observation. Add one line to the PR body routing it to a specific batch (the manifest prose at kernel_manifest_floor_test.go:175 still describes deploykit.ResolveSpecBox as live and rides along).
Mechanics for the next round
- The branch is
BEHINDmain (28590c1). Catch up withgh pr update-branch(a merge — never a rebase, never a force-push). - Push the fix as an ADDITIONAL commit; the status resets and I re-run.
- Re-run the R10 beds on the final tree after the fix, per the standing gate.
No merge, no tag. Status posted as failure.
…_candy injection ProjectResolvedProject's call to deploykit.InjectInitDependsCandy had zero coverage anywhere: replacing it with a no-op left the whole sdk suite, the superproject's go test ./charly/..., and plugin-build / plugin-bundle / plugin-box green. The R10 beds do not close it either — the build path reaches the injection through candy/plugin-build's resolveBuildEngine, so a silent no-op at this seam is invisible to them. That matters because this seam is not the build path. It feeds the validate / inspect / bundle-deploy envelope, and candy/plugin-bundle's resolveBoxSelection reads rp.Boxes[...] to decide what a deploy installs — so a no-op here is a real deploy defect. It is also the exact failure shape this cutover's own RCA names: the deleted validator had zero coverage, which is why the defect survived in the first place. loaderkit/resolve_project_test.go runs the genuine resolve to inject to project chain through the real buildkit.ResolveBox and asserts the PROJECTED view carries the init candy — sealing both halves of the wiring: the call itself, and the second-pass projection ordering the call forced. Verified to FAIL under both mutations (the call neutered; the projection moved back into the resolve loop) and to pass restored. Also states the injection's presence-check SCOPE in its doc comment: it reads the box's OWN resolved order (ResolveCandyOrder with a nil parentCandies), not its base chain, so a child whose BASE installs the init candy still gains it. Harmless for the artifact — GlobalOrderForBox filters a base-provided candy back out at render — but rp.Boxes[child].Candy can then name a candy the child does not itself install, and a consumer reading that field as "what this box installs" must account for it. Assisted-by: Claude Code Anthropic Claude Opus 5 (analysed on a live system)
|
Two round-2 findings. THE CITED FILE DOES NOT EXIST. The entry named `charly/kernel_manifest_floor_test.go` as prose still describing `deploykit.ResolveSpecBox` as live, and pointed the dead-code batch at it. That file was deleted from superproject main at 21ab450b, about an hour before this PR's first commit; `charly/import_purity_test.go:6` records the deletion. The citation was false when written — I described a rider I had not opened. The real residue is in `spec`, not `charly`: resolvedproject.cue:331-332 and buildwire.cue:238 (plus their generated twins) still name the two functions in the present tense, and `WrapSpecBoxes`' own doc comment claims a charly consumer that has not existed since the #55 terminus. That makes the separability argument stronger, not weaker — deleting the three here would drag a spec schema sweep plus `task cue:gen` into the middle of a four-repo chain. R10 EVIDENCE NOW IN THE ENTRY, not only in the PR body, and re-run on the caught-up tree rather than the tree the header was written against. The gate the plan states is the gate that runs: check-tutorial-shell PASS (steps=13), which fails without this change because its box composes no supervisord candy and still gets [program:sshd]; check-migrate-local PASS (steps=6), exercising ProjectResolvedProject on the deploy path the injection now sits inside. Zero warnings. Assisted-by: Claude Code Anthropic Claude Opus 5 (fully tested and validated)
core/skills/service/SKILL.md:101 claimed `charly box validate` enforces that an image with an init-system layer must include the required dependency layer. That enforcement was deleted in the opencharly/sdk#119 plugins leg (validateInitDependencies in candy/plugin-box/validate_graph.go); a whole-tree grep returns zero hits. The skill had been documenting an enforcement that no longer existed — and pointing readers at a gate that could not have caught the shape that actually broke deploys, since a box passing validate still failed at [start] with no init in the image. The line now states what happens instead: a box composing a service: candy gets the active init's depends_candy added to its composition automatically, so it never has to list supervisord by hand and can no longer be missing it. Every skill in this repo is published to opencharly.ai, so this was a false claim on a public surface about the exact mechanism this chain changes. Found by the R1 claim-keyed sweep for the injection mechanism, not by reading the diff. Assisted-by: Claude Code Anthropic Claude Opus 5 (analysed on a live system)
…t a derived view (#120) #119 (bc183d1, v0.2026215.2321) 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, which is a pure BareCandyRef normalization of the authored list (buildkit/config_resolve.go:124-126) — a DERIVED VIEW, not a second source of truth. Five chain collectors (CollectDescriptions / CollectHooks / CollectBoxPorts / CollectShell / CollectBoxVolume) re-derive the composition from cfg via BoxCandyChain -> cfg.WalkBaseChain -> node.Img.Candy, so an injected candy contributed nothing to any of them: the image ran supervisord as PID 1 while the baked ai.opencharly.description label — the plan `charly check box` runs — never mentioned it. The pass now takes (cfg *spec.Config, layers, initCfg) and prepends the active init's candy to the AUTHORED composition via cfg.SetBox, before box resolution. Every derivation follows for free. The five collectors are UNCHANGED — no signature change, no threading, no fallback branch, no special case naming supervisord or init; base-chain folding (union across levels, first-occurrence-wins) is untouched. All three composition chokepoints move ahead of resolution: loaderkit.ProjectResolvedProject, deploykit.FillNamespaceBoxViews, and candy/plugin-build's resolveBuildEngine (superproject leg). loaderkit's freshOrder/freshBoxes two-pass dance — which existed only because injection had to run after resolve — is DELETED, not left dormant. Coverage: deploykit/init_depends_collect_test.go (new, seven tests) asserts the CONTRIBUTION class — description, ports, volumes, base-chain inheritance with de-dup, machine-venue negative, and idempotence across the three chokepoints in both local- and remote-keyed shapes. Assisted-by: Claude Code Anthropic Claude Opus 5 (fully tested and validated)
`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)
Round-2 review findings, all five mine. CHANGELOG, wrong PR and wrong repo. The entry credited the validator deletion to "the #119 plugins leg". opencharly/sdk#119 added the injection HELPER; the deletion is opencharly/charly#205 (9631f646, v2026.216.0358), and candy/plugin-box/ does not exist in sdk at all. CHANGELOG land order omitted the leg that matters. It concluded "neither claim describes a behaviour that is not yet true" from sdk#119 + #120 + distro-fedora#11 — while both the injection call site and the deleted presence check live in the SUPERPROJECT. Until #205 merged, charly neither injected nor had stopped policing, so both rewritten pages described behaviour the tool did not have. That is precisely the false state a validator caught in round 1; the fix was to land #205 first, not to soften the pages. The entry now names all five legs with their merges and tags. Three sibling pages carried the same corrected claim and were never swept, because the original sweep was keyed to literal strings rather than to the claim: distros/skills/tutorial-shell "Drop either candy and the check fails" — a three-candy-model claim containing neither literal. supervisord can no longer be dropped (it is injected, not listed), and of the two composed candies only sshd's removal fails the check: with no service: declared, nothing selects an init, so no config is assembled to hold the block. distro-fedora#11 fixed this exact sentence in the box comment; the skill's mirror was missed. infrastructure/skills/supervisord — the Usage example LISTED supervisord in a box's candy: list, with a comment saying service: layers "need" it, directly above prose stating you rarely add it manually. The example now omits it, so the sample and the paragraph under it agree. image/skills/layer — a generic require: example used [python, supervisord]. The example teaches require: mechanics and is not an init recommendation, but supervisord is now a hazardous name to demonstrate with, since composing the init by hand is the thing the injection makes wrong. Swapped for build-toolchain; the mechanism being taught is unchanged. Also removed cutover narrative from core/skills/service — "the presence check that used to enforce this is gone, it could not catch..." is history, and skills state current behaviour in present tense. The standing rule was already in the bullet's first half. Re-swept claim-keyed over four claim families, newline-normalized, instrument asserting what it read: 474 files enumerated, 474 read, 0 read failures. Zero live hits outside CHANGELOG/ history. Assisted-by: Claude Code Anthropic Claude Opus 5 (documentation reviewed)
The defect
Declaring a
service:in a candy is what SELECTS an init system and assembles its config — but nothing installed the selected init's own binary.With a box composing only
ripgrep+sshd(nothing bringing supervisord), measured before the fix:charly box validate→ passescharly box build→ succeeds;/etc/supervisord.confassembled,ai.opencharly.init="supervisord"set, but no supervisor package installedcharly check box→ passes (the service probe iscontext: [runtime], skipped at image scope)charly check run <bed>→ FAILS at[start].fallback_entrypoint: [sleep, infinity]did not mask it.The init vocabulary already declared the dependency correctly (
supervisord→depends_candy: supervisord;systemd→ none, since every machine venue already has one).DependsCandywas decoded and carried through the resolve envelope, then read by exactly ONE consumer — a validator that waived itself for dual-init candies, which is the shape the layer skill recommends everywhere and exactly whatcandy/sshdis. Nothing injected it into composition.The fix
New
deploykit.InjectInitDependsCandy(boxes, layers, initCfg)— the ONE shared pass (R3), mirroringComputeIntermediates's(boxes, layers)shape.Placement. The decision needs BOTH the box set and the candy graph — which candies trigger which init is a whole-composition question — so it cannot live in
buildkit.ResolveBox, which resolves ONE box in isolation and deliberately carries no candy map. That decoupling (documented onbuildkit.ResolveOpts) is respected, not changed.Target-awareness is structural, not a flag. The active init comes from
InitConfig.ResolveInitSystem— the SAME resolution that decidesai.opencharly.initand drives the render. A container resolves tosupervisord(injected); apreserve_user/bootc machine venue resolves tosystemd, which declares nodepends_candy, so nothing is added. A blanketrequire: supervisordon service candies would be the WRONG fix for exactly that reason: target-blind, it would install supervisord onto systems that already have an init.Why the companion validator deletion is safe
The superproject leg deletes
validateInitDependenciesand its four helpers. That is only defensible if injection makes the missing-init case impossible on every path that composes a box — not merely the build path. It does, and here is the full accounting.buildkit.ResolveBoxis the ONLY place a box'sCandylist is set (config_resolve.go,resolved.Candy = …). So every composition path funnels through one of three seams, and all three inject:ResolveAllBox's returned mapcandy/plugin-build/resolve.go), afterResolveAllBox, beforeComputeIntermediates/GlobalCandyOrder/RenderPrepAll. Also covers thepullNamespacedBox+resolveNamespacedBasesentries, which write into that same mapProjectResolvedProjectfresh-box looploaderkit)FillNamespaceBoxViewsdeploykit)Two consequences worth stating explicitly, because they are what close the argument:
candy/plugin-bundle'sresolveBoxSelectionreadsrp.Boxes[req.BoxRef]from the resolved-project envelope — the very envelope the second seam produces — rather than re-resolving. Same for the add-candy-on-box overlay shape, which readsrp.Boxes[req.BaseBoxRef].local:/VM deploy composes no box at all. Those substrates compile a candy list into an InstallPlan; there is noResolvedBox, so there is nothing for the guard to have checked. On a machine venue the active init issystemd, which declares nodepends_candyanyway.The third seam was found by auditing rather than assumed — an import namespace's boxes are resolved from the namespace's OWN config and reach NEITHER of the other two, so without it a namespaced box would have its init RESOLVED by the following
RenderPrepBox(bakingai.opencharly.init) while its init candy was never added: the very defect this closes.ResolveSpecBox/ResolveAllSpecBoxes/WrapSpecBoxeshave no production consumers — they are dead surface, not an open question. Named exit: the dead-code batch cutover, which also carriescharly/kernel_manifest_floor_test.go:175, whose prose still describesdeploykit.ResolveSpecBoxas live and rides along with the deletion. They are deliberately NOT deleted here: that would widen a deploy fix into a public-API removal with its own blast radius, and this cutover's R10 neither exercises nor changes verdict on their removal (the R2 separability test).The deleted code had zero test coverage —
git grepfor the five removed identifiers across*_test.goreturns nothing. That is part of why the defect survived: the guard was never exercised, and its dual-init waiver was never questioned.And the replacement seam had the same hole, now closed. Review mutation-tested it: replacing the
InjectInitDependsCandycall inProjectResolvedProjectwith a no-op left EVERYTHING green — the sdk suite, the superproject'sgo test ./charly/..., and plugin-build / plugin-bundle / plugin-box. The R10 beds do not close it either: the build path reaches the injection through the FIRST seam, and the superproject leg deletes the validator, so a silent no-op at the second seam was invisible. Shipping a fix for a zero-coverage defect with the same hole in the fix is not a thing this PR is going to do —loaderkit/resolve_project_test.gonow seals it (see Verification).The
loaderkitfresh arm now projects its views in a SECOND pass, because the injection rewritesimg.CandyandProjectResolvedBoxcopies that list into the view. That refactor also collapsed two byte-identical projection blocks into one closure (R3).Two RCAs worth reading
TestValidate_PortRelayMissingSocatbroke. Injection manufactured an "unknown candy" error that masked the socat error under test. The injected candy must actually be in the scan — an absent one is now a no-op, since a project without it could not install that init by any route.box/fedorawhile every unit test stayed green.BareCandyRefstrips only the@and the:versionsuffix, so a REMOTE candy is keyed by its full repo path (github.com/opencharly/charly/candy/supervisord) while the vocabulary names itsupervisord. Now resolved viaGetName(). Caught by reading the emitted Containerfile (R8), not by the tests — regression test added.Verification
go build ./...+go test ./...green incharly,sdk,spec, and every candy module (in-workspace andGOWORK=offfor out-of-process ones).gofmt -lempty. Binary rebuilt withtask build:binary; every command run through that worktree's./bin/charly.9 tests in
deploykit/init_depends_test.go: both directions, remote-key, idempotence, transitiverequire:, unreachable-candy no-op, and the namespaced-box path. Verified to FAIL with the implementation stubbed out, and the namespace test verified to fail with only that seam removed.NEW
loaderkit/resolve_project_test.go— the second seam, which the tests above cannot see: they all call the pass DIRECTLY, so they stay green ifProjectResolvedProjectsilently stops calling it. The test runs the genuine resolve -> inject -> project chain through the realbuildkit.ResolveBoxand asserts the projected view (rp.Boxes["tutorial-shell"].Candy) carries the init candy — sealing both halves of the wiring: the call itself, and the second-pass projection ordering the call forced. It lives inloaderkitso the coverage sits with the seam; the fixture cost was ~4 lines, sincedeploykit.NewSpecCandyModelis exported and the seams are plain func fields.Mutation-verified, both directions of the wiring. Neuter the call at
loaderkit/resolve_project.go:117:Move the projection back into the resolve loop (single-pass, pre-injection list) — same failure. Restored, on the caught-up tree:
Under the mutation the new test is the ONLY failure across
go test -count=1 ./...— which is exactly the point: nothing else in the module was watching that call.Doc-comment scope correction on
InjectInitDependsCandy: the presence check reads the box's OWN resolved order (ResolveCandyOrderwith a nilparentCandies), NOT its base chain, so a child whose BASE installs the init candy still gains it. Harmless for the artifact —GlobalOrderForBoxfilters a base-provided candy back out at render — butrp.Boxes[child].Candycan then name a candy the child does not itself install, and the comment now says so instead of claiming the chain is checked.R10, both directions, on the final tree:
container direction —
tutorial-shellcomposes only ripgrep + sshd, supervisord arriving PURELY by injection. Artifact proof:ARG BASE_IMAGE=ghcr.io/opencharly/fedora-supervisord:..., whose Containerfile runsdnf install -y supervisor. This bed FAILED at[start]before the fix.machine venue —
host: local,disposable: true.Re-run on the caught-up tree (round 3). The paragraph that stood here said the outputs came from the tree at
60c1a1cand argued the later commits could not affect them. That argument was probably right, but it is an argument where a run was available, and a reviewer correctly declined to waive this PR's own gate on it. Both beds were therefore re-run on the current tip:Zero warnings.
go build ./...,go vet ./...,gofmt -l,go test -count=1 ./...clean, and the seam-2 mutation re-run post-merge with the same result: neuteringloaderkit/resolve_project.go:117failsTestProjectResolvedProject_InjectsInitDependsCandyand nothing else; restoring it goes green. Both outputs are now in the CHANGELOG entry too, since a merged entry is immutable and a PR body is not.Round-3 correction — a false citation. The CHANGELOG named
charly/kernel_manifest_floor_test.goas prose still describingdeploykit.ResolveSpecBoxas live. That file does not exist: it was deleted from superprojectmainat21ab450b, about an hour before this PR's first commit, andcharly/import_purity_test.go:6records the deletion. I cited a file I had not opened. The real residue is cross-repo —spec/schema/resolvedproject.cue:331-332andspec/schema/buildwire.cue:238plus their generated twins — which strengthens the case for keeping the dead-code deletion out of this chain rather than weakening it.Systemd direction, stated precisely: there is no
preserve_user/bootc box anywhere in-tree, so no machine-venue IMAGE exists to assert on. Structurally the injection touches only box resolution, andlocal:/VM deploys compile candies rather than boxes, so it is unreachable there; the one machine-venue path that does go through box resolution is covered byTestInjectInitDependsCandy_MachineVenueInjectsNothing, plus the live local bed above.R2 routing (not this cutover)
candy/plugin-tmuxTestConcurrentTmuxRunsIsolateTypedPasteAndHighVolumeOutputfails in the superproject. Causality established: it fails identically on a pristinesdkwith this cutover's changes removed, andplugin-tmuximports neitherdeploykitnorloaderkit. Outside this cutover's R10; belongs to the next thematic batch, not parked.Landing
Chain:
spec(opencharly/spec#14) → this →box/fedora(opencharly/distro-fedora#11) → superproject. Merge after the spec leg. Tags here use the Go-module schemev0.<YYYYDDD>.<HHMM leading-zeros-stripped>, not plain CalVer.Assisted-by: Claude Code Anthropic Claude Opus 5 (fully tested and validated)