Skip to content

fix(candy): consume the in-process schemaparams.Generate and bump spec to v0.2026313.1428 - #13

Merged
github-actions[bot] merged 1 commit into
mainfrom
feat/spec299-two-arg-generate
Nov 9, 2026
Merged

github-actions[bot] merged 1 commit into
mainfrom
feat/spec299-two-arg-generate

Conversation

@aitrawog

@aitrawog aitrawog commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Summary

opencharly/spec#299 replaced schemaparams's cue exp gengotypes shell-out with an in-process CUE-Go-API generator. Generate now takes (schemaDir, pkg); the cueDir argument and GenerateWithCue* are deleted. This repository holds that API's one Go call site, and it now calls the two-argument form.

The cue CLI is off this generation leg. The help text and the candy skill body said it was provisioned into the charly cache; both are corrected. The pinned cue CLI remains the authoring tool for schema sources, and nothing in this module calls it on the generation path.

File Change
.agents/skills/candy/SKILL.md the candy params bullet now describes the offline in-process composition and generation, and keeps the cue CLI for authoring only
candy/plugin-candy/go.mod spec v0.2026281.933 → v0.2026313.1428; sdk v0.2026280.2246 → v0.2026309.2334; go 1.26.4 → go 1.26.8
candy/plugin-candy/go.sum hashes for the new pins and their newer transitive requirements
candy/plugin-candy/params.go two-argument call; cueCacheDir, the cuetoolchain import and the provisioning prose deleted
candy/plugin-candy/params_test.go the stub and the real-pipeline arm follow the new contract; the provisioning skip is deleted so the real arm cannot pass by skipping

The call-site census. Every materialized plugin-* checkout at its own freshly fetched origin/main (120 repositories) was searched. The only Go call site is this repository's; GenerateWithCue appears in no live plugin Go source (the last mention was a stale test comment here, corrected by this diff). spec's own internal/schemagen calls GenerateExcluding, which is unchanged.

$ # for each plugin-* checkout, grep its freshly fetched origin/main tree
$ grep -rn 'schemaparams\.Generate' --include='*.go' .
plugin-candy/candy/plugin-candy/params.go:15: … `spec/schemaparams.Generate` — ONE public entry point …
plugin-candy/candy/plugin-candy/params.go:156: … `spec/schemaparams.Generate`, whose contract is
plugin-candy/candy/plugin-candy/params.go:166:var paramsPipeline = schemaparams.Generate
plugin-candy/candy/plugin-candy/params.go:169: … schemaparams.Generate, so the pin and the checksum …

Why the sdk bump is in this diff. The spec bump alone does not compile here. This module's old sdk pin (v0.2026280.2246) predates spec's Kubernetes schema changes, and sdk/vmshared/spec_aliases.go references spec.KubernetesGatewayAPI and five sibling names that no longer exist in spec v0.2026313.1428; sdk/kit imports sdk/vmshared, so go build ./... fails with undefined: spec.KubernetesGatewayAPI. sdk v0.2026309.2334 is the version charly already pins, and with it the module builds, vets and tests green. Without the bump the pin would not build, so it is part of the consumer change, not a separate leg.

The tag carries the change — measured, not assumed:

