Skip to content

feat(plugin): copy the named plugins into the loader's stable path - #9

Merged
github-actions[bot] merged 3 commits into
mainfrom
feat/plugin-tree-delivery
Oct 19, 2026
Merged

github-actions[bot] merged 3 commits into
mainfrom
feat/plugin-tree-delivery

Conversation

@aitrawog

@aitrawog aitrawog commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

What this actually does: it copies the named plugins into the loader's stable path, and stops
there.
It does not make them usable — the variable that points the loader at that path is not
set by this step, and is filed as opencharly/charly#977. The usability proof belongs to a consumer
that composes this plugin, names the tree and invokes it.

Why the copy exists. charly firecracker is an out-of-process command plugin, so a plugin-backed
plan step needs a plugin tree at the venue. Measured on a live kind: cloud_image guest: no
CHARLY_PLUGIN_DIR, no /tmp/charly-plugins, while its charly binary is present and working. The
one delivery mechanism that existed writes the variable into a Containerfile at image-build time,
and that guest is not built from one.

What that measurement does NOT establish, and this PR does not claim: that a delivered tree makes
the verb resolve at such a guest. On the only venue this PR proves — host: local — the deploying
store is the loader's store, so the copy is redundant there and the bed confirms a file landed,
nothing more. That is a claim about a copy, and it is the claim made.

file change
candy/plugin-deploy-firecracker/plugin.go the step:plugin-tree capability with its StepContract, the req.GetClass() dispatch, and the handler
candy/plugin-deploy-firecracker/schema/firecracker.cue #PluginTreeInput — the plugin names to copy
candy/plugin-deploy-firecracker/charly.yml the step joins the providers list; the remit sentence names both classes; the plan's check verifies both classes; and the candy's plan authors run: plugin-tree: plus a paired assertion

The handler, exactly as written: it takes the plugin names from the consumer; for each name it
reads the deploying charly's plugin store (CHARLY_PLUGIN_STORE, or ~/.cache/charly/plugins) and compares every entry's leaf segment exactly — after
trimming the .lock/.stamp sidecars and cutting the final -<build key> — so a different plugin
whose leaf merely begins with the requested one cannot be delivered under the wrong name; it
refuses when it finds none, and selects the newest when several builds are present; it copies the
chosen binary to StablePluginsPath under the leaf name the loader keys a plugin by.

It does not set CHARLY_PLUGIN_DIR. An earlier version appended to ~/.profile and ~/.bashrc;
that was an R3 shim and was removed. Nothing in this change reads or writes any shell startup file.

How tested

On this head, 0c0a40f:

$ go build ./...                                  clean
$ go test ./...                                   ok  …/candy/plugin-deploy-firecracker
$ charly box validate                             OK — 0 warnings, 0 errors
$ charly check run check-deploy-firecracker-host  PASS (steps=6)

What the bed proves, and what it cannot. It proves the step dispatches at a real venue, finds the
named plugin, and writes it under its leaf name — and it fails without each of those: the
no-hash-suffixed-sibling assertion fails on an earlier handler that copied the store's filename
verbatim, and the plan's own check greps for the capability word, the handler and the contract, so
removing the step class fails it (verified by deleting the capability, running the check's command,
seeing it fail, and restoring the file).

It cannot prove the scenario the copy exists for. On host: local the deploying store is the
loader's store, so the bed cannot distinguish "the copy worked" from "the file was already there".
Proving delivery on a store-less venue, and proving that a delivered tree makes the verb resolve,
both need a consumer — which is why the usability proof is the consumer bed's, not this one's.

