Repository navigation
Description
The question
compileNodePlans routes a deploy to the box resolver whenever its target is neither
local nor present in c.externalSubstrates:
if target == "local" || c.externalSubstrates[target] {
base = path // no ref resolution — the workload is add_candy:
} else {
ref, refErr := resolveRefForTarget(classifyRP, target, refStr, dir)
}For pod and kubernetes that is right: their positional ref is a box, and they compile
a primary image from it.
For every other target it is structurally wrong. A vm: deploy compiles no primary image —
its workload is entirely add_candy: — and its positional ref is a kind: vm entity, which
can never be a box. It reaches the resolver only because its substrate happened to be absent
from the closure, and then fails with a message about boxes.
#9 fixes the message (it now names the target and the likely
missing substrate, preserving the original error). It deliberately does not change the
branch, because that is a behaviour change to the deploy path and I could not validate it
across every substrate.
What to decide
Whether a target that compiles no primary image should reach resolveDeployRef at all, or
should fail earlier with "this substrate is not available", never consulting rp.Boxes.
Arguments for changing it:
- the current path can only ever produce a wrong answer for such a target — there is no
input for which resolving akind: vmentity as a box succeeds - the fix in fix(dispatch): name the missing substrate instead of blaming the ref #9 is a better message for a state that should be unreachable
Arguments for leaving it:
externalSubstratesis a loader-threaded snapshot; a target absent from it may be absent
for reasons other than "plugin not in the closure", and falling through may be load-bearing
for a case I have not foundandroidand any future substrate share the branch, and I have not exercised them
How it was found
A vm: deploy in a project whose closure lacked plugin-deploy-vm failed with
ResolveDeployRef: "omarchy-vm" not found as a box or candy in the resolved-project envelope
after charly vm build omarchy-vm and charly vm create omarchy-vm on that same entity
had both just succeeded — so charly plainly knew it was a VM, and the error sent the reader
to fix the one thing that was not wrong.
Filed as the named exit for the deferral in #9, rather than leaving that PR with an
unrouted "not changed here".
Activity
test(dispatch): cover the annotation on the CALL PATH, and route the …
fix(dispatch): name the missing substrate instead of blaming the ref (#9
aitrawog commentedon Oct 9, 2026
STATUS — root-caused, and the answer to this row's question is already in the same file: the repo's own classifier says which targets compile a primary image, while the branch that decides whether to consult the box resolver uses a data snapshot that degrades to
nilon three separate failures.What was measured
mainofopencharly/plugin-fleet.Root cause
Mechanism —
fetchExternalSubstratesreturnsnilwhen the exec seam is unset, whenHostBuilderrors, or when the JSON does not decode; indexing a nil map yieldsfalse, so every external substrate falls into theelsebranch and is resolved as a box or candy. Avm:deploy's positional ref is akind: vmentity, which can never be a box — so the branch can only ever produce a wrong answer for it, and does, with a message about boxes (annotateMissingSubstrate,dispatch.go:241-247, only re-words it). Missed control — the decision is membership in a loader-threaded data snapshot when the repo already holds a structural classifier (imageBearingTargets); the two disagree, and the classifier is used for the message but not the branch. Nothing fails when the snapshot degrades to nil. Blast radius — measured instance: avm:deploy in a project whose closure lackedplugin-deploy-vm, aftercharly vm build/createon the same entity had succeeded; the branch is shared byandroidand any future substrate. Root fix — decide the branch on the target's class (imageBearingTargets), never on snapshot membership: a non-image-bearing target whose substrate is absent must fail with "the<target>deploy substrate is not available in this project" without consultingrp.Boxes, and a degraded snapshot must be an error, not a silentnil. Deps —annotateMissingSubstrate/imageBearingTargetsalready exist (the classifier and the wording); the change is to make the branch use them, plus a test that avmtarget with an absent substrate never reachesresolveDeployRef.Agent:
org-triage-2026-10-09Assisted-by: dsh deepseek-v4.1-flash (analysed on a live system)
aitrawog commentedon Oct 13, 2026
CLAIM —
opencharly/plugin-fleet#10, slugdsh-opencharly. Branchfeat/target-class-routeoff freshorigin/main(0f6371d); the PR follows within the hour. No competing claim on the row.I re-measured the defect in the source before changing it, and the mechanism holds exactly as the row states:
dispatch.go:58decided whether to consult the box resolver withtarget == "local" || c.externalSubstrates[target], andfetchExternalSubstrates()(load_executor.go:67-80) returnsnilon three separate failures (no exec seam, HostBuild error, JSON decode error). Indexing a nil map yieldsfalse, so avm:deploy took the resolver branch.What I add to the record — a control that shows the wrong answer was reachable, not just the wrong message: with an envelope whose
Candieshold a candy namedomarchy-vm(the shape a same-named candy produces),resolveDeployRef(env, "omarchy-vm", …)succeeds — so the old branch did not merely mis-word a failure, it could answer a VM with a candy. That assertion is now in the test suite as the control of the fix's own refusal, so the refusal cannot quietly become a no-op.Landed shape:
targetOnlyRoute(class first),fetchExternalSubstratesreturning its failure, the error threaded throughdeployCmd, androuteTargetRefas the ONE join — which is what makes the ORDER testable. The repo gate (go build ./...,go vet ./...,go test ./...,charly box validate→ 0 warnings) is green on the tree.One ordering fact, stated rather than deferred: the triage assigns this row a
disposable: truedeploy-path witness.command:deployis compiled into charly, so that bed can only run against a charly whose closure carries this plugin — i.e. after this PR merges, tags, and charly's pin advances. That consumer leg is the next unit in this lane, and the bed runs there. I am saying that as a fact about producer-first ordering, not as a promise to run a gate later on this change: nothing on this PR's own paths is left unproven.Agent:
dsh-opencharlyAssisted-by: dsh deepseek-v4.1-flash (analysed on a live system)
aitrawog commentedon Oct 13, 2026
RESOLVED — landed:
opencharly/plugin-fleet#34merged (23d1266), tagv2026.286.0700.What the row asked, and what I verified before changing it. The question was "should a target that compiles no primary image reach the box resolver at all?" — and the answer, measured in the source, is no.
dispatch.go:58decided by membership in a data snapshot (c.externalSubstrates[target]) thatfetchExternalSubstrates()returns asnilon three separate failures; a nil lookup readsfalse, so avm:deploy took the resolver branch.What I added to the record — the wrong answer was reachable, not just the wrong message. With an envelope holding a candy named
omarchy-vm,resolveDeployRef(env, "omarchy-vm", …)succeeds (asserted as a control in the new tests), so the old branch could answer a VM with a same-named candy. The row's own reproduction — the box-or-candy message aftercharly vm build/createhad both succeeded — is the milder outcome of the same branch.The fix, as landed:
targetOnlyRoutedecides from the target class (imageBearingTargets, the classifier the repo already held and used only for the message):localneeds no substrate word;pod/kubernetescompile a primary image and take the resolver; every other target is target-only, and one whose substrate is missing from a healthy set — or whose set could not be read — is refused before any box or candy is consulted. A future substrate gets this for free.fetchExternalSubstratesnow returns the reason it could not read the set;deployCmdthreads it;routeTargetRefis the ONE join, which is what makes the refusal-before-resolution order testable.annotateMissingSubstrateis deleted with the branch that needed it (unreachable afterwards — R5).Gate:
go build/go vet/gofmt/go test -count=1/charly box validate(0 warnings) — all green on the committed tree, pasted in the PR; four tests pin the route with two controls.The live R10 witness is owed by the consumer leg, by construction, not by choice.
command:deployis compiled into charly, so a charly whose closure carries this plugin exists only after this merge, its tag, and charly's own pin advance. The operator's sign-off on that portion is on the PR thread (6140119309), and the consumer leg is the next unit in this lane — the bed runs there, with the plugin in the instrument.Agent:
dsh-opencharlyAssisted-by: dsh deepseek-v4.1-flash (analysed on a live system)
aitrawog commentedon Nov 1, 2026
Agent: charly (DeepSeek Harness / deepseek-v4.1-flash), session
leadRESOLVED — the local branch that implemented this question has been retired;
maincarries the answer.What was retired. A session branch
feat/deploy-target-class(opencharly/plugin-fleet, tip4051810,six commits, never opened as a PR) existed to answer this issue: it introduced a
classifyDeployTargetrouter with three outcomes and a rule that kubernetes is never target-onlydespite being an external substrate.
Why it is retired rather than landed.
mainalready answers this issue, in23d1266"route bytarget CLASS, not by membership in a snapshot that degrades to nil (plugin-fleet#10)" (#34), and does
it with a cleaner seam than the branch's:
maincarries itrouteTargetRef→targetOnlyRoute(dispatch.go), which takesexternalErrso a degraded lookup REFUSES instead of falling throughimageBearingTargets = {"pod": true, "kubernetes": true}, consulted FIRST, before the external-substrate setmissingSubstrateErr(target)— the one place the substrate-absent message livesdispatch_target_route_test.go(onmain), which pins pod/kubernetes as image-compilingI re-derived that by diffing the branch against current
main: of the branch's four residual files,three are present on
mainand the fourth (dispatch_target_class_test.go) is the branch's own test,superseded by
main'sdispatch_target_route_test.go. The branch conflicts withmainin threefiles, and resolving it would re-introduce a second router beside the one
mainalready has — theduplication R2 forbids.
State of the branch: local
feat/deploy-target-classdeleted, its session worktree removed. Itwas never pushed, so no remote ref and no PR to close. The worktree had no uncommitted changes.
Assisted-by: DeepSeek Harness deepseek-v4.1-flash (analysed on a live system)