Skip to content

fix(cache)!: ship a self-contained CUE schema (no schema-less plugin) - #4

Merged
github-actions[bot] merged 2 commits into
mainfrom
feat/inputless-schema
Sep 27, 2026
Merged

github-actions[bot] merged 2 commits into
mainfrom
feat/inputless-schema

Conversation

@aitrawog

@aitrawog aitrawog commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Restore plugin-cache's own self-contained CUE schema — the schema-less-plugin R5 cutover
tracked in opencharly/charly#712 (the SDK contract landed as
opencharly/sdk#314). NewMeta passed a nil schema FS and served an EMPTY
schema — 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), documenting
    command:cache. It references no base def, so it compiles standalone and splices
    base ++ plugin at the host load gate (charly/charly/plugin_loader.go
    registerPluginUnitSchema).
  • 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, alongside candy/plugin-cache/schema/cache.cue) — executes the real host
    schema load gate: it loads the SAME base schema FS charly loads
    (github.com/opencharly/spec/schema), concatenates through the SAME
    spec/schemaconcat contract, compiles base ++ plugin with the SAME
    cuecontext.New() that compileBasePlusServed uses, and asserts #CachePlugin
    resolves to a struct. It FAILS without this change (the served schema was empty, so
    #CachePlugin was undefined).
  • schema_serve_test.go — existing: Describe must serve a non-empty schema_cue
    carrying #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 ++ plugin load-gate splice:

$ go test -run TestServedSchemaSplicesOntoBase -v ./... -count=1
=== RUN   TestServedSchemaSplicesOntoBase
--- PASS: TestServedSchemaSplicesOntoBase (0.09s)
PASS
ok  	github.com/opencharly/plugin-cache/candy/plugin-cache	0.125s
?   	github.com/opencharly/plugin-cache/candy/plugin-cache/cmd/serve	[no test files]

2. Negative control — the new test fails without the change (the trailing meta
argument transiently restored to nil, then the file restored exactly):

### negative control: candy/plugin-cache/plugin.go  meta-arg restored to nil
--- FAIL: TestNewMetaServesNonEmptySchema (0.00s)
    cache_schema_serve_test.go:21: Describe served an EMPTY schema_cue; every plugin MUST ship a non-empty CUE schema
--- FAIL: TestServedSchemaSplicesOntoBase (0.00s)
    schema_splice_test.go:32: Describe served an EMPTY schema_cue; there is no schema-less plugin
FAIL
FAIL	github.com/opencharly/plugin-cache/candy/plugin-cache	0.019s
?   	github.com/opencharly/plugin-cache/candy/plugin-cache/cmd/serve	[no test files]
FAIL
(exit=1; restore=OK)

3. Module gate (fresh):

$ gofmt -l .
(rc=0)
$ go vet ./...
(rc=0)
$ go test ./... -count=1
ok  	github.com/opencharly/plugin-cache/candy/plugin-cache	0.118s
?   	github.com/opencharly/plugin-cache/candy/plugin-cache/cmd/serve	[no test files]
(rc=0)

4. Full schema source — cue def candy/plugin-cache/schema/cache.cue (the faithful rendering: cue eval
resolves the open providers: [...string] to [] and omits the optional config?, so
cue eval under-reports the committed surface; cue def shows the schema exactly):

#CachePlugin: {
	// The declared capability words (the plugin.providers surface), recorded here as
	// part of the plugin's published declaration surface.
	providers: [...string]

	// The command word the plugin serves.
	command: "cache"

	// The subcommands of the `charly cache` CLI tree — the git-ref cache operator
	// surface plus the OCI-transport push/pull leaves.
	subcommands: ["status", "clear", "refresh", "bypass", "push", "pull"]

	// What the command does, in one line (the public-docs surface).
	contract: !=""

	// The configuration surface: env var names the plugin reads, recorded here as part
	// of the plugin's published declaration surface.
	config?: [string]: string
}