Rulebook compliance

  • R0 — plugin, install-plan, check and git-workflow were loaded before the actions they
    govern, plus layer for the candy.
  • R1 — every failure got an RCA before remediation. The RCAs for the predecessor's rounds are on
    opencharly/plugin-deploy-firecracker#8; this PR's own round RCA is posted here
    (#issuecomment-6263375945) because the prefix-collision defect was introduced in this PR's first
    commit and cannot be evidenced on feat(plugin): the deploy target delivers the plugin tree its own plan steps need #8. It names two missed controls: the bed's store holds one
    plugin, so it cannot express a two-plugin-same-prefix failure; and on host: local the deploying
    store is the loader's store, so the assertion is satisfied before it is made.
  • R2 — the destination filename follows the core's own rule (the loader keys by the candy's leaf).
  • R3 — no sleeps or retries; the store search refuses on zero matches and sorts by modification
    time to pick the newest; no shell configuration is touched.
  • R4/R5 — no prose routes around a defect; no legacy path remains.
  • R6 — nothing was force-pushed; this change does not read or write ~/.profile, ~/.bashrc or
    anything under /etc.
  • R7 — the gate fails without the change, verified by deleting the capability and watching the
    check fail, then restoring the tree (0 dirty files afterwards).
  • R8 — N/A — this change crosses no external service boundary; the plugin reads a local
    directory and writes a local directory.
  • R9 — the bed runs the worktree-local, CalVer-stamped build (charly version is the active
    binary's; the bed's own [deploy-add] log records the build stamp the plugin was served from),
    never a shared install.
  • R10 — disposable: true target only, fresh, zero warnings, PASS (steps=6) on this head. The
    venue limitation is stated above rather than papered over.

Filed issues

  • opencharly/charly#977 — the deploy engine should own CHARLY_PLUGIN_DIR for a step whose
    plugin set was delivered. This is the half that makes the copy usable, and it is blocked on that
    issue rather than solved here.
  • opencharly/sdk#399 — the duplicated stablePluginsPath constant.

Change classification

A runtime change to an out-of-tree plugin candy (plugin-deploy-firecracker), gated by this repo's
own R10 bed check-deploy-firecracker-host, which passed on the committed tree. The claim is
scoped to what that bed can see: a copy into the loader's stable path.

Supersedes opencharly/plugin-deploy-firecracker#8, auto-closed at five verdicts; every finding it
raised is fixed in this tree.

Assisted-by: DSH DeepSeek deepseek-v4.1-flash (fully tested and validated)

… steps need

charly firecracker is an out-of-process command plugin, so a plan step that invokes it needs a plugin TREE at the venue - and the one delivery mechanism that existed writes CHARLY_PLUGIN_DIR into a Containerfile at image-build time, which a kind: cloud_image venue is not built from. Measured on a live guest: no variable, no tree, while its charly binary works.

This adds a second served class, step:plugin-tree, beside deploy:firecracker: it takes the plugin names from the consumer, finds each one's newest built binary in the deploying charly's store (skipping the .lock/.stamp sidecars), and copies it to StablePluginsPath under the LEAF name the loader searches. It refuses when it finds none. It does NOT export CHARLY_PLUGIN_DIR - that layer is the product's, filed as opencharly/charly#977.

The candy's own plan authors the step and asserts the result, and the plan's check now verifies BOTH declared classes so it fails if the step class is removed.

Agent: charly-dsh

Assisted-by: DSH DeepSeek deepseek-v4.1-flash (syntax check only - bed run follows)
@github-actions

Copy link
Copy Markdown

Review — BLOCK

Head SHA: 6c74e3929fe9da652245cadaf743f18b930887e9 (branch: feat/plugin-tree-delivery)

Change class: runtime change to an out-of-tree plugin candy (plugin.go + charly.yml + CUE schema).

Comment thread: 0 comments — nothing to disposition.

