Skip to content

feat(sdk)!: K-wave seam-death terminus — loaderkit orchestration, deploykit concurrency correctness, DNS preflight - #122

Merged
atrawog merged 34 commits into
mainfrom
feat/v2-kwave-terminus
Aug 5, 2026
Merged

atrawog merged 34 commits into
mainfrom
feat/v2-kwave-terminus

Conversation

@atrawog

@atrawog atrawog commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

The sdk leg of the K-wave seam-death terminus: 29 commits — the loaderkit growth that lets plugins load projects themselves (the program keystone), plus the deploykit concurrency-correctness fixes the terminus roster surfaced.

Highlights (full narrative in CHANGELOG/2026.999.0001.md; per-commit bodies carry the RCAs):

  • loaderkit (K1): kind-decode/entity-assembly/tree-builder/box-validate-walk/remote-fetch orchestration relocated from core; Resolve{Vm,K8s,Android}EntityViaExecutor; deterministic local-body resolution for shadowed candy refs; RunBootstrapPhase loud failure; RequestedBoxes seeding.
  • deploykit: ONE locked read-modify-write cycle (MutateBundleConfig, flock + re-read + merge-on-latest) for the per-host overlay — the run-2 lost-update family's fix; BringUpMembers/TearDownMembers canonical home + the precise cross-member container-DNS preflight (infra-class failure naming the stale-aardvark condition); flock-held build temps vs the stale-temp sweep; loud missing-package-source on check beds; render-service → InvokeProvider.
  • kit: the false ${DEPLOY_NAME} cluster-addressing claim corrected.

Dependency note (B2): this leg follows spec PR opencharly/spec#17 — after spec merges+tags, the go.mod spec require bumps to the new tag (the retidy step of the chain); in-tree resolution is via the workspace replace.

Proof: the 28-bed roster at measured caps + red/green units per fix (concurrency cycle with negative control, shadow preference, sweep-hold, preflight), zero warnings.

Assisted-by: Claude Code Anthropic Fable 5 (fully tested and validated)

https://claude.ai/code/session_015CXB8CkzwZeXPzbqKjsuYj

atrawog added 30 commits August 3, 2026 22:19
…mechanism

Moves the per-entity CUE decode path (shorthand normalize + CUE-ingest +
Decode) out of charly core into sdk/loaderkit verbatim, per the K1 loader
keystone plan (task #12, W1-spike verdict): DecodeEntityViaCUE +
NormalizeEntityNode + the shorthand expanders (PackageItem/PortSpec/
PreemptibleConfig/TunnelYAML) + flattenYamlFields/forceStringTag/
cloneYAMLNode, relocated from charly/cue_normalize.go + charly/cue_loader.go.

Zero registry coupling (pure reflect+yaml.v3+CUE, spec.* types only) — owns
its own cue.Context (decodeEntityCueCtx), never Unified against charly
core's process-wide cueSchemaCtx, so the two contexts never interoperate.

Two tests relocate here with their subject (TestLibvirtListeners_
OpaqueNotExpander from charly/listen_opaque_gate_test.go,
TestLocalPkgMapRejectsScalar from charly/localpkg_test.go) — both exercise
this mechanism directly with zero charly-core dependency.

Rides the terminus B2 chain: charly's super leg repoints layers.go/
node_build.go through the new spec.ProjectLoader.DecodeEntityViaCUE seam
and deletes the two core files in the same program.

Assisted-by: Claude Code Sonnet 5 (analysed on a live system)
Moves the CUE-validate mechanism out of charly core into sdk/loaderkit, per
the K1 loader keystone plan (task #12): ValidateEntityClosedCUE (entity
closedness check), CueDocFromYAML (YAML->cue.Value ingest), ValidateNodeDocCUE
(the load-time #NodeDoc structural gate, per-entity to avoid the O(entities x
kinds x children) whole-document blow-up), and ApplyCueDefaults (post-merge
schema-defaults fill) — relocated verbatim from charly/cue_schema.go +
charly/cue_node.go + charly/cue_defaults.go.

