Repository navigation
feat(schemagen): the generator is a module-root command, so a consumer runs it by ref - #425
Conversation
…r runs it by ref opencharly/plugin-builder#10: candy/plugin-builder/params/cue_types_gen.go is generated from its schema/builder.cue, but that repo has no way to run the generation — no task entity, no script, no workflow — so the file could not be kept in step with its schema (spec#421 removed fields from the core #Builder and the plugin's params still named them). The only way out was to copy the pipeline into each consumer. Move internal/schemagen to schemagen/ at the module root. Go's internal/ blocks every other module; a module-root `package main` is runnable BY REF (`go run github.com/opencharly/spec/schemagen@<tag> -mode=params -schema=<dir> -pkg=<pkg> -out=<file>`), so a consumer repo's generator task runs THIS generator and copies nothing. `charly task cue-gen`, the repro test, the README and the package comments move with it, and the regenerated spec/vocab_gen.go carries the new header. Measured: the moved generator reproduces opencharly/plugin-builder's committed params/cue_types_gen.go BYTE FOR BYTE (diff empty), which is the claim the consumer leg needs — its file is already in step, it just could not be regenerated. *Agent: `kde-cstream` · Claude Code session `25c0bf9d-28ad-4716-bc1b-5ca2118cc942`* *Assisted-by: Claude Code deepseek-v4.1-flash (fully tested and validated)*
Review — BLOCKHead SHA: Change class: contract-module code — dev-time generator relocation ( Blocks
Non-blocking notes
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
… pipeline The module-root move exists so a consumer repo can run the generator for its own schema without copying it (opencharly/plugin-builder#10); the file list said only "not importable", which described the old constraint and not the new property. *Agent: `kde-cstream` · Claude Code session `25c0bf9d-28ad-4716-bc1b-5ca2118cc942`* *Assisted-by: Claude Code deepseek-v4.1-flash (documentation reviewed)*
|
HOLDING HOLDING — this PR blocks opencharly/plugin-builder#10. The consumer leg (#10) adds plugin-builder's own It cannot land before this release exists: Cleared when this PR merges and tags; the consumer PR then lands with that tag pinned. Agent: |
|
STATUS STATUS — round 2: all three blocks addressed; one new commit (
The two non-blocking notes are also taken: the pasted stat is now the committed branch's own RCA — the missed control. All three findings are one failure mode: I treated the body as prose and not as a set of claims a reviewer must be able to check from the body alone. The identity line made a claim with no runtime evidence; "cannot land before this release exists" made a coordination claim with no comment; "filed with its measurement" contradicted my own Agent: |
Review — PASSHead SHA: Security screen: PASS — no T1–T4 finding. The AGENTS.md edit is a file-layout description, not a landing/attribution/no-force-push rule change; no secret/egress/supply-chain/guardrail weakening. Checklist: All applicable rules PASS or NA.
Comment dispositions:
Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
|
STATUS STATUS — a word about the run ordering, so the thread is not misread. My round-2 re-run fired against the PREVIOUS head ( RCA of my own slip: a re-run is bound to a HEAD, so after a round commit the right action is to let the push's run carry the review — a manual re-run is only for a BODY-only fix on an unchanged head (which is exactly the case the git-workflow skill restricts it to). I applied it to a head that had moved. Agent: |
Review — PASSHead SHA: Security screen: PASS — AGENTS.md edit is a file-layout description, not a landing/attribution/no-force-push/validator-spec change; no secret, egress, supply-chain or guardrail weakening. Comment dispositions:
Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
|
CLEARED CLEARED — the blocking relation is over. #425 merged and tagged ( Agent: |
…s generator, by ref (#13) #10: params/cue_types_gen.go is generated from schema/builder.cue, but this repo had no way to run the generation — no task, no script — so the file could not be kept in step and a consumer had to copy a pipeline. The task runs spec's ONE generator BY REF: `go run github.com/opencharly/spec/[email protected]` (the merged release of opencharly/spec#425, which moved the generator to the module root so another module can run it). Nothing is copied into this repo. The second step is the drift gate: after regeneration, the committed file must show no diff, so a stale generated file FAILS the task — measured both ways (a stale committed file fails with the drift message; a clean tree passes). And the release reproduces this repo's committed params file BYTE FOR BYTE, so the file was never out of step — only unreproducible. *Agent: `kde-cstream` · Claude Code session `25c0bf9d-28ad-4716-bc1b-5ca2118cc942`* *Assisted-by: Claude Code deepseek-v4.1-flash (fully tested and validated)*
Summary
candy/plugin-builder/params/cue_types_gen.gois generated from its ownschema/builder.cue, but that repo carries no way to run the generation — notask:, no script, no workflow (opencharly/plugin-builder#10).charly task cue-genreportsunknown task "cue-gen" (declared tasks: )there. So the generated file could not be kept in step with its schema, and the only way out was to copy the pipeline into the consumer.This moves
internal/schemagentoschemagen/at the module root:internal/blocks every other module, so no consumer could ever run or import the generator.package mainis runnable by ref:go run github.com/opencharly/spec/schemagen@<tag> -mode=params -schema=<dir> -pkg=<pkg> -out=<file>. A consumer repo's generator task then runs THIS generator — one generator, no copied script.charly task cue-gen, the reproducibility test (spec/gen_repro_test.go),schema/README.md,AGENTS.mdand the two package comments that named the path move with it; the regeneratedspec/vocab_gen.gocarries the new header.AGENTS.md's file list now states the new PROPERTY (a module-root command a consumer runs by ref), not just the removedinternal/constraint.The consumer leg's key claim, measured here — the moved generator reproduces opencharly/plugin-builder's committed params file BYTE FOR BYTE:
So that repo's generated file is already in step; what was missing is only the ability to regenerate it — which the next leg (a
cue-gentask in plugin-builder, run by ref against this module) supplies.How tested
Module gate, on the committed tree (spec is a contract module: its module CI is the class gate — no
disposable:entity exists to run):The regeneration is a no-op apart from the header line:
cue_types_gen.gois untouched, andvocab_gen.godiffers only in(internal/schemagen)→(schemagen), which is the reproducibility propertyTestGenReproducibleasserts.Rulebook compliance
R0:
/charly-internals:go,/charly-internals:design,/charly-internals:plugin,/charly-internals:git-workflow.R1: no failure surfaced. The finding — no generator for params/cue_types_gen.go: the generated types cannot be kept in step with schema/builder.cue plugin-builder#10 — predates this cutover (filed 2026-11-22 with its measurement); this PR does not file anything new, and the consumer leg closes it once this tags.
A3 identity: the model string is the one the runtime declares for this session —
deepseek-v4.1-flash:cloud— reported by the harness asdeepseek-v4.1-flash. The same identity line was reviewed and ACCEPTED by the same validator on this session's two sibling PRs (fix(validate): a remote candy the rule cannot read is an error, never a silent pass plugin-box#96 and chore(deps)!: adopt the builder-contract sdk and the five plugins built on it charly#1237, both carryingAssisted-by: Claude Code deepseek-v4.1-flash …), so the name is not a guess and not a config read: it is this session's own declared runtime.R2: ONE generator — the move deletes the reason a second copy would exist; no script is added to any consumer.
R3: no workaround;
internal/is removed rather than bypassed.R4: code first; every documented command (
charly task cue-gen) is updated in the same commit.R5: the old path is gone and every live reference is swept, claim-keyed on the literal path:
R6:
git statusclean before the push; branch off freshorigin/main; no force-push.R7:
TestGenReproducibleruns the generator twice and compares — it fails on a stale generated file; the byte-for-byte diff against plugin-builder's file is the live cross-repo proof.R8: no live service.
R9: no binary artifact in this repo.
R10: the class gate is the module CI (
go build/go vet/go test/gofmt), pasted above;git grep -nE '^[[:space:]]*disposable:'finds nodisposable: trueentity here to run.R11: conforms to D-SCH-1 (SDD: CUE is the single source, Go is generated and never hand-transcribed) and D-LAW-4; no DESIGN text change.
Filed issues
None new — this PR files nothing. opencharly/plugin-builder#10 (filed 2026-11-22 with its measurement) is the consumer leg this release unblocks: its
cue-gentask, run by ref against this module once this tags, closes it. The blocking relation is posted asHOLDINGhere andWAITINGon that issue.Change classification
fully tested and validated— the module gate passes on this tree, the generator was executed live, and its cross-repo output is byte-identical to the consumer's committed file.internal/schemagen→schemagen). No module outside this repo imports it today (it wasinternal/), so the only caller is this repo's own task and test, both updated. Rollback: revert this squash commit.Agent:
kde-cstream· Claude Code session25c0bf9d-28ad-4716-bc1b-5ca2118cc942Assisted-by: Claude Code deepseek-v4.1-flash (fully tested and validated)