5. Repo CI config gate (candy workflow: charly box validate) — run with a charly
built from the repo's OWN pinned tag v2026.247.1701:

$ <charly built from the repo's pinned tag v2026.247.1701> box validate
charly box validate: OK — checked 1 candy, 7 distros, 7 builders; 0 warnings, 0 errors
exit 0

6. R5 stale-reference sweep — the exact command + its complete output:

$ grep -rniE 'input-less|schema-less|ships no schema|no CUE schema' --exclude-dir=.git .
./candy/plugin-cache/plugin.go:43:// Describe. There is NO schema-less plugin: the served schema documents the command contract
./candy/plugin-cache/schema/cache.cue:3:// no schema-less plugin):
./candy/plugin-cache/cache_schema_serve_test.go:14:// served an EMPTY schema ("there is no schema-less plugin").
./candy/plugin-cache/schema_splice_test.go:32:		t.Fatal("Describe served an EMPTY schema_cue; there is no schema-less plugin")
(rc=0)

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-less
comments were corrected in candy/plugin-cache/plugin.go).

Diff-stats at head a68527423fbdf3a2b32127727a77f97994e632d3:

 candy/plugin-cache/cache_schema_serve_test.go | 26 ++++++++++++++
 candy/plugin-cache/go.mod                     |  4 +--
 candy/plugin-cache/plugin.go                  | 14 +++++---
 candy/plugin-cache/schema/cache.cue           | 33 +++++++++++++++++
 candy/plugin-cache/schema_splice_test.go      | 51 +++++++++++++++++++++++++++
 5 files changed, 122 insertions(+), 6 deletions(-)

Rulebook compliance

  • R0 (skills first) — /charly-internals:git-workflow, /charly-internals:plugin,
    /charly-check:check, /charly-internals:cutover-policy, and the umbrella AGENTS.md
    loaded before any edit/branch/commit/PR action.
  • R1 (RCA every anomaly) — the empty served schema and its waiver are root-caused in
    R5 cutover: eradicate the schema-less / input-less plugin exception — ONE uniform plugin config+schema+codegen surface charly#712 before remediation; no blind retry.
  • R2 (finish the whole cutover) — this is ONE ordered per-repo leg of the single #712
    cutover (sdk → plugins → charly host gate → marketplace); every in-scope occurrence in
    THIS repo (the nil meta argument + its stale comments) is fixed here.
  • R3 (no duplication) — reuses the ONE spec/schemaconcat contract, the ONE
    sdk.NewMeta / BuildCapabilities serve path, and the ONE base-schema FS.
  • R4 (no workarounds) — no fallback or retry; the nil schemaFS is removed, not
    papered over.
  • R5 (delete legacy completely) — the nil-schema path is gone in the same commit;
    the stale input-less / ships no schema comments are corrected, and the sweep above
    proves no surviving schema-less claim.
  • R6 (git safety) — one feat/inputless-schema branch, no force-push, no hook bypass,
    no direct push to main.
  • R7 (prove behavior) — TestServedSchemaSplicesOntoBase fails without the change
    (negative control above) and asserts the served artifact resolves from base ++ plugin;
    TestNewMetaServesNonEmptySchema asserts the served artifact directly.
  • R7a (live or skip) — no live-service boundary is crossed: the base schema FS is a
    compile-time artifact and the splice is pure/deterministic. The one runtime consumer is
    the charly host load gate (routed in R10).
  • R8 (preserve emitted artifacts) — the emitted artifact is the Describe reply
    (Capabilities.schema_cue); the tests assert it directly and cue def shows the source.
  • R9 (binary equals source) — N/A: no binary is built/installed and no gitlink changes
    here; the plugin is a Go module compiled by the host.
  • R10 (fresh proof) — the changed path (the served schema splicing onto the base) is
    executed on the final committed tree by TestServedSchemaSplicesOntoBase, against the
    REAL 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. No
    in-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: local witness
    deploys 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

  • Change class: plugin Go module + its self-contained served CUE declaration schema
    (no deployable test target in this repo).
  • Verification gate: the module suite (gofmt -l . + go vet ./... +
    go test ./... -count=1, which now executes the real base ++ plugin splice) + the
    schema source (cue def) + the repo's charly box validate config gate.
  • Authoring runtime: OpenCode harness, provider opencode-go, model
    deepseek-v4.1-flash (the exact name the harness reports).
  • Attribution tier: fully tested and validated — the gate for this change class
    passed 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>.md at merge).