Blocks

  1. R10 / RDD — the proof venue cannot exercise the scenario the change exists for. The PR's stated motivation is a kind: cloud_image venue that has no plugin store and no /tmp/charly-plugins ("measured on a live guest"). The only evidence is check-deploy-firecracker-host on a host: local venue. On host: local the deploying charly's store (~/.cache/charly/plugins, plugin.go:pluginStoreDir) is the loader's own store, so the copy into /tmp/charly-plugins is redundant and the paired check merely confirms a file landed. That bed cannot fail for the reason the feature exists (a store-less venue that needs the delivered tree), so it proves nothing about the actual target — a bed that "cannot fail on the change" for the real scenario (R10). Prove delivery on a disposable venue that lacks the deploying store, or demonstrate a plugin-backed step actually invoking the delivered plugin, or narrow the claim to "copies a file locally."

  2. R1 / CONC — the env-wiring half is mislabelled non-blocking. The handler fills StablePluginsPath and explicitly does not set CHARLY_PLUGIN_DIR; the candy's check: (the-tree-is-delivered-under-its-leaf-name, charly.yml) asserts only presence and no hash suffix, never that any step can invoke the plugin. Without the variable that points the loader at /tmp/charly-plugins, the delivered tree is inert — a plan step still cannot use it. The claim in the title/summary ("delivers the plugin tree its own plan steps need") is unproven while opencharly/charly#977 is filed as non-blocking. R1: "Unsure → blocking." Either demonstrate usability (a subsequent step invokes the delivered plugin) or state plainly that this ships only an inert copy and drops the "need" claim. The presence-only check currently passes for the wrong reason.

  3. QUAL / correctness — prefix-collision in the store search delivers the wrong binary. plugin.go: prefixed, err := filepath.Glob(filepath.Join(store, leaf+"-*")). This matches any store entry beginning <leaf>-, including a different plugin whose leaf is <leaf>-… (e.g. delivering plugin-firecracker also matches plugin-firecracker-extra-<key>). The newest match is then written to filepath.Join(stablePluginsPath, leaf) — the wrong plugin under the right name. The single-plugin bed cannot catch it. Bound the leaf segment (match the build-key separator/format) or list the store and filter by exact leaf.

Notes (non-blocking)

  • pluginStoreDir reads an undocumented CHARLY_PLUGIN_STORE override not mentioned in the body's handler description (minor T3 scope mismatch).
  • The Assisted-by footer's confidence slot carries trailing prose (fully tested and validated — bed PASS on this head) rather than the bare tier; tighten to the exact form.
  • opencharly/sdk#399 (duplicated stablePluginsPath) and opencharly/charly#977 are real filed issues; the constant duplication itself is acceptable as filed debt.

Verdict: BLOCK


ollama-cloud/deepseek-v4.1-flash — action-review.

View action run

A prefix glob on '<leaf>-*' also matched a different plugin whose leaf merely begins with this one, so delivering plugin-firecracker could have written plugin-firecracker-extra-<key> under the name plugin-firecracker - the right name on the wrong binary. The search now reads the store, trims the .lock/.stamp sidecars, cuts the final -<build key> and compares the leaf EXACTLY.

Two review findings asked for the claim rather than the code: this step copies the named plugins into the loader's stable path and does NOT make them usable, because the variable that points the loader at it is filed (opencharly/charly#977). On the only venue the bed reaches - host: local - the deploying store IS the loader's store, so the bed proves a copy, not delivery to a store-less venue. The PR title and body now say that.

    $ go build ./... clean   $ go test ./... ok   $ charly box validate OK   $ bed PASS (steps=6)

Agent: charly-dsh

Assisted-by: DSH DeepSeek deepseek-v4.1-flash (fully tested and validated)
@aitrawog aitrawog changed the title feat(plugin): the deploy target delivers the plugin tree its own plan steps need feat(plugin): copy the named plugins into the loader's stable path Oct 19, 2026
@github-actions

Copy link
Copy Markdown

Review — BLOCK

Head SHA: 284c7943e347a9cf020d809fde0f3db76d4d08eb (branch: feat/plugin-tree-delivery)

Change class: runtime change to an out-of-tree plugin candy (plugin.go + charly.yml + CUE schema).

Security screen: PASS — local file copy only, no secrets/egress/eval, no guardrail or rulebook/validator edits, no embedded directives in body/commits.

