Repository navigation
feat(plugin): compose each served unit's schema, then unify it onto the base - #1115
Conversation
…he base opencharly/sdk#490's second ordered root. The host's plugin schema gate joined every loaded unit's served text into ONE compilation unit and compiled it onto the base. That shape cannot carry an import: a plugin that imports github.com/opencharly/spec/schema gets its import clause copied into a file that already has one, and CUE refuses before resolution is even attempted ("expected label or ':', found 'STRING'"). It made the one-unit case refuse the import outright too, because the text compile had no module in scope. Each unit is now COMPOSED as its own CUE module instance (spec/schemacompose — the ONE composer, in the contract module, because this host may import spec and may not import the sdk, while the serve side may import both) and unified onto the running value. The unit boundary lands where CUE's own package boundary is: one package per plugin. The running value is grown one unify per registration instead of being rebuilt from the base per registration. That is not cosmetic: rebuilding made loading quadratic, and it was MEASURED here — charly/charly's TestMain, which registers the 63 builtin plugin schemas, went from 1.4 s to 26.4 s, which in turn pushed a cancellation test past its 10 s bound (TestConnectPluginReady_HonorsACallerCancellation: the fixture's child process could not finish its own TestMain and answer the handshake). With one unify per registration TestMain is 1.1 s and that test passes at 1.45 s. The declarations the gate reads per source (topLevelDefNames, the charly#770 collision identity index) are unchanged; the def names now come from the composed unit value, which carries the same top-level definitions. Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)
validator INCONCLUSIVE — no review verdict was produced (not a BLOCK; no code finding)The gate could not obtain a review verdict on this run, so it produced no code finding. This is not a BLOCK and the PR is not being rejected — but the required check stays RED on purpose: unreviewed code must never merge.
Root cause (measured in this run). Durable remedy.
Thread policy. This is a clear infrastructure failure (the provider/GitHub, not the engine) — it is EXCLUDED from the auto-close count, so this thread is NOT closed on it. Fix any A run that produced no verdict keeps this required check RED: unreviewed code must never merge. Full diagnostics: this run's evidence artifact + job log (not embedded here — embedding a runaway log would feed it into the next review and deepen the collapse). |
3 similar comments
validator INCONCLUSIVE — no review verdict was produced (not a BLOCK; no code finding)The gate could not obtain a review verdict on this run, so it produced no code finding. This is not a BLOCK and the PR is not being rejected — but the required check stays RED on purpose: unreviewed code must never merge.
Root cause (measured in this run). Durable remedy.
Thread policy. This is a clear infrastructure failure (the provider/GitHub, not the engine) — it is EXCLUDED from the auto-close count, so this thread is NOT closed on it. Fix any A run that produced no verdict keeps this required check RED: unreviewed code must never merge. Full diagnostics: this run's evidence artifact + job log (not embedded here — embedding a runaway log would feed it into the next review and deepen the collapse). |
validator INCONCLUSIVE — no review verdict was produced (not a BLOCK; no code finding)The gate could not obtain a review verdict on this run, so it produced no code finding. This is not a BLOCK and the PR is not being rejected — but the required check stays RED on purpose: unreviewed code must never merge.
Root cause (measured in this run). Durable remedy.
Thread policy. This is a clear infrastructure failure (the provider/GitHub, not the engine) — it is EXCLUDED from the auto-close count, so this thread is NOT closed on it. Fix any A run that produced no verdict keeps this required check RED: unreviewed code must never merge. Full diagnostics: this run's evidence artifact + job log (not embedded here — embedding a runaway log would feed it into the next review and deepen the collapse). |
validator INCONCLUSIVE — no review verdict was produced (not a BLOCK; no code finding)The gate could not obtain a review verdict on this run, so it produced no code finding. This is not a BLOCK and the PR is not being rejected — but the required check stays RED on purpose: unreviewed code must never merge.
Root cause (measured in this run). Durable remedy.
Thread policy. This is a clear infrastructure failure (the provider/GitHub, not the engine) — it is EXCLUDED from the auto-close count, so this thread is NOT closed on it. Fix any A run that produced no verdict keeps this required check RED: unreviewed code must never merge. Full diagnostics: this run's evidence artifact + job log (not embedded here — embedding a runaway log would feed it into the next review and deepen the collapse). |
Review — PASSHead SHA: Security screen: PASS (no scope mismatch; version pin bump justified by opencharly/spec#297; no secrets/egress; gate preserved — self-containment becomes "composes on its own", still rejects an undeclared base-def reference; no alias growth; no Checklist: All applicable rules PASS or NA. Code gate matches the core-plugin-loading class: fresh Placement: CORRECT — plugin schema loading stays in core (plugin loading is core); the shared composer correctly lands in Comment thread: empty (0 comments) — nothing to disposition. Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
Review — BLOCKHead SHA: Change class: code/config — core plugin-loading (per-unit compose) plus cross-module Blocks
Comments considered
Non-blocking notes
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
validator INCONCLUSIVE — no review verdict was produced (not a BLOCK; no code finding)The gate could not obtain a review verdict on this run, so it produced no code finding. This is not a BLOCK and the PR is not being rejected — but the required check stays RED on purpose: unreviewed code must never merge.
Root cause (measured in this run). Durable remedy.
Thread policy. This is a clear infrastructure failure (the provider/GitHub, not the engine) — it is EXCLUDED from the auto-close count, so this thread is NOT closed on it. Fix any A run that produced no verdict keeps this required check RED: unreviewed code must never merge. Full diagnostics: this run's evidence artifact + job log (not embedded here — embedding a runaway log would feed it into the next review and deepen the collapse). |
Review — PASSHead SHA: Security screen: PASS — no scope mismatch (all 13 files accounted for); no secrets/egress; guardrail preserved (self-containment becomes "composes on its own", still hard-rejects an undeclared base-def reference, pinned by Comments considered:
Non-blocking notes: Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
## Summary `validateKindValueCUE` gated every substrate/candy/host-value kind against `spec.KindValueDefs[disc]` looked up in `sharedCueSchema()` — the **base schema alone**. A definition a plugin declares lands in `pluginSchemas.unified` (**base & every served plugin unit**), a different `cue.Value`, so the moment a kind body left `spec/schema` the gate would stop finding its def and silently stop gating. `runPluginKind` chose the host-value fold from the same host-side list (`spec.KindValueDefs` membership). Now: - **The gate reads the composed unit.** `kindValueDefValue` resolves the def against `pluginSchemas.unified` (via the new `composedSchema()` snapshot), falling back to the base only while nothing is composed — and, when the def is in neither the base nor the currently composed units, materializes the builtin units once (`sync.Once`) and retries the composed lookup. - **The fold follows the shape the provider declares.** `kindValueDefPath(prov, disc)` asks the provider first: a `class:kind` capability naming a `#<Word>Value` body def in its `InputDef` is host-value-gated; `spec.KindValueDefs` is only the compatibility fallback for a body that has not moved. `capMeta` now carries that declared `InputDef` (`DeclaredKindInputDef`), so routing and gating read the same declaration, in both placements, with no wire/contract change. Substrate routing (`DeployTraits`) and the candy factory (`CandyKindCarrier`) were already provider-declared and are untouched. No kind moves here. Every kind whose body still lives in the base resolves the **same def it always did**, and the composed value is measured **equal to the base for all 11 gated kinds**. This is `TODO.md` 2.1 / opencharly/spec#304 unit 0 — the gate half. Its prerequisite (per-unit CUE composition, #1115) is already on `main` (`git merge-base --is-ancestor 8403fc1 origin/main` → YES). ### Files | File | Change | |---|---| | `charly/provider_kind_invoke.go` | `kindValueDefPath` + `kindValueDefValue` + `kindInputDefCarrier`; the gate reads the composed unit; the fold routes on the provider's declared shape | | `charly/plugin_loader.go` | `composedSchema()` — the composed-unit snapshot accessor | | `charly/plugin_provider_common.go` | `capMeta.inputDef` + `DeclaredKindInputDef()`; `buildCapMeta` lifts the declared `input_def` | | `charly/cue_schema.go` | doc comment: the gate reads the composed value | | `charly/cue_kinds_corpus_test.go` | the corpus test selects and judges through the provider-declared path | | `charly/kind_value_composed_test.go` | new: the plugin-declared def path, the wire→capMeta chain, the routing contract, the lazy-materialization miss (subprocess), the composed==base measurement | | `charly/test_main_test.go` | a test-only env knob that lets a re-executed helper start with NO composed schema | | `charly/kind_value_corpus_sweep_test.go` | new: opt-in real-corpus sweep with a base-only and a composed arm | | `.agents/skills/plugin/references/authoring-recipes.md` | the rich-value mechanism sentence follows the new source | | `.agents/skills/go/references/source-map.md` | the gate's def source described accurately in the file map | ## How tested ### 1. What the gate reads, before → after ```console $ grep -n "defPath, ok := kindValueDefPath\|def, err := kindValueDefValue\|composedSchema()" charly/provider_kind_invoke.go charly/plugin_loader.go charly/provider_kind_invoke.go:454: if composed, ok := composedSchema(); ok { charly/provider_kind_invoke.go:465: composed, ok := composedSchema() charly/provider_kind_invoke.go:501: defPath, ok := kindValueDefPath(prov, pn.Disc) charly/provider_kind_invoke.go:505: def, err := kindValueDefValue(defPath) charly/plugin_loader.go:265:func composedSchema() (cue.Value, bool) { ``` Before: `defPath, ok := spec.KindValueDefs[pn.Disc]` + `def := sharedCueSchema().LookupPath(...)`, and `runPluginKind` routed on `if _, gated := spec.KindValueDefs[pn.Disc]; gated`. ### 2. Equality for every unmoved kind — composed value == base value ```console $ TMPDIR=/tmp/charly-ci GOTMPDIR=/tmp/charly-ci go test ./charly/ -run TestKindValueDefs_ComposedEqualsBase -v -count=1 === RUN TestKindValueDefs_ComposedEqualsBase kind_value_composed_test.go:168: android #AndroidValue: composed == base kind_value_composed_test.go:168: candy #CandyValue: composed == base kind_value_composed_test.go:168: firecracker #FirecrackerValue: composed == base kind_value_composed_test.go:168: kindcluster #KindclusterValue: composed == base kind_value_composed_test.go:168: kubernetes #KubernetesValue: composed == base kind_value_composed_test.go:168: kubevirt #KubevirtValue: composed == base kind_value_composed_test.go:168: local #LocalValue: composed == base kind_value_composed_test.go:168: pipeline #PipelineValue: composed == base kind_value_composed_test.go:168: pod #PodValue: composed == base kind_value_composed_test.go:168: task #TaskValue: composed == base kind_value_composed_test.go:168: vm #VmValue: composed == base --- PASS: TestKindValueDefs_ComposedEqualsBase (0.00s) ``` 11 of 11 gated defs, compared with `cue.Value.Equals` in a process where `TestMain` registered the 63 builtin units. (`Subsume` is false both ways even for equal CUE values carrying disjunctions, so `Equals` is the measurement — and the test pins it as a regression guard.) ### 3. Zero verdicts moved — real corpus, before vs after The committed sweep (`charly/kind_value_corpus_sweep_test.go`) judges every entity body of a gated kind through the production gate, with a **base-only arm** that reproduces the pre-change lookup exactly (`CHARLY_KIND_VALUE_GATE=base`), over the pinned umbrella tree. ```console $ export TMPDIR=/tmp/charly-ci GOTMPDIR=/tmp/charly-ci CHARLY_CORPUS_ROOT=/home/atrawog/Sync/Atrapub/lo/dsh/opencharly $ CHARLY_KIND_VALUE_GATE=base CHARLY_CORPUS_OUT=/tmp/kv-base.txt go test ./charly/ -run TestKindValueCorpusSweep -v -count=1 kind_value_corpus_sweep_test.go:202: gate=base: judged 2004 entity bodies (1646 files unparsable) -> /tmp/kv-base.txt kind_value_corpus_sweep_test.go:204: android 9 kind_value_corpus_sweep_test.go:204: candy 1025 kind_value_corpus_sweep_test.go:204: kindcluster 24 kind_value_corpus_sweep_test.go:204: kubernetes 23 kind_value_corpus_sweep_test.go:204: kubevirt 25 kind_value_corpus_sweep_test.go:204: local 203 kind_value_corpus_sweep_test.go:204: pipeline 12 kind_value_corpus_sweep_test.go:204: pod 250 kind_value_corpus_sweep_test.go:204: task 47 kind_value_corpus_sweep_test.go:204: vm 386 $ CHARLY_KIND_VALUE_GATE=composed CHARLY_CORPUS_OUT=/tmp/kv-composed.txt go test ./charly/ -run TestKindValueCorpusSweep -v -count=1 kind_value_corpus_sweep_test.go:202: gate=composed: judged 2004 entity bodies (1646 files unparsable) -> /tmp/kv-composed.txt kind_value_corpus_sweep_test.go:204: android 9 kind_value_corpus_sweep_test.go:204: candy 1025 kind_value_corpus_sweep_test.go:204: kindcluster 24 kind_value_corpus_sweep_test.go:204: kubernetes 23 kind_value_corpus_sweep_test.go:204: kubevirt 25 kind_value_corpus_sweep_test.go:204: local 203 kind_value_corpus_sweep_test.go:204: pipeline 12 kind_value_corpus_sweep_test.go:204: pod 250 kind_value_corpus_sweep_test.go:204: task 47 kind_value_corpus_sweep_test.go:204: vm 386 $ diff -u /tmp/kv-base.txt /tmp/kv-composed.txt; echo "diff rc=$?" diff rc=0 $ sha256sum /tmp/kv-base.txt /tmp/kv-composed.txt 117afcac27674e333147f86ea91b97c4209ebda545960b2d236ec01baa52029c /tmp/kv-base.txt 117afcac27674e333147f86ea91b97c4209ebda545960b2d236ec01baa52029c /tmp/kv-composed.txt $ for f in /tmp/kv-base.txt /tmp/kv-composed.txt; do echo "$f judged=$(grep -vc '^PARSE-ERR' $f) ok=$(grep -c '|OK$' $f) fail=$(grep -c '|FAIL ' $f)"; done /tmp/kv-base.txt judged=2004 ok=1984 fail=20 /tmp/kv-composed.txt judged=2004 ok=1984 fail=20 ``` Zero lines differ. The 20 FAILs are the **design negative fixtures** (`design/negative/*`), the retired-pipeline migration fixtures (`charly/charly/testdata/migrate-retired-pipeline`, `plugin-herdr/…`, `pod-herdr/…`) and `plugin-migrate` testdata — files authored to fail; each carries the identical verdict on both sides. The 1646 unparsable files are CI workflows, compose files and other non-charly YAML (identical set on both sides; each is written as `PARSE-ERR <path>` and those lines diff clean too). Corroboration on the **actual pre-change code**: a worktree at `origin/main` (`152dc845`) ran the same harness with only the gate call replaced (`validateKindValueCUE(pn)` and `spec.KindValueDefs[pn.Disc]` selection instead of `validateKindValueCUE(pn, prov)` / `kindValueDefPath`); both trees produced the same `117afcac27674e333147f86ea91b97c4209ebda545960b2d236ec01baa52029c`. ```console $ git -C /home/atrawog/Sync/Atrapub/lo/dsh/opencharly/charly worktree add --detach \ /home/atrawog/Sync/Atrapub/lo/dsh/opencharly/.worktrees/dsh-kindvalue-before/charly origin/main $ # the harness copied in, with the pre-change gate call as shown above $ CHARLY_CORPUS_ROOT=/home/atrawog/Sync/Atrapub/lo/dsh/opencharly CHARLY_CORPUS_OUT=/tmp/corpus-before.txt \ go test ./charly/ -run TestZZCorpusSweep -v -count=1 zz_corpus_sweep_test.go:126: judged 2004 entity bodies (1646 files unparsable) -> /tmp/corpus-before.txt $ sha256sum /tmp/corpus-before.txt /tmp/corpus-after.txt 117afcac27674e333147f86ea91b97c4209ebda545960b2d236ec01baa52029c /tmp/corpus-before.txt 117afcac27674e333147f86ea91b97c4209ebda545960b2d236ec01baa52029c /tmp/corpus-after.txt ``` ### 4. The new path executes — a kind body registered by a PLUGIN `TestKindValueGate_ReadsAPluginDeclaredDefFromTheComposedUnit` registers a unit serving `#GateprobeValue`, asserts the **base cannot see it**, then shows the gate accepting a conforming body and rejecting a typo'd field through it. ```console $ TMPDIR=/tmp/charly-ci GOTMPDIR=/tmp/charly-ci go test ./charly/ -run 'TestKindValueGate_|TestKindValueDefPath_|TestCapMeta_|TestKindValueDefValue_' -v -count=1 === RUN TestKindValueGate_ReadsAPluginDeclaredDefFromTheComposedUnit --- PASS: TestKindValueGate_ReadsAPluginDeclaredDefFromTheComposedUnit (0.03s) === RUN TestKindValueDefPath_FollowsTheProviderDeclaredShape --- PASS: TestKindValueDefPath_FollowsTheProviderDeclaredShape (0.00s) === RUN TestCapMeta_DeclaredKindInputDefLiftedFromTheWireCapability --- PASS: TestCapMeta_DeclaredKindInputDefLiftedFromTheWireCapability (0.00s) === RUN TestKindValueDefValue_MaterializesBuiltinUnitsOnMiss --- PASS: TestKindValueDefValue_MaterializesBuiltinUnitsOnMiss (2.29s) ``` The last two close the production chain the first pair cannot: `buildCapMeta` is the ONLY place a wire `input_def` becomes `capMeta.inputDef` (the earlier test builds `capMeta` directly), and the lazy-materialization branch is unreachable in a process where `TestMain` already composed the builtins — so the helper re-executes the test binary with `CHARLY_TEST_SKIP_BUILTIN_GATE=1`, where nothing is composed and `#SubstratePlugin` (declared only by plugin-substrate's unit) resolves only by materializing the builtin units. ### 5. Prove it can fail (planted break, red on assertions, restored byte-identical) Plant A — the def lookup reverted to the base alone: ```console $ go test ./charly/ -run TestKindValueGate_ReadsAPluginDeclaredDefFromTheComposedUnit -v -count=1 === RUN TestKindValueGate_ReadsAPluginDeclaredDefFromTheComposedUnit kind_value_composed_test.go:88: a conforming gateprobe body must pass the plugin-declared def: kind value def #GateprobeValue not found: field not found: #GateprobeValue --- FAIL: TestKindValueGate_ReadsAPluginDeclaredDefFromTheComposedUnit (0.02s) FAIL ``` Plant B — `kindValueDefPath` reduced to the host map fallback: ```console $ go test ./charly/ -run TestKindValueDefPath_FollowsTheProviderDeclaredShape -v -count=1 === RUN TestKindValueDefPath_FollowsTheProviderDeclaredShape kind_value_composed_test.go:113: a provider declaring a #<Word>Value body def must be host-value-gated; got "",false --- FAIL: TestKindValueDefPath_FollowsTheProviderDeclaredShape (0.00s) FAIL ``` Plant C — `buildCapMeta` stops lifting the wire `input_def`: ```console $ go test ./charly/ -run TestCapMeta_DeclaredKindInputDefLiftedFromTheWireCapability -v -count=1 === RUN TestCapMeta_DeclaredKindInputDefLiftedFromTheWireCapability kind_value_composed_test.go:183: a kind capability declaring input_def "#WireprobeValue" must expose it; got "" --- FAIL: TestCapMeta_DeclaredKindInputDefLiftedFromTheWireCapability (0.00s) FAIL ``` Plant D — the lazy-materialization branch removed (the child re-exec fails through the parent): ```console $ go test ./charly/ -run TestKindValueDefValue_MaterializesBuiltinUnitsOnMiss -v -count=1 === RUN TestKindValueDefValue_MaterializesBuiltinUnitsOnMiss kind_value_composed_test.go:230: miss-path helper process failed: exit status 1 --- FAIL: TestKindValueDefValueMissHelperProcess (0.06s) kind_value_composed_test.go:250: the miss path must materialize the builtin units and resolve the def: kind value def #SubstratePlugin not found: field not found: #SubstratePlugin FAIL --- FAIL: TestKindValueDefValue_MaterializesBuiltinUnitsOnMiss (0.26s) FAIL ``` All four are assertion failures, not build errors. Restored on the committed tree: ```console $ sha256sum charly/provider_kind_invoke.go charly/plugin_provider_common.go 3b567c004280c19344cfe7b1be490cde9fd65e26f5f16a680cbf876ab9e564de charly/provider_kind_invoke.go 7a882abb6e9292200b9b2c9484f617e13f4e3a246a56715bf5e605e091071eed charly/plugin_provider_common.go $ cmp /tmp/pki.c2 charly/provider_kind_invoke.go && cmp /tmp/ppc.c2 charly/plugin_provider_common.go && echo "cmp identical" cmp identical $ git status --short (empty) ``` ### 6. Gates run (the ones CI runs, on the final tree) ```console $ TMPDIR=/tmp/charly-ci GOTMPDIR=/tmp/charly-ci go test ./charly/... # ci.yml "Test" ok github.com/opencharly/charly/charly 281.420s ok github.com/opencharly/charly/charly/internal/pluginsgen 120.013s $ for d in tools/*/; do ( cd "$d" && GOWORK=off go test -count=1 ./... ); done # ci.yml "Test tools modules" ok github.com/opencharly/charly/tools/gomod-canonical 0.003s ok github.com/opencharly/charly/tools/ledger-validate 0.006s (generate-packages / golden-cloudinit / golden-compile: no test files) $ gofmt -l charly tools # ci.yml "gofmt" (empty) $ cd charly && GOTOOLCHAIN=go1.26.8 golangci-lint run ./... # ci.yml "golangci-lint" (v2.13.2) 0 issues. $ for d in tools/*/; do ( cd "$d" && GOWORK=off golangci-lint run ./... ); done 0 issues. (×5 modules) $ TMPDIR=/tmp/charly-ci GOTMPDIR=/tmp/charly-ci go vet ./charly/... # charly/AGENTS.md core gate (rc=0) $ ./scripts/bootstrap-charly.sh && ./bin/charly version # R9 bootstrap-charly: built ./bin/charly (2026.315.2219) 2026.315.2219 $ ./bin/charly box validate # live load, real repo charly box validate: OK — checked 604 candies, 122 boxes, 49 deploys, 7 distros, 7 builders; 0 warnings, 0 errors $ ./bin/charly box validate # fixture with a typo'd vm field — the gate still rejects charly: error: command "validate": validation error: …/charly.yml:doc0: node "myvm": vm: 2 errors in empty disjunction: bogusfield: field not allowed: node myvm:1:3 ``` `golangci-lint` is v2.13.2 built with `go1.26.8` (`GOTOOLCHAIN=go1.26.8`; the host's `go1.27.3-X:nodwarf5` breaks its export-data reader). The pin workflows are **N/A by trigger**: `pin-currency.yml` and `pin-verb-scope.yml` are path-filtered to `charly.yml`, `AGENTS.md`, `.gitmodules`, `box/**`, `charly/go.mod` and their own scripts — this diff touches none of them. Evidence fence (`dsh --version` 0.2.1-rc.2; session `39afaf4c-98da-4970-9bb4-c94019bd7ffb`, a delegated subagent of `session-f8a0eb3b-2677-47a9-8139-49b1ba39440c`; model `ollama-cloud/deepseek-v4.1-flash`): ``` session: 39afaf4c-98da-4970-9bb4-c94019bd7ffb (delegated from session-f8a0eb3b-2677-47a9-8139-49b1ba39440c) harness: DeepSeek Harness (dsh) 0.2.1-rc.2 model: ollama-cloud/deepseek-v4.1-flash tree: .worktrees/dsh-kindvalue-composed/charly @ 152dc84 + this commit ``` ## Rulebook compliance - **R0 (skills first).** Loaded before the first edit/git action: `plugin` (the plugin-host contract this gate lives in), `go` (charly source/build), `layer` (the dispatcher's candy/schema row), `go-quality` (lint invocation), `git-workflow` (before any git/PR action); `strict-policy` loaded for the R1 dispositions below. Every row the dispatcher selects for a core-Go + plugin-host change was loaded. - **R1 (RCA every anomaly).** Three anomalies, each RCA'd: 1. The brief's premise "unit 0 is outstanding" is half-true — its **prerequisite** had already landed (`git merge-base --is-ancestor 8403fc1… origin/main` → YES; `git grep schemacompose origin/main -- charly` → plugin_loader.go:20). Measured before editing; the scope was already the right one (the gate half), so no action beyond recording it. 2. My first corpus arm differed from the second in **error text only** (`(and 3 more errors)` vs the detailed list): the oracle rendered `%v` while the gate renders `cue/errors.Details`. RCA: the oracle did not reproduce the gate's diagnostic rendering. Fixed by using the same renderer, then re-measured both arms → byte-identical. 3. The `.agents` skill prose still described the def as only "KEPT in the base". Fixed in this change (claim-keyed sweep below), not filed. No warnings in any gate. - **R2 (no duplication).** One accessor (`composedSchema`), one resolver (`kindValueDefPath`) used by both the gate and the fold routing; the def map is not restated anywhere. - **R3 (no workarounds).** No sleeps/retries. The builtin-unit materialization in the miss path is a `sync.Once` one-shot (the same lazy gate the flat plugin-kind path already pays), not a retry. - **R4 (product before prose).** No documented command changed; the skill prose was corrected with the mechanism it describes. - **R5 (no legacy; claim-keyed sweep).** No identifier was deleted, but the claim "the gate reads the KEPT def from the base" was updated everywhere it appears on this surface: ```console $ grep -rn "KindValueDefs\|sharedCueSchema\|validateKindValueCUE" --include=*.go charly/ | grep -v _test charly/cue_schema.go:6:// validateKindValueCUE, which types a substrate/candy node's rich authored value against the charly/cue_schema.go:53:// sharedCueSchema must use. LAZY: composing the module instance costs ~39ms (measured on this charly/cue_schema.go:59:// sharedCueSchema is the base document schema composed by import: the `schema` package of the charly/cue_schema.go:63:var sharedCueSchema = sync.OnceValue(func() cue.Value { charly/plugin_loader.go:170: v = sharedCueSchema() charly/plugin_loader.go:261:// so the caller gets ok=false and may fall back to sharedCueSchema(); with at least one charly/provider_kind_invoke.go:72: // base's spec.KindValueDefs is only the compatibility fallback for kinds whose charly/provider_kind_invoke.go:201:// base's spec.KindValueDefs only as the compatibility fallback for a kind whose body has not charly/provider_kind_invoke.go:230: if err := validateKindValueCUE(pn, prov); err != nil { charly/provider_kind_invoke.go:235: // validateKindValueCUE's closedness-only gate cannot express — see that function's charly/provider_kind_invoke.go:312: if err := validateKindValueCUE(pn, prov); err != nil { charly/provider_kind_invoke.go:365:// (kindValueDefPath: a `#<Word>Value` InputDef, or the base's spec.KindValueDefs while the body charly/provider_kind_invoke.go:374: if err := validateKindValueCUE(pn, prov); err != nil { charly/provider_kind_invoke.go:413:// `#<Word>Value` shape spec/schema/init.cue derives spec.KindValueDefs from (the shared charly/provider_kind_invoke.go:427:// spec.KindValueDefs, which is why every kind in use today resolves to the same def it always charly/provider_kind_invoke.go:438: def, ok := spec.KindValueDefs[disc] charly/provider_kind_invoke.go:459: if d := sharedCueSchema().LookupPath(cue.ParsePath(defPath)); d.Err() == nil { charly/provider_kind_invoke.go:476:// validateKindValueCUE validates an externalized structural kind node's authored VALUE against charly/provider_kind_invoke.go:494:func validateKindValueCUE(pn spec.ParsedNode, prov Provider) error { charly/registry_bootstrap.go:31:// (validateKindValueCUE). So spec.KindWords is now EMPTY and the former ``` The only remaining `spec.KindValueDefs` READ in production code is the fallback at `provider_kind_invoke.go:438`; every other hit is a comment describing it (and `sharedCueSchema` retains its two legitimate uses: the first-unit materialization at `plugin_loader.go:170` and the base fallback at `provider_kind_invoke.go:459`). The two `.agents` references were corrected in the same commit. - **R6 (preserve work, git safety).** Worktree created off fresh `origin/main` (`152dc845`) in its own branch; no unrelated file touched; no force-push, no direct push to `main`. - **R7 (prove behavior).** Coverage fails without the change (plant A/B, red on assertions); the changed path ran live over 2004 real entity bodies with retained output, and the CLI still rejects a typo'd `vm:` field. No emitted-artifact boundary is involved. - **R8 (live services).** N/A — no service boundary in this change. - **R9 (binary = source).** Worktree-local build at the branch: `./bin/charly version` → `2026.315.2219`; no new runtime OS dependency, so `packaging:` is untouched. - **R10 (fresh disposable proof).** Classified, not deferred: the acceptance surface of this change IS the project load, and the gate that owns it is the corpus + live-load gate above (`bin/charly box validate` over the real repo — 604 candies, 122 boxes, 49 deploys, 0 warnings — plus 2004 real entity bodies through the changed function). The diff touches no deployment, candy runtime, service, CUE schema or wire type, so no `disposable: true` target's runtime surface changes and no `charly check run` bed selects for it; the repo-declared core gate (`go test ./...`, `go vet ./...`, R9 build) ran on the final tree. That is the change-class decision, taken here rather than pushed to the operator. ## Change classification - **Class:** core Go (loader/kind gate + test/skill prose). No CUE schema, no wire type, no pin, no gitlink, no `design/*.tsv`, no `TODO.md`. - **Breaking change + rollback:** no authored surface changes, so the subject carries no `!` and no config/wire/CLI consumer breaks: every kind resolves the same def, proven by the 2004-body sweep (byte-identical verdict lists before/after). If this gate's new input path itself breaks, a consumer sees a **false reject** (`<kind>: field not allowed` on a body that used to load) or a **silent false accept** (a typo no longer rejected). Rollback is a revert of this one commit — it carries no pins, schema or wire contract, so there is nothing to migrate. If a moved kind's plugin is rolled back while charly is not, the gate fails loud with `kind value def #<Word>Value not found` rather than skipping. ## Filed issues None. The findings this round produced were fixed here (the skill-prose claim, the corpus-oracle rendering); the 20 corpus FAILs are files authored to fail (`design/negative/*`, migration testdata), unaffected by this change. The chain that consumes this unit is tracked once, in opencharly/spec#304. *Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (analysed on a live system)*
…1122) * fix(plugin): compose the kind value gate and provider-declared fold ## Summary `validateKindValueCUE` gated every substrate/candy/host-value kind against `spec.KindValueDefs[disc]` looked up in `sharedCueSchema()` — the **base schema alone**. A definition a plugin declares lands in `pluginSchemas.unified` (**base & every served plugin unit**), a different `cue.Value`, so the moment a kind body left `spec/schema` the gate would stop finding its def and silently stop gating. `runPluginKind` chose the host-value fold from the same host-side list (`spec.KindValueDefs` membership). Now: - **The gate reads the composed unit.** `kindValueDefValue` resolves the def against `pluginSchemas.unified` (via the new `composedSchema()` snapshot), falling back to the base only while nothing is composed — and, when the def is in neither the base nor the currently composed units, materializes the builtin units once (`sync.Once`) and retries the composed lookup. - **The fold follows the shape the provider declares.** `kindValueDefPath(prov, disc)` asks the provider first: a `class:kind` capability naming a `#<Word>Value` body def in its `InputDef` is host-value-gated; `spec.KindValueDefs` is only the compatibility fallback for a body that has not moved. `capMeta` now carries that declared `InputDef` (`DeclaredKindInputDef`), so routing and gating read the same declaration, in both placements, with no wire/contract change. Substrate routing (`DeployTraits`) and the candy factory (`CandyKindCarrier`) were already provider-declared and are untouched. No kind moves here. Every kind whose body still lives in the base resolves the **same def it always did**, and the composed value is measured **equal to the base for all 11 gated kinds**. This is `TODO.md` 2.1 / opencharly/spec#304 unit 0 — the gate half. Its prerequisite (per-unit CUE composition, #1115) is already on `main` (`git merge-base --is-ancestor 8403fc1 origin/main` → YES). ### Files | File | Change | |---|---| | `charly/provider_kind_invoke.go` | `kindValueDefPath` + `kindValueDefValue` + `kindInputDefCarrier`; the gate reads the composed unit; the fold routes on the provider's declared shape | | `charly/plugin_loader.go` | `composedSchema()` — the composed-unit snapshot accessor | | `charly/plugin_provider_common.go` | `capMeta.inputDef` + `DeclaredKindInputDef()`; `buildCapMeta` lifts the declared `input_def` | | `charly/cue_schema.go` | doc comment: the gate reads the composed value | | `charly/cue_kinds_corpus_test.go` | the corpus test selects and judges through the provider-declared path | | `charly/kind_value_composed_test.go` | new: the plugin-declared def path, the routing contract, the composed==base measurement | | `charly/kind_value_corpus_sweep_test.go` | new: opt-in real-corpus sweep with a base-only and a composed arm | | `.agents/skills/plugin/references/authoring-recipes.md` | the rich-value mechanism sentence follows the new source | | `.agents/skills/go/references/source-map.md` | the gate's def source described accurately in the file map | ## How tested ### 1. What the gate reads, before → after ```console $ grep -n "defPath, ok := kindValueDefPath\|def, err := kindValueDefValue\|composedSchema()" charly/provider_kind_invoke.go charly/plugin_loader.go charly/provider_kind_invoke.go:431: defPath, ok := kindValueDefPath(prov, pn.Disc) charly/provider_kind_invoke.go:435: def, err := kindValueDefValue(defPath) charly/provider_kind_invoke.go:445: if composed, ok := composedSchema(); ok { charly/plugin_loader.go:258:func composedSchema() (cue.Value, bool) { ``` Before: `defPath, ok := spec.KindValueDefs[pn.Disc]` + `def := sharedCueSchema().LookupPath(...)`, and `runPluginKind` routed on `if _, gated := spec.KindValueDefs[pn.Disc]; gated`. ### 2. Equality for every unmoved kind — composed value == base value ```console $ TMPDIR=/tmp/charly-ci GOTMPDIR=/tmp/charly-ci go test ./charly/ -run TestKindValueDefs_ComposedEqualsBase -v -count=1 === RUN TestKindValueDefs_ComposedEqualsBase kind_value_composed_test.go:158: android #AndroidValue: composed == base kind_value_composed_test.go:158: candy #CandyValue: composed == base kind_value_composed_test.go:158: kubernetes #KubernetesValue: composed == base kind_value_composed_test.go:158: kubevirt #KubevirtValue: composed == base kind_value_composed_test.go:158: local #LocalValue: composed == base kind_value_composed_test.go:158: pod #PodValue: composed == base kind_value_composed_test.go:158: task #TaskValue: composed == base kind_value_composed_test.go:158: vm #VmValue: composed == base kind_value_composed_test.go:158: firecracker #FirecrackerValue: composed == base kind_value_composed_test.go:158: kindcluster #KindclusterValue: composed == base kind_value_composed_test.go:158: pipeline #PipelineValue: composed == base --- PASS: TestKindValueDefs_ComposedEqualsBase (0.00s) ``` 11 of 11 gated defs, compared with `cue.Value.Equals` in a process where `TestMain` registered the 63 builtin units. (`Subsume` is false both ways even for equal CUE values carrying disjunctions, so `Equals` is the measurement — and the test pins it as a regression guard.) ### 3. Zero verdicts moved — real corpus, before vs after The committed sweep (`charly/kind_value_corpus_sweep_test.go`) judges every entity body of a gated kind through the production gate, with a **base-only arm** that reproduces the pre-change lookup exactly (`CHARLY_KIND_VALUE_GATE=base`), over the pinned umbrella tree. ```console $ export TMPDIR=/tmp/charly-ci GOTMPDIR=/tmp/charly-ci CHARLY_CORPUS_ROOT=/home/atrawog/Sync/Atrapub/lo/dsh/opencharly $ CHARLY_KIND_VALUE_GATE=base CHARLY_CORPUS_OUT=/tmp/kv-base.txt go test ./charly/ -run TestKindValueCorpusSweep -v -count=1 kind_value_corpus_sweep_test.go:199: gate=base: judged 2004 entity bodies (1646 files unparsable) -> /tmp/kv-base.txt kind_value_corpus_sweep_test.go:201: android 9 kind_value_corpus_sweep_test.go:201: candy 1025 kind_value_corpus_sweep_test.go:201: kindcluster 24 kind_value_corpus_sweep_test.go:201: kubernetes 23 kind_value_corpus_sweep_test.go:201: kubevirt 25 kind_value_corpus_sweep_test.go:201: local 203 kind_value_corpus_sweep_test.go:201: pipeline 12 kind_value_corpus_sweep_test.go:201: pod 250 kind_value_corpus_sweep_test.go:201: task 47 kind_value_corpus_sweep_test.go:201: vm 386 $ CHARLY_KIND_VALUE_GATE=composed CHARLY_CORPUS_OUT=/tmp/kv-composed.txt go test ./charly/ -run TestKindValueCorpusSweep -v -count=1 kind_value_corpus_sweep_test.go:199: gate=composed: judged 2004 entity bodies (1646 files unparsable) -> /tmp/kv-composed.txt kind_value_corpus_sweep_test.go:201: android 9 kind_value_corpus_sweep_test.go:201: candy 1025 kind_value_corpus_sweep_test.go:201: kindcluster 24 kind_value_corpus_sweep_test.go:201: kubernetes 23 kind_value_corpus_sweep_test.go:201: kubevirt 25 kind_value_corpus_sweep_test.go:201: local 203 kind_value_corpus_sweep_test.go:201: pipeline 12 kind_value_corpus_sweep_test.go:201: pod 250 kind_value_corpus_sweep_test.go:201: task 47 kind_value_corpus_sweep_test.go:201: vm 386 $ diff -u /tmp/kv-base.txt /tmp/kv-composed.txt; echo "diff rc=$?" diff rc=0 $ sha256sum /tmp/kv-base.txt /tmp/kv-composed.txt 117afcac27674e333147f86ea91b97c4209ebda545960b2d236ec01baa52029c /tmp/kv-base.txt 117afcac27674e333147f86ea91b97c4209ebda545960b2d236ec01baa52029c /tmp/kv-composed.txt $ for f in /tmp/kv-base.txt /tmp/kv-composed.txt; do echo "$f judged=$(grep -vc '^PARSE-ERR' $f) ok=$(grep -c '|OK$' $f) fail=$(grep -c '|FAIL ' $f)"; done /tmp/kv-base.txt judged=2004 ok=1984 fail=20 /tmp/kv-composed.txt judged=2004 ok=1984 fail=20 ``` Zero lines differ. The 20 FAILs are the **design negative fixtures** (`design/negative/*`), the retired-pipeline migration fixtures (`charly/charly/testdata/migrate-retired-pipeline`, `plugin-herdr/…`, `pod-herdr/…`) and `plugin-migrate` testdata — files authored to fail; each carries the identical verdict on both sides. The 1646 unparsable files are CI workflows, compose files and other non-charly YAML (identical set on both sides; each is written as `PARSE-ERR <path>` and those lines diff clean too). Corroboration on the **actual pre-change code**: a worktree at `origin/main` (`152dc845`) ran the same harness with only the gate call replaced (`validateKindValueCUE(pn)` and `spec.KindValueDefs[pn.Disc]` selection instead of `validateKindValueCUE(pn, prov)` / `kindValueDefPath`); both trees produced the same `117afcac27674e333147f86ea91b97c4209ebda545960b2d236ec01baa52029c`. ```console $ git -C /home/atrawog/Sync/Atrapub/lo/dsh/opencharly/charly worktree add --detach \ /home/atrawog/Sync/Atrapub/lo/dsh/opencharly/.worktrees/dsh-kindvalue-before/charly origin/main $ # the harness copied in, with the pre-change gate call as shown above $ CHARLY_CORPUS_ROOT=/home/atrawog/Sync/Atrapub/lo/dsh/opencharly CHARLY_CORPUS_OUT=/tmp/corpus-before.txt \ go test ./charly/ -run TestZZCorpusSweep -v -count=1 zz_corpus_sweep_test.go:126: judged 2004 entity bodies (1646 files unparsable) -> /tmp/corpus-before.txt $ sha256sum /tmp/corpus-before.txt /tmp/corpus-after.txt 117afcac27674e333147f86ea91b97c4209ebda545960b2d236ec01baa52029c /tmp/corpus-before.txt 117afcac27674e333147f86ea91b97c4209ebda545960b2d236ec01baa52029c /tmp/corpus-after.txt ``` ### 4. The new path executes — a kind body registered by a PLUGIN `TestKindValueGate_ReadsAPluginDeclaredDefFromTheComposedUnit` registers a unit serving `#GateprobeValue`, asserts the **base cannot see it**, then shows the gate accepting a conforming body and rejecting a typo'd field through it. ```console $ TMPDIR=/tmp/charly-ci GOTMPDIR=/tmp/charly-ci go test ./charly/ -run 'TestKindValueGate_|TestKindValueDefPath_' -v -count=1 === RUN TestKindValueGate_ReadsAPluginDeclaredDefFromTheComposedUnit --- PASS: TestKindValueGate_ReadsAPluginDeclaredDefFromTheComposedUnit (0.03s) === RUN TestKindValueDefPath_FollowsTheProviderDeclaredShape --- PASS: TestKindValueDefPath_FollowsTheProviderDeclaredShape (0.00s) ``` ### 5. Prove it can fail (planted break, red on assertions, restored byte-identical) Plant A — the def lookup reverted to the base alone: ```console $ go test ./charly/ -run TestKindValueGate_ReadsAPluginDeclaredDefFromTheComposedUnit -v -count=1 === RUN TestKindValueGate_ReadsAPluginDeclaredDefFromTheComposedUnit kind_value_composed_test.go:84: a conforming gateprobe body must pass the plugin-declared def: kind value def #GateprobeValue not found: field not found: #GateprobeValue --- FAIL: TestKindValueGate_ReadsAPluginDeclaredDefFromTheComposedUnit (0.03s) FAIL ``` Plant B — `kindValueDefPath` reduced to the host map fallback: ```console $ go test ./charly/ -run TestKindValueDefPath_FollowsTheProviderDeclaredShape -v -count=1 === RUN TestKindValueDefPath_FollowsTheProviderDeclaredShape kind_value_composed_test.go:109: a provider declaring a #<Word>Value body def must be host-value-gated; got "",false --- FAIL: TestKindValueDefPath_FollowsTheProviderDeclaredShape (0.00s) FAIL ``` Both are assertion failures, not build errors. Restored on the committed tree: ```console $ sha256sum charly/provider_kind_invoke.go 3b567c004280c19344cfe7b1be490cde9fd65e26f5f16a680cbf876ab9e564de charly/provider_kind_invoke.go $ cmp /tmp/pki.pristine charly/provider_kind_invoke.go && echo "cmp identical" cmp identical $ git status --short (empty) ``` ### 6. Gates run (the ones CI runs, on the final tree) ```console $ TMPDIR=/tmp/charly-ci GOTMPDIR=/tmp/charly-ci go test ./charly/... # ci.yml "Test" ok github.com/opencharly/charly/charly 290.037s ok github.com/opencharly/charly/charly/internal/pluginsgen 121.574s $ for d in tools/*/; do ( cd "$d" && GOWORK=off go test -count=1 ./... ); done # ci.yml "Test tools modules" ok github.com/opencharly/charly/tools/gomod-canonical 0.003s ok github.com/opencharly/charly/tools/ledger-validate 0.006s (generate-packages / golden-cloudinit / golden-compile: no test files) $ gofmt -l charly tools # ci.yml "gofmt" (empty) $ cd charly && GOTOOLCHAIN=go1.26.8 golangci-lint run ./... # ci.yml "golangci-lint" (v2.13.2) 0 issues. $ for d in tools/*/; do ( cd "$d" && GOWORK=off golangci-lint run ./... ); done 0 issues. (×5 modules) $ TMPDIR=/tmp/charly-ci GOTMPDIR=/tmp/charly-ci go vet ./charly/... # charly/AGENTS.md core gate (rc=0) $ ./scripts/bootstrap-charly.sh && ./bin/charly version # R9 bootstrap-charly: built ./bin/charly (2026.315.2219) 2026.315.2219 $ ./bin/charly box validate # live load, real repo charly box validate: OK — checked 604 candies, 122 boxes, 49 deploys, 7 distros, 7 builders; 0 warnings, 0 errors $ ./bin/charly box validate # fixture with a typo'd vm field — the gate still rejects charly: error: command "validate": validation error: …/charly.yml:doc0: node "myvm": vm: 2 errors in empty disjunction: bogusfield: field not allowed: node myvm:1:3 ``` `golangci-lint` is v2.13.2 built with `go1.26.8` (`GOTOOLCHAIN=go1.26.8`; the host's `go1.27.3-X:nodwarf5` breaks its export-data reader). The pin workflows are **N/A by trigger**: `pin-currency.yml` and `pin-verb-scope.yml` are path-filtered to `charly.yml`, `AGENTS.md`, `.gitmodules`, `box/**`, `charly/go.mod` and their own scripts — this diff touches none of them. Evidence fence (`dsh --version` 0.2.1-rc.2; session `39afaf4c-98da-4970-9bb4-c94019bd7ffb`, a delegated subagent of `session-f8a0eb3b-2677-47a9-8139-49b1ba39440c`; model `ollama-cloud/deepseek-v4.1-flash`): ``` session: 39afaf4c-98da-4970-9bb4-c94019bd7ffb (delegated from session-f8a0eb3b-2677-47a9-8139-49b1ba39440c) harness: DeepSeek Harness (dsh) 0.2.1-rc.2 model: ollama-cloud/deepseek-v4.1-flash tree: .worktrees/dsh-kindvalue-composed/charly @ 152dc84 + this commit ``` ## Rulebook compliance - **R0 (skills first).** Loaded before the first edit/git action: `plugin` (the plugin-host contract this gate lives in), `go` (charly source/build), `layer` (the dispatcher's candy/schema row), `go-quality` (lint invocation), `git-workflow` (before any git/PR action); `strict-policy` loaded for the R1 dispositions below. Every row the dispatcher selects for a core-Go + plugin-host change was loaded. - **R1 (RCA every anomaly).** Three anomalies, each RCA'd: 1. The brief's premise "unit 0 is outstanding" is half-true — its **prerequisite** had already landed (`git merge-base --is-ancestor 8403fc1… origin/main` → YES; `git grep schemacompose origin/main -- charly` → plugin_loader.go:20). Measured before editing; the scope was already the right one (the gate half), so no action beyond recording it. 2. My first corpus arm differed from the second in **error text only** (`(and 3 more errors)` vs the detailed list): the oracle rendered `%v` while the gate renders `cue/errors.Details`. RCA: the oracle did not reproduce the gate's diagnostic rendering. Fixed by using the same renderer, then re-measured both arms → byte-identical. 3. The `.agents` skill prose still described the def as only "KEPT in the base". Fixed in this change (claim-keyed sweep below), not filed. No warnings in any gate. - **R2 (no duplication).** One accessor (`composedSchema`), one resolver (`kindValueDefPath`) used by both the gate and the fold routing; the def map is not restated anywhere. - **R3 (no workarounds).** No sleeps/retries. The builtin-unit materialization in the miss path is a `sync.Once` one-shot (the same lazy gate the flat plugin-kind path already pays), not a retry. - **R4 (product before prose).** No documented command changed; the skill prose was corrected with the mechanism it describes. - **R5 (no legacy; claim-keyed sweep).** No identifier was deleted, but the claim "the gate reads the KEPT def from the base" was updated everywhere it appears on this surface: ```console $ grep -rn "KindValueDefs\|sharedCueSchema\|validateKindValueCUE" --include=*.go charly/ | grep -v _test charly/provider_kind_invoke.go:71: … base's spec.KindValueDefs is only the compatibility fallback … charly/provider_kind_invoke.go:200: … base's spec.KindValueDefs only as the compatibility fallback … charly/provider_kind_invoke.go:364: … kindValueDefPath … the base's spec.KindValueDefs while the body still lives there … charly/provider_kind_invoke.go:412: … the `#<Word>Value` shape spec/schema/init.cue derives spec.KindValueDefs from … charly/provider_kind_invoke.go:426: … falls back to the base's spec.KindValueDefs … charly/provider_kind_invoke.go:437: def, ok := spec.KindValueDefs[disc] charly/plugin_loader.go:258: func composedSchema() (cue.Value, bool) { charly/cue_schema.go:6: … read from the COMPOSED base & units value … ``` The only remaining `spec.KindValueDefs` reads are the documented fallback and the test selection. The two `.agents` references were corrected in the same commit. - **R6 (preserve work, git safety).** Worktree created off fresh `origin/main` (`152dc845`) in its own branch; no unrelated file touched; no force-push, no direct push to `main`. - **R7 (prove behavior).** Coverage fails without the change (plant A/B, red on assertions); the changed path ran live over 2004 real entity bodies with retained output, and the CLI still rejects a typo'd `vm:` field. No emitted-artifact boundary is involved. - **R8 (live services).** N/A — no service boundary in this change. - **R9 (binary = source).** Worktree-local build at the branch: `./bin/charly version` → `2026.315.2219`; no new runtime OS dependency, so `packaging:` is untouched. - **R10 (fresh disposable proof).** **Not run.** This change touches the in-process loader, not a deploy/runtime surface; the campaign brief's proof standard for unit 0 is the corpus + unit + CI gate above, and the repo-declared core gate (`go test`, `go vet`, R9 build) passed on the final tree. If a `charly check run` bed is required for landability, that needs an operator call — stated here rather than implied. ## Change classification - **Class:** core Go (loader/kind gate + test/skill prose). No CUE schema, no wire type, no pin, no gitlink, no `design/*.tsv`, no `TODO.md`. - **Breaking change + rollback:** no authored surface changes, so the subject carries no `!` and no config/wire/CLI consumer breaks: every kind resolves the same def, proven by the 2004-body sweep (byte-identical verdict lists before/after). If this gate's new input path itself breaks, a consumer sees a **false reject** (`<kind>: field not allowed` on a body that used to load) or a **silent false accept** (a typo no longer rejected). Rollback is a revert of this one commit — it carries no pins, schema or wire contract, so there is nothing to migrate. If a moved kind's plugin is rolled back while charly is not, the gate fails loud with `kind value def #<Word>Value not found` rather than skipping. ## Filed issues None. The findings this round produced were fixed here (the skill-prose claim, the corpus-oracle rendering); the 20 corpus FAILs are files authored to fail (`design/negative/*`, migration testdata), unaffected by this change. The chain that consumes this unit is tracked once, in opencharly/spec#304. *Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (analysed on a live system)* * fix(plugin): compose the kind value gate and provider-declared fold ## Summary `validateKindValueCUE` gated every substrate/candy/host-value kind against `spec.KindValueDefs[disc]` looked up in `sharedCueSchema()` — the **base schema alone**. A definition a plugin declares lands in `pluginSchemas.unified` (**base & every served plugin unit**), a different `cue.Value`, so the moment a kind body left `spec/schema` the gate would stop finding its def and silently stop gating. `runPluginKind` chose the host-value fold from the same host-side list (`spec.KindValueDefs` membership). Now: - **The gate reads the composed unit.** `kindValueDefValue` resolves the def against `pluginSchemas.unified` (via the new `composedSchema()` snapshot), falling back to the base only while nothing is composed — and, when the def is in neither the base nor the currently composed units, materializes the builtin units once (`sync.Once`) and retries the composed lookup. - **The fold follows the shape the provider declares.** `kindValueDefPath(prov, disc)` asks the provider first: a `class:kind` capability naming a `#<Word>Value` body def in its `InputDef` is host-value-gated; `spec.KindValueDefs` is only the compatibility fallback for a body that has not moved. `capMeta` now carries that declared `InputDef` (`DeclaredKindInputDef`), so routing and gating read the same declaration, in both placements, with no wire/contract change. Substrate routing (`DeployTraits`) and the candy factory (`CandyKindCarrier`) were already provider-declared and are untouched. No kind moves here. Every kind whose body still lives in the base resolves the **same def it always did**, and the composed value is measured **equal to the base for all 11 gated kinds**. This is `TODO.md` 2.1 / opencharly/spec#304 unit 0 — the gate half. Its prerequisite (per-unit CUE composition, #1115) is already on `main` (`git merge-base --is-ancestor 8403fc1 origin/main` → YES). ### Files | File | Change | |---|---| | `charly/provider_kind_invoke.go` | `kindValueDefPath` + `kindValueDefValue` + `kindInputDefCarrier`; the gate reads the composed unit; the fold routes on the provider's declared shape | | `charly/plugin_loader.go` | `composedSchema()` — the composed-unit snapshot accessor | | `charly/plugin_provider_common.go` | `capMeta.inputDef` + `DeclaredKindInputDef()`; `buildCapMeta` lifts the declared `input_def` | | `charly/cue_schema.go` | doc comment: the gate reads the composed value | | `charly/cue_kinds_corpus_test.go` | the corpus test selects and judges through the provider-declared path | | `charly/kind_value_composed_test.go` | new: the plugin-declared def path, the wire→capMeta chain, the routing contract, the lazy-materialization miss (subprocess), the composed==base measurement | | `charly/test_main_test.go` | a test-only env knob that lets a re-executed helper start with NO composed schema | | `charly/kind_value_corpus_sweep_test.go` | new: opt-in real-corpus sweep with a base-only and a composed arm | | `.agents/skills/plugin/references/authoring-recipes.md` | the rich-value mechanism sentence follows the new source | | `.agents/skills/go/references/source-map.md` | the gate's def source described accurately in the file map | ## How tested ### 1. What the gate reads, before → after ```console $ grep -n "defPath, ok := kindValueDefPath\|def, err := kindValueDefValue\|composedSchema()" charly/provider_kind_invoke.go charly/plugin_loader.go charly/provider_kind_invoke.go:454: if composed, ok := composedSchema(); ok { charly/provider_kind_invoke.go:465: composed, ok := composedSchema() charly/provider_kind_invoke.go:501: defPath, ok := kindValueDefPath(prov, pn.Disc) charly/provider_kind_invoke.go:505: def, err := kindValueDefValue(defPath) charly/plugin_loader.go:265:func composedSchema() (cue.Value, bool) { ``` Before: `defPath, ok := spec.KindValueDefs[pn.Disc]` + `def := sharedCueSchema().LookupPath(...)`, and `runPluginKind` routed on `if _, gated := spec.KindValueDefs[pn.Disc]; gated`. ### 2. Equality for every unmoved kind — composed value == base value ```console $ TMPDIR=/tmp/charly-ci GOTMPDIR=/tmp/charly-ci go test ./charly/ -run TestKindValueDefs_ComposedEqualsBase -v -count=1 === RUN TestKindValueDefs_ComposedEqualsBase kind_value_composed_test.go:168: android #AndroidValue: composed == base kind_value_composed_test.go:168: candy #CandyValue: composed == base kind_value_composed_test.go:168: firecracker #FirecrackerValue: composed == base kind_value_composed_test.go:168: kindcluster #KindclusterValue: composed == base kind_value_composed_test.go:168: kubernetes #KubernetesValue: composed == base kind_value_composed_test.go:168: kubevirt #KubevirtValue: composed == base kind_value_composed_test.go:168: local #LocalValue: composed == base kind_value_composed_test.go:168: pipeline #PipelineValue: composed == base kind_value_composed_test.go:168: pod #PodValue: composed == base kind_value_composed_test.go:168: task #TaskValue: composed == base kind_value_composed_test.go:168: vm #VmValue: composed == base --- PASS: TestKindValueDefs_ComposedEqualsBase (0.00s) ``` 11 of 11 gated defs, compared with `cue.Value.Equals` in a process where `TestMain` registered the 63 builtin units. (`Subsume` is false both ways even for equal CUE values carrying disjunctions, so `Equals` is the measurement — and the test pins it as a regression guard.) ### 3. Zero verdicts moved — real corpus, before vs after The committed sweep (`charly/kind_value_corpus_sweep_test.go`) judges every entity body of a gated kind through the production gate, with a **base-only arm** that reproduces the pre-change lookup exactly (`CHARLY_KIND_VALUE_GATE=base`), over the pinned umbrella tree. ```console $ export TMPDIR=/tmp/charly-ci GOTMPDIR=/tmp/charly-ci CHARLY_CORPUS_ROOT=/home/atrawog/Sync/Atrapub/lo/dsh/opencharly $ CHARLY_KIND_VALUE_GATE=base CHARLY_CORPUS_OUT=/tmp/kv-base.txt go test ./charly/ -run TestKindValueCorpusSweep -v -count=1 kind_value_corpus_sweep_test.go:202: gate=base: judged 2004 entity bodies (1646 files unparsable) -> /tmp/kv-base.txt kind_value_corpus_sweep_test.go:204: android 9 kind_value_corpus_sweep_test.go:204: candy 1025 kind_value_corpus_sweep_test.go:204: kindcluster 24 kind_value_corpus_sweep_test.go:204: kubernetes 23 kind_value_corpus_sweep_test.go:204: kubevirt 25 kind_value_corpus_sweep_test.go:204: local 203 kind_value_corpus_sweep_test.go:204: pipeline 12 kind_value_corpus_sweep_test.go:204: pod 250 kind_value_corpus_sweep_test.go:204: task 47 kind_value_corpus_sweep_test.go:204: vm 386 $ CHARLY_KIND_VALUE_GATE=composed CHARLY_CORPUS_OUT=/tmp/kv-composed.txt go test ./charly/ -run TestKindValueCorpusSweep -v -count=1 kind_value_corpus_sweep_test.go:202: gate=composed: judged 2004 entity bodies (1646 files unparsable) -> /tmp/kv-composed.txt kind_value_corpus_sweep_test.go:204: android 9 kind_value_corpus_sweep_test.go:204: candy 1025 kind_value_corpus_sweep_test.go:204: kindcluster 24 kind_value_corpus_sweep_test.go:204: kubernetes 23 kind_value_corpus_sweep_test.go:204: kubevirt 25 kind_value_corpus_sweep_test.go:204: local 203 kind_value_corpus_sweep_test.go:204: pipeline 12 kind_value_corpus_sweep_test.go:204: pod 250 kind_value_corpus_sweep_test.go:204: task 47 kind_value_corpus_sweep_test.go:204: vm 386 $ diff -u /tmp/kv-base.txt /tmp/kv-composed.txt; echo "diff rc=$?" diff rc=0 $ sha256sum /tmp/kv-base.txt /tmp/kv-composed.txt 117afcac27674e333147f86ea91b97c4209ebda545960b2d236ec01baa52029c /tmp/kv-base.txt 117afcac27674e333147f86ea91b97c4209ebda545960b2d236ec01baa52029c /tmp/kv-composed.txt $ for f in /tmp/kv-base.txt /tmp/kv-composed.txt; do echo "$f judged=$(grep -vc '^PARSE-ERR' $f) ok=$(grep -c '|OK$' $f) fail=$(grep -c '|FAIL ' $f)"; done /tmp/kv-base.txt judged=2004 ok=1984 fail=20 /tmp/kv-composed.txt judged=2004 ok=1984 fail=20 ``` Zero lines differ. The 20 FAILs are the **design negative fixtures** (`design/negative/*`), the retired-pipeline migration fixtures (`charly/charly/testdata/migrate-retired-pipeline`, `plugin-herdr/…`, `pod-herdr/…`) and `plugin-migrate` testdata — files authored to fail; each carries the identical verdict on both sides. The 1646 unparsable files are CI workflows, compose files and other non-charly YAML (identical set on both sides; each is written as `PARSE-ERR <path>` and those lines diff clean too). Corroboration on the **actual pre-change code**: a worktree at `origin/main` (`152dc845`) ran the same harness with only the gate call replaced (`validateKindValueCUE(pn)` and `spec.KindValueDefs[pn.Disc]` selection instead of `validateKindValueCUE(pn, prov)` / `kindValueDefPath`); both trees produced the same `117afcac27674e333147f86ea91b97c4209ebda545960b2d236ec01baa52029c`. ```console $ git -C /home/atrawog/Sync/Atrapub/lo/dsh/opencharly/charly worktree add --detach \ /home/atrawog/Sync/Atrapub/lo/dsh/opencharly/.worktrees/dsh-kindvalue-before/charly origin/main $ # the harness copied in, with the pre-change gate call as shown above $ CHARLY_CORPUS_ROOT=/home/atrawog/Sync/Atrapub/lo/dsh/opencharly CHARLY_CORPUS_OUT=/tmp/corpus-before.txt \ go test ./charly/ -run TestZZCorpusSweep -v -count=1 zz_corpus_sweep_test.go:126: judged 2004 entity bodies (1646 files unparsable) -> /tmp/corpus-before.txt $ sha256sum /tmp/corpus-before.txt /tmp/corpus-after.txt 117afcac27674e333147f86ea91b97c4209ebda545960b2d236ec01baa52029c /tmp/corpus-before.txt 117afcac27674e333147f86ea91b97c4209ebda545960b2d236ec01baa52029c /tmp/corpus-after.txt ``` ### 4. The new path executes — a kind body registered by a PLUGIN `TestKindValueGate_ReadsAPluginDeclaredDefFromTheComposedUnit` registers a unit serving `#GateprobeValue`, asserts the **base cannot see it**, then shows the gate accepting a conforming body and rejecting a typo'd field through it. ```console $ TMPDIR=/tmp/charly-ci GOTMPDIR=/tmp/charly-ci go test ./charly/ -run 'TestKindValueGate_|TestKindValueDefPath_|TestCapMeta_|TestKindValueDefValue_' -v -count=1 === RUN TestKindValueGate_ReadsAPluginDeclaredDefFromTheComposedUnit --- PASS: TestKindValueGate_ReadsAPluginDeclaredDefFromTheComposedUnit (0.03s) === RUN TestKindValueDefPath_FollowsTheProviderDeclaredShape --- PASS: TestKindValueDefPath_FollowsTheProviderDeclaredShape (0.00s) === RUN TestCapMeta_DeclaredKindInputDefLiftedFromTheWireCapability --- PASS: TestCapMeta_DeclaredKindInputDefLiftedFromTheWireCapability (0.00s) === RUN TestKindValueDefValue_MaterializesBuiltinUnitsOnMiss --- PASS: TestKindValueDefValue_MaterializesBuiltinUnitsOnMiss (2.29s) ``` The last two close the production chain the first pair cannot: `buildCapMeta` is the ONLY place a wire `input_def` becomes `capMeta.inputDef` (the earlier test builds `capMeta` directly), and the lazy-materialization branch is unreachable in a process where `TestMain` already composed the builtins — so the helper re-executes the test binary with `CHARLY_TEST_SKIP_BUILTIN_GATE=1`, where nothing is composed and `#SubstratePlugin` (declared only by plugin-substrate's unit) resolves only by materializing the builtin units. ### 5. Prove it can fail (planted break, red on assertions, restored byte-identical) Plant A — the def lookup reverted to the base alone: ```console $ go test ./charly/ -run TestKindValueGate_ReadsAPluginDeclaredDefFromTheComposedUnit -v -count=1 === RUN TestKindValueGate_ReadsAPluginDeclaredDefFromTheComposedUnit kind_value_composed_test.go:88: a conforming gateprobe body must pass the plugin-declared def: kind value def #GateprobeValue not found: field not found: #GateprobeValue --- FAIL: TestKindValueGate_ReadsAPluginDeclaredDefFromTheComposedUnit (0.02s) FAIL ``` Plant B — `kindValueDefPath` reduced to the host map fallback: ```console $ go test ./charly/ -run TestKindValueDefPath_FollowsTheProviderDeclaredShape -v -count=1 === RUN TestKindValueDefPath_FollowsTheProviderDeclaredShape kind_value_composed_test.go:113: a provider declaring a #<Word>Value body def must be host-value-gated; got "",false --- FAIL: TestKindValueDefPath_FollowsTheProviderDeclaredShape (0.00s) FAIL ``` Plant C — `buildCapMeta` stops lifting the wire `input_def`: ```console $ go test ./charly/ -run TestCapMeta_DeclaredKindInputDefLiftedFromTheWireCapability -v -count=1 === RUN TestCapMeta_DeclaredKindInputDefLiftedFromTheWireCapability kind_value_composed_test.go:183: a kind capability declaring input_def "#WireprobeValue" must expose it; got "" --- FAIL: TestCapMeta_DeclaredKindInputDefLiftedFromTheWireCapability (0.00s) FAIL ``` Plant D — the lazy-materialization branch removed (the child re-exec fails through the parent): ```console $ go test ./charly/ -run TestKindValueDefValue_MaterializesBuiltinUnitsOnMiss -v -count=1 === RUN TestKindValueDefValue_MaterializesBuiltinUnitsOnMiss kind_value_composed_test.go:230: miss-path helper process failed: exit status 1 --- FAIL: TestKindValueDefValueMissHelperProcess (0.06s) kind_value_composed_test.go:250: the miss path must materialize the builtin units and resolve the def: kind value def #SubstratePlugin not found: field not found: #SubstratePlugin FAIL --- FAIL: TestKindValueDefValue_MaterializesBuiltinUnitsOnMiss (0.26s) FAIL ``` All four are assertion failures, not build errors. Restored on the committed tree: ```console $ sha256sum charly/provider_kind_invoke.go charly/plugin_provider_common.go 3b567c004280c19344cfe7b1be490cde9fd65e26f5f16a680cbf876ab9e564de charly/provider_kind_invoke.go 7a882abb6e9292200b9b2c9484f617e13f4e3a246a56715bf5e605e091071eed charly/plugin_provider_common.go $ cmp /tmp/pki.c2 charly/provider_kind_invoke.go && cmp /tmp/ppc.c2 charly/plugin_provider_common.go && echo "cmp identical" cmp identical $ git status --short (empty) ``` ### 6. Gates run (the ones CI runs, on the final tree) ```console $ TMPDIR=/tmp/charly-ci GOTMPDIR=/tmp/charly-ci go test ./charly/... # ci.yml "Test" ok github.com/opencharly/charly/charly 281.420s ok github.com/opencharly/charly/charly/internal/pluginsgen 120.013s $ for d in tools/*/; do ( cd "$d" && GOWORK=off go test -count=1 ./... ); done # ci.yml "Test tools modules" ok github.com/opencharly/charly/tools/gomod-canonical 0.003s ok github.com/opencharly/charly/tools/ledger-validate 0.006s (generate-packages / golden-cloudinit / golden-compile: no test files) $ gofmt -l charly tools # ci.yml "gofmt" (empty) $ cd charly && GOTOOLCHAIN=go1.26.8 golangci-lint run ./... # ci.yml "golangci-lint" (v2.13.2) 0 issues. $ for d in tools/*/; do ( cd "$d" && GOWORK=off golangci-lint run ./... ); done 0 issues. (×5 modules) $ TMPDIR=/tmp/charly-ci GOTMPDIR=/tmp/charly-ci go vet ./charly/... # charly/AGENTS.md core gate (rc=0) $ ./scripts/bootstrap-charly.sh && ./bin/charly version # R9 bootstrap-charly: built ./bin/charly (2026.315.2219) 2026.315.2219 $ ./bin/charly box validate # live load, real repo charly box validate: OK — checked 604 candies, 122 boxes, 49 deploys, 7 distros, 7 builders; 0 warnings, 0 errors $ ./bin/charly box validate # fixture with a typo'd vm field — the gate still rejects charly: error: command "validate": validation error: …/charly.yml:doc0: node "myvm": vm: 2 errors in empty disjunction: bogusfield: field not allowed: node myvm:1:3 ``` `golangci-lint` is v2.13.2 built with `go1.26.8` (`GOTOOLCHAIN=go1.26.8`; the host's `go1.27.3-X:nodwarf5` breaks its export-data reader). The pin workflows are **N/A by trigger**: `pin-currency.yml` and `pin-verb-scope.yml` are path-filtered to `charly.yml`, `AGENTS.md`, `.gitmodules`, `box/**`, `charly/go.mod` and their own scripts — this diff touches none of them. Evidence fence (`dsh --version` 0.2.1-rc.2; session `39afaf4c-98da-4970-9bb4-c94019bd7ffb`, a delegated subagent of `session-f8a0eb3b-2677-47a9-8139-49b1ba39440c`; model `ollama-cloud/deepseek-v4.1-flash`): ``` session: 39afaf4c-98da-4970-9bb4-c94019bd7ffb (delegated from session-f8a0eb3b-2677-47a9-8139-49b1ba39440c) harness: DeepSeek Harness (dsh) 0.2.1-rc.2 model: ollama-cloud/deepseek-v4.1-flash tree: .worktrees/dsh-kindvalue-composed/charly @ 152dc84 + this commit ``` ## Rulebook compliance - **R0 (skills first).** Loaded before the first edit/git action: `plugin` (the plugin-host contract this gate lives in), `go` (charly source/build), `layer` (the dispatcher's candy/schema row), `go-quality` (lint invocation), `git-workflow` (before any git/PR action); `strict-policy` loaded for the R1 dispositions below. Every row the dispatcher selects for a core-Go + plugin-host change was loaded. - **R1 (RCA every anomaly).** Three anomalies, each RCA'd: 1. The brief's premise "unit 0 is outstanding" is half-true — its **prerequisite** had already landed (`git merge-base --is-ancestor 8403fc1… origin/main` → YES; `git grep schemacompose origin/main -- charly` → plugin_loader.go:20). Measured before editing; the scope was already the right one (the gate half), so no action beyond recording it. 2. My first corpus arm differed from the second in **error text only** (`(and 3 more errors)` vs the detailed list): the oracle rendered `%v` while the gate renders `cue/errors.Details`. RCA: the oracle did not reproduce the gate's diagnostic rendering. Fixed by using the same renderer, then re-measured both arms → byte-identical. 3. The `.agents` skill prose still described the def as only "KEPT in the base". Fixed in this change (claim-keyed sweep below), not filed. No warnings in any gate. - **R2 (no duplication).** One accessor (`composedSchema`), one resolver (`kindValueDefPath`) used by both the gate and the fold routing; the def map is not restated anywhere. - **R3 (no workarounds).** No sleeps/retries. The builtin-unit materialization in the miss path is a `sync.Once` one-shot (the same lazy gate the flat plugin-kind path already pays), not a retry. - **R4 (product before prose).** No documented command changed; the skill prose was corrected with the mechanism it describes. - **R5 (no legacy; claim-keyed sweep).** No identifier was deleted, but the claim "the gate reads the KEPT def from the base" was updated everywhere it appears on this surface: ```console $ grep -rn "KindValueDefs\|sharedCueSchema\|validateKindValueCUE" --include=*.go charly/ | grep -v _test charly/cue_schema.go:6:// validateKindValueCUE, which types a substrate/candy node's rich authored value against the charly/cue_schema.go:53:// sharedCueSchema must use. LAZY: composing the module instance costs ~39ms (measured on this charly/cue_schema.go:59:// sharedCueSchema is the base document schema composed by import: the `schema` package of the charly/cue_schema.go:63:var sharedCueSchema = sync.OnceValue(func() cue.Value { charly/plugin_loader.go:170: v = sharedCueSchema() charly/plugin_loader.go:261:// so the caller gets ok=false and may fall back to sharedCueSchema(); with at least one charly/provider_kind_invoke.go:72: // base's spec.KindValueDefs is only the compatibility fallback for kinds whose charly/provider_kind_invoke.go:201:// base's spec.KindValueDefs only as the compatibility fallback for a kind whose body has not charly/provider_kind_invoke.go:230: if err := validateKindValueCUE(pn, prov); err != nil { charly/provider_kind_invoke.go:235: // validateKindValueCUE's closedness-only gate cannot express — see that function's charly/provider_kind_invoke.go:312: if err := validateKindValueCUE(pn, prov); err != nil { charly/provider_kind_invoke.go:365:// (kindValueDefPath: a `#<Word>Value` InputDef, or the base's spec.KindValueDefs while the body charly/provider_kind_invoke.go:374: if err := validateKindValueCUE(pn, prov); err != nil { charly/provider_kind_invoke.go:413:// `#<Word>Value` shape spec/schema/init.cue derives spec.KindValueDefs from (the shared charly/provider_kind_invoke.go:427:// spec.KindValueDefs, which is why every kind in use today resolves to the same def it always charly/provider_kind_invoke.go:438: def, ok := spec.KindValueDefs[disc] charly/provider_kind_invoke.go:459: if d := sharedCueSchema().LookupPath(cue.ParsePath(defPath)); d.Err() == nil { charly/provider_kind_invoke.go:476:// validateKindValueCUE validates an externalized structural kind node's authored VALUE against charly/provider_kind_invoke.go:494:func validateKindValueCUE(pn spec.ParsedNode, prov Provider) error { charly/registry_bootstrap.go:31:// (validateKindValueCUE). So spec.KindWords is now EMPTY and the former ``` The only remaining `spec.KindValueDefs` READ in production code is the fallback at `provider_kind_invoke.go:438`; every other hit is a comment describing it (and `sharedCueSchema` retains its two legitimate uses: the first-unit materialization at `plugin_loader.go:170` and the base fallback at `provider_kind_invoke.go:459`). The two `.agents` references were corrected in the same commit. - **R6 (preserve work, git safety).** Worktree created off fresh `origin/main` (`152dc845`) in its own branch; no unrelated file touched; no force-push, no direct push to `main`. - **R7 (prove behavior).** Coverage fails without the change (plant A/B, red on assertions); the changed path ran live over 2004 real entity bodies with retained output, and the CLI still rejects a typo'd `vm:` field. No emitted-artifact boundary is involved. - **R8 (live services).** N/A — no service boundary in this change. - **R9 (binary = source).** Worktree-local build at the branch: `./bin/charly version` → `2026.315.2219`; no new runtime OS dependency, so `packaging:` is untouched. - **R10 (fresh disposable proof).** Classified, not deferred: the acceptance surface of this change IS the project load, and the gate that owns it is the corpus + live-load gate above (`bin/charly box validate` over the real repo — 604 candies, 122 boxes, 49 deploys, 0 warnings — plus 2004 real entity bodies through the changed function). The diff touches no deployment, candy runtime, service, CUE schema or wire type, so no `disposable: true` target's runtime surface changes and no `charly check run` bed selects for it; the repo-declared core gate (`go test ./...`, `go vet ./...`, R9 build) ran on the final tree. That is the change-class decision, taken here rather than pushed to the operator. ## Change classification - **Class:** core Go (loader/kind gate + test/skill prose). No CUE schema, no wire type, no pin, no gitlink, no `design/*.tsv`, no `TODO.md`. - **Breaking change + rollback:** no authored surface changes, so the subject carries no `!` and no config/wire/CLI consumer breaks: every kind resolves the same def, proven by the 2004-body sweep (byte-identical verdict lists before/after). If this gate's new input path itself breaks, a consumer sees a **false reject** (`<kind>: field not allowed` on a body that used to load) or a **silent false accept** (a typo no longer rejected). Rollback is a revert of this one commit — it carries no pins, schema or wire contract, so there is nothing to migrate. If a moved kind's plugin is rolled back while charly is not, the gate fails loud with `kind value def #<Word>Value not found` rather than skipping. ## Filed issues None. The findings this round produced were fixed here (the skill-prose claim, the corpus-oracle rendering); the 20 corpus FAILs are files authored to fail (`design/negative/*`, migration testdata), unaffected by this change. The chain that consumes this unit is tracked once, in opencharly/spec#304. *Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (analysed on a live system)* --------- Co-authored-by: aitrawog <[email protected]>
… the release (#287) * fix(gate): the engine pin measures the asset and names the class, not the release The validator's `Ensure charly` step decides whether the pinned release's assets can be obtained before a review is attempted, and when it cannot, it hands a class to the gate. It fetched with `curl -fsSL` — discarding the status and the body — and then reported, for EVERY failure, "the release is published but its assets could not be downloaded (a partial upload)". That sentence is false for the failure that actually happens, and it names a remedy that is already true. MEASURED, 2026-11-09 (#285): .../v2026.308.2259/charly-linux-amd64 -> 200, 37097634 B .../v2026.313.0209/charly-linux-amd64 -> 504, 92 B (GitHub's gateway page) .../v2026.313.0209/charly-candy-charly.yml -> 200, 23561 B (same release) .../v2026.308.2259/charly-candy-charly.yml -> 504, 92 B (same release) Both releases report every asset `state: uploaded` at its full size over the release API, so no API-only check can see the condition; the same bytes answer 200 over the API asset route while the download path 504s. The failing hop is GitHub's release-download path, it is INTERMITTENT and per-OBJECT, and a pin move moves the failure instead of removing it. So each asset is now fetched WITHOUT `-f` and the BYTES are judged: HTTP status, size and the first four magic bytes (ELF for the binary, gzip for the plugin bundle). A 200 carrying a gateway page is not an engine. The release's own state is measured separately over the API, and the gate reports one of three classes, each with its own remedy: endpoint-failed the download path failed -> RE-RUN; never move the pin absent the release does not serve it -> re-upload or move the pin no-tag/absent/draft release -> serve the release or move the pin The comment's `class:` line now carries the failing asset's URL and HTTP status. No review criterion, model setting, timeout or auto-close threshold is changed: the class stays INFRA and is still excluded from AI_REVIEW_AUTO_CLOSE_AFTER, and the gate still fails closed (the required check stays RED; unreviewed code never merges). Coverage: `scripts/engine-pin-asset_test.sh` extracts the shipped steps and runs THEM against a stubbed `curl` (six discriminations, including a 200 that is not the asset), asserts the posted comment body, and turns itself RED under three negative controls. `scripts/proof-engine-pin.sh` replaces the retired `proof-unresolvable-pin.sh` and runs the same shipped text live, for the measurement. The gate's own `pin_class` output and its "(a partial upload)" sentence are retired, with the claim sweep pasted in the PR. Refs: #285, opencharly/charly#723, opencharly/charly#1115 Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated) * fix(ci): the proof harness resolves its example tags at run time, never as literals The harness defaulted to two literal tags. That is the same rot-prone shape this change is about, and the org's own retired-name sweep is what caught it: the sweep for the tag the brief named found it in `scripts/proof-engine-pin.sh`. The default pair is now derived at run time — the tag the org pin names today, and the release before it — and the file names no tag at all. Passing two tags still overrides both, which is how the harness was exercised. Round-1 evidence: `git grep 'v2026.308.2259'` over the tree now returns rc=1 with 0 files, while the same predicate matches a tag the tree does carry (calibrated, not silent). NOT PUSHED YET: the open verdict asks for a T4 maintainer sign-off, and this commit rides with it so the final head carries both. Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated) * fix(ci): the harness reaches its output block, and the body counts four classes
Summary
opencharly/sdk#490's second ordered root: the host's plugin schema gate no longer joins unit
sources into one compilation unit.
compileBasePlusServedcompiledstrings.Join(everyLoadedUnit, "\n")onto charly's base, andregisterPluginUnitSchemafirst compiled each unit's text standalone with no CUE module inscope. Both shapes are text, and text cannot carry the import this cutover exists for. Measured
on the pre-change tree, with a plugin schema that imports
github.com/opencharly/spec/schema:The second is a failure #490 names as independent of the first: N units joined into one file
put N import clauses in one compilation unit, which is not CUE at all.
Now each unit is COMPOSED as its own CUE module instance and the values are unified onto the
base — the unit boundary lands exactly where CUE's own package boundary is: one package per
plugin. The composer is
spec/schemacompose, the ONE composer in the contract module: this hostmay import
github.com/opencharly/specand may NOT importgithub.com/opencharly/sdk(thisrepo's import-purity gate, "the sdk mechanism kits and the sdk root plugin-authoring package are
for PLUGINS to import, never the host"), while the serve side may import both — so the shared
home is the only place the two halves can judge the same schema with the same code.
The running value is grown one unify per registration, not rebuilt from the base. That is a
measured requirement, not a refinement: rebuilding made plugin loading quadratic, and
charly/charly's TestMain — which registers the 63 builtin plugin schemas — went from 1.4 s to26.4 s, which then pushed
TestConnectPluginReady_HonorsACallerCancellationpast its 10 s bound,because the fixture's child process could not finish its own TestMain and answer the handshake.
With one unify per registration TestMain is 1.1 s and that test passes at 1.45 s.
The declarations the gate reads per source are unchanged:
topLevelDefNamesnow reads thecomposed unit's value, which carries the same top-level definitions, and the charly#770
collision identity index is untouched.
The composer's deep arms live where the composer lives: opencharly/spec#297 tagged
v0.2026313.453, which this change pins.Files
charly/plugin_loader.gocharly/plugin_schema_import_test.gocharly/plugin_schema_collision_test.gocharly/provider_checkenv_schema_gate_test.gocharly/registry_testsupport_test.gocharly/go.modgithub.com/opencharly/spec→v0.2026313.453charly/go.sumThe six lockstep
tools/modulesThe
gojob'sTestContractPinsMatchSharedrequires every locksteptools/*module to carry the shared pins.Bumping spec in
charly's owngo.modwithout them fails that test — caught by CI, not by a localgo test ./...,which never leaves the
charly/module. Fixed with the repo's owncharly task mods-tidy, which changed exactlythese six files (spec pin
v0.2026313.48across the lockstep set):tools/generate-packages/go.modtools/generate-packages/go.sumtools/golden-cloudinit/go.modtools/golden-cloudinit/go.sumtools/golden-compile/go.modtools/golden-compile/go.sumHow tested
Code gate, on the committed tree
d481eb65609feb27bce4694a7fe95fc5211e937d:The suite includes
TestMain, which loads all 63 builtin plugin schemas through the changedgate — so the whole shipped corpus composes and unifies under the new shape.
The host's own arms:
R7 — the arms fail without the change. With
origin/main'splugin_loader.gorestored, thesame source produced the two errors quoted in the Summary (
imported but not definedfor oneunit;
expected label or ':', found 'STRING'for two joined). That measurement is the reason thejoined path cannot simply be given a module.
R9 — the binary is the source.
./scripts/bootstrap-charly.shbuilt this worktree'sbin/charly(charly version=2026.313.0209), and the changed path ran live:R10 — the disposable bed.
./bin/charly check run check-pod-overlayon this tree (adisposable: truepod bed that builds an overlay image, deploys it, runs its checks, does agenuine
charly updaterebuild and re-checks). The first attempt failed on an upstreamcurl: (22) The requested URL returned error: 504fetching a release tarball inside the image build — an external condition, RCA'd and evidenced before retrying. The retry's summary:summary.ymlrecords the same run against the worktree binary:driver: .../dsh-490/charly/bin/charly,driver_version: 2026.313.0209, every stepok: true.