Assisted-by: OpenCode DeepSeek V4.1 Flash (fully tested and validated)

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.
@github-actions

Copy link
Copy Markdown

Review — BLOCK

Head SHA: 5fdbc622debda1fbbafa23b09c49fdb139f3d1da (branch: feat/inputless-schema)

Change class: code/config — Go plugin code (plugin.go) + an embedded, served CUE schema in the plugin-cache candy repo.

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 charly/ import, no alias file, no sdk mechanism kit pulled into core.

Comment thread: empty (0 comments) — nothing to re-derive.

Blocks

  1. B14(d) / R5 — unexecuted sweep (FRAUD-class). The body's R5 line — "Sweep for input-less|schema-less|ships no schema|no CUE schema finds only the new 'There is NO schema-less plugin' statements" — is a described-but-unrun grep. B14(d) requires the actually-executed command and its output pasted in the body; "I grepped and found none" is not evidence. The "How tested" block contains only cue eval/gofmt/go vet/go test — no grep. Paste the real command and its real output (or delete the claim).

  2. A2 / B12 (R10) — no fresh-rebuild bed run for a code/runtime change. The diff changes runtime behaviour: NewMeta now serves a schema the host splices at the load gate. The only runtime evidence offered is a bare go test ./... -count=1 (A2 explicitly classifies a bare go test as FRAUD for a code change) plus a standalone cue eval. No bed on a disposable: true target ever loaded the plugin and exercised the served schema being consumed/spliced. Run and paste the required bed(s), or cite the R10 change-class matrix showing no bed applies — the body's bare assertion "no disposable bed applies" is uncited, and the How-tested block names neither a disposable target nor a fresh-rebuild confirmation.

  3. A3 — attribution tier not justified. fully tested and validated requires the changed runtime behaviour to have executed against the fresh rebuild; the host consuming the newly-served schema was never exercised (only the in-package unit test ran). Drop to the accurate tier, or supply the bed that proves the changed path end-to-end. Also confirm the footer's full model name — DeepSeek V4.1 Flash is not corroborated by any authoring-runtime evidence in the body (A3: a guessed/config-read model name is a defect).

Verdict: BLOCK


ollama-cloud/deepseek-v4.1-flash — action-review.

View action run

…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.
@github-actions

Copy link
Copy Markdown

Review — PASS

Head SHA: a68527423fbdf3a2b32127727a77f97994e632d3 (branch: feat/inputless-schema)

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).
Checklist: All applicable rules PASS or NA.
Placement (B16): CORRECT — the capability and its self-contained #CachePlugin schema live in the plugin-cache candy; no charly/ import, no alias file, no sdk mechanism kit pulled into core.
Comment thread: 1 comment (prior BLOCK at stale SHA 5fdbc622) — re-derived against the current state: the R5 sweep now carries the actually-executed grep command + full output (hit line numbers 43/3/14/32 match the current diff exactly), R10 now cites the change-class matrix and names the consumer bed (charly#712), and the authoring runtime (OpenCode / deepseek-v4.1-flash) is supplied. All three findings are superseded; none survives.

Verdict: PASS


ollama-cloud/deepseek-v4.1-flash — action-review.

View action run

@github-actions
github-actions Bot enabled auto-merge (squash) September 27, 2026 13:14
@github-actions
github-actions Bot merged commit 1366000 into main Sep 27, 2026
2 checks passed
charly-auto-merge Bot added a commit that referenced this pull request Sep 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants