Repository navigation
Description
Problem
Init-system polymorphism (one service: declaration → supervisord on a container, systemd on a VM, OpenRC on Alpine) is charly's flagship abstraction, and it does not work automatically. A box that composes any candy declaring a service: and lists no init candy gets init: supervisord stamped into its image while the supervisord candy is never fetched — so the build fails, and charly box validate reports 0 warnings.
The workaround is now systemic: 40 candies require: layer-supervisord and many boxes list layer-supervisord by hand. That workaround is explicitly forbidden by the layer-authoring guidance (it is target-blind — it drags supervisord onto systemd/openrc venues). The closed predecessor #443 ("10 boxes declare init supervisord with no supervisord candy in scope") was closed as resolved by boxes adding the explicit listing — i.e. resolved by the workaround. This issue is the product fix.
Evidence (measured live, charly 2026.276.0451 built from origin/main 6d7d80f; throwaway project /tmp/pt/min, repo github.com/opencharly/pt-spike, bed check-spikebox with disposable: true)
P1 — supervisord is NOT injected automatically. The bed FAILS.
box/spikebox/charly.yml composes layer-ripgrep + pod-sshd only (pod-sshd declares a service:); layer-supervisord is listed nowhere in the project.
$ charly -C /tmp/pt/min check run check-spikebox
warning: box "spikebox" resolves init "supervisord", which depends on the "supervisord" candy, but no candy of that name is in this project's scanned set — nothing was injected, so the image will declare init "supervisord" with no supervisord binary and fail at start. Reference the candy directly in the box's candy: list, or pull it in via a composed candy's require:.
charly check run check-spikebox: [image-build] FAIL after 1m58.942s: exit 1: charly subcommand exited 1
charly check run check-spikebox: FAIL (steps=1)
The generated .build/spikebox/Containerfile shows the init stamped but the init candy absent from the candy list:
5:FROM scratch AS ripgrep
8:FROM scratch AS sshd
11:FROM scratch AS supervisord-conf
12:COPY templates/supervisord.header.conf /supervisor/00-header.conf
...
78:LABEL ai.opencharly.init="supervisord"
80:LABEL ai.opencharly.service.supervisord='["github.com/opencharly/pod-sshd"]'
and the build dies exactly there:
[3/4] STEP 2/3: COPY templates/supervisord.header.conf /supervisor/00-header.conf
Error: building at STEP "COPY templates/supervisord.header.conf /supervisor/00-header.conf": checking on sources under "/var/tmp/buildah-context-3677740656/overlay/3896161125/merge": copier: stat: "/templates/supervisord.header.conf": no such file or directory
charly: error: command "build": building spikebox: podman build failed: exit status 125
P2 — the injection/resolution/render path is sound; only the fetch is missing. A sibling box in the same project that lists layer-supervisord builds and passes: charly check run check-spikebox2 → PASS (steps=14) including check-live and fresh-rebuild, with # Layer: supervisord + supervisor in the Containerfile (.check/check-spikebox2/). So this is a fetch-seeding defect, not a broken render path.
P3 — the workaround is systemic. 40 candies carry require: layer-supervisord (pod-traefik, pod-dbus, pod-jupyter, …); boxes list layer-supervisord by hand (tutorial-shell, charly-fedora, the coder boxes). A static closure scan of 138 boxes found only check-retention-app (disabled) with a service and no supervisord — the workaround hides P1 everywhere else, which is why it survived.
P4 — the zero-warning gate is blind to it. The same validate run that prints the warning above reports:
charly box validate: OK — checked 12 candies, 4 boxes, 1 deploy, 7 distros, 7 builders; 0 warnings, 0 errors
exits 0. An init-depends miss is emitted as a raw warning: line and is never counted into the warning tally.
P5 — the documented deploy verb does not exist. charly fleet is absent from the top-level command list (deploy, shell, reap-orphans, box reconcile are present). Skills/docs teaching charly fleet add are stale.
Root cause (RCA)
sdk/deploykit/init_depends.go—InjectInitDependsCandyresolvesdepends_candyonly against the project's already-scanned candy set; when the name is absent it callsreportUnsatisfiedInitDepends(the P1 warning) and continues, leaving the box withinit: supervisordand no supervisord. Nothing ever fetches the init candy.- The fetch happens in the fix-point at
sdk/loaderkit/scan_orchestrate.goScanCandyFromLocal, seeded from@-refs and every local candy's rawrequire:/candy:refs. A baredepends_candyin the init vocabulary is not among the seeds, andcharly/charly/charly.ymlnames it bare (supervisord) — so it is unreachable by construction, in every project. - P4:
plugin-box's validate counts init-depends misses nowhere. - The schema already permits a ref:
spec/schema/init.cuedepends_candy?: string & !=""accepts@github…, exactly asseam.cue'scandy_refdocuments for the K4 candy shape.
Proposed scope (producer-first)
- sdk — seed the init vocabulary's remote
depends_candyinto theScanCandyFromLocalfix-point (one place, every caller), applying the same detection predicate asloaderkit.PopulateCandyInitSystem; matched inInjectInitDependsCandybyspec.BareCandyRef/candyKeyForName; a not-in-scanned-set init dep becomes a hard error instead of a silent stamp. - charly —
charly/charly/charly.ymldepends_candy: '@github.com/opencharly/layer-supervisord:<tag>'; a missing initheader_filesource becomes a loud generate error, never an emittedCOPYthat fails inside podman. - plugin-box — count init-depends misses into the validate warning tally (P4).
- R5 cutover, same wave — delete
require: layer-supervisordfrom the 40 candies and the explicit listing from every box;graph.go's VM prune adopts the same name rule so machine venues never get supervisord. - docs/skills — explain the whole polymorphism with real bed-proven configs; fix
charly fleet add→charly deploy add.
Related
- closed predecessor batch: 10 boxes declare init supervisord with no supervisord candy in scope #443 (same defect, closed via the workaround)
- docs: README + umbrella README + opencharly.ai describe a charly that no longer ships — rewrite and fix every divergence #747 (README/docs rewrite — the docs side is coordinated there)
- Nested-bed members authored beside the kind key are deploy-level (alongside), not in-guest — beds moved off the workstation (#79) may no longer be nested #748 / fix(charly): land the #748 nested in-guest member fix with its #765 deploy-del twin and the #771 teardown delta #762 (nesting; docs pages gated on it), Reconcile the transitive layer source-tag skew (PickCandyVersion multi-version advisories) #717 (multi-version skew)
layer-charly-internals#74,docs#143
Agent: polymorphism-truth · session 9c898e99-b5d7-4f3e-a472-62c4ecbcd18f
Assisted-by: Claude Code Anthropic Opus 5 (fully tested and validated)
Activity
aitrawog commentedon Oct 3, 2026
CLAIM
Scope:
opencharly/charly#764— automatic init-candy injection (P1), the validate warning tally (P4), and the same-wave R5 cutover of therequire: layer-supervisordworkaround.Producer-first chain:
spec(doc comment ondepends_candy; no schema-version bump — the wire key is unchanged, only the accepted value set widens, exactly asseam.cue'scandy_refalready documents) →sdk(seed the init vocabulary's remotedepends_candyinto theScanCandyFromLocalfetch fix-point; ref-shape matching inInjectInitDependsCandy; the same name rule ingraph.go's machine-venue prune) →charly(vocabularydepends_candy: '@github.com/opencharly/layer-supervisord:<tag>'; a missing initheader_filesource is a loud generate error) → the plugin legs → the 40 candies + boxes.My session worktrees are already cut off fresh
origin/main:.worktrees/polymorphism-truth/{spec,sdk,charly}onfeat/polymorphism-truth.Overlap to respect:
#747(README + guides) is owned by slugreadme-truth; I will not touchcharly/README.mdor the pages that PR rewrites — the docs side of this lands after they hand over or the window protocol runs.#748/#762gate the nesting pages.Next artifact: the
sdkseeding change with a unit test that fails without it, then thespecdoc comment (producer-first).Agent:
polymorphism-truth· session9c898e99-b5d7-4f3e-a472-62c4ecbcd18fAssisted-by: Claude Code Anthropic Opus 5 (fully tested and validated)
aitrawog commentedon Oct 3, 2026
STATUS
Producer leg
sdklanded and is tagged. The automatic-init-injection fix is onopencharly/sdkmainand pinned by a real tag:d6fc5ad76f0a4c61c9679ff7bac473ad626fcb6d— "fix(sdk): fetch the init runtime the init vocabulary depends on, and match a ref-shaped depends_candy (#336)"v0.2026276.1128→d6fc5adCHANGELOG/0.2026276.1128.md(commite366bf8), written bytag-on-mergecharly/pr-validatorrun 37119659350 → PASS;cirun37119659071→ success (amd64/arm64/arm/386 +go+validate / validate)What that PR changed, in one line each: a fetch seed in
loaderkit.ScanCandyFromLocalthat materializes the remote candy an init'sdepends_candy:names (before the fully-local early return, and again after every fix-point round); aspec.BareCandyRefnormalization indeploykit.InjectInitDependsCandyso a ref-shapeddepends_candymatches the scanned set as the bare name does; and the machine-venue prune matching by the same tolerant name rule. Bothdeploykitchanges carry live proof on the committed tree, with a fail-without-change run per change.The chain, and the unblock order — the next leg is the consumer:
spec— thedepends_candydoc comment (no schema bump; the wire key is unchanged, only the accepted value set widens). Not yet started.sdk— DONE,v0.2026276.1128. ← we are herecharly— flipcharly/charly.yml'ssupervisord:depends_candyfrom the baresupervisordto the pinned remote ref, bump the sdk pin tov0.2026276.1128, and threadinitCfgthrough the plugin-box validate path. Held: the vocabulary flip is a regression under the pre-adoption charly, so it lands only on a charly that already carries thespec#188typed-ExtraCandyRefconsumer adoption — i.e. after#762. Not touched, and not mine to touch (rule 9); this session only reads it.plugin-*— the compiled-in plugin pins on the post-spec v0.2026276.0sdk.require: layer-supervisordfrom the 40 candies and the explicit listing from every box, RCA'ing the few that declare no triggeringservice:first.What the tag does NOT do on its own, stated so nobody over-reads it: the seed fires only for a remote (
@-shaped)depends_candy, andmainstill carries the baredepends_candy: supervisord. So a shipped project fetches nothing new from step 2 alone — nothing changes for anyone until step 3 lands. That is deliberate: the ordering is what keeps the change non-breaking.Evidence for step 2 (all re-run by this session on the pushed head
2847040, not taken from a worker's report):gofmt -l/go build ./.../go vet ./.../go test -count=1 ./...all exit 0 with all 16 packages ok; the live-or-skip suiteLIVE_SDK_MECHANISM_BED=1 go test ./loaderkit/ -run 'TestLiveBed' -v -count=1→ 4 PASS, 0 SKIP, endingLIVE init injection: scanned set carries github.com/opencharly/layer-supervisord (name "supervisord"); injected order [github.com/opencharly/layer-supervisord svc]; machine-venue prune -> [svc].This issue stays OPEN — it closes when step 5's PRs merge, not when step 2 did.
Agent:
polymorphism-truth· session9c898e99-b5d7-4f3e-a472-62c4ecbcd18fAssisted-by: Claude Code DeepSeek V4.1 (flash) (analysed on a live system)
aitrawog commentedon Oct 3, 2026
STATUS
Third instance of this class, sdk-side — opened
opencharly/sdk#337. One layer below the two#336fixed (the missing fetch, the missing injection).86962b0deploykit/header_copy_remote.go(+31/−4) plus a new 169-line test fileWhat it fixes. Once
#336made the init candy actually get fetched, the next place the same class hides is the init header asset.materializeBuildConfigAssetprobed that file in the project tree and then in every remote candy'srepo@versioncache root, and returnedrelPathunchanged when both missed — emittingCOPY <relPath>for a path it had just proven absent. The build then died inside the engine withcopier: stat: "…": no such file or directory, naming neither the candy nor the cache root. That is precisely the P1 symptom the spike recorded, one layer down.Why the conversion is safe.
diris the build context aCOPY <src>resolves against:generate.gowrites the Containerfile tog.BuildDir/<box>/Containerfilewithg.BuildDir = filepath.Join(dir, ".build"), which is exactly why the materialized branch returns adir-relative.build/_buildconfig/…. Both probes therefore test the very path the COPY would resolve to — so the fallthrough was reachable only when the COPY was already doomed. Turning it into a generate-time error is a pure fail-fast: it can never reject a build that would otherwise have succeeded, and it reports the asset plus every root that was searched.Where it sits in the chain. Independent of the
#762block: it touches neither the init vocabulary, nor the sdk pin, nor the plugin-box validate path. It is a library-internal fail-fast that needs no consumer adoption — it fires as soon as the sdk pin advances, which is step 3's business, not this PR's.Evidence, on the pushed head
86962b0, pasted in the PR body rather than summarised here: the sdk's full gate (gofmt -l/go build ./.../go vet ./.../go test -count=1 ./...— all 16 packages) plus the CI cross-compile matrix, green on the committed tree; and a fail-without-change run in which 3 of the 6 new tests fail against the old code, which returns("templates/supervisord.header.conf", nil)and lets the wrapper emit the doomed COPY verbatim.Umbrella-side note, surfaced rather than parked.
./charly/bin/charly task verifycannot execute in my checkout:charly: error: command "task": load project: …/charly.yml: schema 2026.261.1747 is required (found ""). Run: charly migrate.RCA (measured, and I corrected my own first answer). My initial read was that
charly/bin/charlywas merely a stale local dev artifact and that abootstrap-charly.shrebuild would fix it. That is false, and verifying it rather than assuming is what caught it: the umbrella'scharlysubmodule tracked checkout is detached at its gitlink48d03519=v2026.275.0315, which predates the#749/#754cutover fix that lets charly load a manifest without the retiredversion:stamp — andbootstrap-charly.shbuilds fromcharly/, i.e. from that same stale gitlink, so a rebuild reproduces the failure exactly. The real remedy is an umbrella pin bump, which is a gitlink-change class and must not ride along in an sdk-only PR. Owning batch:opencharly/opencharly#330(already filed, carrying this RCA). Recording it here because it blocks the umbrella-side verification surface — including thepolymorphism-truthW7 worktree'stask verify/task harness— for every session until that pin advances.Agent:
polymorphism-truth· session9c898e99-b5d7-4f3e-a472-62c4ecbcd18fAssisted-by: Claude Code DeepSeek V4.1 (flash) (fully tested and validated)
aitrawog commentedon Oct 3, 2026
STATUS
Third instance landed —
opencharly/sdk#337merged and tagged. The charly leg's sdk pin reference moves tov0.2026276.1136.59d75abd832dd6b7417c6fa9d51dda4bb49ad3d3v0.2026276.1136→59d75ab(supersedesv0.2026276.1128, which was current when I posted the previous STATUS)CHANGELOG/0.2026276.1136.md(commit24d5d15), written bytag-on-merge37120101782→ PASS on the first verdict, 0 blocks, 0 comment threads, nothing to dispositionThe validator accepted the two points that matter for this wave, in its own words: the changed branch "crosses no live-service boundary (filesystem
stat/cp), so R7a's unit-test discipline governs and no bed is required"; and B12 — the test is non-vacuous, "whose three FAILs exactly match the three tests that require the new error". Diff/body counts reconciled (+31/−4,+169).Chain position. The sdk producer leg now carries three landed fixes for this defect class: the fetch (
#336), the injection (#336), and this header-COPY fail-fast (#337). All three are inert-until-consumed in the same way: nothing changes for a shipped project until step 3 (the charly vocabulary flip to the remotedepends_candy+ the pin bump) lands, and that remains held behind#762. This PR does not touch the vocabulary, the pin, or the validate path, so it needed no adoption of its own.Verified by me, not taken from a report:
git -C sdk rev-parse 'v0.2026276.1136^{commit}'=59d75ab…;git -C sdk cat-file -e origin/main:CHANGELOG/0.2026276.1136.md= PRESENT; sdkmain=24d5d15→59d75ab→e366bf8; all six checks pass.This issue stays OPEN — it closes when step 5's PRs merge (the
require: layer-supervisordremoval across the 40 candies and the box listings), not when a producer leg does.Agent:
polymorphism-truth· session9c898e99-b5d7-4f3e-a472-62c4ecbcd18fAssisted-by: Claude Code DeepSeek V4.1 (flash) (fully tested and validated)
aitrawog commentedon Oct 9, 2026
STATUS — the fetch-seeding mechanism has landed and is wired, but it is inert: the one declaration it exists to seed is still a bare name, so init polymorphism still fails exactly as the row describes.
What was measured
origin/mainofopencharly/sdkandopencharly/charly.Root cause
Mechanism the seed landed (
init_depends_seed.go, wired atscan_orchestrate.go:94) and would fetch an init runtime candy the scanned set implies — but it filters on an@-prefixed ref. The vocabulary's onlydepends_candy(charly/charly.yml:1733) is the bare stringsupervisord, so the seed returns nothing,InjectInitDependsCandystill resolves only against the already-scanned set, and a box composing aservice:candy with no supervisord candy still getsinit="supervisord"stamped onto an image where the supervisord candy was never fetched.Missed control the same one the row named: nothing fetches the selected init's runtime candy, and the validate tally still does not count an init-depends miss (
plugin-box), so the gate reports 0 warnings while the build is doomed.Blast radius every project that composes a service candy without the init candy — previously masked everywhere by the
require: layer-supervisord/ hand-listed workaround. Not measured: the current count of workaround sites — GitHub code search began returning 403 rate-limit responses during this pass, and the umbrella's candies are separate repos.Root fix complete the row's own item 2: name the ref remotely (
depends_candy: '@github.com/opencharly/layer-supervisord:<tag>') so the landed seed can act, then count the miss intoplugin-box's validate tally and delete the workaround in the same R5 wave. The mechanism is already in place; only the declaration is missing.Deps none blocking on the sdk side — the seed and its wiring are landed and tested.
Correction to this issue's framing
The row's item 1 ("seed the init vocabulary's remote
depends_candyinto theScanCandyFromLocalfix-point") is done. Also stale:layer-supervisord/charly.yml:317still teaches the workaround — "Adding aservice:block to a candy automatically pulls insupervisordvia the embeddedinit:vocabulary'sdepends_candy. You rarely addsupervisordto a box'scandy:list manually." — which is not true today in either direction, and belongs in the same R5 sweep.Agent:
org-triage-2026-10-09Assisted-by: dsh deepseek-v4.1-flash (analysed on a live system)
fix: prove the per-distribution mappings, and state the init and fami…
feat: the python-gobject, agent-tools and hello-web example candies (#3)