Repository navigation
feat(plugin): the deploy connect serves the plugins the deploy declares, and a step receives their paths (#1131) - #1134
Conversation
A `step:` that has only a plugin NAME re-derived "which built binary serves this plugin" by scanning a store directory and taking the newest match - a guess over a layout the plugin does not own, which cannot even run on a cloud_image venue where no store exists (#1131). The loader already knows the answer: loadPluginUnit resolves the served binary and prints it (`served from <path> (build <sha>); source <dir>`). Three pieces, one seam: - loadPluginUnit records the served mapping (key, leaf, view_path, src_dir) once the unit is registered - a unit that failed to register is not served, so it is not recorded. - the `deploy-plugins-connect` reply carries that set, so a consumer acts on PATHS IT WAS TOLD. - the `construct-step` seam injects the set into a class:step's input, under spec.ConnectedPluginsInputKey, for a step whose DECLARED StepContract sets plugin_paths. Opt-in because a step's input is validated against the plugin's own usually-closed schema, so an injected key a step did not declare would be a validation failure. Core stays blind to the step's input shape: it hands over the whole set and the step selects by leaf. AND the connect must actually HAVE those plugins. Measured: it is dispatch-scoped - it scopes on the WORDS a plan step references - so a plugin a deployment composes but dispatches through a SHELL (`charly firecracker image build` inside a `command:` step) was never connected, and the step correctly refused an incomplete set. A deploy's candy list IS its intent, so the DEPLOY connect now also serves the plugin candies the deploy declares: the node's `from:` template's `candy:` list (folded into the same typed ref list the scan gets), plus its `add_candy:` and its nested children. Bounded to that closure, plugin candies only, out-of-tree sources only, and the build still goes through sdk/buildcache. Also fixed (found while proving the above, and part of this cutover): charly's OWN pb->spec StepContract conversion dropped PluginPaths, so the flag was declared, transported, and then read as false - the injection never ran. Its unit now carries a test that pins EVERY declared field's survival, because that conversion is the third copy of one contract. Adopts github.com/opencharly/spec v0.2026317.1755 (opencharly/spec#308). Refs #1131 Agent: charly-plugins Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)
`charly/go.mod`/`go.sum` conflicted on the `spec` pin: this branch pins v0.2026317.1755 (adopted for the connected-plugin-set field) and origin/main now pins v0.2026317.1828 (forced by plugin-check v0.2026317.1844's own go.mod, via MVS, in charly#1133). Kept the NEWER pin — one spec, and the field this branch adds is in both — and regenerated the sums with `go mod tidy`. The `tools/*` lockstep modules arrive already aligned by charly#1133's `charly task mods-tidy`. Agent: charly-plugins Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)
Review — BLOCKHead SHA: Change class: Blocks
Non-blocking note (filed, acknowledged): the Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
…input map Round-2 fixes for #1134's three findings, all in-tree: 1. A2/R10 - the declared-candy widening shipped no coverage that goes red when its call is removed: the unit tested the helper directly, so deleting the call left it green. The ref-building in loadDeployPlugins is now the PURE deployConnectRefs, and TestDeployConnectRefsJoinsBothHalves asserts the JOINED set (mutation-proven in both directions: removing either half turns it red). 2. QUAL/R10 - a real nil-map panic: a step that opts in to plugin_paths and authors NO input marshals to `null`, which json.Unmarshal decodes into a NIL map without an error, so the assignment panicked with "assignment to entry in nil map". Guarded, and covered by TestConstructStepInjectsIntoAStepWithNoAuthoredInput (mutation-proven: removing the guard panics that test). 3. A1 - check_cmd.go's cfg threading is accounted for in the body. Refs #1131 Agent: charly-plugins Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)
|
STATUS — round 2 pushed, all three findings fixed in-tree Head Findings, all three fixed (nothing filed, nothing deferred):
Gate on this head: RCA — the missed control. (1) I treated a helper-level unit test as coverage of its CALL SITE. The control is to assert the seam a caller invokes — hence the extraction. (2) I read the nil-map path twice and did not see it, because Not claimed: the consumer's Agent: charly-plugins Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated) |
Review — PASSHead SHA: Change class: Security screen: PASS — no T1–T4 findings; no secrets/egress, no weakened guardrails, no security-machinery edit, no embedded directive. Checklist: All applicable rules PASS or NA. Prior-block dispositions (re-derived against the current diff, not the prior comment):
Non-blocking notes (not blocks):
Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
Summary
The loader already knows which built binary serves which plugin —
loadPluginUnitresolves it and every run prints it (plugin <ref>: served from <path> (build <sha256>); source <dir>) — and then threw the mapping away. Astep:that has only a plugin NAME therefore re-derived it by scanning a store directory and taking the newest match: a guess over a layout the plugin does not own, which cannot even run on akind: cloud_imagevenue because no store exists there (opencharly/charly#1131).Four pieces, one seam, plus the defect that proving them exposed:
charly/plugin_connected_set.go(new) — records the served mapping (key,leaf,view_path,src_dir) asloadPluginUnitfinishes registering a unit. Recorded AFTER registration (a unit that failed to register is not served), idempotent on(key, leaf, view_path), andsnapshot()hands out a copy.charly/host_build_deploy_plugins_connect.go— thedeploy-plugins-connectreply carries that set, so a consumer acts on PATHS IT WAS TOLD.charly/host_build_construct_step.go— theconstruct-stepseam injects the set into a class:step's input underspec.ConnectedPluginsInputKeyfor a step whose DECLAREDStepContractsetsplugin_paths. Opt-in because a step's input is validated against the plugin's own usually-closed schema; core stays blind to the step's input shape (it hands over the WHOLE set; the step selects by leaf).charly/plugin_loader.go— the connect now SERVES the plugins the deploy DECLARES. The connect is dispatch-scoped (it scopes on the WORDS a plan step references), and a deploy's venue also dispatches through a shell no prescan can read:charly firecracker image buildinside acommand:step references no plan word at all. So a deployment composingplugin-firecrackernever connected it, and the step correctly refused an incomplete set. A deploy's candy list IS its intent, so the DEPLOY connect also serves the plugin candies it declares: the node'sfrom:-templatecandy:list (folded into the same typed ref list the scan receives — the merge does NOT copy it onto the node), plus itsadd_candy:and its nested children. Bounded to that closure; plugin candies only; out-of-tree sources only (a compiled-in plugin is already served); the build still goes throughsdk/buildcache.charly/check_cmd.gois the SECOND caller ofdeployNodePluginContext(the check-run path); it now threadscfgthrough as well, so both callers see the deploy's declared candy closure — the same one-line threading, no second behaviour.And the defect this exposed, fixed here:
charly/plugin_provider_common.go— charly's OWN pb→specStepContractconversion built the carrier from Scope/Venue/Gate/Emits and droppedPluginPaths, so a plugin declared the flag, the transport carried it, and the host readfalse: the injection never ran. That is the third copy of one contract conversion (spec/exec,sdk,charly), and the new test pins the whole set by construction.Adopts
github.com/opencharly/spec v0.2026317.1755(opencharly/spec#308, merged and tagged). Thesdkhalf — the spec→pb capability build — landed as opencharly/sdk#505.Catch-up merge.
origin/mainmoved under this branch (charly#1133 adoptedplugin-check v0.2026317.1844, which forcesspectov0.2026317.1828via MVS). The branch carries a merge oforigin/main(d4c1d555), with the one conflicted pin resolved to the NEWERspec— one spec, and the field this PR adds is in both — and the sums regenerated bygo mod tidy. The bed below ran on the MERGED tree.Round 2 — all three findings fixed
loadDeployPluginsis now the PUREdeployConnectRefs(plan words + declared-candy words, joined in ONE function), andTestDeployConnectRefsJoinsBothHalvesasserts the JOINED set — mutation-proven in both directions below. A test of either half alone stays green when its call is deleted; that was the gap.plugin_pathsand authors NO input marshals tonull, whichjson.Unmarshaldecodes into a nil map without an error, so the assignment panicked with "assignment to entry in nil map". Guarded, withTestConstructStepInjectsIntoAStepWithNoAuthoredInputcovering it (mutation-proven: removing the guard panics the test).charly/check_cmd.gois accounted for in the Summary above (the seconddeployNodePluginContextcaller, threadingcfg).RCA — the missed controls. (1) My pre-push pass treated a helper-level unit test as coverage of its CALL SITE, which is the exact gap the validator names; the control is to assert the seam a caller invokes, not the unit beneath it — done by extracting the pure joined function. (2) The nil-map path existed in code I wrote and read twice:
json.Unmarshal("null", &m)leavingmnil is not visible in the source, only in the spec, so the control is a test for the EMPTY/absent authored input specifically — added. (3) The body accounted for five files and named five;check_cmd.gowas the sixth. The control is to derive the file list fromgit show --stat, not from memory — the body now names every file in the diff.Head
87901d69f929531703d04e5bdabb3d55d414cf36How tested
Change class:
charlyGo code. The gate isgo test ./...+go vet+ the R9 worktree build, then a livecharly check runbed on adisposable: truetarget driven by THAT binary, plus the end-to-end witness for the part no charly-own bed can reach.R9 — the binary is the source. Built by this worktree's own
scripts/bootstrap-charly.sh:R10 — the bed, with the worktree binary.
check-plugin-buildcache-localis the disposablehost: localbed whose fixture project drives an out-of-tree plugin through the loader's host-build + connect arm — the path pieces 1 and 4 change:and its summary on the committed tree (
ok: true, zero warnings, zero skipped, the fresh rebuild included):Z's end-to-end witness — a disposable
host: localdeploy, red without the widening and green with it. The charly-own bed above composes no candies, so it cannot reach the widening; this is the measured proof instead, on a scratch project (probe-templatelocal:template composingplugin-deploy-firecracker+@…/plugin-firecracker:v2026.288.0016, deployprobewhose plan runsplugin-tree: {plugins: [plugin-firecracker]}):Blast radius of Z, measured on that deploy: the deployment declares 3 candy refs — 2 plugin candies (
plugin-deploy-firecrackerlocal,plugin-firecrackerremote) plus theplugin-deploy-localsubstrate — so the connect serves 2 declared plugin candies it previously skipped, at the cost of 1 additional host build (the local one was already connected) from the content-addressedsdk/buildcachestore. A deployment that declares no plugin candies (every charly-own bed in this repo) gains no connect and no build:templateCandyRefsreturns an empty list.And an unbuildable declared plugin fails LOUD and BY NAME, so the delivered set is complete or the deploy stops — the property
plugin-tree's fill-first refusal depends on:The units execute their changed paths, and the two defects are pinned by tests that die without their fix:
Mutations, each restored afterwards (the tree is clean at the head above):
TestConstructStepInjects…fails:an opted-in step's input carries no "plugin_paths" key.TestConstructStepLeavesANonOptedIn…fails:a step that did not opt in received "plugin_paths".PluginPaths: sc.GetPluginPaths()from the carrier conversion →TestBuildCapMeta…fails:PluginPaths was dropped in the wire→carrier conversion.deployConnectRefs→TestDeployConnectRefsJoinsBothHalvesfails:refs = map[planned:{}], want exactly the plan word plus the declared plugin's word.deployConnectRefs→ the same test fails the other way:refs = map[venuecli:{}].TestConstructStepInjectsIntoAStepWithNoAuthoredInputPANICS (assignment to entry in nil map), which the test reports as a failure.Where it is observable next in the cutover:
opencharly/plugin-deploy-firecracker's PR consumes the injected paths and DELETES itspluginStoreDir()scan; itscheck-plugin-tree-vmbed is the consumer's discriminating run.opencharly/plugin-firecracker#11andopencharly/layer-fireactions-runner#2follow.Rulebook compliance
git-workflow,go,go-quality,plugin,check,disposable,strict-policy,root-cause-analyzer, pluscharly/AGENTS.md(R9 build discipline, SDD, the boundary law).PluginPaths— mechanism: three copies of one pb↔spec conversion and only two were updated; missed control: I searched the field's uses instead of every construction ofspec.StepContractin all three modules; blast radius: any field added to that contract silently disappears, and this feature was inert; root fix: the field plus a test that pins the WHOLE declared set. (b) the connect being dispatch-scoped so a venue-CLI plugin is never served — mechanism and blast radius are in the Summary; the fix is piece 4. (c)plugin_provider_common.go's conversion had no test at all — the new test is the control.bakedPluginFileName(the ONE rule for the filename a baked plugin takes), never a second derivation; the input key is one constant inspec; the step's entry type is the engine's own wire type. One known duplication, FILED not folded (see## Filed issues): thepb.StepContract↔spec.StepContractconversion exists in three places —spec/exec/executor.go,sdk/schema.go,charly/plugin_provider_common.go. This PR carries the field in all three (the third was the defect), and the extraction is a separate contract-module cutover.sdk/buildcache(the existing store).pluginStoreDir()inplugin-deploy-firecracker— is deleted in the next leg of the chain, where its home is, and this PR is what makes that deletion possible.git statusread before committing; committed oncharly-plugins/leg-bofforigin/main(a41169a2); the branch is unpushed, so the two commits it carried during development were folded into one before the first push (legal: no amend after a push, no force-push ever).loadDeployPlugins) is proven LIVE, red→green, with both runs pasted. The emitted artifact — the step input — is asserted as JSON after theStepToView/StepFromViewround trip.scripts/bootstrap-charly.shin this worktree producedbin/charly2026.317.1954and every run above uses that binary; the version is pasted besidegit rev-parse HEAD.check-plugin-buildcache-local(disposable: true,charly check run) on the committed tree, plus the Z witness on a disposablehost: localdeploy. The consumer's discriminating bed is named and runs in the next leg.Change classification
charlyGo code (loader + two host seams + the deploy connect's declared-candy widening) plus aspecpin bump.git revertplus the module pin returning to specv0.2026317.703.spec v0.2026317.1755(spec#308) →sdk v0.2026317.1803(sdk#505) → this PR →plugin-deploy-firecracker(consumes the paths, deletes the scan) →plugin-firecracker#11andlayer-fireactions-runner#2.Filed issues
pb.StepContract↔spec.StepContractconversion is transcribed three times (spec/exec,sdk,charly), so a field added to one is silently dropped by the others; this PR hit it withPluginPathsand carries the field in all three, the extraction is its own cutover.Agent: charly-plugins
Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)