Comment intake

  • Comment 6263217465 (@github-actions[bot], head 6c74e39) — re-derived against current state:
    • Finding 1 (R10/RDD — bed cannot exercise the store-less scenario) → addressed by narrowing. Body now leads with "copies … and stops there. It does not make them usable," scopes the claim to "a copy into the loader's stable path," and states the bed cannot distinguish copy-worked from file-already-there. The prior reviewer explicitly offered "narrow the claim to 'copies a file locally'"; the author did. Not a surviving finding.
    • Finding 2 (R1/CONC — env-wiring mislabelled non-blocking) → addressed. Body states plainly it does not set CHARLY_PLUGIN_DIR, files opencharly/charly#977, and the Summary no longer claims usability. Filed issue is a genuinely separable product-layer concern. Not a surviving finding.
    • Finding 3 (QUAL — prefix collision delivers wrong binary) → fixed in diff. filepath.Glob(leaf+"-*") is gone; the current handler reduces each entry to its leaf via strings.LastIndex(name,"-") and compares name[:cut] != leaf, so plugin-firecracker-extra-… no longer matches plugin-firecracker. Resolved.
    • Note (Assisted-by trailing prose) → stale/superseded; current footer is the clean (fully tested and validated) form.
    • Note (CHARLY_PLUGIN_STORE undocumented) → still live, see non-blocking notes.

Blocks

  1. R1 — review-round evidence: no fresh RCA on this PR naming the missed control. The push 284c794 follows the BLOCK on 6c74e39, so R1 requires "the round's PR comment … carries a fresh RCA that names the MISSED CONTROL (why the author's own pre-push gate did not catch it)." This PR's thread contains no author comment at all — only the bot BLOCK. The body's R1 line punts the RCAs to opencharly/plugin-deploy-firecracker#8, but the prefix-collision (filepath.Glob → exact-leaf) defect was introduced in this PR's first commit (6c74e39), so its RCA cannot live on feat(plugin): the deploy target delivers the plugin tree its own plan steps need #8. Fix: post a PR comment on this thread with the RCA for the glob→exact-leaf fix — specifically why the pre-push gate / single-plugin bed did not catch that a one-plugin bed cannot exercise a two-plugin-same-prefix store, and why a prefix glob was chosen over exact-leaf matching.

Non-blocking notes

  • pluginStoreDir() reads an undocumented CHARLY_PLUGIN_STORE override the body's handler description never mentions (minor T3 scope note; benign local-directory redirect, not a security issue). Either document it in the Summary or drop it.
  • The leaf reduction (LastIndex(name,"-")) assumes the build key contains no hyphen; a hyphenated key would fail safe (refuse), not mis-deliver — acceptable, but worth a one-line comment since the body claims "cutting the final -<build key>."
  • candy/plugin-deploy-firecracker/charly.yml still reads "delivers the plugin tree a plugin-backed plan step requires"; tighten to "the plugin files a step requires to be present" so it cannot be read as claiming the env-wiring half this PR explicitly does not do.
  • stablePluginsPath duplication filed as opencharly/sdk#399; acceptable as filed debt.

Verdict: BLOCK


ollama-cloud/deepseek-v4.1-flash — action-review.

View action run

@aitrawog

Copy link
Copy Markdown
Contributor Author

RCA for review round 1 on this PR (6c74e39 → 284c794) — the missed control, named.

Agent: charly-dsh

You are right that the RCAs cannot live on #8: the prefix-collision defect was introduced in this
PR's first commit, so its RCA belongs here.

Finding: R10/RDD + R1/CONC — the claim outran the evidence (the bed cannot reach a store-less
venue; the tree is inert without the variable).

  • Mechanism: the PR described what the change was for (a kind: cloud_image guest with no
    store) and then pasted the evidence it had (host: local), without asking whether the two were
    the same scenario. On host: local the deploying store and the loader's store are one directory,
    so the copy is redundant and the assertion is satisfied before it is made.
  • Missed control: I never asked "what would this bed print if the change were absent?" For any
    bed, that question has a cheap form — delete the behaviour and re-run — and I had already written
    it down twice in this leg (S20.132 for the naming assertion, S20.146 finding 2 for the export half)
    without applying it to the scenario. The R7 self-test I ran in the previous round tested the
    assertion, not the venue; both are needed, and only one was run.
  • Root fix: the claim is narrowed to what the bed can see — "copies the named plugins into the
    loader's stable path" — and the venue limitation is stated in the Summary in the same words.

Finding: QUAL — the prefix collision (filepath.Glob(leaf+"-*") → exact leaf).

  • Mechanism: a prefix match cannot distinguish the requested leaf from a longer leaf that begins
    with it, so plugin-firecracker also matched a hypothetical plugin-firecracker-extra-<key>; the
    newest of them would then be written under the requested name — the right name on the wrong binary.
  • Missed control: the bed's store contains exactly one plugin, so the bed cannot express the
    failure at all.
    That is a property of the FIXTURE, not of the assertion, and no amount of running
    the bed would have revealed it. What would have: asking, of any glob, "what else matches this
    pattern?"
    — a one-line question I asked of the .lock sidecars two rounds earlier and did not
    re-ask when the pattern changed. And a prefix glob was chosen in the first place because it was
    the shortest way to find "the built plugin for this name"; exact-leaf matching costs an os.ReadDir
    and a LastIndex, which is the price of being right.
  • Root fix: the store is listed, each entry's .lock/.stamp sidecars trimmed, the final
    -<build key> cut, and the leaf compared exactly — so a longer leaf cannot match. Verified
    against the real store: plugin-firecracker-8d5a3bcc02ebf9f4 → plugin-firecracker (match);
    plugin-firecracker-extra-abc → plugin-firecracker-extra (rejected).

And the generic lesson, stated once: a bed that cannot express a failure is not evidence of
absence. Both findings here are of that kind — one because the venue could not differ, one because
the fixture could not. The control is to ask what would print differently if the code were wrong,
and I applied it to the assertion in both cases and to the scenario and the fixture in neither.

Assisted-by: DSH DeepSeek deepseek-v4.1-flash (documentation reviewed)

The store search documents its LastIndex assumption (a hyphenated build key would cut in the wrong place and REFUSE rather than mis-deliver); pluginStoreDir documents the CHARLY_PLUGIN_STORE override the body never mentioned; and the manifest's remit sentence now says the step COPIES the plugin files a step requires to be PRESENT, so it cannot be read as claiming the env-wiring half this PR explicitly does not do.

    $ go build ./... clean   $ go test ./... ok   $ charly box validate OK

Agent: charly-dsh

Assisted-by: DSH DeepSeek deepseek-v4.1-flash (syntax check only - bed run follows)
@github-actions

Copy link
Copy Markdown

Review — BLOCK

Head SHA: 0c0a40f4bbcf8aa96441139d7f4054f17c691239 (branch: feat/plugin-tree-delivery)

Change class: runtime change to an out-of-tree plugin candy (plugin.go + charly.yml + CUE schema).

Security screen: PASS — local file copy only; no secrets/egress/eval; no guardrail, rulebook or validator edits; no embedded directives in body/commits.

