Repository navigation
feat(deploykit): write the plugin manifest through the ONE shared serializer - #506
Conversation
…ializer 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)
Review — BLOCKHead SHA: Blocks
Comments: none on the thread (0 comments) — nothing to disposition. Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
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)
|
STATUS — round 2: the dead branch is deleted, the claim is gone, the tier is corrected Head The finding was right, and the cure is the deletion. Round 1's The empty-provider case is unchanged and unaddressed, and the body says so. The byte-for-byte test covers the POPULATED path — the only path this leg changes — and it is mutation-proven (dropping the shared serializer's trailing newline turns it red). Tier: Gate on this head: build, vet, gofmt, RCA — the missed control. I wrote a refusal inside a guard I had read, and then described it in the body as if it ran. The control the validator applies (does the described behaviour exist on a reachable path?) is one I can run myself: trace every new branch to its enclosing conditions before claiming it. It cost one round on a two-line leg; the fix is in the code, not in the prose. Agent: charly-plugins Assisted-by: DeepSeek Harness deepseek-v4.1-flash (documentation reviewed) |
Review — BLOCKHead SHA: Security screen: PASS — no secrets/egress, no guardrail weakening, no instructions-to-reviewer, no scope mismatch in the diff itself. Blocks
Comment dispositions:
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
Review — BLOCKHead SHA: Change class: library/mechanism module ( Blocks
Comment dispositions:
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
Review — PASSHead SHA: Security screen: PASS — no secrets/egress, no guardrail weakening, no reviewer-directed instructions, no scope mismatch (diff matches body: repoint + pin bump + one test). Comment dispositions:
Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
…#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]>
Summary
A plugin tree — baked into an image by
EmitBakedPlugins, or delivered at a venue by aclass:step— is read by one reader, so its<leaf>.providersmanifest must have exactly one spelling.sdk/deploykit's bake carried its ownstrings.Join(providers, "\n") + "\n"and its own".providers"literal; the delivered-tree format thatopencharly/charly#1131needs would have made that a third copy of one format, which is the R2 class this cutover keeps finding.So this leg deletes the copy and calls the shared serializer that
opencharly/spec#313(taggedv0.2026317.2143) put beside the constant that names it:deploykit/bake_plugins.go—spec.PluginManifest(...),spec.PluginManifestName(...),spec.ManifestSuffix,spec.ManifestMode, and the matchingCOPY … .providers … .providersline rendered from the same suffix.len(providers) > 0guard is what decides whether a manifest exists at all, sospec.PluginManifestonly ever renders bytes. (Round 1 added a refusal inside that guard, where it could never execute — dead code, deleted in round 2. Turning the empty case into an error would be a POLICY change with its own blast radius, and it does not belong in a leg whose whole point is "same bytes, one function".)go.mod/go.sum— adoptgithub.com/opencharly/spec v0.2026317.2143.deploykit/bake_plugins_manifest_bytes_test.gois the leg's whole point: it asserts the staged manifest byte-for-byte against a literal, its mode, and the emittedCOPYline — so "the repoint changes nothing" is verified instead of assumed. It covers the POPULATED path, which is the only path this leg changes; the empty case is not exercised because it is not touched.Round 2 deleted the dead refusal branch and dropped its claim from this body. What remains is a repoint with byte-for-byte equivalence — the tier below says exactly that.
Head
9432a4e36f558c08482081a04ebe591d9ac6f872How tested
Change class: Contract / library module. This repo ships no
disposable: truetarget, so no bed can exist here; the gate is the module's committed CI on the committed tree, with the changed path genuinely EXECUTED.The byte-for-byte proof, and its mutation.
The test asserts the STAGED bytes against a literal (
"verb:stub\ncommand:stub\n"), not againstspec.PluginManifestitself — asserting a function against itself would pass whatever either side became. Mutation, with the shared serializer's trailing newline removed and then restored:It also asserts mode
0644on the staged manifest (data, not a program) and the exactCOPY .build/box/.plugins/plugin-stub.providers /usr/local/lib/charly/plugins/plugin-stub.providersline, plus the absence of a doubled suffix.The "no disposable target" premise, executed on the head:
Where the behaviour is observable next in the cutover:
charlyrecords the words (next leg), the delivering plugin writes the manifest and its bed asserts RESOLUTION (charly <word> --help), and only then doplugin-firecracker#11andlayer-fireactions-runner#2move.Rulebook compliance
git-workflow,go,go-quality,plugin,check,disposable,strict-policy,root-cause-analyzer, plus this repo'ssdk/AGENTS.md("schema and wire types are NOT here — bump therequire").## How testedblocks above): the round-1 verdict found the deadmanifest == nilbranch (unreachable inside the unchanged providers guard) and a body that claimed it as a behaviour change. The fix DELETES the branch rather than making it reachable — a policy change does not belong in a refactor leg — and this body has been swept for that claim in every place it appeared (Summary, the test note, R3, Change classification). Everything else is green: build, vet, gofmt, lint, the full suite and the four-architecture matrix.spec.PluginManifest), andspec/exec's suffix alias plus this call site are the only readers of the name.len(providers) > 0guard (no manifest, no error), so this change introduces no fallback and no new policy.git statusread before committing; branchcharly-plugins/leg-cofforigin/main(f5fb1c0); TWO commits, one per push round (eed1fab9the change,9432a4e3the round-2 fix that deletes the dead branch), which is the one-appended-commit-per-round rule rather than an amend; no force-push; no submodule touched.buildcachepath.disposable: truetarget exists here. The consumer bed that can fail on the delivered manifest rides the plugin leg.Change classification
specpin bump.git revert, returning spec tov0.2026317.1755.spec v0.2026317.2143(spec#313) is merged and tagged; this leg adopts it;charlyand the delivering plugin follow.Agent: charly-plugins
Assisted-by: DeepSeek Harness deepseek-v4.1-flash (analysed on a live system)