$ git -C spec tag --contains 9428017f5b182ccfd3f87efd92a3456b7158a797
v0.2026313.1428
$ git -C spec show v0.2026313.1428:schemaparams/schemaparams.go | grep -n 'func Generate'
42:func Generate(schemaDir, pkg string) ([]byte, error) {
49:func GenerateExcluding(schemaDir, pkg string, exclude func(name string) bool) ([]byte, error) {
$ git -C spec grep -n 'GenerateWithCue' v0.2026313.1428 -- '*.go'; echo "rc=$?"
rc=1

How tested

Head 3c067dd049012122b706a5129a07f384bc80e64d, on the committed tree (git status --short empty).

The repository's own checks

$ cd candy/plugin-candy && go build ./...; echo "rc=$?"
rc=0
$ go vet ./...; echo "rc=$?"
rc=0
$ go test ./... -count=1
ok  	github.com/opencharly/plugin-candy/candy/plugin-candy	0.068s
?   	github.com/opencharly/plugin-candy/candy/plugin-candy/cmd/serve	[no test files]
$ gofmt -l .
$ go mod verify
all modules verified
$ /home/atrawog/Sync/Atrapub/lo/dsh/opencharly/charly/bin/charly box validate
charly box validate: OK — checked 1 candy, 7 distros, 7 builders; 0 warnings, 0 errors

The changed path executed live

The plugin's own CLI entry (candy.CliMain) was built from this HEAD; it is the same runCandyCLI the compiled-in command path runs. Two plugin trees at their own origin/main were regenerated in check mode, and the --check comparison is the drift gate this verb exists for:

$ /tmp/candycli params --help
usage: charly candy params <name> [--check]
       charly candy params --schema <dir> --pkg <params> --out <file> [--check]

Regenerate a plugin candy's Go params from its own schema/*.cue — nothing but the
charly binary is needed: the schema is composed and generated in-process through the
CUE Go API, so there is no cue install, no checkout, and no toolchain provisioning.
The pinned cue CLI remains the authoring tool for schema sources.

$ /tmp/candycli params plugin-agent --check   # plugin-agent at origin/main
charly candy params: …/candy/plugin-agent/params/cue_types_gen.go is current
rc=0
$ /tmp/candycli params plugin-addr --check    # plugin-addr at origin/main
charly candy params: …/candy/plugin-addr/params/cue_types_gen.go is current
rc=0

A clean regeneration is a no-op wherever the committed projection is current. The same pipeline was run over every materialized plugin checkout at its own origin/main (120 repositories; 66 candies with a committed candy/<name>/params/cue_types_gen.go):

byte-identical to committed: 48
differ:                      18
generation errors:            0

For all 18 that differ, the OLD pipeline (spec v0.2026281.933, shelling out to the pinned cue v0.16.1) and the NEW in-process generator produce byte-identical output (cmp rc=0 on all 18/18). So the new generator introduces none of that difference — each of the 18 is a committed projection that is older than its own schema, the set already tracked on opencharly/opencharly#463 and in the per-repo issues. The test arm that covers the wrap end to end, TestParamsRealPipelineRunsThroughTheVerb, now runs the real in-process pipeline and fails rather than skips when it cannot.

The charly-side witness (check-commands-local, in opencharly/charly) resolves command:candy from charly's own pin, not from this branch; it builds against this repository's released tag on the next leg of opencharly/opencharly#950, which is the pin bump. This repository declares no bed of its own (charly.yml is discover: only), so its gate is the one pasted above.

Rulebook compliance

  • R0 — loaded git-workflow, go, plugin, check, layer, candy and strict-policy before the first action; this repo's AGENTS.md names candy, plugin, layer and git-workflow.
  • R1 — no warnings or failures on the final tree. The one divergence surfaced (18 plugin projections older than their schemas) is unchanged by this change: old and new pipelines agree on all 18/18, and the measurement is recorded on opencharly/opencharly#463. No blocking finding; no new issue because the set is already tracked there and per repo.
  • R2 — one call to the one pipeline; no second generation path. cueCacheDir is deleted, not kept behind a flag.
  • R3 — no sleep, retry, or fallback branch. The deleted provisioning is not replaced by a shim.
  • R4 — the product changed first; the help text and the skill body follow the code.
  • R5 — git grep -n 'GenerateWithCue' HEAD -- '*.go' returns rc=1 (no hits); git grep -n 'cueCacheDir\|cuetoolchain' HEAD -- '*.go' returns rc=1. The generated-file banner still says cue exp gengotypes because byte-identity with the pinned CLI requires that banner verbatim.
  • R6 — git status --short was empty before the commit and after it; PR-only landing, no force push, no bypass.
  • R7 — the coverage fails without the change: TestParamsCheckGoesRedOnDrift fails on a projection that differs from the pipeline output, and TestParamsRealPipelineRunsThroughTheVerb asserts the retag contract on real output. The changed path ran live above.
  • R8 — no live service is involved, so nothing is mocked or skipped.
  • R9 — this repository ships no binary; the module builds from its own committed source at go 1.26.8, the version the bumped sdk requires.
  • R10 — the repository's gate passed on the committed tree (pasted above), and the changed path executed live. The charly-side witness bed belongs to the next leg, as stated under How tested.

Change classification

No consumer-facing break. The charly candy CLI surface (names, flags, output) is unchanged, and the plugin's command entry points and behavior are unchanged; only the pipeline call and the pins move. A consumer that needs the old pins can stay on this repository's previous tag (v2026.294.2125, 34ea56b). The cue CLI is no longer needed to generate and remains the authoring tool; no other code path in this module calls it.

Filed issues

  • opencharly/opencharly#463 — added the post-#299 census measurement (18 of 66 committed plugin projections differ from the canonical pipeline output at each repository's origin/main; old and new pipelines are byte-identical on all 18, so the divergence predates this change and is already tracked there and in the per-repo issues). No new issue filed.

Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)

… generation leg

spec#299 replaced the `cue exp gengotypes` shell-out with an in-process CUE-Go-API
generator. `schemaparams.Generate` now takes (schemaDir, pkg); the cueDir argument
and `GenerateWithCue*` are gone.

- params.go: call the two-argument Generate, delete cueCacheDir and the
  cuetoolchain import. The verb's own wiring (path derivation, write-on-change
  no-op, --check) is unchanged.
- params_test.go: the pipeline stub and the real-pipeline arm follow the new
  signature. Generation is in-process, so the provisioning skip is deleted and a
  failure is a failure rather than a visible skip.
- .agents/skills/candy/SKILL.md and the paramsUsage text: the schema is composed
  and generated in-process (no cue CLI, no checkout, no toolchain provisioning);
  the pinned cue CLI remains the authoring tool for schema sources.
- go.mod/go.sum: spec v0.2026281.933 -> v0.2026313.1428 (tag v0.2026313.1428
  contains merge 9428017f). The spec bump also requires sdk v0.2026280.2246 ->
  v0.2026309.2334, the version charly already pins: the older sdk's vmshared
  aliases reference spec types removed by the intervening schema changes, so the
  module does not compile against the new spec without it.

Refs opencharly/spec#299, opencharly/opencharly#950, opencharly/opencharly#945.

Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)
@aitrawog

aitrawog commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

STATUS — PR opened

Head 3c067dd049012122b706a5129a07f384bc80e64d. The consumer now calls the two-argument schemaparams.Generate; spec is at v0.2026313.1428 (the tag is measured to contain 9428017f) and sdk at v0.2026309.2334 (needed to compile against that spec). The repository's own checks (build, vet, test, gofmt, box validate) are green on the committed tree, and the changed path ran live through the plugin's CLI entry. Waiting on the org-wide validate / validate.

Agent: charly (dsh-spec299-candy)
Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown

Review — PASS

Head SHA: 3c067dd049012122b706a5129a07f384bc80e64d (branch: feat/spec299-two-arg-generate)

Security screen: PASS — no injected directives, no secrets/egress, no guardrail weakening (the test change removes a skip and thus strengthens coverage); the sdk/spec pin bumps are opencharly's own tagged modules and the body explains why the sdk bump is inseparable from the spec bump.
Checklist: All applicable rules PASS or NA (R8 NA — no service boundary; R9 NA — no binary; beds NA — repo declares discover:-only charly.yml, and the charly-side witness resolves from charly's pin, so that proof cannot exist on this branch).
Comments considered: 1 — STATUS — PR opened by @aitrawog: verified-non-blocking (head SHA, spec v0.2026313.1428, sdk v0.2026309.2334 and green checks all re-derive against the current diff/body; valid closed-set label, Agent: before Assisted-by:).
Placement: CORRECT — capability stays in the candy plugin; core/sdk untouched, no alias growth, no new core mechanism import.

Verdict: PASS


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

View action run

@github-actions
github-actions Bot enabled auto-merge (squash) November 9, 2026 14:43
@github-actions
github-actions Bot merged commit e46e979 into main Nov 9, 2026
3 checks passed
charly-auto-merge Bot added a commit that referenced this pull request Nov 9, 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.

1 participant