Repository navigation
feat(schema)!: remove config/schema versioning entirely - #183
Conversation
Delete the arbitrary schema-version stamp and its equality gate. Compatibility between charly core and a plugin is ALREADY enforced by unifying the authored document against the CLOSED CUE schema (an unknown or removed field is a hard `field not allowed` error) plus the plugin-provided CUE source spliced onto the host base. A denormalised CalVer copied into every authored file added a second source of truth that could only ever disagree with those, producing a pure re-stamp wave on every schema change and a red-CI sea across the org. Only the CalVer git tags (binary identity, candy/ref pinning) remain real versioning. Removed (spec leg, producer of this B2 chain): - `schema/version.cue` (the `#SchemaVersion` HEAD + `#SchemaFloor` literals) and its generated `spec/version_gen.go` (const `SchemaVersion`/`SchemaFloor`). - The document/entity `version:` on every authored def — `#NodeDoc` (the reserved document directive), `#Box`, `#Candy`, `#Deploy`, and the system-packaging `#PackagingConfig`. `_common.cue`'s `#CalVer` wire regex is deleted with its last user. - The ledger `schema_version:` on `#DeployRecord`/`#CandyRecord` and the `LedgerSchemaVersion` record-format constant (`spec/ledger_records.go`, whose only content was that constant). - `calver.LatestSchemaCalVer`/`SchemaFloorCalVer`/`MustCalVer` and the HEAD/floor parsed vars; `calver` keeps only the pure CalVer parse/compare used for the binary's build identity and git tags. - `internal/schemagen -mode=version` (and its `writeVersion`/`stringConst`/ `renderVersion`) — no schema version to emit; `charly.yml`'s `cue-gen` drops the step, `TestGenReproducible` drops the `version_gen.go` arm. - The `refs` git-cache writer's `version:` stamp (a fresh per-host charly.yml no longer needs one) and its test. The `version:` key is removed from `#NodeDoc`'s reserved-directive exclusion regex on purpose: a leftover `version:` is now an unknown field — a closed-CUE hard error naming it — and `charly migrate` (raw-YAML, loader-independent) strips it. `#Distro.version` and `#Marketplace.version` (semver metadata) and the runtime wire `version:` fields (image/package versions) are untouched — they are not schema stamps. Concrete edits: 16 files, +40/−233. Breaking change + rollback: consumers pin `spec` by tag, so this is inert until a consumer bumps its `require github.com/opencharly/spec`; rollback is a revert of this one commit. How R10-tested (spec leg, CUE + Go contract): - `charly task cue-gen` equivalent (the same concat + `cue exp gengotypes` + `-mode=retag` + `-mode=vocab`): `gengotypes OK`, regen reproducible, and `version` is absent from the generated `Box`/`Candy`/`Deploy` structs and from `DocDirectives`. - `GOWORK=off go build ./...` OK; `go vet ./...` OK; `gofmt -l .` empty. - `GOWORK=off go test ./...` — 20 packages pass, 0 fail (incl. `TestGenReproducible` and the updated `refs` cache test). The full B2 chain (sdk → plugin-migrate → charly + the corpus) lands after this; its R10 is the fresh-rebuild `box validate` on the assembled chain. Assisted-by: opencode Ollama Cloud deepseek-v4.1-flash (analysed on a live system)
Review — PASSHead SHA: Security screen: PASS Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
Review — PASSHead SHA: Security screen: PASS Notes (non-blocking): the sole prior comment ( Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
|
Cross-leg sequencing flag from the schema-versioning-removal chain ( The
Proposed sequencing (no action needed from me if you prefer another order): land the C7 sdk adoption first (it bumps Flagging so we don't both bump |
Correction: the C7 sdk adoption already LANDED — no sequencing wait is neededRe-verified live against sdk
So the collision you flagged does not exist: sdk Suggested: proceed with the schema-versioning-removal sdk leg directly (bump the (No action needed from me; this only removes a wait that would have stalled the sdk leg.) Assisted-by: OpenCode ollama-cloud/deepseek-v4.1-flash (analysed on a live system) |
Summary
Delete the arbitrary config/schema version stamp and its equality gate from the
speccontract module — the producer leg of the schema-versioning removal chain (spec→sdk→plugin-migrate→plugin-box/plugin-fleet→charly).Why. Compatibility between charly core and a plugin is already enforced by unifying the authored document against the CLOSED CUE schema — an unknown or removed field is a hard
field not allowederror — plus the plugin-provided CUE source (PluginSchema{CueSource, InputDefs}) spliced onto the host base. A denormalised CalVer copied into every authored file added a second source of truth that could only ever disagree with those two, and the equality gate (GateSchemaVersiondemands the file stamp == the binary's embedded HEAD) produced a pure re-stamp wave on every schema change. Measured: 376 per-repocandyCI gates pinned to old charly tags are RED org-wide withconfig schema … is newer than this charly supports, for zero shape reason. Only the CalVer git tags (binary build identity, candy/ref pinning) remain real versioning.What changed — 1 commit (squash-merged), 23 files, +112/−421
schema/version.cue(#SchemaVersion/#SchemaFloor) + generatedspec/version_gen.go— DELETED.version:on#NodeDoc,#Box,#Candy,#Deploy,#PackagingConfig;_common.cue's#CalVerregex.schema_version:on#DeployRecordand#CandyRecord,#CandyRecord.version(version?: string @go(Version)), and theLedgerSchemaVersionconstant (spec/ledger_records.go, whose only content was that constant).calver.LatestSchemaCalVer/SchemaFloorCalVer/MustCalVer+ the HEAD/floor parsed vars.internal/schemagen -mode=version; thecharly.ymlcue-genstep;TestGenReproducible'sversion_gen.goarm.refsgit-cache writer'sversion:stamp + its renamed test (TestGitClientFreshFileHasCacheSection).versionremoved from#NodeDoc's reserved-directive exclusion regex → a leftoverversion:is a closed-CUE hard error naming it;charly migrate(raw-YAML) strips it.#ResolvedBox.version,#ResolvedBoxView.version,#ResolvedProject.version,spec.CandyCandidate.Version— DELETED (effective_versionderives from source candy git tags).#PackagingConfig+#Packaging.configDELETED — the operator directed that the package stop shipping/etc/charly/charly.yml("fully drop it from the package config"), while the loader STILL checks that path as a system config location (loaderkit.DefaultSystemConfigPathunchanged). RCA: the shipped system project existed ONLY to give the systemd MCP server a local project instead of a network fetch; with the file dropped, the path is a read location with no package artifact, and#Packaging.configis a dead wire field (nothing declares it any more —charly/packaging/charly.yml'sconfig:block and itsTestPackagingConfigDeclaredare removed in the CHARLY leg (a different repo — NOT in this 23-file spec diff)).ExtractMetadata(container/box_metadata_coneb.go) now usesai.opencharly.box, notai.opencharly.version, as the charly-vs-non-charly boundary — the removal makes a local-only image carry an EMPTYEffectiveVersion, so a version-keyed boundary misclassified it as a plain base (found live:charly check boxprinted "No plan steps defined"; the bed'sconfigstep failed).schema/instrument.cue+spec/charly_methods.gostale#CalVer/#SchemaVersioncomments swept;cue_types_gen.go/vocab_gen.goregenerated.#Distro.version/#Marketplace.version(semver metadata) and runtime wireversion:fields (image/package versions) are untouched — not schema stamps.Consumer liveness (checked against consumers'
origin/main)Complete sweep — every form of the removed symbols, including the UNQUALIFIED in-package calls (e.g.
kit's ownLatestSchemaVersion(), which akit\.-prefixed pattern misses):Those are exactly the
sdk/charly/plugin-migratelegs of this chain. Consumers pinspecby tag, so this is inert until each bumps itsrequire; rollback is a revert.The
spec.CandyCandidate.Version/PickCandyVersionremoval is covered by the same sweep extended to that identifier:—
sdk/loaderkit(the arbiter + scanner) andcharly/charly/layers.go, all in this chain's legs.How tested
Producer gate (CUE codegen + Go build/vet/test), executed live:
The
refsgit-cache writer's stamp removal is pinned by a test that FAILS without the change —TestGitClientFreshFileHasCacheSectionnow asserts a freshly created per-host cache file contains noversion:key (strings.Contains(data, "version:")→ fatal). It was previously name-only and passed either way.R10 end-to-end gate — RUN on the assembled tree (
spec+sdk+plugin-migrate+plugin-box+plugin-fleet+charly, built locally withreplaces). Adisposable: truepod bed that exercises the changed schema-load path (a self-contained project:discover:+ a local candy + a candy-image + a pod bed) ran the fullcharly check runsequence:charly box validateon a real project (plugin-spice, version stripped bycharly migrate) also passes:OK — checked 7 distros, 7 builders; 0 warnings, 0 errors. Theupdate+check-live-rebuildsteps are the fresh-rebuild R10 acceptance leg.Assembled-tree provenance (this checkout,
/home/atrawog/Sync/Atrapub/mo/opencoder/opencharly; the other session's/no/opencodecheckout could not see it): the bed project is/tmp/opencode/wave/bedproj, its run summary is.check/check-bedproj/2026.270.0719/summary.yml(ok: true, 14/14), and the per-step logs are beside it. The assembled tree builds because every consumer leg is locally replaced —spec(branch),sdk,plugin-migrate,plugin-box,plugin-fleet— plus the externalplugin-deploy-podviaCHARLY_REPO_OVERRIDE; replacing onlyspec(as the other session did) cannot build, which is expected for an unmerged chain and is not evidence the change is untestable.Rulebook compliance
/charly-internals:go,/charly-internals:plugin,/charly-check:check,/charly-internals:cutover-policy,/charly-internals:strict-policy,/charly-internals:root-cause-analyzer,/charly-internals:git-workflow. The change follows the CUE-schema-change recipe (CUE is the single source; generated Go regenerated viacharly task cue-gen, never hand-edited).candygates to the equality gate (measuredconfig schema … newer than this charly supports), and RCA'd the empty-EffectiveVersionimage-misclassification found live on the bed before fixing it.ExtractMetadataboundary fix are here, not deferred.#CalVerregex died with its last user.version.cue,version_gen.go,ledger_records.go,writeVersion, thecue-genstep, the reserved-directive regex, therefstest rename, and every doc comment naming#SchemaVersion/LatestSchemaCalVer/#CalVer.git statusbefore staging; PR-only landing, no force-push.ai.opencharly.boxis present andExtractMetadatanow recognizes it (the bed'scheck-image/check boxandconfigsteps pass); the label change isai.opencharly.box(boundary) withai.opencharly.versionnow legitimately empty for local-only images.go build -ldflags "-X main.BuildCalVer=…") andcharly versionprinted the injected stamp, so the binary under test matched the source under test.steps=14).Cross-leg coordination
A cross-reference from the sdk#301 / C6 unified-deploy-identity cutover asks that a versionless
charly migrateentry re-keying orphaned legacyvm:<dashed>per-host entries land with the plugin-migrate leg of this chain (no#SchemaVersionbump). Acknowledged and scoped there; the exact identity-recovery rule (the legacy key is lossy) is confirmed in the PR thread.Change classification
charly task cue-genreproducibility +go build/go vet/gofmt+go test ./...+ the assembled-tree disposable bed.analysed on a live system— the producer gate passed and the changed schema-load path ran live on a locally-assembled tree (this session'sreplacedspec+sdk+plugin-migrate+plugin-box+plugin-fleet+ aCHARLY_REPO_OVERRIDEdplugin-deploy-pod), producing the fresh-rebuild bedPASS (steps=14)with on-disk provenance (/tmp/opencode/wave/bedproj/.check/check-bedproj/2026.270.0719/summary.yml,ok: true, 14/14).analysed on a live systemfor this producer leg while the consumer chain (sdk→plugin-migrate→plugin-box/plugin-fleet→charly+ corpus) lands as the B2 follow-through. The consumer legs are authored and locally green in this session's workspace; the assembled-tree fresh-rebuild bed (steps=14) is the end-to-end proof.Assisted-by: opencode Ollama Cloud deepseek-v4.1-flash (analysed on a live system)