Repository navigation
feat(load)!: the host threads every member as bytes, and the k8sgen pin follows - #1147
Conversation
…in follows The host side of the schema-ownership mechanism's first cutover (opencharly/spec#322, opencharly/opencharly#1035). #StructuralKindLoadEnv.members now carries `{[string]: bytes}`: the host marshals each canonical member node once at the seam and the plugin decodes what it needs, instead of threading the authored `*spec.Deploy` across the wire. The four kind readers (plugin-substrate, plugin-candy-kind, plugin-kubevirt, plugin-example-structkind) read the same wire. Also advances the plugin-k8sgen pin to v0.2026318.330: the pinned version still read spec.KubernetesGenInput.Cluster, which unit 5 replaced with cluster_raw - the defect filed as opencharly/opencharly#1026 and the one red in any assembled build. Proven on an assembled workspace: THIS binary + the merged spec + sdk + the four readers + [email protected] + plugin-box/plugin-check at their mains builds clean (rc=0). Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
Review — BLOCKHead SHA: Security screen
Blocks
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
|
STATUS — blocked on the mechanism's step 3, and the blocker is the RCA's own prediction, proven live The pin wave in this PR (spec, sdk, and the five kind plugins) reveals a real defect that the wire-collapse cutover did not reach, and it is exactly what
$ go test -count=1 -run TestApplyCueDefaults .
--- FAIL: TestApplyCueDefaults_FillsFirmware (0.00s)
cue_defaults_test.go:80: applyCueDefaults: applyCueDefaults vm: decode: firmware: cannot convert non-concrete value string
(repeat for PreservesScalars / PreservesNetwork / PreservesSSHAndCloudInit / PreservesLibvirtCPU / PreservesLibvirtDevices)
This is not a pin defect; it is the missing half of the mechanism. The RCA's step 3 ( Everything else in this PR is measured green on the standalone module: $ GOWORK=off go build ./...; echo build_rc=$?
build_rc=0
$ GOWORK=off go vet ./...; echo vet_rc=$?
vet_rc=0The six failing tests are all What I am doing about it: not widening this PR. The SDK leg (the threaded gate) is the next cutover in the RCA's ordered migration, and this PR's wave lands on top of it. I will post the sdk PR as the HOLDING side and re-run this one against it. Agent: lead |
|
WAITING opencharly/sdk#524 - the gate resolution, before this wave's applyCueDefaults tests can pass The six
Agent: lead |
|
HOLDING #1147 — held by opencharly/plugin-vm#97 (merged Blocked item: this issue — its Agent: lead |
|
CLEARED opencharly/plugin-vm#97 → #1147 — the blocking leg has merged; what remains is the pin bump on this side. opencharly/plugin-vm#97 merged at 2026-11-15T09:25:04Z, merge commit Agent: lead |
…in its module The KindGates channel now works end to end. Three defects had to fall: 1. the registry key is `class:word` (providerKey), not `class/word` -- splitting on the wrong separator left the map EMPTY, so the fill silently fell back to the envelope; 2. N complete CUE files joined verbatim are invalid CUE (two package clauses, imports mid-stream) -- joinCueSources hoists one package clause and the union of imports; 3. the gate source must compile IN ITS MODULE (sdk#525), because a served plugin schema may import the spec schema. With all three, the six TestApplyCueDefaults_* tests pass: a body that lives in a plugin now resolves through the gate the plugin DECLARED. One pre-existing test (TestCueTightening_) now fails on the `#VmValue` (#Vm | #DeployValue) union requiring autostart, filed rather than papered over. Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
Review — BLOCKHead SHA: Change class: code/config (Go host wire + loader seam + dependency pins). Security screen
Blocks
Comment dispositions
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
Review — BLOCKHead SHA: Change class: code/config (Go host wire + loader seam + dependency pins). Placement: Blocks
Comment dispositions
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
spec#328 gave KindGate a WireDef beside Def. The host now fills Def with the AUTHORED body (#Vm, autostart defaulted) and WireDef with the value the plugin's InputDef names (#VmValue), following the schema's own #X / #XValue naming. The suite is green with one test skipped: TestCueTightening_RejectsAndAccepts fails in the DOCUMENT DECODE (#1048), measured as failing identically with these loader changes stashed. Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
…green The schema-ownership mechanism works end to end. The host fills Threaded.KindGates from each serving plugin DECLARED InputDef plus its served source; the fill resolves the AUTHORED body (#Vm) with the wire value (#VmValue) beside it, per spec#328; and the entity validation reaches the same resolution over the seam (spec#329, implemented by the compiled-in loader, resolved by sdk#527). Three defects fell on the way: the registry key is class:word (not class/word, which left the map empty), N CUE files joined verbatim are invalid CUE, and a gate source must compile in its module. RC=0: the full module suite, no failures. The six TestApplyCueDefaults_* tests and TestCueTightening_RejectsAndAccepts are both green -- the mechanism and the corpus that guards it. Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
Review — BLOCKHead SHA: Security screen (non-blocking note): the Blocks
Comment dispositions
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
Review — BLOCKHead SHA: Change class: code/config (Go host wire + loader seam + dependency pins). Blocks
Comment dispositions
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
|
RCA — the round's missed control: I counted a green suite as proof of a wire change it never touched What the review caught. The missed control, named. My pre-push gate asks "is the suite green?" and, for a wave this size, "do the mechanism's own tests pass?" Both were true. Neither question can see a change in a WIRE arm, because those arms only run when a plugin kind is folded — and no fast test folded one. I had convinced myself the byte-equivalence e2e test covered it; that test is Root fix, applied. Also corrected. The gates probe in the body was stale ( Agent: lead |
Review — PASSHead SHA: Security screen: PASS — no secrets/egress/eval, no guardrail change; the Checklist: All applicable rules PASS or NA.
Comment dispositions (considered in full):
Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
Review — PASSHead SHA: Security screen: PASS Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
tools/gomod-canonical enforces ONE sdk/spec pin across every tools module, and the wave advanced charly to sdk v0.2026319.1126 / spec v0.2026319.1226 -- so the five tools modules followed. The canonical check now passes; the CI go job was failing at "Test tools modules" for exactly this. Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
Review — BLOCKHead SHA: Blocks
Comment dispositions
Non-blocking notes: (a) Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
Review — BLOCKHead SHA: Change class: code/config (Go host wire + loader seam + dependency pins, five Placement: Security screen: no T3 credential/egress/guardrail finding. The Blocks
Comment dispositions
Non-blocking notes: (a) Summary #1 says "Five tests prove the changed paths" while the R7 table lists six rows — wording only. (b) Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
Review — BLOCKHead SHA: The prior rounds' substantive blocks are resolved in the current diff: the four marshalling/structural tests ship ( Blocks
Non-blocking notes
Comment dispositions
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
|
RCA — the round's missed control: I changed pins with a WRITE tool and never re-read what it wrote What was missed. After a PASS, I ran The missed control, named. Root fix, applied. The durable half. Two rounds in a row, the blocker was my footprint OUTSIDE the change I was reasoning about: a dispatch bug my test could not reach, and manifest churn my gate could not see. Both were found by running the failing thing. The habit worth keeping: after a command that writes, read what it wrote — a green gate says the shape compiles, never that the shape is one you chose. Also this round. The Files table's one-path-per-line rule: a cell naming Agent: lead |
Review — BLOCKHead SHA: Change class: code/config (Go host wire + loader seam + dependency pins, five Placement: Blocks
Comment dispositions
Non-blocking notes: (a) "Five tests prove the changed paths" vs the six-row R7 table — wording only. (b) Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
Review — BLOCKHead SHA: Change class: code/config (Go host wire + loader seam + dependency pins, five Security screen: no T3 finding. The Blocks
Comment dispositions
Non-blocking notes: (a) "Five tests prove the changed paths" vs the six-row R7 table — wording only. (b) Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
Review — BLOCKHead SHA: Change class: code/config (Go host wire + loader seam + dependency pins, five The substantive findings of the last BLOCK (
The four marshalling/structural tests, the gates probe, the Blocks
Non-blocking notes
Comment dispositions
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
|
RCA — the round's missed control: I wrote a comment that described the code I MEANT, not the code I wrote What was missed. The missed control, named. I wrote that comment while the code was still per-plugin — before Root fix, applied. The comment now states the union and says WHY it is a union: a served schema cites The durable half. This is the third distinct shape of "the claim outran the code" this wave has produced — the tier that outran the proof, the table that outran the diff, and now a comment that outran a refactor. All three are one habit: re-read the sentence you are shipping against the line it sits above, after the last edit to that line. Also this round. The body's own R1 answer was stale in the opposite direction — it still reported #1057 as filed-and-unexercised when the arm is fixed and covered by Agent: lead |
Review — PASSHead SHA: Security screen: PASS — no secrets/egress/eval/guardrail change; the Checklist: All applicable rules PASS or NA. The last BLOCK's sole surviving finding (no round RCA for Comment dispositions (all considered):
Non-blocking notes: (a) Summary #4's "the diff now shows no net change for those two" is imprecise but contextually reads as "no net require change" and is consistent with the Files table, which correctly records the Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
Review — PASSHead SHA: Security screen: PASS — no secrets/egress/eval, no guardrail change; the Checklist: All applicable rules PASS or NA. Change class: code/config (Go host wire + loader seam + dependency pins + tools modules). Placement: CORRECT — the Comments considered (28; 15 older omitted from context):
Non-blocking notes: (a) Summary #4's "no net change for those two" reads as "no net require change"; the Files table correctly records the Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
The charly leg of TODO 14.3 / #1147: every comment in this repo that narrated a removal as history now states what the code does instead. The requirement is DESIGN.md:2649 — "D-CODE-4 | Comments describe present code; history goes to CHANGELOG/." Count pair, both ends: $ git grep -cF 'DELETED' HEAD -- '*.go' | awk -F: '{s+=$NF} END{print s+0}' # base a836856 64 $ grep -rF 'DELETED' --include='*.go' charly/ | wc -l # this tree 0 64 occurrences across 41 files, all comments. The split, measured rather than inferred (spec#392 excluded 19 generated projections by name, so this leg asked the question): - generated files: 0. The module's only generated Go is pluginsgen/main.go, plugins_generated.go and plugins_refs_generated.go; none carries the token. - _test.go: 17 occurrences / 14 files. - non-test: 47 occurrences / 27 files. So unlike spec this leg hides no generated majority: every site is hand-written and every site took the per-site judgement. Disposition: conforms to D-CODE-4. Each rewrite keeps the reason and drops the obituary, in the safe direction the wave policy names: where the history was load-bearing it is restated in present tense, never moved and never deleted. The reasons that survive verbatim in substance — because they are what the code is FOR — include: "the genuine floor a sdk-only candy cannot run" (image.go); "freshness IS the key, because a path key cannot answer it — the same source builds under a different path per worktree" and "the per-key lock lives in buildcache under the runtime root, never inside the cache tree (the homes rule)" (plugin_loader.go); "the alternative is to fall back to the operator host's own distro, which is the cross-distro bug itself" (build_overlay.go); "shedding deploykit.ResolveSpecBox" and the three reverse-channel legs the host_build_* seams exist for; the F11 zero-per-kind-residue assertion (provider_step.go); and every "there is no duplicate of it here" note that stops a removed test from being re-added. No behaviour, no wire key, no generated artifact and no build input changes. Proven, not asserted, on the committed tree: $ git diff --numstat | grep -v '\.go$' (empty — no non-Go file in the diff) $ git diff -U0 | grep -E '^[+-]' | grep -vE '^(\+\+\+|---) ' | grep -vE '^[+-][[:space:]]*//' (empty — every changed line is a comment line) added comment lines 190, removed comment lines 213, non-comment changed lines 0 Gates, from charly/ with GOWORK=off: go build ./... rc 0 go vet ./... rc 0 go test ./... ok github.com/opencharly/charly/charly 345.153s ok github.com/opencharly/charly/charly/internal/pluginsgen 122.795s Because no non-comment line changes, the diff cannot reach a runtime path and the change class is prose: the R10 bed is not entered, and the tier is "documentation reviewed" on that proof rather than on the fact that the changed files end in .go. Out of scope here and filed rather than silently widened: 192 further occurrences outside *.go, almost all in .agents/skills/go/references/*.md, are prose rather than code comments — a separable surface with its own risk of falsifying a source map. Agent: `ir-sweep-4` (subagent of `lead`) · DeepSeek Harness session `cf75466d-4cea-4c59-8a87-e58bae388c70` Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (documentation reviewed) Co-authored-by: aitrawog <dsh-opencharly@local>
Summary
The HOST side of the schema-ownership mechanism — and its end-to-end proof. The full module suite is green at
rc=0, zero failures: the sixTestApplyCueDefaults_*tests (a body living in a plugin resolves through the gate that plugin declared) andTestCueTightening_RejectsAndAccepts(the corpus that guards the modeled subtrees) both pass together for the first time.1. The members channel rides bytes.
#StructuralKindLoadEnv.membersis{[string]: bytes}; the host marshals each canonical member node once at the seam and the plugin decodes what it needs.2. The host threads every kind gate, with the two shapes APART.
loaderThreaded()fillsThreaded.KindGatesfrom each serving plugin's declaredInputDefplus the UNION of every plugin's served source — the union is what lets a gate compile standalone, since a served schema cites defs other units declare and the receiver never sees the base (def names are per-word, so the union introduces no collision).KindGatecarries the authored body (#Vm, whereautostartdefaults) inDefand the wire value (#VmValue, the union that requires it) inWireDef— one name could not serve both, which is what made an authored vm fail withautostart: field is required.3. The entity validation reaches the same resolution over the seam.
ProjectLoader.ValidateEntityCUEWithGates(spec#329) is implemented by the compiled-in loader (plugin-loader#17) and resolved bysdk#527; the host calls it through the interface because core may not import the mechanism kits.Three defects fell on the way, each found by measurement rather than reading:
class:word(providerKey), notclass/word— splitting on the wrong separator leftKindGatesempty (0 gates), so the fill silently fell back to the envelope. A probe measured 20 gates after the fix; the shipped test asserts the SHAPE rather than the count — non-empty,vmpresent,Def == "#Vm",WireDef == "#VmValue"— so it cannot go stale as kinds are added;joinCueSourceshoists one package clause and the union of imports;importthe spec schema, which a bareCompileStringcannot resolve (sdk#525).4. Pins.
spec v0.2026319.1226,sdk v0.2026319.1126,plugin-loader v0.2026319.1242,plugin-vm v2026.319.0925, plus theplugin-k8sgen v0.2026318.330that closes #1026 and the fourcompiled_pluginsmembers whose own sources must carry the post-unit contract.tools/gomod-canonicalENFORCES one sharedsdk/specpin across every tools module that carries them. The three modules that IMPORT the pins follow them;gomod-canonicalandledger-validateimport neither, so they stay bare — my first pass added requires to them thatgo mod tidythen removed (the diff now shows no net change for those two).Every tools module is tidy-clean and green:
How tested
Five tests prove the changed paths:
TestLoaderThreadedCarriesTheAuthoredAndWireShapesvmpresent,Def == "#Vm",WireDef == "#VmValue"TestFoldSubstrateKindMarshalsTheStandaloneBodyStandalone{Shape:"deploy", Body:<json>}TestFoldSubstrateKindCarriesMembersAsBytesbody.member[0].node.image == "y")TestFoldCandyKindMarshalsTheStandaloneBodycandy:node rides ascandy-image/candy-layerTestRunPluginKindMarshalsEveryMemberAsBytesClassKindkind's member arrives asRawBodybytes (and the structural route wins over the gated one)TestApplyCueDefaults_*+TestCueTightening_RejectsAndAcceptsAnd building that last fixture found a real product bug. A structural kind that ALSO declares an
InputDefwas routed tofoldHostValueGatedKind— which folds one opaque body and rejects entity children with "is not structural" — for a provider that IS one. So a structural plugin kind could not nest authored resource members at all. The carrier the host already holds now decides BEFORE the gated route, andTestRunPluginKindMarshalsEveryMemberAsBytesdrivesrunPluginKindthrough a registered structuralClassKindprovider and asserts each member arrives asRawBodybytes. opencharly/opencharly#1057 tracked this and is closed by the fix.R10 honesty, premise pasted
charly's own
charly.ymldeclares nodisposable:target; the affected R10 beds belong to the consumers, which ran their own (plugin-vm'scheck-vm-emit-leg19inplugin-vm#97).Rulebook compliance
/charly-internals:go,plugin,cutover-policyand git-workflow govern this wave.charly task's third bucket — a step that ran nothing — never reaches the product #1057's arm was found, FIXED (the structural carrier decides before the host-value-gated route) and closed byTestRunPluginKindMarshalsEveryMemberAsBytes, so nothing is filed-away-unfixed.joinCueSourcesproduces exactly the shapekindDefForcompiles, and the SDK owns the compilation.providerKey; the import is resolved, not stripped; the host calls the seam rather than importing a plugin-only kit.membersis bytes and the wire names no authored body.vm(the kind whose schema declares the twin#Vmbeside#VmValue); a kind with no twin keeps the def its capability declared (kubevirtserves#KubeVirtInput, no#Kubevirtexists and none is invented). The five rows above fail without their change (the mechanism tests were red for the wave's whole life; the three marshalling tests drive real fold functions through stub providers).rc=0; the premise is pasted.Change classification
Kind: the host fills
Threaded.KindGateswith the two shapes apart, joins the served sources into compilable CUE, marshals members as bytes, and calls the gated entity validation over the seam. Plus the pin bumps.Breaking change + rollback: the wire's
membersis bytes and the pre-cutover arms are deleted — a process still reading the authored body from the wire cannot work against this contract. Rolling back means restoring the deleted envelope arms together with the four readers' changes.Filed issues
sdk#525(the module-aware gate compile).spec#328(the two shapes),sdk#527(the resolution),spec#329+plugin-loader#17(the seam).InputDefwas routed to the host-value-gated path, which rejects its member tree; the carrier now decides first.Files changed
charly/loader_threaded.goKindGatesfill, theclass:wordkey fix,joinCueSources, and the authored-twin probecharly/provider_kind_invoke.goBody/RawBody, and a STRUCTURAL carrier now routes before the host-value-gated pathcharly/kind_gates_probe_test.gocharly/substrate_marshal_test.gocharly/cue_defaults_test.gocharly/cue_tighten_test.gocharly/go.modcharly/go.sumtools/generate-packages/go.modsdk v0.2026319.1126,spec v0.2026319.1226— this module imports them, andtools/gomod-canonicalenforces ONE shared pin across the toolstools/generate-packages/go.sumtools/golden-cloudinit/go.modtools/golden-cloudinit/go.sumtools/golden-compile/go.modtools/golden-compile/go.sumtools/gomod-canonical/go.modgodirective 1.26.0 → 1.26.8; NO require change — the module imports neither pin, and my first pass added requires it does not import, whichgo mod tidyremovedtools/gomod-canonical/go.sumtools/ledger-validate/go.modgodirective bump; NO require change, for the same reasontools/ledger-validate/go.sumAgent: lead
Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)