Skip to content

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

Merged
github-actions[bot] merged 1 commit into
mainfrom
feat/schema-ver-removal
Sep 27, 2026
Merged

github-actions[bot] merged 1 commit into
mainfrom
feat/schema-ver-removal

Conversation

@aitrawog

@aitrawog aitrawog commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Eradicate the schema-less plugin exception for plugin-ollama: every plugin MUST serve a non-empty, self-contained CUE schema over Describe (opencharly/sdk#314; there is no schema-less plugin). This plugin passed nil as the schemaFS and served an EMPTY schema_cue, which makes charly panic at process start (loadBuiltinPluginUnits) once charly pins the post-sdk#314 contract — the direct blocker of the charly host leg (opencharly/charly#714).

Ordered per-repo unit of the R5 cutover tracked in opencharly/charly#712.

Files (git diff --name-only origin/main...HEAD):

    candy/plugin-ollama/go.mod
    candy/plugin-ollama/plugin.go
    candy/plugin-ollama/schema/ollama.cue
    candy/plugin-ollama/schema_serve_test.go

How tested

Module gate — fresh on the committed tree at head 846cf725ca7aaa65516594d21ab3c2bd9082cff6 (from candy/plugin-ollama):

$ env -u GOFLAGS GOWORK=off go mod tidy && gofmt -l . && go build ./... && go vet ./... && go test ./... -count=1
ok  	github.com/opencharly/plugin-ollama/candy/plugin-ollama

R10 — real host gate + disposable target (operator bed, opencharly/charly#712, 2026-09-27). A rebuilt charly compiled this plugin FROM SOURCE (worktree) via a go.work, so the real process-start host gate loadBuiltinPluginUnits() gates its served schema; then a target explicitly marked disposable: true ran.

This plugin is compiled into the bed from its worktree — the untruncated provenance line:

    dep	github.com/opencharly/plugin-ollama/candy/plugin-ollama	(devel)	

The real gate names THIS plugin's unit (per-unit line, 63 compiled-in units gated):

    gated command:ollama                               schema_bytes=1312
    total compiled-in units gated: 63
$ <bed>/bin/charly version
2026.270.1151
$ <bed>/bin/charly check run check-commands-local
charly check run check-commands-local: [deploy-add] PASS
charly check run check-commands-local: [bring-up-members] PASS
charly check run check-commands-local: [check-live] PASS
charly check run check-commands-local: [update] PASS          <-- FRESH REBUILD
charly check run check-commands-local: [cleanup] PASS
charly check run check-commands-local: PASS (steps=6)
$ cat <bed>/.check/check-commands-local/2026.270.1632/summary.yml
ok: true
total_seconds: 371
diagnostics: {errors: 0, warnings: 0, advisories: 0}

Named disposable target: check-commands-local — a kind: local deploy explicitly marked disposable: true in the bed project's charly.yml (the only target the bed destroys/rebuilds). Negative control: TestServedSchemaSplicesOntoHostBase reproduces the base ++ plugin splice; reverting schemaFS→nil makes both schema tests FAIL.

Rulebook compliance

Change classification

Refs opencharly/charly#712 · opencharly/charly#714.

Agent: schema-ver-removal · session ses_f1cc58648ffetzNWhHFWuSeKxC
Assisted-by: OpenCode ollama-cloud/deepseek-v4.1-flash (analysed on a live system)

Every plugin MUST serve a non-empty, self-contained CUE schema over Describe
(the SDK contract landed as sdk#314; there is no schema-less plugin). This
plugin passed `nil` as the schemaFS and served an EMPTY schema_cue, which makes
`charly` panic at process start (`loadBuiltinPluginUnits`) once charly pins the
post-sdk#314 contract — the direct blocker of the charly host leg
(opencharly/charly#714).

- NEW candy/plugin-ollama/schema/ollama.cue — a package-less, self-contained doc schema for
  this plugin's served declaration surface. It references no base def, so it
  compiles STANDALONE and splices `base ++ plugin` at the host load gate.
- plugin.go — `//go:embed schema/*.cue` + `sdk.NewMeta(calver, caps, schemaFS)`
  instead of `nil`; the stale "ships no schema" comment corrected.
- NEW schema_serve_test.go — `TestNewMetaServesNonEmptySchema` +
  `TestServedSchemaSplicesOntoHostBase` (the real `base ++ plugin` splice).

Refs opencharly/charly#714 · opencharly/charly#712.

Assisted-by: OpenCode ollama-cloud/deepseek-v4.1-flash (analysed on a live system)
@github-actions

Copy link
Copy Markdown

Review — PASS

Head SHA: 846cf725ca7aaa65516594d21ab3c2bd9082cff6 (branch: feat/schema-ver-removal)

Security screen: PASS — no T1–T4 findings (no embedded directives, no secrets/egress, no guardrail weakening; cuelang.org/go v0.16.1 pin unchanged, only moved indirect→direct for the test import).
Checklist: All applicable rules PASS or NA — body accounts for all 4 files; code-change gate (module gate + operator bed on a disposable: true target, zero warnings) matches the plugin Go+CUE class; analysed on a live system is conservative (not inflated); one atomic commit; tests FAIL without the change (negative control).
Placement: CORRECT — the served-schema capability stays in the candy plugin (candy/plugin-ollama), served through the SDK NewMeta contract; no core/sdk re-coupling, no *_aliases.go, no naked generated-file edit (the schema is explicitly not a codegen source).
Comments: none on the PR (empty thread).

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 17:19
@github-actions
github-actions Bot merged commit add9d49 into main Sep 27, 2026
2 checks passed
charly-auto-merge Bot added a commit that referenced this pull request Sep 27, 2026
@aitrawog aitrawog added the rerun label 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