Every call carries the host's spec.CueSchema handle (Ctx/Root/KindDef) rather
than compiling an independent schema: these functions Unify against the
host's process-wide sharedCueSchema, and cue.Value instances only interoperate
within the cue.Context that built them (unlike unit 1's DecodeEntityViaCUE,
which never Unifies against the shared base schema and so safely owns its own
context). docDirectiveSet is NOT re-threaded — it reuses the existing
sliceSet(spec.DocDirectives) already declared in parse.go (R3).

Rides the terminus B2 chain: charly's super leg wires candy/plugin-loader and
keeps thin core wrappers over the new seam methods.

Assisted-by: Claude Code Sonnet 5 (analysed on a live system)
…nd-decode support helpers

Moves the bundle/resource-member kind-decode SUPPORT helpers out of charly
core into sdk/loaderkit, per the K1 loader keystone plan (task #12):
IsResourceDisc / BundleTargetForDisc / SetBundleCrossRef (relocated from
charly/node_bundle.go) and IsStandaloneResourceKind / FoldStandaloneTemplateReply
(relocated from charly/node_normalize.go) — reusing the already-declared
resourceKindSet (parse.go, R3) rather than re-threading it.

These are pure functions of the registry-derived spec.Threaded snapshot
(DeploySubstrates/DeployTraits) with zero *genericNode dependency — unlike
their siblings in the same two files (buildBundleNode, isDeployShape,
decodeStandaloneTemplateJSON, resourceChildren), which stay core pending the
K1 unit 3b genericNode-boundary design.

Rides the terminus B2 chain: charly's super leg wires candy/plugin-loader
and keeps thin core wrappers over the new seam methods.

Assisted-by: Claude Code Sonnet 5 (analysed on a live system)
…ndle tree-builder

Moves the entity-body assembly + bundle/resource-member tree-builder mechanism
out of charly core into sdk/loaderkit, per the K1 loader keystone plan (task
#12): AssembleEntityBody/DecodeNodeValue/EntityBodyJSON (relocated from
charly/node_build.go + charly/provider_kind_invoke.go) and BuildBundleNode/
BuildResourceMemberChildren/BuildBundleNodeInto/IsDeployShape/
DecodeStandaloneTemplateJSON/ResourceChildren (relocated from
charly/node_bundle.go + charly/node_normalize.go, both now deleted/thinned).

Operates on spec.ParsedNode throughout — never charly's *genericNode, which
this relocation does NOT touch (it stays core, consumed directly by the TRUE
clause-M dispatch's bootstrap-critical candy/box routing). A private
discValue(pn) helper reconstructs the yaml.Node a scalar-vs-mapping shape
check needs (mirrors charly's former parsedNodeToGeneric reconstruction
exactly, so cross-ref/deploy-shape detection stays byte-identical for every
JSON scalar type, not just strings). EntityBodyJSON reuses parse.go's
existing entityBodyJSON(name, discValue) helper rather than reimplementing
the yaml-marshal/json-remarshal transform (R3).

Rides the terminus B2 chain: charly's super leg wires candy/plugin-loader
and threads pn straight through provider_kind_invoke.go's dispatch chain.

Assisted-by: Claude Code Sonnet 5 (analysed on a live system)
…ree walk

Moves the box-validate entity-tree walk out of charly core into
sdk/loaderkit, per the K1 loader keystone plan (task #12), completing the
K1 unit 2 deferral: ValidateCandyManifestCUE / ValidateNodeFormSteps
(relocated from charly/cue_schema.go, both had exactly one production
caller — validate.go), plus their purely-internal helpers
assembleAndValidateEntitySteps / ValidateEntityNodeRec (relocated
verbatim — zero registry coupling of their own, so no core wrapper is
needed for either).

Zero registry coupling in this whole family: the only host-coupled inputs
are t (the Threaded snapshot, already built) and parser (the resolved
DocParser), both threaded in exactly like WalkSeams/MaterializeSeams thread
host-built DATA to a kind-blind mechanism.

Rides the terminus B2 chain: charly's super leg wires candy/plugin-loader
and keeps thin core wrappers for the 2 seam-exposed entry points.

Assisted-by: Claude Code Sonnet 5 (analysed on a live system)
…ation + candy-ref collection

Moves the remote-repo fetch ORCHESTRATION + candy-ref collection mechanism
out of charly core into sdk/loaderkit, per the K1 loader keystone plan (task
#12): EnsureRepoDownloaded (local-override short-circuit, cache-hit check,
cache-miss dispatch through the RefsDownloader backend, post-fetch schema
auto-migration) and CollectRemoteRefsOpts (the depth-first base/builder/
candy-ref graph walk over a *spec.Config) — relocated from charly/refs.go,
along with their private helpers (normalizeOverrideRepoPath, repoOverrideDir,
cacheBehindHead, the autoMigratedRepos re-entrancy guard).

Both operate on spec.Config/spec.CandyReader/spec.ResolveOpts directly:
charly core's local `Config` name is `type Config = spec.Config`
(config.go), so this relocation adds no new dependency, just repoints
through the ALREADY spec-legal underlying type — confirmed via
`grep func (c *Config)` across charly/*.go returning zero results (every
method is genuinely defined on spec.Config itself).

The two genuinely registry-coupled calls this mechanism used to make
directly — the local-template substrate-plugin resolve (former
resolveLocalViaPlugin) and the command:migrate dispatch (former
autoMigrateCacheProjectOnly) — thread in as spec.RefsCollectSeams callback
fields, exactly like MaterializeSeams.DecodeEntity/BuildBundleEntity thread
the registry-touching kind dispatch to a kind-blind mechanism.

RepoOverrideEnv (the env var NAME) / selfSuperprojectOverridePair /
mergeRepoOverrides stay core: they are shared with host_build_check_bed.go's
+ check_cmd.go's check-bed local-override wiring, a DIFFERENT domain from
loader/refs (RDD local-override plumbing, not candy-ref collection), so
they are not K1 residue — confirmed via a defines-vs-calls trace before
moving anything (spike-lite).

Fixes sdk/kit/refs_downloader.go's own doc comment, which claimed (P7-era)
"the host keeps the fetch ORCHESTRATION" as a deliberate boundary — that
boundary predates K1's mandate; the v2 end-state supersedes it the same way
K1 unit 1 already superseded materialize.go's own former "stays core,
clause M" self-classification (the canonical boundary-law precedent for
this exact situation).

Two test files move with their subject (R3): TestMarkRepoAutoMigrating_GuardsReentry
(charly/refs_automigrate_guard_test.go, white-box on the re-entrancy guard)
and TestRepoOverrideDir/_LocalResolution/_OperatorFirstWins
(charly/refs_test.go + repo_override_test.go) — repoOverrideDir now takes
the env VALUE as an explicit parameter rather than reading os.Getenv
internally, so these are rewritten to pass the value directly instead of
via t.Setenv.

Rides the terminus B2 chain: charly's super leg wires candy/plugin-loader
and keeps thin core wrappers over the new seam methods.

Assisted-by: Claude Code Sonnet 5 (analysed on a live system)
The Config = spec.Config alias this comment cited was deleted by W0
(dissolve-inline-aliases) on the accumulation branch merged into
feat/w1-loader; refs.go's wrapper functions now take *spec.Config
directly. Update the comment to state the alias is gone rather than
claiming it as the live mechanism.

Assisted-by: Claude Code Sonnet 5 (analysed on a live system)
…ness receipt

sdk/loaderkit/load_via_executor.go already hosts the ONE hoisted plugin-side
LoaderExecutor witness (executorLoaderExecutor + LoadUnifiedViaExecutor) candy/
plugin-bundle migrated onto; candy/plugin-build and candy/plugin-vm still carried
their own byte-identical buildLoaderExecutor/vmLoaderExecutor duplicates (an R3
violation the file's own header already tracked as debt). Add
LoaderThreadedViaExecutor (the standalone LoaderThreaded leg, for a caller that
needs the registry snapshot without a full LoadUnified) so both candies' remaining
direct-interface call sites can drop their private copies too — done in the
companion super-leg commit. Fix two stale header comments naming the deleted
per-candy copies and clarify candy/plugin-loader (the host-consumed DocParser/
ProjectWalker provider) never carried this pattern at all.

Assisted-by: Claude Code Sonnet 5 (analysed on a live system)
Thin candy-facing re-export of the new spec/phase.PhasePreflight constant (companion
spec commit 0a82eb2), matching the existing sdk.PhaseBootstrap/etc convention — a
sanctioned re-export layer for plugin call sites (distinct from the charly-core
ZERO-ALIASES gate this same cutover closed, which polices charly/*.go re-exports, not
sdk's candy-facing ones). candy/plugin-doctor's verb:freshness-guard capability
(companion charly/candy commit) declares Phase: sdk.PhasePreflight.

Assisted-by: Claude Code Sonnet 5 (analysed on a live system)
K-wave W3a A3-phase-2: the k8s/android/vm branches of the former
"deploy-entity-resolve" HostBuild seam die now that W1's
LoadUnifiedViaExecutor lets a plugin self-load the project instead of
round-tripping to the host. These three helpers mirror the existing
Resolve<Kind>ViaExecutor naming/shape convention, walking the unified
project tree plugin-side and resolving a kind:<word> template body
through the compiled-in candy/plugin-substrate provider
(SubstrateTemplateResolveRequest via InvokeProvider "kind"/OpResolve).

Assisted-by: Claude Code Sonnet 5 (analysed on a live system)
…laim

resolveMergedDeployTree relocated from charly/check_cmd.go to
charly/plugin_loader.go (super leg landing alongside this commit).

Assisted-by: Claude Code Sonnet 5 (analysed on a live system)
…nical home)

Relocated from charly/bundle_members.go (the operator-path consumer,
candy/plugin-bundle/walk.go, lands in the same commit set calling this
directly). Uses the new spec.IsVmVenue/IsContainerVenue predicates instead
of a private nodeTraits copy - every node reaching these functions comes
from an already-loaded, Descent-stamped project (foldMembers marks only
the folded top-level copy), so no registry-fallback branch is needed here,
matching candy/plugin-check/venue.go's own registry-free twin.

charly/bundle_members.go keeps a TEMPORARY duplicate for one commit cycle:
host_build_check_bed.go's members-up/members-down ops still call it as a
same-package function (core cannot import sdk/deploykit - import-purity).
The immediately-following B2-full unit deletes that core copy.

Assisted-by: Claude Code Sonnet 5 (analysed on a live system)
…ion references

Removes deploykit.ResolveBedCheckLevel as dead code (R1 sweep, spec leg
a6cce60): zero remaining callers once bedCheckLevel's plugin-side port
(candy/plugin-check/bed_session.go, super leg) inlined to the spec.*
helpers directly, matching what core's own check_bed_run.go had already
done before it was deleted. PersistBedDeployOverrides is the one
function that genuinely stays here - a plain library function any
placement can call.

Fixes several comments claiming charly/host_build_check_bed.go as a
live current caller (kit/checklevel.go, kit/vm_domain_lock.go,
vmshared/vm_domain_reexport.go) - the seam it named is deleted; the
callers are core (unchanged) and candy/plugin-check/bed_session.go now.

Assisted-by: Claude Code Sonnet 5 (analysed on a live system)
The deploy-verify path reaching sdk/kit/report.go's re-exported reporters
is candy/plugin-bundle/verify_local.go now (super leg landing alongside
this commit), not charly core's check_cmd.go.

Assisted-by: Claude Code Sonnet 5 (analysed on a live system)
…keProvider

CompileServiceSteps' systemd custom-unit rendering (renderServiceViaSeam)
no longer round-trips to the host via HostBuild("render-service"). It
now delegates to render_generator_from_project.go's
renderSeamCaller.renderService - an R3 find made mid-cutover: that
caller already implements the exact same sequence (kind:init's
OpResolve via direct InvokeProvider, then verb:egress's OpValidate on
the rendered unit text) for the build-time init-assembly path, so the
deploy-time call site reuses it instead of duplicating the
marshal/dispatch/decode boilerplate a second time in the same package.

R8 byte-proof: render_service_seam_roundtrip_test.go wires REAL
compiled-in candy/plugin-init + candy/plugin-egress providers (not
canned replies) so CompileServiceSteps drives the actual template
render + actual egress-schema validation. Run against the pre-change
HostBuild mechanism and again against the post-change InvokeProvider
mechanism: byte-identical output, now asserted as a fixed golden and
kept as permanent regression coverage for a path that previously had
none.

plan_compile_test.go's existing mocked HostBuild round-trip test is
rewritten to mock InvokeProvider instead, matching the new mechanism.
render_generator.go/render_generator_from_project.go doc comments
updated - they described charly-core's RenderService as still live and
as the shared source; it is deleted now, and this package's own
renderSeamCaller.renderService is the ONE shared implementation for
both the build-time and deploy-time paths.

Assisted-by: Claude Code Sonnet 5 (fully tested and validated)
Rung 2 of team-lead's corrected R8 ladder: the round-trip harness gains
a case matching check-local-layer's new custom systemd service: entry
exactly (candy name, service name, exec command, restart:always,
enable:true, scope:system, no env/working_directory) - proving the
real init-render + egress-validate sequence handles this simpler shape
byte-for-byte the same way as the existing golden.

Assisted-by: Claude Code Sonnet 5 (fully tested and validated)
…ire ops

Re-exports spec/ops's new OpResolveEndpoint, OpResolveImageLabel, and
OpDrainEndpointCleanups. Fixes a header claim in deploykit/container_resolve.go
that pre-dated B7 (never true even before this cutover): it credited
charly's check_endpoint_resolve.go/check_venue_resolve.go with calling
deploykit.ResolveContainer directly, which neither file has ever done.

Assisted-by: Claude Sonnet 5 (fully tested and validated)
…ference

ResolveLifecycleDeployNodeViaExecutor's header cited the now-deleted
spec.PodStartRequest.Node; the pod-lifecycle wire unification renamed it to
spec.PodLifecycleRequest.Node (one envelope, not eight per-verb request
types).

Assisted-by: Claude Sonnet 5 (documentation reviewed)
…nt fallback

executorLoaderExecutor.RunBootstrapPhase used to silently return the raw,
un-bootstrapped root bytes on any HostBuild("loader-bootstrap") failure — the
ONE LoaderExecutor leg with this silent-swallow shape (every sibling leg
already propagates a HostBuild failure as a hard error). LoadUnified then
threaded the possibly-un-bootstrapped bytes into the early schema-version
gate and the whole subsequent walk with zero visible signal. Now propagates
the error via `fmt.Errorf("loader-bootstrap: %w", err)`; LoadUnified's own
call site aborts the whole load with `bootstrap phase: %w` on failure instead
of silently continuing.

hostLoaderExecutor.RunBootstrapPhase (the compiled-in, same-process sibling)
gets the matching signature update — it has no failure mode of its own
(runBootstrapPhase already tolerates every per-provider error internally),
so it always returns a nil error.

Step 1 of the K-wave terminus RCA fix for #20 (confirmed wave regression,
bisected to e0edc38d's vmPrepareVenue self-load swap): this makes a silent
divergence loud so the next solo check-substrate rerun either surfaces the
real trigger with a visible "loader-bootstrap" error, or — if the guest is
still silently missing its InstallPlan content afterward — rules this leg out
entirely and the search resumes elsewhere in vmPrepareVenue's post-resolve
logic.

Assisted-by: Claude Code Sonnet 5 (analysed on a live system)
…ced boxes

CollectRemoteRefsOpts' reachability walk only followed base/builder edges
from ROOT-owned images (cfg.AllBoxNames()), so an on-demand
namespace-qualified generate/build target unreachable from any root-owned
image (e.g. `charly box generate fedora.check-pod`, where box/fedora's
check-pod is never a base/builder of anything root-owned) never had its own
remote candy refs collected/fetched — the later candy-order resolve then
failed "unknown candy" for a ref the fetch step silently skipped.

Mirrors buildkit.ResolveAllBox's own opts.RequestedBoxes handling, which
already pulls a qualified on-demand target into the RESOLVE set the
identical way; this closes the matching gap on the COLLECT half.

Assisted-by: Claude Code Sonnet 5 (analysed on a live system)
… claim

Three comments here taught that a deploy-scope check can address its own
cluster generically via cluster: "${DEPLOY_NAME}". That is false for the case
that matters: the VM live check seeds DEPLOY_NAME from the kind:vm ENTITY name
(candy/plugin-check's pluginCheckLiveVM), which every bed deploying that entity
SHARES — so it names another deployment's kubeconfig context, or none at all.
The k3s-server candy followed the guidance and its four kube: steps failed with
"no kubeconfig context selected". The comments now state what DEPLOY_NAME is
(the sanitized name of the deployment under check) and that it is NOT a cluster
selector, pointing at the in-venue probe that replaced it.

deploy_name.go also named a call site the K-wave had already relocated:
check_cmd.go no longer seeds the VM DEPLOY_NAME; candy/plugin-check does.

Assisted-by: Claude Code Claude Opus 5 (fully tested and validated)
… body

`ScanCandyFromLocal` announced "local candy X shadows remote candy Y" and then
kept the REMOTE body under the full-ref key anyway, so the announcement never
took effect. A candy name is globally unique, so a local candy and a pinned
remote ref declaring that name are ONE logical candy reachable under TWO map
keys — and the scan handed its consumers two rival bodies for it.

Any consumer that iterates the candy map therefore acted twice on the same
candy with different content, and Go's map order decided which one won. The
plugin loader is where that bit: loadProjectPlugins host-builds a plugin
candy's GetSourceDir() per entry, and both twins declare the SAME
plugin.source string, so pluginAlreadyConnected() treats whichever came
second as "already connected from the same source" and drops it. Whichever
key the map yielded FIRST decided whether the local tree or the OLD pinned
remote was built and connected — nondeterministic execution of old code.

When the remote twin won, it was a pre-sdk-split source: at charly
v2026.183.1359 the plugin candies require github.com/opencharly/charly/charly
and there is no sdk submodule at all, i.e. ProtocolVersion 1, which the v2
client rejects. That surfaced as the intermittent go-plugin handshake warning
  plugin "…/candy/plugin-example-builder": incompatible API version.
  Plugin version: 1, Client versions: [2]
plus a signal:killed ERROR from the same failed handshake. Six pre-fix runs of
an unchanged tree named plugin-example-step five times and
plugin-example-builder once — the map-order nondeterminism, observed.

Fix at the arbitration point rather than at the plugin loader: a shadowed ref
now resolves to the LOCAL body under both keys, so the note is true and the
choice is deterministic at the source instead of per consumer. The ref still
RESOLVES (consumers reach candies by full ref) — it merely resolves to the
local materialization. Local wins on identity, not version arbitration:
PickCandyVersion continues to arbitrate among remote candidates only.

Covered by sdk/loaderkit/scan_shadow_test.go: the shadowed-pair case (looped
64x since Go randomizes map order per range), a precedence case pinning that a
newer remote version: cannot outrank the local, and a negative control proving
an UNshadowed remote still keeps its remote body — so the fix cannot degenerate
into dropping remote candies. Both shadow cases fail on the pre-fix code.

Proof: sdk + charly `go test ./...` green; golangci-lint 0 issues; cold-cache
(CHARLY_REPO_CACHE=<fresh dir>) `box generate fedora.check-pod` exits 0 with
zero warnings across 7 runs where the pre-fix binary warned intermittently;
`box validate` clean at root and in all three distro submodules. The complete
fresh-rebuild R10 bed roster is run once at the terminus and did NOT run here.

Assisted-by: Claude Code Claude Opus 5 (analysed on a live system)
…eploy overlay

The per-host overlay (~/.config/charly/charly.yml) is a single shared file every
concurrent charly process writes. SaveBundleConfig's tempfile+rename makes a
reader never see a torn file, but it does NOT prevent a LOST UPDATE: a writer
that loaded the config at T0 and saves at T1 silently discards every entry any
other process wrote in between.

Four writers guarded that window with the process-shared flock (SaveDeployState
and CleanDeployEntry inline, SaveVmDeployState and RemoveVmDeployEntry via an
injected callback) while three candies each carried an identical private lock
helper — and candy/plugin-deploy-pod's config-setup path, which holds its
snapshot across MINUTES of orchestration, carried none at all. Three copies of
one mechanism is exactly the R3 smell that let a fourth surface ship without it.
Observed on the 32-bed concurrent roster: overlay resolved_image refs lost (two
beds deployed their BASE image), a RELEASED exclusive arbiter claim resurrected
by a stale write-back, and failed beds' entries vanishing outright.

Adds MutateBundleConfig (deploy_config_cycle.go): acquire the flock, re-read the
overlay INSIDE the lock, run the caller's mutation against THAT fresh copy, save.
Every write becomes a merge-on-latest. Expressing the mutation as a function over
fresh state is what keeps the lock off the caller's orchestration — holding it
across a minutes-long `charly config` would serialize every concurrent bed, a
different regression. Corollary for authors, documented at the helper: anything
the outcome depends on must be computed INSIDE the closure, port allocation
above all (ResolveDeployPorts picks against the other entries' occupied ports, so
computing it outside the lock hands two concurrent deploys the same host port
even though the write itself is serialized).

SaveDeployState, CleanDeployEntry, SaveVmDeployState and RemoveVmDeployEntry now
route through it, their bodies split into plain functions over fresh state. The
vm pair no longer takes an acquireLock parameter — its two per-candy lock copies
are deleted in the superproject leg.

Coverage: TestMutateBundleConfig_ConcurrentMutatorsOfDifferentEntriesAllSurvive
(12 concurrent writers, all entries survive) plus the deterministic RED arm
TestUnlockedReadModifySaveLosesUpdates, which drives the pre-fix shape and
asserts it keeps exactly one of twelve. Negative control: removing the lock from
MutateBundleConfig fails the green arm (11 of 12 entries). Both run clean under
-race; the two concurrency fixtures now guard their store field, since the race
detector cannot see happens-before through an OS flock.

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

The R5 self-test for the two removed per-candy lock helpers came back with one
live hit left: this file's own header named both while explaining that they are
gone. A grep for a deleted identifier must return only CHANGELOG history, so the
sentence now describes the helpers by where they lived rather than by name — which
also reads better, since it can then say the thing that actually matters: the pod
path had no such helper at all, and that is how it shipped with no lock.

Comment-only.

Assisted-by: Claude Code Claude Opus 5 (documentation reviewed)
…a bed has no package source

Two fixes, both about a build silently losing something it needed.

FIX G (the sweep). Every temp this package creates in a swept namespace now goes
through proc.MkdirTempHeld, so a live build holds its tree against
SweepStaleTemps (see spec 03ea3d8 for the mechanism and the host-verified
evidence). Three creators here:

  - charly-localpkg-src-, the makepkg STAGE tree. This is the one the roster
    lost: makepkg runs with source/ as its CWD and writes src/ and pkg/ beneath
    it, so the root's mtime never advances and no descriptor points at it. A bed
    died with src/charly gone mid-build.
  - charly-localpkg-, the build OUTPUT dir.
  - charly-pkgdep-, the dependency staging dir bind-mounted into a builder
    container — same exposure, since the writes land inside the mount.

The whole-tree R5 grep is what caught the stage tree: an earlier pass had
converted only the output dir and the sites the RCA named, and would have left
the actual victim untouched.

FIX H (the bed's missing source). ExecLocalPkgInstall treated a package source it
could not locate as a benign skip — "the candy's curl/COPY task installs it
instead" — even on a disposable check bed. The image path hard-errors the
IDENTICAL condition, and says why: a disposable check bed must build the
in-development package. The two legs disagreed, and the deploy leg's silence is
how check-fedora-vm quietly stopped building its rpm when pkg/fedora was an
uninitialized submodule; the bed then failed much later at a live `rpm -q` check
that named neither the missing source nor the skipped build.

The deploy leg now takes the same discriminator the image leg uses, threaded as
EmitOpts.DevLocalPkg (the deploy-side twin of `charly box build --dev-local-pkg`,
set by the bed runner and nothing else) and hard-fails, naming the format, the
ref, the candy and both directories it searched. For a NON-bed deploy the skip
stays: a target whose distro has no package source in this checkout legitimately
falls back to the candy's curl/COPY task.

Coverage: both arms, plus a blast-radius guard that the bed flag changes ONE
decision — an unsupported venue and a distro with no localpkg-capable format are
still clean no-ops on a bed, since failing those would make beds unrunnable on
those targets. Negative controls: removing the hold reproduces the deletion with a
bare os.MkdirTemp; removing the bed branch makes the bed arm return nil again.

Assisted-by: Claude Code Claude Opus 5 (analysed on a live system)
…s probes run

BringUpMembers now confirms, once every member is up, that each cross-member name a
member's plan addresses actually resolves from that member's venue.

THE FAILURE THIS RECLASSIFIES. podman's aardvark-dns can survive in a STALE rootless
netns — its pidfile conflates "the process is alive" with "it is serving the CURRENT
netns". While it does, NO container name resolves host-wide, even though every
container still starts perfectly normally. Without a preflight that host fault lands
on the probe steps, which burn their entire retry budget on an unresolvable name and
then report a CHECK failure (exit 2) — i.e. "the thing under test is broken". It is
not; the host's DNS is. Observed on check-cross-pod-cdp, whose chrome driver reaches
its web subject via the ${HOST:web} form.

Failing here instead classifies it as INFRA (exit 1) — BringUpMembers runs inside the
deploy step — and the message names both the stale-aardvark condition and the recovery
command, rather than leaving an operator to rediscover it.

PRECISE, NOT BLANKET. Only the (member -> sibling) pairs a member's own plan actually
references are probed, collected with the existing kit.CollectHostRefs/SplitHostKey.
The port-bearing endpoint form is excluded: it resolves to a host-vantage 127.0.0.1
address and never touches container DNS. A group that does no cross-member addressing
therefore performs zero probes and can never be failed by this.

NO AUTO-RECOVERY, deliberately. Reloading podman's networks from inside a bed would
mutate host-wide podman state, disrupting every unrelated running container including a
concurrent bed's. That is a policy decision of its own; considered and deferred, so the
preflight reports and stops.

The probe and container-resolution boundaries are package vars so the behaviour is
unit-testable with a fake resolver, mirroring the proc.RunCharlySubcommand seam the
existing bring-up routing tests already use.

Assisted-by: Claude Code Anthropic Claude Opus 5 (fully tested and validated)
atrawog added 4 commits August 5, 2026 05:07
…never depends on plugins

go mod tidy (run for the spec pin bump) promoted sdk's two test-only candy-plugin
imports (plugin-egress, plugin-init) into REQUIRES — inverting the dependency
direction (sdk must never depend on candy plugins; they resolve via go.work
in-workspace). The same trap coneTail caught and reverted pre-bank; this drops the
two requires while keeping the spec v0.2026217.301 bump. Follow-up commit rather
than amend: the branch is pushed.

Assisted-by: Claude Code Anthropic Fable 5 (syntax check only)

Claude-Session: https://claude.ai/code/session_015CXB8CkzwZeXPzbqKjsuYj
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant