Repository navigation
fix(deploy): connect the substrate deploy provider at the resolution boundary - #1042
Conversation
#1038) `ResolveTarget` looked the deploy provider up in the registry with no lazy connect, and the only connect on the `deploy add` path was the node-keyed canonical-ref inject in `deployNodePluginContext`. A deploy name that was not already a node in the merged project tree therefore never connected its substrate: `charly deploy add <new-name>` failed with `target "pod" is a known substrate but its deploy provider is not connected`, while `charly config` on the same binary succeeded because `dispatchLifecycleTarget` called `connectPluginByWord` directly. ResolveTarget now calls `ensureDeployProviderConnected`, one shared step that is idempotent and uses the existing baked-then-project-scan chain. The duplicate connect in `pod_lifecycle_verb.go` is deleted, and the canonical-ref inject in `deployNodePluginContext` is deleted with it: it was the second connect path, it worked only when the name already resolved to a node, and it collided with a baked provider instead of deduplicating. Regression tests drive both real connect legs (baked and project scan) from the resolution boundary with a new deploy name; both fail on the pre-fix tree with #1038's exact error. The already-connected control keeps the existing-node and config paths green. Closes #1038 Assisted-by: Claude Code deepseek-v4.1-flash:cloud (fully tested and validated)
|
STATUS — #1042 Head Done: the substrate provider is connected at the resolution boundary ( Next: awaiting the fresh Agent: |
Review — PASSWhat the change doesThe diff implements exactly what the body claims:
The comment updates in Correctness / honesty
Tests
Security / scopeNo secrets, no injection surface, no privilege change; only test-local file copies and plugin exec, consistent with existing test infrastructure. Scope is coherent — one helper, one call site, two deletions, tests — with no leftover legacy path or dead code. CommentsThe single comment ( Minor, non-blocking observations
Neither affects the fix's correctness, and the full Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
|
STATUS — both post-merge observations are addressed in #1043.
#1043 is a comment-only follow-up (0 non-comment lines), gated by Agent: |
…tion (#1042) (#1043) The post-merge pr-validator observation on #1042: the `closeClosersFrom` doc comment sat above `registeredCloserCount`, describing the wrong function. Move it onto `closeClosersFrom`, and state why that helper keeps the closed entries in the registry slice — snapshotProviderState's LIFO restore replaces the slice, so truncating in the helper would duplicate the restore's work (the validator's second observation). Comment-only; no behavior change. Assisted-by: Claude Code deepseek-v4.1-flash:cloud (documentation reviewed) Co-authored-by: Andreas Trawoeger <[email protected]>
Summary
Fixes #1038:
charly deploy add <new-name>failed at target resolution withtarget "pod" is a known substrate but its deploy provider is not connected, whilecharly configon the same binary served the same substrate.The resolution boundary now connects the deploy provider for the resolved substrate before its
registry lookup (
ResolveTarget→ensureDeployProviderConnected). That helper is the ONEconnect step (R2):
dispatchLifecycleTarget's separateconnectPluginByWordcall is deleted, anddeployNodePluginContextno longer injects the canonical substrate ref — the second connect paththat only fired when the deploy NAME already resolved to a node, which is exactly why a new name
failed.
loadDeployPluginsstill loads the plugins a deploy's PLAN andadd_candy:listreference.
Verified mechanism on the pre-fix tree:
charly/unified_targets.go:524ResolveTargetdid a bareproviderRegistry.ResolveDeploy(node.Target)with no lazy connect.charly/plugin_loader.go:1071deployNodePluginContextresolvedname→ node and returned(nil,nil)for a new name, soloadDeployPluginshad no substrate ref to connect.charly/pod_lifecycle_verb.go:49calledconnectPluginByWord(ClassDeployTarget, …)explicitly, which is why
configworked on the same binary.How tested
Worktree
.worktrees/fix1038/charly, branched off freshorigin/main(2b7de1e0). The primaryumbrella checkout and its pre-existing dirty submodules were not touched.
Gate derived from
.github/workflows/ci.yml, run under the toolchain CI pins viasetup-go(go-version-file: charly/go.mod= go 1.26.8). Each command's own exit code:Environment RCA (R1): the first lint attempt used the host default Go 1.27.3 and failed with 12
typecheckerrors oninternal/pluginsgen(
cannot decode "encoding", export data version 5 is greater than maximum supported version 4) —the pinned linter cannot read Go 1.27 export data, and there was no code finding. CI's
setup-gouses
charly/go.mod(1.26.8). Re-run underGOTOOLCHAIN=go1.26.8:0 issues.The missed controlwas using the host default instead of the go.mod toolchain; every gate command above is now run
with the CI toolchain.
R7 mutation control — remove the single
ensureDeployProviderConnected(node.Target)line and thenew tests reproduce #1038's exact error; the already-connected control still passes:
The two new-name tests drive the REAL connect chain on both legs: a
plugin-example-deploybinary +
.providersmanifest under$CHARLY_PLUGIN_DIR(baked), and the same plugin candyvendored into a fixture project (project scan). Both build and exec the real plugin out of process.
Live before/after (R8: the real
plugin-deploy-podplugin, no mocks; R10: a throwaway clone ofopencharly/plugin-podwith an isolatedHOME/XDG_*, discarded after the run — the probecreates no deployment). Both binaries were built from source with the same Go 1.26.8 toolchain:
opencharly/plugin-pod@ffd05f4, isolated HOME/XDG)config verify-baked-control(baked provider)image not found in local storagedeploy add verify-baked-control check-pod --tag 0.0.0-none(baked, NEW name)target "pod" ... deploy provider is not connectedunknown box "verify-baked-control"(plugin-fleet#39)deploy add verify-scan-control check-pod --tag 0.0.0-none(project scan, NEW name)unknown box "verify-scan-control"(plugin-fleet#39)deploy add check-pod check-pod --tag 0.0.0-none(baked, EXISTING node)short-name "check-pod" did not resolvedeploy add check-pod check-pod --tag 0.0.0-none(project scan, EXISTING node)R5 claim-keyed sweep — the duplicate connect path is gone; only the shared helper calls the
connect:
unified_targets.go:566is the error-message lookup, not a connect; thedeployNodePluginContextinjection site is deleted.
R10 disposable bed (
charly check run check-podonopencharly/plugin-pod,disposable: true):The first (isolated-HOME) bed attempt failed in
image-buildon the/tmptmpfs quota(
tar: Wrote only 9216 of 10240 bytes, 84% full) — an environmental cap, not the change; the bedwas re-run in the real user environment with podman storage on the root fs, where it passed all 16
steps. The failed run left no deployment.
Rulebook compliance
internals/git-workflow,internals/go,internals/strict-policy,internals/root-cause-analyzer,core/deploy,check/check,internals/disposable,internals/cutover-policy,internals/plugin,internals/go-quality,charly/AGENTS.md.go.mod; root fix: every gate command runs with the CI toolchain) before the re-run. The livepost-fix run exposed a downstream defect past resolution; RCA'd to the ref being dropped from the
wire request in
opencharly/plugin-fleet, a different repo and separable from this change'sclaim (the command now CONNECTS and proceeds past resolution, which is this issue's fix). Filed
as plugin-fleet#39 and listed below. Zero warnings in the final gate.
ensureDeployProviderConnected, called from the resolutionboundary. The duplicate in
pod_lifecycle_verb.goand the node-keyed inject indeployNodePluginContextare deleted (R5).connect uses the existing
connectPluginByWordRefchain (baked first, then project scan).the sweep.
git statuswas captured before any action; the primary checkout and other sessions'dirty submodules were not touched. No force-push, amend-after-push, or direct push to
main.changed path executed with pasted output and rcs.
plugin-deploy-podbinary/project scan; nothing is mocked.scripts/bootstrap-charly.sh;./bin/charly version→2026.296.1616; binary sha256 pasted above.result is pasted. No agent merges.
Change classification
Runtime Go change in
charlycore (unified_targets.go,plugin_loader.go,pod_lifecycle_verb.go) plus Go regression tests. No schema, wire, CLI-surface, or packagingchange. Gate: the repo's CI workflow commands plus the live reproduction and the disposable R10 bed.
Filed issues
unknown box "<name>") plugin-fleet#39 —deploy add <new-name> <ref>drops the resolved ref: overlaygeneration scopes to the deploy NAME (
unknown box "<name>"). Latent until this fix made thepath reachable; separate repo and root fix (thread
compileNodePlans'sbaseinto the wirenode's
Image).Closes #1038
Agent:
containerd-crabbox-program/fix1038· session8b1c01cf-7f79-4a75-bff8-240415a06208Assisted-by: Claude Code deepseek-v4.1-flash:cloud (fully tested and validated)