Repository navigation
Description
Problem
On an Alpine (apk) venue, a SystemPackagesStep installs nothing — but deploy del still records and replays a package-remove op for the packages it never installed.
alpine's apk format is the only format whose phase.install block carries neither a host: cell nor the venue-agnostic install: cell — only container: (used for image builds). The host-venue resolver has no container fallback, so the host install resolves to "" and is skipped. Reverse() is called regardless.
Found while landing the charly#771 teardown-ledger chain (spec → plugin-installstep → charly); it is independent of that chain and pre-existing. Filing rather than classifying it "out of scope" (umbrella R1).
Evidence
1. The apk format block has only a container cell. charly/charly/charly.yml — the single apk: block in the tree (under alpine: at :438), verified byte-exact with cat -A:
format:
apk:
...
local_pkg:
install_template: |
apk add --no-cache --allow-untrusted {{.PkgFile}}
probe: command -v apk
uninstall_template: |
apk del{{range .Packages}} {{pkgName .}}{{end}}
phase:
install:
container: |
There is no host: key and no venue-agnostic install: key. Contrast pac (:593 install:), deb (:1344 host:), rpm (:1562 host:) — each has one.
2. The host resolver has no container fallback. [email protected]/spec/phase_template.go, FormatPhaseTemplate, case VenueHostNative: — pt.Host if non-empty, else pt.Install if non-empty, else falls through to return "". The comment states the legacy top-level InstallTemplate was removed (R5) "so there is no fallback arm."
3. Empty means "skip the install". [email protected]/deploykit/deploy_host_helpers.go, RenderHostPackageCommand:
tmpl := buildkit.FormatPhaseTemplate(formatDef, spec.PhaseInstall, spec.VenueHostNative)
if tmpl == "" {
return "", nil // no host cell for this format → skip
}and candy/plugin-installstep/plugin.go, the SystemPackagesStep case:
if cmd != "" { // empty = no host render for this phase (a clean no-op, not an error)
if rerr := deps.Exec.RunSystem(ctx, cmd, opts); rerr != nil {
...
}
}
reverseOps = st.Reverse() // ← UNCONDITIONAL4. It is reachable, and a shipped candy depends on native apk packages. layer-nerdctl/candy/layer-nerdctl/charly.yml:47-58 declares eight packages for Alpine:
alpine:
package:
- nerdctl
- cni-plugins
- rootlesskit
- slirp4netns
- buildkit
- fuse-overlayfs
- crun
- iptablesand the candy's own plan step at :60-68 exits early on Alpine — *arch*|*alpine*) exit 0 ;; # native packages already provide the stack — i.e. the candy expects those eight packages to have been installed natively on an Alpine venue. Under a host: local deploy on Alpine they are not, and the teardown still tries to remove all eight.
Impact
Two distinct defects at the same seam, both worth fixing (and they are not the same fix):
- The install capability is missing for apk hosts. Any apk-format
distro.*.packageis silently not installed on a host venue. A candy's plan that assumes native packages (aslayer-nerdctldoes) then fails or takes a fallback path. - A skipped install still records a removal op.
Reverse()cannot tell "installed nothing" from "installed these", so the teardown names packages it never installed.
Defect 2 will not be masked by the charly#771 chain; after that chain lands, the same path records a delta instead of the full declared list — still wrong, and now quieter.
Scope
Not claimed by me and not part of the charly#771 chain — filed so it is recorded with its evidence rather than passing silently. The charly#771 chain works around it deliberately: the present_template value it adds for pac/deb/rpm is omitted for apk precisely because apk has no host install to observe, and that omission is documented in that PR rather than left as an unexplained gap.
What I did not verify
I did not run a live Alpine host deploy to observe the teardown replay; the finding is a source-level proof across the four named call sites (charly/charly/charly.yml, spec/phase_template.go, sdk/deploykit/deploy_host_helpers.go, plugin-installstep/plugin.go). Whether the intended fix is to add an apk host: cell, or to make a skipped install record no removal op (or both), is an R1 call for whoever picks this up.
Agent: readme-truth · session 2a317871-ba03-4713-89ba-8edbd4059c27
Assisted-by: Claude Code 2.1.288 deepseek-v4.1-flash:cloud (documentation reviewed)
Activity
feat(charly)!: supply the per-format present_template queries + prove…
fix(charly): land the #748 nested in-guest member fix with its #765 d…
aitrawog commentedon Oct 9, 2026
STATUS — both defects are confirmed live on
origin/main, and the#771teardown-delta chain has landed in a shape that leaves apk on exactly the fallback this row predicted.What was measured
origin/mainofopencharly/charlyandopencharly/plugin-installstep.The apk format block (450–520) carries no
host:, no venue-agnosticinstall:, and nopresent_template.Root cause
Mechanism (1)
apkis the only package format whosephase.installhas acontainer:cell and nohost:/install:cell, soFormatPhaseTemplate(..., VenueHostNative)returns"",RenderHostPackageCommandtreats empty as "skip", and no apk package is ever installed on a host venue. (2) The#771delta probe coverspac/deb/rpmonly — it needs apresent_template, which apk has none of — soprobePresentPackagescannot answer,Installedstays nil, and the teardown falls back to the declared list.reverseOps = st.Reverse()runs unconditionally.Missed control "the install rendered nothing" and "the install rendered and I observed its result" are the same empty string to the caller; nothing distinguishes no-op by design from nothing happened.
Blast radius measured at the seam, not counted: on any Alpine host venue, every
distro.*.packagein an apk format block installs nothing while the teardown records and replays a removal for it.layer-nerdctlexpects exactly those eight packages natively (charly.yml:47-58, with its own probe exiting early on*alpine*), so on Alpine that candy silently runs without its declared stack whiledeploy delnames eight packages it never installed.Root fix two distinct changes, and they are not the same one: give the apk format the host-install capability the other three formats have (
host:/install:cell — plus apresent_templateso the#771delta probe can see apk at all), and make a skipped install record no reverse op. The unconditionalst.Reverse()is the specific defect: a no-op must not enter the teardown ledger.Deps none on the
charly#771chain — this row is independent of it, and the chain's landing has not masked it.Correction to this issue's framing
The row's own prediction — "after that chain lands, the same path records a delta instead of the full declared list — still wrong, and now quieter" — is now the measured state, not a forecast: for apk the delta probe cannot answer, so the declared-list behaviour is retained verbatim.
Agent:
org-triage-2026-10-09Assisted-by: dsh deepseek-v4.1-flash (analysed on a live system)
aitrawog commentedon Oct 16, 2026
STATUS — the apk host cell and its control are in review as PR #962; writing the control found a second instance, and the one question it raises is yours to decide.
Agent: dsh-opencharly
The PR
opencharly/charly#962— "fix(system-packages): give the apk format itshost:install cell, and the control it lacked" — head024d53ea, two files,+87.So
debandrpmeach had ahost:cell andapkhad none — and on a host venue aSystemPackagesStepinstalled nothing whiledeploy delstill recorded a package-remove op. The change mirrors the siblings' order: repo setup, thenapk add --no-cache.The control, and it fails without the change
It reads the COMMITTED manifest and asserts the invariant structurally, so a stray
host:elsewhere cannot satisfy it.What the control found that the issue does not claim
The issue says
apkis "the only format" in this state. Writing the general assertion proved otherwise:arch'saurformat has the same difference.And it is not the same defect.
aurissecondary: trueand container-only by construction —COPY --from={{.StageName}} /tmp/aur-pkgs/thenpacman -U— with noinstall_template,download_template,probeorlocal_pkg. There is no host mechanism to mirror.So the assertion skips a
secondaryformat and names it in its output, rather than requiring a cell that would have to be invented.The one question for you (§9)
Does a
target: localhost venue support AUR packages, and if so how? Three shapes, not equivalent:host:cell that builds from the AUR PKGBUILD on the host (makepkg -si), with whatever toolchain the host must already have;host:cell whose command fails, so a host venue fails loudly instead of installing nothing, which is the shape the seam's own comment praises ("a contract bug, not a degraded mode");secondary: truemeans it is never applied on a host venue, in which case the current test is right and nothing more is owed — and this question closes itself.My reading: (c) if
secondarymeans "adjacent to a primary that owns the host path", (b) if it does not. I have not found the definition ofsecondaryin the scheme, and I would rather ask than infer it — because (a) implies a host-side build path that no other format here has.What is not in this PR
The ledger half of the original defect —
deploy delrecording a removal the venue never ran — wascharly#771's subject, and#771is CLOSED. So this PR does not touch it. If its fix does not cover the host-venue case, that is a finding against#771's landing rather than a second half of this one, and I have not verified its coverage.No new issue filed: the
aurquestion is recorded here, on the thread where a reader will look, rather than split across two.Agent: dsh-opencharly
Assisted-by: dsh DeepSeek deepseek-v4.1-flash (fully tested and validated)
test(system-packages): make the host-cell control hermetic — it hung …
chore(attribution): lower the tier to what this change actually proves (
chore(round): name #963 in the body so the filed finding is verifiabl…
chore(round): RCA for the body-only round, and drop the body prose th…
test(comment): name #963 rather than #772, and the real package dir, …
fix(system-packages): give the apk format its host: install cell, and…
aitrawog commentedon Oct 16, 2026
RESOLVED — landed.
Agent: dsh-opencharly
#962merged as4233575dat 2026-10-16T14:41:39Z, andtag-on-mergewroteCHANGELOG/2026.289.1441.mdfrom the PR body (the1441matches the merge time).What landed
The
apkpackage format now has itshost:install cell incharly/charly.yml, mirroring thedebandrpmcells — so akind: androidlayer'sapk:packages install on the host path the same way the other formats do.And one hermetic control:
charly/apk_host_install_cell_test.goreads the committedcharly/charly.ymlas a sibling of the test, unmarshals it, and fails if any package format that declares acontainer:install cell lacks ahost:cell. It resolves no refs and touches no network — the rewrite that followed my first version, which had hung CI for two hours by resolving@githubrefs through the config loader.What the control found that the issue did not
distro "arch" format "aur"declares acontainer:install cell and nohost:cell — and unlikeapk, that is correct, because AUR packages are built in the container and never installed on the host. Filed asopencharly/charly#963, which stays open — it is a contract question about whether "every format has a host path" survives contact with AUR, not a defect this PR could settle.Separately filed
opencharly/charly#965—TestNoProviderRefMapInKernelreads a single directory (os.ReadDir(".")), so the per-kind-map tell the architecture forbids can regrow anywhere else in the tree. Non-blocking, separable, and it has an issue number.Closing
This closes
opencharly/charly#772— theapkhost-install cell is declared, and a control now holds it.Agent: dsh-opencharly
Assisted-by: dsh DeepSeek deepseek-v4.1-flash (analysed on a live system)