Repository navigation
fix(cache)!: ship a self-contained CUE schema (no schema-less plugin) - #4
Conversation
Replace the nil schemaFS passed to sdk.NewMeta with an embedded schema/cache.cue served over Describe, and add a test pinning that the served schema_cue is non-empty and carries #CachePlugin. R5: the schema-less plugin exception is eradicated — every plugin ships a non-empty, self-contained CUE schema (opencharly/charly#712). The old "input-less plugin passes nil" path is deleted in the same commit.
Review — BLOCKHead SHA: Change class: code/config — Go plugin code ( Security screen: PASS — no T1–T4 finding (no secrets/egress, no guardrail weakening, no supply-chain change, no embedded directives; PR content treated as data). Placement (B16): CORRECT — the capability and its schema live in the plugin candy; no Comment thread: empty (0 comments) — nothing to re-derive. Blocks
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
…e schema docs - add schema_splice_test.go, which reproduces charly's host schema load gate (compileBasePlusServed: base FS from spec/schema + this served schema, compiled with cuecontext.New()) and asserts the plugin's def resolves. It FAILS without the change (empty schema_cue). - schema/*.cue: drop false 'cannot silently drift' claims (open constraints pin nothing) and the 'SINGLE SOURCE' header claim. - go.mod: cuelang.org/go becomes a direct test dependency.
Review — PASSHead SHA: Security screen: PASS — no T1–T4 finding (no secrets/egress, no guardrail weakening, no new/changed dependency version, no embedded directives; PR content treated as data). Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
Summary
Restore
plugin-cache's own self-contained CUE schema — the schema-less-plugin R5 cutovertracked in opencharly/charly#712 (the SDK contract landed as
opencharly/sdk#314).
NewMetapassed anilschema FS and served an EMPTYschema — the SDK's former "input-less plugin" waiver. There is no schema-less plugin:
every plugin presents the same CUE declaration surface, even where a capability's authored
input is its pass-through CLI grammar (or a structured wire envelope) rather than an
authored
plugin_input.Files
candy/plugin-cache/schema/cache.cue— the plugin's OWN self-contained schema (#CachePlugin), documentingcommand:cache. It references no base def, so it compiles standalone and splicesbase ++ pluginat the host load gate (charly/charly/plugin_loader.goregisterPluginUnitSchema).candy/plugin-cache/plugin.go—//go:embed schema/*.cue+sdk.NewMeta(calver, caps, schemaFS)replaces the trailing
nil; the stale schema-less comment is corrected.schema_splice_test.go(NEW, alongsidecandy/plugin-cache/schema/cache.cue) — executes the real hostschema load gate: it loads the SAME base schema FS charly loads
(
github.com/opencharly/spec/schema), concatenates through the SAMEspec/schemaconcatcontract, compilesbase ++ pluginwith the SAMEcuecontext.New()thatcompileBasePlusServeduses, and asserts#CachePluginresolves to a struct. It FAILS without this change (the served schema was empty, so
#CachePluginwas undefined).schema_serve_test.go— existing:Describemust serve a non-emptyschema_cuecarrying
#CachePlugin(also fails without the change).Refs: opencharly/charly#712
How tested
All commands run FRESH from the committed tree at head
a68527423fbdf3a2b32127727a77f97994e632d3.1. The changed path — the real
base ++ pluginload-gate splice:2. Negative control — the new test fails without the change (the trailing meta
argument transiently restored to
nil, then the file restored exactly):3. Module gate (fresh):
4. Full schema source —
cue def candy/plugin-cache/schema/cache.cue(the faithful rendering:cue evalresolves the open
providers: [...string]to[]and omits the optionalconfig?, socue evalunder-reports the committed surface;cue defshows the schema exactly):5. Repo CI config gate (
candyworkflow:charly box validate) — run with a charlybuilt from the repo's OWN pinned tag
v2026.247.1701:6. R5 stale-reference sweep — the exact command + its complete output:
Every hit is a NEW "there is no schema-less plugin" statement — the corrected reality; no
surviving claim that a plugin ships no schema (the prior
ships no schema/input-lesscomments were corrected in
candy/plugin-cache/plugin.go).Diff-stats at head
a68527423fbdf3a2b32127727a77f97994e632d3:Rulebook compliance
/charly-internals:git-workflow,/charly-internals:plugin,/charly-check:check,/charly-internals:cutover-policy, and the umbrellaAGENTS.mdloaded before any edit/branch/commit/PR action.
R5 cutover: eradicate the schema-less / input-less plugin exception — ONE uniform plugin config+schema+codegen surface charly#712 before remediation; no blind retry.
cutover (sdk → plugins → charly host gate → marketplace); every in-scope occurrence in
THIS repo (the
nilmeta argument + its stale comments) is fixed here.spec/schemaconcatcontract, the ONEsdk.NewMeta/BuildCapabilitiesserve path, and the ONE base-schema FS.nilschemaFS is removed, notpapered over.
nil-schema path is gone in the same commit;the stale
input-less/ships no schemacomments are corrected, and the sweep aboveproves no surviving schema-less claim.
feat/inputless-schemabranch, no force-push, no hook bypass,no direct push to
main.TestServedSchemaSplicesOntoBasefails without the change(negative control above) and asserts the served artifact resolves from
base ++ plugin;TestNewMetaServesNonEmptySchemaasserts the served artifact directly.compile-time artifact and the splice is pure/deterministic. The one runtime consumer is
the charly host load gate (routed in R10).
Describereply(
Capabilities.schema_cue); the tests assert it directly andcue defshows the source.here; the plugin is a Go module compiled by the host.
executed on the final committed tree by
TestServedSchemaSplicesOntoBase, against theREAL base schema FS with charly's exact concat + compile contract, and the repo's
committed CI config gate (
charly box validate) is green under its pinned charly. Noin-repo disposable bed can exercise this change: the served schema has exactly one
runtime consumer — the charly host load gate — and this repo's
kind: localwitnessdeploys exercise the externalized CLI COMMAND against the pinned charly, not this
repo's changed served-schema path. Per
/charly-check:check"R10 gate by change class"(the Contract / library module row: the module suite IS the gate; a bed that cannot
fail on the change proves nothing) and its consumer-boundary clause, the consumer bed is
named as the charly host-gate leg of R5 cutover: eradicate the schema-less / input-less plugin exception — ONE uniform plugin config+schema+codegen surface charly#712 (producer→consumer order,
B6) — it is not this repo's PR to run.
Change classification
(no deployable test target in this repo).
gofmt -l .+go vet ./...+go test ./... -count=1, which now executes the realbase ++ pluginsplice) + theschema source (
cue def) + the repo'scharly box validateconfig gate.opencode-go, modeldeepseek-v4.1-flash(the exact name the harness reports).fully tested and validated— the gate for this change classpassed on the final committed tree and the changed path is executed by the new splice
test.
The PR body IS the changelog (tag-on-merge writes it to
CHANGELOG/<calver>.mdat merge).Assisted-by: OpenCode DeepSeek V4.1 Flash (fully tested and validated)