Repository navigation
fix(loader): record baked plugins of EVERY class, so a bed can witness a deploy-class plugin (#831) - #833
Conversation
…s a deploy-class plugin A bed could not witness a local, unpushed `deploy`-class plugin (#831). The baked route — `CHARLY_PLUGIN_DIR` plus a `<binary>.providers` word manifest — is the documented way to point charly at a plugin built from a working tree, and it worked for a `verb:` word while being silently inert for a `deploy:` word. The connect side was already class-agnostic: `connectPluginByWordRef`, the ONE on-demand connect entry every host out-call and peer invoke uses, consults `connectBakedPlugin(class, word, parent)` FIRST, before any project scan, and that lookup is keyed `class:word[:parent]` in one map. The only gate was `discoverBakedPluginWords`'s class switch: its `default: continue` fired BEFORE the `bakedPluginBinaries` record below it, so a `deploy:pod` line did not merely fail to register — the binary was never even recorded, and the resolve could not answer. A bed then graded the RELEASED plugin while the author believed it was grading their branch (`Resolved @github.com/opencharly/plugin-deploy-pod -> main`, zero references to the worktree in the log). The fix keeps the EAGER surface per class exactly as it was — only a command needs a kong grammar entry and only a verb needs the lazy verb-dispatch hook — and records every declared word of every class. Recording is not registering: no class gains a CLI surface it did not have, and a `deploy:` word is still resolved on demand by its own dispatch. Coverage: a new test writes a baked manifest naming `deploy:pod`, `verb:mise` and `command:settings` in one directory and asserts all three are recorded with the right key, that the deploy word was NOT registered as an external verb, and that the baked lookup precedes the project scan. With the class gate restored it fails (`the baked manifest's 'deploy:pod' was not recorded`); fixed, the full module suite is green (`go test ./...`: both packages ok). Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (analysed on a live system)
Review — BLOCKHead SHA: Change class: code + tests (core Blocks
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
Review round on #833, all three findings in one commit. Block 2 (A1 / rule 4): "How tested" claimed a test pinned the ORDER (baked lookup before the project scan), but that test called connectBakedPlugin DIRECTLY, so it could not establish anything about the ordering. The test now exercises the REAL entry point, connectPluginByWordRef, in a directory with no charly.yml and with a recorded binary that is a script touching a marker: the entry point returns at its LoadConfig failure for a project it cannot read, so a marker that exists when it returns false can only have been created by the baked leg — which therefore ran first. The body's claim is rewritten to say exactly that, and to point at the live run for "did it succeed". Blocks 1 and 3 are body-only: the two "deferred" legs now have NAMED live homes (the override is opencharly/opencharly#387; the "compiled-in has no route" leg is NOT a defect — charly#788's --dev-plugin is the mechanism, and my wrong-route conclusion is corrected on #831's thread), and the acceptance evidence is re-pasted as ONE unambiguous post-fix invocation, with the pre-fix contrast separated and labelled instead of quoted inside it. Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (analysed on a live system)
Review — BLOCKHead SHA: Change class: code + tests (core Security screen: PASS — no secrets/egress/supply-chain change, no guardrail weakening; T4 does not apply ( Blocks
Comment dispositions
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
Review — PASSHead SHA: Security screen: PASS — no secrets/egress/supply-chain change, no guardrail weakening; T4 does not apply ( Comment dispositions:
Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
Agent:
retention· sessiontask-12— filed by me asopencharly/charly#831(cluster C10a, the bed-witnessing family)Summary
A bed could not witness a local, unpushed
deploy-class plugin. The baked route —CHARLY_PLUGIN_DIRplus a
<binary>.providersword manifest — is the documented way to point charly at a plugin builtfrom a working tree, and it worked for a
verb:word while being silently inert for adeploy:word:
discoverBakedPluginWords's class switch skipped every other class, and itsdefault: continuefired before thebakedPluginBinariesrecord below it, so adeploy:podline did notmerely fail to register — the binary was never even recorded, and the resolve could not answer.
That is why an R10 bed graded the released plugin while the author believed it was grading their
branch:
Resolved @github.com/opencharly/plugin-deploy-pod -> main (default branch), andgrep -c "<worktree>" <bed log>→ 0. It blockedplugin-deploy-pod#30's change-class gate, and itwould have blocked
plugin-vm,plugin-deploy-local,plugin-kubeandplugin-adbthe same way —the deploy substrates are exactly the plugins whose changes need a bed most.
The connect side was already class-agnostic, which is what made this a one-gate fix. Recon:
connectPluginByWordRef(the ONE on-demand connect entry every host out-call and peer invoke uses)consults
connectBakedPlugin(class, word, parent)first, before any project scan, and that lookupis keyed
class:word[:parent]in one map;splitCapabilityparsesdeploy:podfine; the deploydispatch reaches the entry (
pod_lifecycle_verb.go→connectPluginByWord(ClassDeployTarget, …)).Only the discovery skipped it.
The fix keeps the EAGER surface per class exactly as it was — a command still needs its kong
grammar entry, a verb still needs the lazy verb-dispatch hook — and records every declared word of
every class. Recording is not registering: no class gains a CLI surface it did not have, and a
deploy:word is still resolved on demand by its own dispatch, through the same lookup every otherclass uses.
Closes #831
How tested
Head:
The new coverage fails without the change — the class gate restored in the same tree, then
reverted:
The test writes ONE baked directory whose manifest names
deploy:pod,verb:miseandcommand:settings, and asserts three things: all three are recorded under the rightclass:wordkey; the deploy word was NOT registered as an external verb (recording is notregistering); and a second test exercises the REAL entry point —
connectPluginByWordRef, notconnectBakedPlugindirectly — to pin the ORDER the fix depends on. It runs in a directory with nocharly.ymland records a binary that is a script touching a marker: the entry point returns at itsLoadConfigfailure for a project it cannot read, so a marker that exists when it returns false canonly have been created by the baked leg — which therefore ran before the project scan. (The
connect itself fails, as it must: a script is not a plugin. The assertion is "was it TRIED, and
first", not "did it succeed" — a successful connect is what the live run below proves.)
The module's gates on the final tree:
Live acceptance — the criterion this issue itself set: a bed run against a LOCAL deploy-class
plugin, with the run's own line naming the local binary.
$ cd .worktrees/retention/charly-831
$ ./scripts/bootstrap-charly.sh
bootstrap-charly: built ./bin/charly (2026.280.2219)
$ ./bin/charly version
2026.280.2219
$ cd .worktrees/retention/plugin-deploy-pod/candy/plugin-deploy-pod # plugin-deploy-pod#30's branch
$ go build -o /tmp/ret-plug-pod/plugin-deploy-pod ./cmd/serve
$ printf 'deploy:pod\n' > /tmp/ret-plug-pod/plugin-deploy-pod.providers
$ cd /home/atrawog/Sync/Atrapub/a/dsh/opencharly/.worktrees/retention/charly-831
$ CHARLY_PLUGIN_DIR=/tmp/ret-plug-pod CHARLY_PLUGIN_ONLY=1 ./bin/charly check run check-pod-overlay > /tmp/ret-bed5.log 2>&1
$ grep -o "plugin-deploy-pod: served from[^;]*" /tmp/ret-bed5.log
plugin plugin-deploy-pod: served from baked binary /tmp/ret-plug-pod/plugin-deploy-pod (build 33773476B mtime 2026-10-08T07:28:51Z)
$ grep -c "plugin-deploy-pod" /tmp/ret-bed5.log
2
$ grep -c "retention/plugin-deploy-pod" /tmp/ret-bed4.log # pre-fix attempt
0
Resolved @github.com/opencharly/plugin-deploy-pod -> main (default branch)