Repository navigation
feat(loaderkit)!: read the pod floor from the contract's kept envelope, not the moved #Pod - #504
Conversation
…e, not the moved #Pod opencharly/spec#304 unit 3, leg 3. The contract module deleted `#Pod` and `#PodValue` (opencharly/spec#307, tag v0.2026317.703), and this module named them in two places. `vmshared/spec_aliases.go`: `PodSpec = spec.PodSpec` was an UNUSED zero-churn alias (the only `PodSpec` occurrence in this module is its own definition), so it goes with the type it named. `loaderkit/cue_schema.go`: `cueKindDefs["pod"] = "#Pod"` indexes the EMBEDDED contract schema, and `sharedCueSchema()` fail-fasts on an absent def, so with the moved def the parse panicked at init — `loaderkit: CUE kind "pod": definition #Pod not found`. The entry now names `#ResolvedPod`, the resolve-to-envelope form the contract KEEPS: the same def the contract keeps `#PodSidecar` for. Dropping the entry instead is the silent option, and it is the one this repo's own gate forbids. That table is the source of the declared-fields CONTRACT FLOOR (loaderkit/declared_fields_floor.go), whose header records the live repro it exists to prevent — distro-arch check-agent-live's pod body, an `iterate:` key carrying an `agent:` kind-word key, failing `charly deploy add` with `expected a mapping value` (sdk#221/#223/#225) — and TestContractDeclaredFields_Floor pins `pod` as a non-empty floor. A nil floor would re-arm exactly that bug. Two consequences are deliberate, bounded, and written beside the table rather than discovered later: the floor for `pod` gains the resolved-only `raw` (which the pod value gate still rejects as `field not allowed`, so the extra name cannot admit a document), and `env_default`'s type differs between the authored `#StrVal` and the envelope's `string` — which would matter only to a CONCRETE unify (`ValidateEntityClosedCUE("pod", ...)` / `ApplyCueDefaults("pod")`), and no caller in the tree passes "pod" to either. `require github.com/opencharly/spec` advances to v0.2026317.703. Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
Review — PASSHead SHA: Security screen: PASS Non-blocking note: the Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
Summary
Leg 3 of unit 3's chain (
TODO.md2.1, trackeropencharly/spec#304, row 3 — thepodkind). The contract module deleted#Pod/#PodValueinopencharly/spec#307(squash8cceca6924290854600a29cb74b7daf83d7bec01, merge-time tagv0.2026317.703), and this module names them in TWO places — one dead alias, one load-bearing table:vmshared/spec_aliases.goPodSpec = spec.PodSpec— an unused zero-churn alias (the onlyPodSpecoccurrence in this module IS that definition)loaderkit/cue_schema.gocueKindDefs["pod"] = "#Pod"— the table the embedded contract schema is indexed by, and the source of the declared-fields CONTRACT FLOOR#ResolvedPod, the def the contract keepsHead of this PR:
$ git rev-parse HEADWhy the table entry is a RETARGET, not a deletion
It is not cosmetic.
sharedCueSchema()fail-fasts on any entry whose def is absent, so with the contract's deletion linked, the loader does not warn — it panics at init:and the same table feeds
loaderkit/declared_fields_floor.go— the process-lifecycle-independent field-name set the parse consults when the served-schema channel is empty. That file's header records the live repro it exists to prevent (distro-archcheck-agent-live's pod body, aniterate:key carrying anagent:kind-word key, failingcharly deploy addwithexpected a mapping value— sdk#221/#223/#225), andTestContractDeclaredFields_Floorpinspodas a NON-empty floor. Dropping the entry re-arms exactly that bug, and this repo's own gate forbids it — the plant below turns that test red.So the entry names
#ResolvedPod: the resolve-to-envelope form the contract keeps for the kind (and the reason the contract keeps#PodSidecar), whose field set is the authored body's plus the resolved-onlyraw. Two consequences are deliberate and written beside the table instead of being discovered later:podgainsraw— a field no correct document authors, and one the pod VALUE gate still rejects asfield not allowed, so the extra name cannot admit a document;env_default's type differs between the authored#StrValand the envelope'sstring, which would matter only to a CONCRETE unify —ValidateEntityClosedCUE("pod", …)/ApplyCueDefaults("pod")— and no caller in the tree passes"pod"to either:One hit, and it is the comment in this diff that NAMES the two functions — there is no call site: the only
"pod"argument any of them receives anywhere in the tree is that sentence.Files (exactly the diff)
$ git diff --stat origin/main...HEADgo.modrequire github.com/opencharly/spec→v0.2026317.703(the merged leg-2 tag)go.sumloaderkit/cue_schema.gopodentry names#ResolvedPod; the reasoning and both bounded consequences are the comment under the tableloaderkit/declared_fields_floor.goloaderkit/declared_fields_floor_test.gocueKindDefs["pod"] == "#ResolvedPod"and the floor still covers the AUTHORED body's own field names (box,sidecar,env_default,secret)vmshared/spec_aliases.goPodSpecaliasHow tested
This repo's gate (
sdk/AGENTS.md: gofmt,go vet,go test,golangci-lint, and the cross-compile matrix), on the committed tree with thespecrequire at the merged leg-2 tag:The consumer matrix — the modules that read this surface, built against THIS tree
go mod edit -replace github.com/opencharly/sdk=<this tree>in each consumer (its ownspecthen follows this module's require through MVS), then its owngo build ./...:Six of the twenty-six modules that import
sdk/loaderkitorsdk/vmsharedare built here; the one failure is the next leg of this chain and nothing else —plugin-check's ownvar pod spec.Pod, retargeted in its own PR. The five that pass include the ones whose parse path actually consumes the floor this diff touches.The plant — red on ASSERTIONS, restored byte-identical
Plant: drop
podfromcueKindDefs(the option that would silently re-arm the unsafe value-shape scan) — the floor gate must go red on its own assertion, not on a build error:Restored, verified byte-identical against the committed files, and the restored tree IS the committed tree:
R10 — the assembled bed
No disposable target of this repo's own exists:
sdk/AGENTS.mdnames the Go gates plus the org-wide validator, and a mechanism library ships no deploy. The change is bedded where it is CONSUMED — thecharlyleg of this same chain runs the assembledcheck-podbed with all four pins (and the spec leg's own run already drove that bed with this tree linked in). Scope limit, stated rather than implied: this repo cannot bed itself; its proof is the gates, the consumer matrix, and the assembled bed on the consumer's tree.Rulebook compliance
/charly-internals:plugin,/charly-internals:goand/charly-internals:git-workflowwere loaded before the first code change; this repo'sAGENTS.mdand the umbrella rulebook were read first.specleg records: the tracker's row 3 said "nocharly+sdkconsumer", and this module has two — because neither writesspec.Pod; one namesspec.PodSpecthrough the alias, the other names the DEF as a table key, and the second one FAILS AT INIT rather than at compile time. RCA and fix are both in this diff and in the tracker'sSTATUScomment. The one separable finding of the chain (plugin-substrate's own test that still marshalsspec.Pod) is filed asopencharly/plugin-substrate#33.pod— one map entry changes, and the fallback for words the contract does not declare is untouched.#Podas a live contract def are corrected in the same change.grep -rn 'PodSpec' --include='*.go' .returns nothing after this diff; the only#Podmentions left are prose recording the move:All three hits are PROSE that records the move — two bullets of the new comment beside the table, and the failure message of the assertion that pins it. No definition, no reference, no name of a symbol this module must still resolve.
git statusread before staging; branchfeat/delete-podspec-aliasoff freshorigin/main; no force-push, no unrelated file staged. No pin, gitlink,design/*.tsvorTODO.mdis touched.Change classification
Breaking change + rollback:
require github.com/opencharly/specadvances to the tag wherespec.Pod/spec.PodSpecno longer exist, so this module's exportedvmshared.PodSpecdisappears. Nothing in the tree used it (the grep above), and every consumer that importssdk/loaderkit/sdk/vmsharedbuilds against this tree exceptplugin-check, which is the next leg and retargets its ownspec.Poddecode. Rollback is a revert of this commit: the previousspecrequire resolves again and the alias returns with it; the loaderkit retarget is harmless against the old contract too (it names a def that exists in both), so a partial revert cannot strand the chain.Filed issues
None new from this leg. The chain's one separable finding —
plugin-substrate'sload_pod_substrate_test.go:275still marshallingspec.Pod— is filed asopencharly/plugin-substrate#33from thespecleg.Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)