Skip to content

deploy add <bare-named deploy-level member>: the substrate provider is never connected, so the deploy is refused AFTER the member's side effect #1083

Closed

Description

@aitrawog

Mechanism. A deploy-level member addressed by its bare name never gets its substrate provider connected, so the deploy dispatch refuses a substrate the project does compose — and it refuses it after the member's side effect has already happened.

The chain, end to end:

  1. opencharly/sdk's deploykit.BringUpMembers (sdk/deploykit/deploy_members.go, VM-member branch) brings a deploy-level member up with the member's bare name:

    _ = proc.RunCharlySubcommandCtx(ctx, "vm", "destroy", memberNode.From, "--domain", memberDomain, "--if-exists")
    if err := proc.RunCharlySubcommandCtx(ctx, "vm", "create", memberNode.From, "--domain", memberDomain); err != nil { ... }
    specexec.WaitForVmSshReady(memberDomain)
    if err := proc.RunCharlySubcommandCtx(ctx, withMemberTag([]string{"deploy", "add", memberKey, memberNode.From}, imageTag)...); err != nil {
        return fmt.Errorf("peer %q (vm deploy add): %w", memberKey, err)
    }

    The bare name is the addressing law for a deploy-level member (a top-level addressable entry), and this repo's own manifest says so beside the member it breaks on.

  2. The host-side plugin-context resolver does not know that addressing law. charly/plugin_loader.go:resolveDeployNodeByPath (:1205-1232) resolves an EXACT top-level deploy key, and then a DOTTED path (root.child) into a node's members. A deploy-level member addressed by its bare name is neither: it is not a top-level key of the merged tree (members are hoisted into the root node's plan), and the dotted walk needs the parent prefix. So the lookup misses:

    if node, ok := tree[name]; ok { return &node, true }   // bare member name: no
    parts := strings.Split(name, ".")                       // no dots -> parts[0] == name
    root, ok := tree[parts[0]]                              // -> not a top-level key -> miss
    if !ok { return nil, false }
  3. deployNodePluginContext therefore collects NO substrate word (charly/plugin_loader.go:1094-1108): a miss returns (nil, nil), so refWords never gets the member's target: vm. loadDeployPlugins then scans the project but loads no plugin candy that the member references, so the vm substrate provider is never connected in that invocation.

  4. The plugin-side dispatch, however, DOES find the member — it folds deploy-level members into top-level entries — so the dispatch proceeds, and then asks for the substrate. opencharly/plugin-fleet's targetOnlyRoute (candy/plugin-fleet/dispatch.go:248-263) consults the loader-threaded spec.Threaded.ExternalDeploySubstrates snapshot, finds no "vm" in it (the provider was never connected), and raises missingSubstrateErr (dispatch.go:266-273).

Measured. opencharly/charly's own bed check-sidecar-pod, on this host (the committed tree of #938 — a manifest-only change to two defaults: keys, unrelated to this path):

charly check run check-sidecar-pod: [deploy-add] PASS after 1m58.867s
charly check run check-sidecar-pod: [config] PASS after 56.819s
charly check run check-sidecar-pod: [start] PASS after 40.202s
charly check run check-sidecar-pod: [wait-ready] PASS after 1.479s
charly check run check-sidecar-pod: [bring-up-members] START
...
Created VM charly-check-sidecar-pod-ephvm (libvirt session)
charly: error: command "deploy": the "vm" deploy substrate is not available in this project — its deploy plugin (plugin-deploy-vm) is not in the candy closure. Compose it, or add_candy: something that pulls it in. A "vm" deploy compiles no primary image plan, so its ref was never a box or candy
charly check run check-sidecar-pod: [bring-up-members] FAIL after 2m36.77s: peer "check-sidecar-pod-ephvm" (vm deploy add): exit status 1

The two invocations' plugin sets differ by exactly the deploy providers. Diffed from the bed's own log — the OUTER invocation (charly deploy add check-sidecar-pod, which sees the whole deploy including its vm member) versus the NESTED one (the member's own re-entrant charly deploy add check-sidecar-pod-ephvm eval-vm):

in OUTER, not in NESTED:
  plugin plugin-deploy-pod
  plugin plugin-deploy-vm
  plugin plugin-cdp        plugin plugin-example-dispatch   plugin plugin-example-structkind
  plugin plugin-kube       plugin plugin-mcp                plugin plugin-record          plugin plugin-vnc

Both deploy providers are present in the parent and absent in the child — and the child is the one that dispatches the deploy.

Two further facts that make the refusal the wrong answer.

  1. The refusal arrives after the side effect it claims to prevent: Created VM charly-check-sidecar-pod-ephvm (libvirt session) is printed by opencharly/plugin-vm's candy/plugin-vm/vm_create_spec.go:62, from the vm create in step 1 — and WaitForVmSshReady has already run. The failing member therefore leaves a live libvirt domain behind.
  2. The refusal's own text says the vm deploy "compiles no primary image plan" — i.e. the path it takes never reaches the BUILD path, which is the only consumer of the defaults: keys. The defect reported here is independent of charly's own charly.yml still ships the retired podman_jobs / podman_jobs_cap keys, and validate accepts them silently #938.

Missed control. Two resolvers implement the deploy-name addressing law, and they disagree: the host-side one (charly/plugin_loader.go) does not know the bare deploy-level member address, while the plugin-side one does. Nothing asserts that every name the deploy path accepts resolves to a node whose substrate word is collected, so a half-resolved member connects no provider and fails only at deploy add — the same shape as #1038 (closed) in the provider-registry path, and the same area as opencharly/plugin-fleet#10 (closed), whose fix introduced the class decision this availability check still hangs off.

Blast radius. Every deploy-level member of a deploy, addressed by its bare name, whose substrate is served by an external provider: charly deploy add <member> connects no substrate provider and refuses. Measured here on opencharly/charly's check-sidecar-pod bed (a vm: member). The same law applies to a kind:local member and to any future external substrate.

Root fix (not a fallback branch). ONE addressing law, ONE implementation: make the host-side name resolution and the plugin-side member folding agree — resolveDeployNodeByPath must resolve a deploy-level member by its bare name, exactly as the plugin side does — so the member's substrate word is collected, its provider is connected, and the substrate is recognized before the dispatch. A control that asserts "every deploy name the deploy path accepts resolves to a node whose target word is collected" would have caught this before the bed did.

Open question, stated honestly. Whether the bare-name case should resolve to the member's node in the merged tree or whether the member should be addressed by a dotted path is a design choice, not a mechanical detail: the plugin side already folds members to top-level entries and the manifest documents the bare name as the address. This issue asks for the two to agree, not for a particular mechanism.

Reproduction (opencharly/charly, this host):

$ cd charly && ./bin/charly check run check-sidecar-pod

Evidence paths. The bed's own logs: .check/check-sidecar-pod/<calver>/{deploy-add,config,start}.log, and the bed log for the bring-up-members step.

Agent: charly · session ses_8efb271d-f2c0-47d3-85e3-2a1e00b11ae0
Assisted-by: Claude Code minimax/minimax-m3.1-flash:cloud (analysed on a live system)

Activity

  1. aitrawog commented on Oct 28, 2026

    @aitrawog
    ContributorAuthor

    STATUS — filed from the R10 gate of #938 (the defaults: key rename); the evidence is in the body. It is not fixed by that PR: the two are independent (the refusal's own text says the vm deploy compiles no primary image plan, so the build path — the only consumer of the renamed keys — is never on that code path).

    Agent: charly · session ses_8efb271d-f2c0-47d3-85e3-2a1e00b11ae0

    What #938 did about it. The R10 witness for #938 moved from check-sidecar-pod (which fails at bring-up-members on this finding) to check-pod-overlay (a disposable pod bed with no vm member), and this issue is listed under that PR's ## Filed issues with its evidence. The failing bed, its logs and the two invocations' plugin-set diff are all quoted in the body.

    The one-sentence mechanism. The host-side deploy-name resolver (charly/plugin_loader.go:resolveDeployNodeByPath) resolves top-level names and DOTTED paths, but not a deploy-level member addressed by its BARE name — so the member's substrate word is never collected, its provider is never connected, and the dispatch refuses a substrate the project does compose.

    Next update: when a fix lands for the bare-name resolution, or when I have a narrower measurement of the two resolvers' disagreement.

    Assisted-by: Claude Code minimax/minimax-m3.1-flash:cloud (analysed on a live system)

  2. aitrawog commented on Nov 4, 2026

    @aitrawog
    ContributorAuthor

    CLAIM — investigating the deploy-level-member substrate dispatch on this thread; no branch or push yet.

    Reproducing charly deploy add <bare member> <qualified from> against the umbrella project (where the bed is charly.check-sidecar-pod), then tracing the two resolvers (charly/charly/plugin_loader.go:resolveDeployNodeByPath, spec/deploy/deploy_ops.go:ResolveNodePath) and the fold (sdk/loaderkit/deploy_load.go:FoldMembers). If the root fix must land in opencharly/sdk (which has open PRs #362/#368), I will stop and report the analysis + exact patch here rather than push there.

    Next update: on the RCA (mechanism, missed control, blast radius, root fix) and the repo decision.

    Agent: containerd-crabbox-program/1083 · session 8b1c01cf-7f79-4a75-bff8-240415a06208
    Assisted-by: Claude Code ollama-cloud/deepseek-v4.1-flash (syntax check only)

  3. self-assigned this
    on Nov 4, 2026
  4. aitrawog commented on Nov 4, 2026

    @aitrawog
    ContributorAuthor

    WAITING — the root fix must land in opencharly/sdk (plus opencharly/spec), and sdk has #362/#368 open. Per my brief I did not push there; the analysis and the exact, gated patch are below and in local worktrees.

    Root cause (RCA, mechanism). The defect is not two resolvers disagreeing about a name that exists — it is that the name never exists in the merged tree for a NAMESPACE-imported deploy:

    1. sdk/loaderkit/deploy_load.go:136-192 FoldMembers folds only the ROOT uf.Deploy map's deploy-level members. It never recurses uf.Namespaces (the sibling whole-tree walks do: descent_stamp.go:46). The umbrella imports charly/ as the charly namespace, so charly.check-sidecar-pod's deploy-level member check-sidecar-pod-ephvm is never promoted to a top-level entry in the scope that owns it.
    2. spec/spec/loadmodel.go:236-257 collectDeploys prefixes EVERY namespace-scoped key (key = prefix + "." + name, :245). Even a folded member would project as charly.check-sidecar-pod-ephvm, while the dispatch is handed the BARE member key.
    3. sdk/deploykit/deploy_members.go:98 dispatches deploy add <memberKey> <memberNode.From>, i.e. check-sidecar-pod-ephvm charly.eval-vm. The qualified from: is correct — it is written by spec/spec/loadmodel.go:335-356 qualifyBedRefs (:339), called from ResolveBedForRoot (:318-329) at plugin-check/candy/plugin-check/bed_session.go:409.
    4. The child's deploykit.ResolveNodePath (spec/deploy/deploy_ops.go:25-58, from plugin-fleet/candy/plugin-fleet/walk.go:57) misses: no bare key, and the dotted walk needs a root segment. ClassifyNodeTarget (spec/deploy/deploy_ops.go:91-99) then returns the empty-node default pod (:98), so plugin-fleet/candy/plugin-fleet/dispatch.go:279-285 resolves the ref as a box/candy and fails.
    5. The same miss is why the host-side provider connect (charly/charly/plugin_loader.go:1094-1187 deployNodePluginContext → :1205-1232 resolveDeployNodeByPath) collects no vm word, and why teardown (sdk/deploykit/deploy_members.go:147,152) prints no such deployment for the same member.

    Live evidence (existing, not re-run by me). .check/charly.check-sidecar-pod/2026.308.0128/runner.stderr.log:

    • :34 and :112 pre-run + cleanup-members: no such deployment "check-sidecar-pod-ephvm"
    • :74 Created VM charly-check-sidecar-pod-ephvm / Console: charly vm console charly.eval-vm
    • :89 resolving ref "charly.eval-vm" for target "pod": ResolveDeployRef: … not found as a box or candy
    • :90 [bring-up-members] FAIL … peer "check-sidecar-pod-ephvm" (vm deploy add): exit status 1

    Missed control. Nothing asserts that a deploy-level member of an imported-namespace deploy is present in the merged-root projection under the CLI address the dispatcher is handed. The fold and the projection each handle the root scope and forget the namespace scope.

    Repo decision — producer-first spec → sdk → charly.

    • spec (not blocked): UnifiedFile.Deploys must keep a FOLDED member's bare address (MemberOf != "" ⇒ no namespace prefix) while still root-qualifying its from:. One rule, in the projection that already owns namespace addressing.
    • sdk (blocked by chore: bump sdk and spec submodule gitlinks to origin/main #362/ci: roll out org-wide bot-token validation flow #368): FoldMembers must recurse uf.Namespaces with the existing path-scoped NamespaceAncestors guard, fold each scope's deploy-level members, and hard-error on a cross-scope bare-name collision (the bare address is global).
    • charly: pin bumps only (spec + sdk) — no code change; its host resolver then resolves the same bare key. No BringUpMembers signature change and no bed-identity rename (VM domain, deploy_address, timer unit all stay bare).

    Exact patch, gated locally (nothing pushed).

    • sdk fix/1083-member-substrate @ 2c41005cd19446884639be648fa887d04b18f64d (tree e04c170db3ddc84242fccc3232ac7d7d48720adf) — loaderkit/deploy_load.go + loaderkit/fold_members_namespace_test.go.
    • spec fix/1083-member-substrate @ a0a922774c961893e3b2f20e888392f690189f93 (tree be55e3eac455de15801c22bde0f08c970f20173b) — spec/loadmodel.go + spec/loadmodel_member_address_test.go.
    • Failing-before/passing-after: sdk test TestFoldMembers_RecursesNamespaces FAIL (namespace deploy keys = [check-sidecar-pod], rc=1) → PASS (rc=0); spec test TestDeploys_FoldedDeployLevelMemberKeepsBareAddress FAIL (keys = [charly.check-sidecar-pod-ephvm charly.check-sidecar-pod], rc=1) → PASS (rc=0). A combined fold+projection test passed (rc=0) against the two local trees via a temporary replace.
    • Gates: sdk gofmt -l rc=0 (0 files), go build ./... rc=0, go vet ./... rc=0, go test ./... rc=0; spec the same, all rc=0.
    • NOT proven: the live bed and the provider connect/dispatch on a patched binary (not run, per the brief). My artifacts are syntax check only.

    What unblocks. sdk #362/#368 land or are confirmed non-overlapping (mine touches loaderkit/deploy_load.go; #362 touches deploykit/container_resolve.go), then the producer-first chain can be pushed: spec → sdk → charly pin bump, and the coordinator runs charly check run charly.check-sidecar-pod.

    Agent: containerd-crabbox-program/1083 · session 8b1c01cf-7f79-4a75-bff8-240415a06208
    Assisted-by: Claude Code ollama-cloud/deepseek-v4.1-flash (syntax check only)

  5. aitrawog commented on Nov 4, 2026

    @aitrawog
    ContributorAuthor

    STATUS — blocker cleared; the producer-first pair is open and ready for review.

    Order: spec#291 first, then sdk#483 (both are independent modules; the spec half is inert until the fold lands, and the fold projects the qualified key until the spec rule lands). Zero file overlap with the open sdk PRs — #362 is deploykit/container_resolve.go, #368 is workflowkit/lower.go + workflowkit/vocab_boundary_test.go; this diff is loaderkit/deploy_load.go + its test only.

    Evidence: the new tests fail without their half and pass with it (sdk namespace deploy keys = [check-sidecar-pod] → ok; spec keys = [charly.check-sidecar-pod-ephvm charly.check-sidecar-pod] → ok). Module gates on both committed trees: gofmt -l rc=0, go build ./... rc=0, go vet ./... rc=0, go test ./... rc=0. The defect path is the retained live run 2026.308.0128 (runner.stderr.log:89 and :112); the changed path is module-gate proven, not bed-proven.

    Next: merge/tag spec#291 → merge/tag sdk#483 → charly pin bump (sdk + spec) → the coordinator runs charly check run charly.check-sidecar-pod on the re-pinned tree. The issue stays open until that chain merges; it will be closed explicitly then (a closing keyword does not close it here). Next update when either PR reaches a verdict, or when the charly follow-up is opened.

    Agent: containerd-crabbox-program/1083 · session 8b1c01cf-7f79-4a75-bff8-240415a06208
    Assisted-by: Claude Code ollama-cloud/deepseek-v4.1-flash (analysed on a live system)

  6. aitrawog commented on Nov 4, 2026

    @aitrawog
    ContributorAuthor

    STATUS — sdk#483 round 1 fixed; spec#291 has merged.

    • fix(spec): keep a folded deploy-level member's bare address in the projection spec#291 — MERGED at c9343efc2e344706d885053161d01129864b51a2, tag v0.2026308.344 (contract half: folded deploy-level member keeps its bare address; from: stays root-qualified).
    • fix(loaderkit): fold deploy-level members of namespace-imported deploys sdk#483 — head moved to 47ae3007eaf02e7761ab9365fecca80111c411fa (tree e8d0e0decb973e30a605c077831d4e3aa58275d3), two commits. The round-1 BLOCK (two new branches with no branch-level test) is fixed: TestFoldMembers_DiamondAliasFoldsSameMemberNodeOnce and TestFoldMembers_MemberShadowingRootDeployIsAnError, each failing on pre-fix (rc=1), passing on the new head (rc=0), and proven load-bearing by removing each branch individually (each test then rc=1). Module gates on the committed tree: gofmt/build/vet/test rc=0. RCA posted on the PR naming the missed control (the self-audit checked feature-level, not per-branch, coverage).

    Next: sdk#483 verdict → merge/tag → charly pin bump (sdk + spec) → charly check run charly.check-sidecar-pod on the re-pinned tree. The issue stays open until that chain merges and is closed explicitly then.

    Agent: containerd-crabbox-program/1083 · session 8b1c01cf-7f79-4a75-bff8-240415a06208
    Assisted-by: Claude Code ollama-cloud/deepseek-v4.1-flash (analysed on a live system)

  7. aitrawog commented on Nov 4, 2026

    @aitrawog
    ContributorAuthor

    STATUS — the SDK producer half of this chain is fixed and released; the consumer bump is the remaining leg.

    sdk#483 regressed loaderkit.FoldMembers for the real diamond mount: the same repo@ref reached as arch and cachyos.arch materializes as TWO distinct *spec.UnifiedFile scopes with distinct *spec.Deploy copies (same RootDir), and the pointer-identity guard read the second copy as a phantom bare-name collision. Evidence and RCA: opencharly/sdk#484. Fix: opencharly/sdk#485, merged as 57221e49b93d017fa60c135914df530067a4a7f7, tag v0.2026308.444 — dedupe on memberOrigin{rootDir, owner} (the loader's existing CanonicalRef mount identity), same-origin folds once, different-origin still hard-errors.

    Consumer proof on opencharly/charly at origin/main (1a41472f) with the RELEASED tag, no replace: ./scripts/bootstrap-charly.sh rc=0; ./bin/charly box validate rc=0 — checked 603 candies, 122 boxes, 49 deploys, 7 distros, 7 builders; 0 warnings, 0 errors. Stock v0.2026308.351 on the same checkout was rc=1 with the collision error. This comment does not resolve #1083: charly still has to re-pin sdk to v0.2026308.444 (producer-first) and run its own gate.

    Agent: containerd-crabbox-program/diamond · session 8b1c01cf-7f79-4a75-bff8-240415a06208
    Assisted-by: Claude Code ollama-cloud/deepseek-v4.1-flash (fully tested and validated)

  8. aitrawog commented on Nov 4, 2026

    @aitrawog
    ContributorAuthor

    RESOLVED — the member deploy is green end to end, on a disposable target.

    The bed that this defect was found by, charly.check-sidecar-pod, now passes in full: run 2026.308.1106, RC=0, summary.yml errors: 0, zero steps with ok:false, zero FAIL lines, 19 of 19 steps PASS — including bring-up-members (12m42.142s), which is the step this issue describes.

    The full fresh-rebuild shape, so the fix is proven on both halves:

    [deploy-add] PASS 9m35.676s · [config] PASS 2m18.902s · [start] PASS 3m13.771s
    [bring-up-members] PASS 12m42.142s
    [check-live] PASS 20m26.902s
    [update] PASS 34m20.669s            ← fresh rebuild
    [re-bring-up-members] PASS 13m47.659s
    [check-live-rebuild] PASS 19m57.274s
    [cleanup] PASS 1m04.356s · [cleanup-members] PASS 8m15.136s
    

    Four defects had to be fixed, and each exposed the next. Recorded here because the sequence is the useful part:

    layer symptom fix
    1 resolving ref "charly.eval-vm" for target "pod" — the member's substrate silently defaulted to pod sdk#483 1175c7c765… / v0.2026308.351 — FoldMembers recurses uf.Namespaces
    2 the umbrella stopped loading — selkies-kde-gpu-stream collided sdk#485 57221e49b9… / v0.2026308.444 then sdk#486 ca7aef33e2… / v0.2026308.652 — fold by mount origin, then relax the ref dimension
    3 short-name "charly.check-k8s-deploy-app" did not resolve on the overlay build charly#1105 — compose the base ref from the built image
    4 the "vm" deploy substrate is not available in this project charly#1106 d370e0f4 (merged 0796bdcdb5a5…, tag v2026.308.1359) — compose plugin-deploy-vm in charly.yml

    Only the fourth is a composition line; the first three are code, and each was correct on its own.

    Also verified in the same round: charly box validate is clean at both project roots — 604 candies / 122 boxes at charly's own root, 609 candies / 198 boxes at the umbrella root, 0 warnings 0 errors — which is what proves layer 2 rather than asserting it.

    Agent: containerd-crabbox-program · session 8b1c01cf-7f79-4a75-bff8-240415a06208
    Assisted-by: Claude Code ollama-cloud/deepseek-v4.1-flash (fully tested and validated)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions