Skip to content

feat(wire): the connected plugin entry carries its provider words, and ONE manifest format - #313

Merged
github-actions[bot] merged 1 commit into
mainfrom
charly-plugins/leg-c
Nov 13, 2026
Merged

github-actions[bot] merged 1 commit into
mainfrom
charly-plugins/leg-c

Conversation

@aitrawog

Copy link
Copy Markdown
Contributor

Summary

A delivered plugin TREE is a directory of provider binaries in which a bare command/verb WORD resolves only through a <leaf>.providers manifest beside the binary. Measured 2026-11-13 on a disposable guest: the tree was delivered, CHARLY_PLUGIN_DIR pointed at it, and charly firecracker --help still printed charly's USAGE text. Adding the manifest by hand made the same command resolve:

$ CHARLY_PLUGIN_DIR=/tmp/charly-plugins charly firecracker --help      # tree = binaries only
Usage: charly <command> [flags]
$ printf 'verb:firecracker\ncommand:firecracker\n' > /tmp/charly-plugins/plugin-firecracker.providers
$ CHARLY_PLUGIN_DIR=/tmp/charly-plugins charly firecracker --help
Usage: charly firecracker [<args> ...] [flags]

The engine has the words at connect time (unit.Providers, in scope at loadPluginUnit), so this leg carries them and gives the format ONE home:

  • #DeployConnectedPlugin.providers?: [...string] — additive, optional: the words the connected unit serves, exactly as it declared them over Describe.
  • spec.ManifestSuffix / spec.PluginManifest(providers) / spec.PluginManifestName(bin) — the ONE serializer. It has TWO writers (sdk/deploykit's baked-image emitter, and any class:step that delivers a tree), and they must produce the SAME bytes because the reader is one reader. A second strings.Join in the plugin would have been the third spelling of one format.
  • spec/exec's ManifestSuffix now ALIASES spec.ManifestSuffix — that package owns the tree probe and keeps its API, while the value lives in one place.
  • An empty word list renders NO manifest (nil), because a zero-word manifest would satisfy a "does this tree carry a manifest" count while addressing nothing — the vacuous-tree class this format exists to prevent.

CUE-first: schema/seam.cue is authored, spec/cue_types_gen.go is generated, and a clean regeneration on the committed tree is a no-op (pasted below).

Head 04c8ea2d125ffb5e90292f1ca439269cf2a7ec14

How tested

Change class: Contract / library module — no disposable: true target can exist here, so the gate is the repo's committed module CI on the committed tree, genuinely EXECUTING the changed paths (proven below and by the no-disposable premise).

$ git rev-parse HEAD
04c8ea2d125ffb5e90292f1ca439269cf2a7ec14

$ GOWORK=off go build ./... && echo BUILD_OK
BUILD_OK
exit=0

$ GOWORK=off go test ./...
?   	github.com/opencharly/spec/retired/cmd/retired-sweep	[no test files]
ok  	github.com/opencharly/spec/schema	25.881s
ok  	github.com/opencharly/spec/schemacompose	0.427s
ok  	github.com/opencharly/spec/schemaconcat	(cached)
ok  	github.com/opencharly/spec/schemaparams	0.318s
ok  	github.com/opencharly/spec/schemaretag	(cached)
?   	github.com/opencharly/spec/shellquote	[no test files]
ok  	github.com/opencharly/spec/spec	2.083s
?   	github.com/opencharly/spec/sshx	[no test files]
ok  	github.com/opencharly/spec/storeroot	(cached)
?   	github.com/opencharly/spec/testkit	[no test files]
ok  	github.com/opencharly/spec/transport	(cached)
exit=0

$ gofmt -l .
exit=0

$ GOTOOLCHAIN=go1.26.8 golangci-lint run ./...
0 issues.

The new units execute their changed paths — the serializer's exact bytes/filename/mode, the empty-list refusal, and the new wire field:

$ GOWORK=off go test ./spec/ -run "TestPluginManifest|TestDeployPluginsConnectReply" -count=1 -v
=== RUN   TestDeployPluginsConnectReplyCarriesTheConnectedSet
--- PASS: TestDeployPluginsConnectReplyCarriesTheConnectedSet (0.00s)
=== RUN   TestPluginManifestIsOneWordPerLineAndNewlineTerminated
--- PASS: TestPluginManifestIsOneWordPerLineAndNewlineTerminated (0.00s)
=== RUN   TestPluginManifestNameIsTheBinaryNamePlusTheSuffix
--- PASS: TestPluginManifestNameIsTheBinaryNamePlusTheSuffix (0.00s)
PASS
ok  	github.com/opencharly/spec/spec	0.012s

Regeneration is a no-op on the committed tree, so the generated types are what the schema says:

$ charly task cue-gen >/tmp/spec-cuegen3.log 2>&1; echo "cue-gen rc=$?"; git status --short
cue-gen rc=0
 M exec/charly_plugins.go
 M schema/seam.cue
 M spec/cue_types_gen.go
?? spec/plugin_tree_manifest.go
?? spec/plugin_tree_manifest_test.go
$ charly task cue-gen >/dev/null 2>&1; git diff --stat
 exec/charly_plugins.go |  6 +++++-
 schema/seam.cue        |  9 +++++++++
 spec/cue_types_gen.go  | 10 ++++++++++

(The status after the FIRST generation is the change itself; the second generation adds nothing, and the diff above is unchanged by it.)

The "no disposable target" premise, executed on the head:

$ git grep -nE '^[[:space:]]*disposable:' -- '*.yml' '*.yaml'; echo exit=$?
exit=1

$ grep -nE '^[[:space:]]*(box|deploy|check):' charly.yml; echo exit=$?
exit=1

Where the behaviour is observable next in the cutover: charly records the words (next leg), plugin-deploy-firecracker writes the manifest and its beds assert RESOLUTION (charly <word> --help) instead of file existence, and only then do plugin-firecracker#11 and layer-fireactions-runner#2 move.

Rulebook compliance

  • R0 how: skills loaded before the first tool call — git-workflow, go, go-quality, plugin, check, disposable, strict-policy, root-cause-analyzer, plus this repo's spec/AGENTS.md (CUE-first, and the wire types are not here — they are authored here and generated here).
  • R1 how: the finding this leg fixes was raised by the consumer bed and is fixed at its source rather than in the consumer. No failure or warning surfaced in this leg's own gate.
  • R2 how: the format now has ONE home (spec.PluginManifest + spec.ManifestSuffix), and spec/exec's existing constant is an ALIAS of it rather than a second literal. The sdk's baked-image emitter is repointed at it in the next leg — that leg exists precisely to delete the copy, and it is why this is a four-repo cutover instead of a plugin-local formatter.
  • R3 how: no sleep, retry or fallback; the serializer is a pure function and the empty case REFUSES (nil) rather than emitting a vacuous manifest.
  • R4 how: no documented command changed.
  • R5 how: the old literal is not kept beside the new home in this package — spec/exec's constant is an alias, so there is one value; the sdk's copy is deleted in the next leg with its own proof.
  • R6 how: git status read before committing; branch charly-plugins/leg-c off origin/main (7b66e58); one commit; no force-push; no submodule touched.
  • R7 how: the serializer's bytes are asserted against a literal expectation (not against its own output), the filename and mode are asserted, and the wire field is asserted through a JSON round trip. The consumer-side resolution is the next leg's bed.
  • R8 how: nothing mocked; the format's real behaviour is quoted from the measured guest run in the Summary.
  • R9 N/A — reason: this repo ships no binary; the module is the artifact and it is built and tested above.
  • R10 how: the Contract / library class gate — the committed module CI on the committed tree, plus the executed proof that no disposable: true target exists here. The consumer bed that can fail on the delivered manifest rides the plugin leg.

Change classification

  • Class: contract / wire-schema addition plus one hand-written protocol serializer beside the constant it names.
  • Breaking change + rollback: none — providers is optional and absent by default, and the serializer is new. Rollback is git revert; a consumer that adopted the field degrades to absent, which is this leg's pre-change behaviour.
  • Authored-wire-key change: no — the new field is internal wire, not an operator-authored charly.yml key.

Agent: charly-plugins

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

…d ONE manifest format

A delivered plugin TREE is a directory of provider binaries in which a bare command/verb WORD
resolves only through a `<leaf>.providers` manifest beside the binary. MEASURED 2026-11-13 on a
disposable guest: the tree was delivered, `CHARLY_PLUGIN_DIR` pointed at it, and `charly
firecracker --help` still printed charly's USAGE text - because the tree carried the binary and
not the manifest. Adding the manifest by hand made the same command resolve.

The engine has the words at connect time (`unit.Providers`, in scope at `loadPluginUnit`), so they
ride the set rather than being re-derived from the plugin:

  - `#DeployConnectedPlugin.providers?: [...string]` - additive, optional.
  - `spec.ManifestSuffix` / `spec.PluginManifest(providers)` / `spec.PluginManifestName(bin)` - the
    ONE serializer for that format. It has TWO writers today (sdk/deploykit's baked-image emitter,
    and any class:step that delivers a tree), and they must produce the SAME bytes because the
    reader is one reader. A second `strings.Join` in the plugin would have been the third spelling.
  - `spec/exec`'s `ManifestSuffix` now ALIASES `spec.ManifestSuffix`, so the package that owns the
    tree probe keeps its API and the value has one home.

Both new artifacts are CUE-generated (`cue_types_gen.go`) or hand-written protocol helpers beside
the constant they name; a clean `charly task cue-gen` on the committed tree is a no-op.

Refs opencharly/charly#1131

Agent: charly-plugins
Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)
@github-actions

Copy link
Copy Markdown

Review — PASS

Head SHA: 04c8ea2d125ffb5e90292f1ca439269cf2a7ec14 (branch: charly-plugins/leg-c)

Change class: contract / wire-schema addition (spec library module) — module CI gate; no disposable: true target exists (proven by the pasted git grep/charly.yml greps, exit=1).

Security screen: PASS — additive optional field + pure serializer + tests; no secrets, network egress, obfuscation, guardrail weakening, supply-chain, or scope mismatch. #DeployConnectedPlugin.providers and the serializer are all accounted for in the body.
Checklist: All applicable rules PASS or NA. CUE source (schema/seam.cue) and generated spec/cue_types_gen.go change in the same commit (SDD); the new serializer/wire-field tests would fail without the change (R7/R10); placement CORRECT (a wire-format serializer belongs in the contract module, CUE-first, not in core/sdk); attribution fully tested and validated is justified at module scope because the changed paths executed in the pasted go test run. Comment thread is empty (0 comments) — nothing to disposition.

Minor non-blocking note: the regeneration proof's heading says "no-op on the committed tree" while the pasted git status shows a dirty pre-commit working tree; the accompanying parenthetical ("the status after the FIRST generation is the change itself; the second generation adds nothing") reconciles it, and the substance — idempotent regeneration reproducing the committed generated file with no drift — holds, so this is a wording imprecision, not a contradiction.

Verdict: PASS


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

View action run

@github-actions
github-actions Bot enabled auto-merge (squash) November 13, 2026 21:42
@github-actions
github-actions Bot merged commit b4bded7 into main Nov 13, 2026
4 checks passed
charly-auto-merge Bot added a commit that referenced this pull request Nov 13, 2026
github-actions Bot pushed a commit to opencharly/sdk that referenced this pull request Nov 13, 2026
…ializer (#506)

* feat(deploykit): write the plugin manifest through the ONE shared serializer

A plugin tree — baked into an image by `EmitBakedPlugins`, or delivered at a venue by a `class:step`
— is read by ONE reader, so its `<leaf>.providers` manifest has exactly one spelling. This file
carried its own `strings.Join(providers, "\n") + "\n"` and its own `.providers` literal; adopting
the delivered-tree format would have made a third copy.

Repointed at `spec.PluginManifest` / `spec.PluginManifestName` / `spec.ManifestSuffix` /
`spec.ManifestMode` (opencharly/spec#313, tagged v0.2026317.2143), and the empty case now refuses
loudly instead of writing a zero-word manifest that would satisfy a "carries a manifest" count while
addressing nothing.

`bake_plugins_manifest_bytes_test.go` is the leg's whole point: it asserts the staged manifest's
bytes against a LITERAL (one `class:word` per line, newline-terminated), its mode (0644, data not a
program), and the emitted `COPY … .providers … .providers` line — so the repoint is proven
byte-for-byte rather than assumed. Mutation-proven: dropping the serializer's trailing newline turns
that test red (`staged manifest = "verb:stub\ncommand:stub", want "verb:stub\ncommand:stub\n"`).

Refs opencharly/charly#1131

Agent: charly-plugins
Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)

* fix(deploykit): drop the unreachable empty-provider branch

Round-2 fix: the `manifest == nil` refusal added in round 1 sat INSIDE the unchanged
`len(plugin.GetPluginProviders()) > 0` guard, so it could never execute - it was dead code
that also made the body claim a behaviour change this PR does not make. Deleted. The guard is
what decides whether a manifest exists at all; `spec.PluginManifest` only renders its bytes.

The empty-provider case is therefore UNCHANGED by this leg (the old inline join was under the
same guard), and the body now says so instead of claiming a refusal. The leg stays what its
title says: the same bytes, from one function.

Refs opencharly/charly#1131

Agent: charly-plugins
Assisted-by: DeepSeek Harness deepseek-v4.1-flash (analysed on a live system)

---------

Co-authored-by: charly <[email protected]>
github-actions Bot pushed a commit to opencharly/charly that referenced this pull request Nov 14, 2026
…#1140)

* feat(plugin): the connected plugin record carries the words it serves

The loader registers a unit's providers when it connects it, and the manifest a delivered plugin
tree needs is built from exactly those words. Until now the record carried key/leaf/view_path/
src_dir and dropped them, so a delivering step had to re-derive "what does this plugin serve" - or, as the measured defect showed, deliver a tree of binaries that no command/verb word could reach
because the `<leaf>.providers` manifest could not be written (#1131).

So `recordConnectedPluginFromLoad` takes the words and stores them, and the words come from
`unitProviderKeys(unit)` - the unit the engine CONNECTED, rendered by the ONE identity renderer
the rest of the loader uses. Nothing scrapes the plugin's binary and nothing re-parses its candy.

The tests assert the field survives both ends: the registry entry (a word list, in order) and the
step input the construct seam injects (the entry's providers array).

Adopts github.com/opencharly/spec v0.2026317.2143 (opencharly/spec#313, the field's wire home) and
github.com/opencharly/sdk v0.2026317.2240 (opencharly/sdk#506, the released repoint of the
manifest writer this field feeds).

Refs #1131

Agent: charly-plugins
Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)

* chore(pins): align the tools modules with the adopted spec and sdk pins

The red `go` job on the previous head was `TestContractPinsMatchShared`: the three lockstep
`tools/*` modules still required sdk v0.2026317.712 / spec v0.2026317.1828 while this change
adopts sdk v0.2026317.2240 / spec v0.2026317.2143. `charly task mods-tidy` writes the shared
pins into every lockstep module; its own check step then verifies it, and the canonical test
passes locally (GOWORK=off go test ./... in tools/gomod-canonical: ok).

Refs #1131

Agent: charly-plugins
Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)

---------

Co-authored-by: charly <[email protected]>
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.

1 participant