Comment intake

  • Comment 6263217465 (@github-actions[bot], head 6c74e39) — stale-superseded. Its three findings were re-derived against current state and are addressed: prefix-glob replaced by exact-leaf match (plugin.go), claim narrowed in the body, env-wiring filed as opencharly/charly#977.
  • Comment 6263355071 (@github-actions[bot], head 284c794) — verified-blocking → addressed. Its blocking finding (missing round RCA) is satisfied by comment 6263375945. Its non-blocking notes were mostly taken in 0c0a40f (CHARLY_PLUGIN_STORE documented in code, hyphen-key comment, charly.yml wording tightened), though the body still omits the env override (see notes).
  • Comment 6263375945 (@aitrawog) — verified. This is the round RCA, posted by a maintainer-set account. It correctly places the prefix-collision RCA on this PR (not feat(plugin): the deploy target delivers the plugin tree its own plan steps need #8) — which directly contradicts the body's own R1 line (block 3).

Blocks

  1. R10 / A1 — the body's proof is on a superseded commit, not the head. The body's "How tested" says "On this head, 284c794", but the current head is 0c0a40f. The third commit (0c0a40f, "fix: address the review's non-blocking notes") touches candy/plugin-deploy-firecracker/charly.yml and candy/plugin-deploy-firecracker/plugin.go, so the current head carries no pasted evidence (go build, go test, charly box validate, charly check run check-deploy-firecracker-host). Fix: update the body to reference 0c0a40f and re-run/paste the gate output on that commit — or state explicitly that the third commit is comment/prose-only and does not alter runtime behavior.

  2. A1 — rulebook-compliance section omits R8 and R9. The body answers R0, R1, R2, R3, R4/R5, R6, R7, R10 but never answers R8 (live-or-skip) or R9 (binary equals source). R9 is applicable (the change is exercised on a target) and the body never asserts the rebuilt binary / charly version; R8 is at minimum N/A — no external service boundary. Fix: add both lines with a one-line HOW or N/A — <reason>.

  3. A1 / R1 — the body's R1 line contradicts the thread. The body states "the review-round RCAs naming the missed control are posted on the predecessor PR (opencharly/plugin-deploy-firecracker#8)", but the RCA for the prefix-collision is posted on this PR (comment 6263375945, which explicitly says it cannot live on feat(plugin): the deploy target delivers the plugin tree its own plan steps need #8). Fix: update the R1 line to name the RCA posted on this PR.

Non-blocking notes

  • The body's handler description omits the CHARLY_PLUGIN_STORE override read by pluginStoreDir() (documented in code but not in the Summary) — minor A1 scope gap; add one clause or drop the override.
  • schema/firecracker.cue declares plugins: [...string] (open list, empty allowed) while the handler rejects an empty list — harmless but the schema could state minItems: 1.
  • "Newest by modification time" is a heuristic for "the build the project resolved most recently"; not a sleep/retry, but worth a one-line caveat.
  • stablePluginsPath duplication is filed as opencharly/sdk#399 — acceptable as filed debt.

Verdict: BLOCK


ollama-cloud/deepseek-v4.1-flash — action-review.

View action run

@github-actions

Copy link
Copy Markdown

Review — PASS

Head SHA: 0c0a40f4bbcf8aa96441139d7f4054f17c691239 (branch: feat/plugin-tree-delivery)

Change class: runtime change to an out-of-tree plugin candy (plugin.go + charly.yml + CUE schema).

Comment intake (all re-derived against the current body/diff):

  • 6263217465 — stale-superseded. Claim narrowed in body; env half filed as opencharly/charly#977; filepath.Glob replaced by exact-leaf os.ReadDir+LastIndex match (plugin.go); CHARLY_PLUGIN_STORE now documented; footer tightened.
  • 6263355071 — stale-superseded. Round RCA posted (6263375945); non-blocking notes taken.
  • 6263375945 — verified. Round RCA naming the missed controls, posted by maintainer-set account; satisfies R1 review-round evidence.
  • 6263423554 — stale-superseded. Body now names head 0c0a40f; R8 and R9 answered; R1 line corrected to point at this PR's RCA; CHARLY_PLUGIN_STORE documented.

Security screen: PASS — local file copy only; no secrets/egress/eval; no guardrail, rulebook or validator edits; no embedded directives.

Checklist: All applicable rules PASS or NA. Placement: CORRECT (a step capability in a candy; no core/sdk import, no alias growth).

Verdict: PASS


ollama-cloud/deepseek-v4.1-flash — action-review.

View action run

@github-actions
github-actions Bot enabled auto-merge (squash) October 19, 2026 08:56
@github-actions
github-actions Bot merged commit d62d3c0 into main Oct 19, 2026
1 of 2 checks passed
charly-auto-merge Bot added a commit that referenced this pull request Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants