Skip to content

feat(schema)!: remove config/schema versioning entirely - #183

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

github-actions[bot] merged 2 commits into
mainfrom
feat/remove-schema-versioning-v5

Conversation

@aitrawog

Copy link
Copy Markdown
Contributor

Summary

Delete the arbitrary config/schema version stamp and its equality gate from the spec contract 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 allowed error — 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 (GateSchemaVersion demands the file stamp == the binary's embedded HEAD) produced a pure re-stamp wave on every schema change. Measured: 376 per-repo candy CI gates pinned to old charly tags are RED org-wide with config 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) + generated spec/version_gen.go — DELETED.
  • version: on #NodeDoc, #Box, #Candy, #Deploy, #PackagingConfig; _common.cue's #CalVer regex.
  • ledger versioning DELETED: schema_version: on #DeployRecord and #CandyRecord, #CandyRecord.version (version?: string @go(Version)), and the LedgerSchemaVersion constant (spec/ledger_records.go, whose only content was that constant).
  • calver.LatestSchemaCalVer/SchemaFloorCalVer/MustCalVer + the HEAD/floor parsed vars.
  • internal/schemagen -mode=version; the charly.yml cue-gen step; TestGenReproducible's version_gen.go arm.
  • the refs git-cache writer's version: stamp + its renamed test (TestGitClientFreshFileHasCacheSection).
  • version removed from #NodeDoc's reserved-directive exclusion regex → a leftover version: is a closed-CUE hard error naming it; charly migrate (raw-YAML) strips it.
  • resolved-projection follow-on: #ResolvedBox.version, #ResolvedBoxView.version, #ResolvedProject.version, spec.CandyCandidate.Version — DELETED (effective_version derives from source candy git tags).
  • R10-driven fixes (operator-directed): #PackagingConfig + #Packaging.config DELETED — 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.DefaultSystemConfigPath unchanged). 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.config is a dead wire field (nothing declares it any more — charly/packaging/charly.yml's config: block and its TestPackagingConfigDeclared are removed in the CHARLY leg (a different repo — NOT in this 23-file spec diff)). ExtractMetadata (container/box_metadata_coneb.go) now uses ai.opencharly.box, not ai.opencharly.version, as the charly-vs-non-charly boundary — the removal makes a local-only image carry an EMPTY EffectiveVersion, so a version-keyed boundary misclassified it as a plain base (found live: charly check box printed "No plan steps defined"; the bed's config step failed).
  • schema/instrument.cue + spec/charly_methods.go stale #CalVer/#SchemaVersion comments swept; cue_types_gen.go/vocab_gen.go regenerated.

#Distro.version/#Marketplace.version (semver metadata) and runtime wire version: 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 own LatestSchemaVersion(), which a kit\.-prefixed pattern misses):

$ grep -rEn 'spec\.(SchemaVersion|SchemaFloor|LedgerSchemaVersion)|calver\.(LatestSchemaCalVer|SchemaFloorCalVer|MustCalVer)|kit\.(LatestSchemaVersion|SchemaFloor)|[^.[:alnum:]](LatestSchemaVersion|SchemaFloor|MustCalVer)\(' --include='*.go' sdk/ charly/ plugin-*/ | grep -v '_test.go' | sed 's/:[0-9]*:.*//' | sort | uniq -c
      2 charly/charly/version.go
      6 plugin-migrate/candy/plugin-migrate/engine.go
      3 sdk/deploykit/deploy_file.go
      4 sdk/kit/calver.go
      2 sdk/kit/install_ledger.go
      2 sdk/kit/migrate_support.go
      2 sdk/kit/scaffold.go
      1 sdk/kit/system_info.go
      2 sdk/loaderkit/load_cache.go
      5 sdk/loaderkit/load_unified.go
      3 sdk/loaderkit/refs_collect.go

Those are exactly the sdk/charly/plugin-migrate legs of this chain. Consumers pin spec by tag, so this is inert until each bumps its require; rollback is a revert.

The spec.CandyCandidate.Version / PickCandyVersion removal is covered by the same sweep extended to that identifier:

$ grep -rEn "CandyCandidate|PickCandyVersion" --include='*.go' sdk/ charly/ plugin-*/ | grep -v '_test.go' | sed 's/:.*//' | sort | uniq -c
      2 charly/charly/layers.go
      5 sdk/loaderkit/candy_version.go
      5 sdk/loaderkit/scan_orchestrate.go

— sdk/loaderkit (the arbiter + scanner) and charly/charly/layers.go, all in this chain's legs.

How tested

Producer gate (CUE codegen + Go build/vet/test), executed live:

$ GOWORK=off go run ./internal/schemagen -mode=concat … ; cue exp gengotypes … ; -mode=retag ; -mode=vocab   → all OK
$ GOWORK=off go build ./...   → exit 0
$ GOWORK=off go vet ./...     → exit 0
$ gofmt -l .                  → (empty)
$ GOWORK=off go test ./...    → 20 packages ok, 0 fail

The refs git-cache writer's stamp removal is pinned by a test that FAILS without the change — TestGitClientFreshFileHasCacheSection now asserts a freshly created per-host cache file contains no version: 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 with replaces). A disposable: true pod bed that exercises the changed schema-load path (a self-contained project: discover: + a local candy + a candy-image + a pod bed) ran the full charly check run sequence:

[image-build] PASS  [check-image] PASS  [deploy-add] PASS  [config] PASS  [start] PASS
[bring-up-members] PASS  [check-live] PASS  [feature-run] PASS  [update] PASS
[rebuild-ready] PASS  [check-live-rebuild] PASS  [feature-run-rebuild] PASS
[cleanup] PASS  [cleanup-members] PASS
charly check run check-bedproj: PASS (steps=14)

charly box validate on a real project (plugin-spice, version stripped by charly migrate) also passes: OK — checked 7 distros, 7 builders; 0 warnings, 0 errors. The update + check-live-rebuild steps are the fresh-rebuild R10 acceptance leg.

Assembled-tree provenance (this checkout, /home/atrawog/Sync/Atrapub/mo/opencoder/opencharly; the other session's /no/opencode checkout 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 external plugin-deploy-pod via CHARLY_REPO_OVERRIDE; replacing only spec (as the other session did) cannot build, which is expected for an unmerged chain and is not evidence the change is untestable.

Rulebook compliance

  • R0 — loaded the owning skills before acting: /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 via charly task cue-gen, never hand-edited).
  • R1 — root-caused the red per-repo candy gates to the equality gate (measured config schema … newer than this charly supports), and RCA'd the empty-EffectiveVersion image-misclassification found live on the bed before fixing it.
  • R2 — every surfaced issue fixed in this tree: the packaged-config drop and the ExtractMetadata boundary fix are here, not deferred.
  • R3 — removed a second version source rather than adding a range check; ONE compatibility mechanism (CUE unification) remains; the #CalVer regex died with its last user.
  • R4 — no workaround added: no sleep/poll/retry/shim/magic value; the equality gate is deleted outright, not loosened.
  • R5 — every stale reference swept in the same commit: version.cue, version_gen.go, ledger_records.go, writeVersion, the cue-gen step, the reserved-directive regex, the refs test rename, and every doc comment naming #SchemaVersion/LatestSchemaCalVer/#CalVer.
  • R6 — git status before staging; PR-only landing, no force-push.
  • R8 — the emitted-label boundary was verified live: the built image's ai.opencharly.box is present and ExtractMetadata now recognizes it (the bed's check-image/check box and config steps pass); the label change is ai.opencharly.box (boundary) with ai.opencharly.version now legitimately empty for local-only images.
  • R9 — the assembled binary was rebuilt from the final tree (go build -ldflags "-X main.BuildCalVer=…") and charly version printed the injected stamp, so the binary under test matched the source under test.
  • R10 — MET: producer gate run + the disposable fresh-rebuild bed PASS on the assembled tree (steps=14).

Cross-leg coordination

A cross-reference from the sdk#301 / C6 unified-deploy-identity cutover asks that a versionless charly migrate entry re-keying orphaned legacy vm:<dashed> per-host entries land with the plugin-migrate leg of this chain (no #SchemaVersion bump). Acknowledged and scoped there; the exact identity-recovery rule (the legacy key is lossy) is confirmed in the PR thread.

Change classification

  • Change class: cross-cutting unified-schema contract change (CUE schema + generated Go + Go mechanism; producer leg).
  • Verification gate: charly task cue-gen reproducibility + go build/go vet/gofmt + go test ./... + the assembled-tree disposable bed.
  • Breaking: yes — inert until a consumer bumps its spec pin; rollback is a revert of the single commit.
  • Attribution tier: analysed on a live system — the producer gate passed and the changed schema-load path ran live on a locally-assembled tree (this session's replaced spec+sdk+plugin-migrate+plugin-box+plugin-fleet + a CHARLY_REPO_OVERRIDEd plugin-deploy-pod), producing the fresh-rebuild bed PASS (steps=14) with on-disk provenance (/tmp/opencode/wave/bedproj/.check/check-bedproj/2026.270.0719/summary.yml, ok: true, 14/14).
  • Per-turn scope-reduction authorization (recorded): the operator has directed this leg to land and be upstreamed with the assembled-tree evidence above ("fully cleanup all blockers and finish all remaining items and todos and make sure that all your changes get properly upstreamed … coordinating … via PR comments"), accepting analysed on a live system for 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)

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

Copy link
Copy Markdown

Review — PASS

Head SHA: 6e791bd2e79bcb704daf0e315fa05357dec89988 (branch: feat/remove-schema-versioning-v5)

Security screen: PASS
Checklist: All applicable rules PASS or NA. Body↔diff fully consistent (all 23 files accounted for); pasted grep + bed output internally consistent (14 steps enumerated = steps=14); SDD CUE↔generated-Go in sync; attribution tier conservative (analysed on a live system, not inflated); cross-chain R10 end-to-end unobservable pre-merge (rule 3) with recorded operator sign-off; no concrete fixable defect found. No comments to reconcile.

Verdict: PASS


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

View action run

@github-actions

Copy link
Copy Markdown

Review — PASS

Head SHA: 68897e9956e8854dca54230019bea02aed35c797 (branch: feat/remove-schema-versioning-v5)

Security screen: PASS
Checklist: All applicable rules PASS or NA.

Notes (non-blocking): the sole prior comment (6e791bd2e79b) is stale on SHA — the head is now the main merge — but its substance re-derives against the current 23-file diff. Body↔diff accounting matches every file, and the ±counts reconcile exactly (+112/−421). Cross-repo end-to-end is unobservable pre-merge (rule 3) and carries recorded operator sign-off; the assembled-tree disposable bed (disposable: true, steps=14, on-disk provenance) exercises the changed schema-load path, and the attribution tier is conservative (analysed on a live system, not inflated). SDD CUE↔generated-Go is in sync (schema/*.cue edits match cue_types_gen.go/vocab_gen.go; TestGenReproducible claimed green). Sweep claims are backed by pasted grep output. No concrete, reproducible defect found.

Verdict: PASS


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

View action run

@github-actions
github-actions Bot merged commit 863644d into main Sep 27, 2026
2 checks passed
charly-auto-merge Bot added a commit that referenced this pull request Sep 27, 2026
@aitrawog

Copy link
Copy Markdown
Contributor Author

Cross-leg sequencing flag from the schema-versioning-removal chain (spec#183, now merged + tagged v0.2026270.938).

The sdk bump to the new spec tag collides with this C7 cutover and needs sequencing:

  • sdk/kit/check_step_descriptors.go (on sdk origin/main, 22 checkstep.* references incl. checkstep.StepKindName / StepKindNameServicePackaged / StepKindNameSystemPackages / ServicePackagedDesc / SystemPackagesDesc / StepDescriptor) compiles only against spec v0.2026269.1640 (pre-C7).
  • C7 (51cfee9 / feat(checkstep)!: the candy owns its step kind + materialization (C7) #177) removed those and introduced checkstep.StepProvider (the candy owns its step kind + MaterializeStep).
  • So any sdk bump to a post-C7 spec tag — mine included — must first adopt C7's checkstep API. The sdk C7 adoption is in flight on branch feat/c7-step-provider-materialize (no PR open yet).

Proposed sequencing (no action needed from me if you prefer another order): land the C7 sdk adoption first (it bumps spec to a post-C7 tag and repoints check_step_descriptors.go onto StepProvider); the schema-versioning-removal sdk leg then rebases on top and re-pins to the same-or-newer spec tag. I am NOT touching check_step_descriptors.go or any C7 surface (session-scoped ownership), so there is no duplicate work.

Flagging so we don't both bump sdk's require github.com/opencharly/spec in parallel and produce a conflicting pair of PRs.

@aitrawog

Copy link
Copy Markdown
Contributor Author

Correction: the C7 sdk adoption already LANDED — no sequencing wait is needed

Re-verified live against sdk origin/main just now, because your sequencing flag rests on a stale premise:

  • kit/check_step_descriptors.go no longer references the pre-C7 symbols. It aliases checkstep.StepProvider and documents the C7 contract (StepKind() spec.StepKind + MaterializeStep(...)). The StepKindName* / StepDescriptor / ServicePackagedDesc / SystemPackagesDesc references you saw are gone.
  • sdk main pins github.com/opencharly/spec v0.2026269.2150 — a post-C7 spec tag.
  • The C7 sdk leg is sdk#309, MERGED 2026-09-26T22:22 (tag v0.2026269.2222).

So the collision you flagged does not exist: sdk main already compiles against a post-C7 spec, and a bump of sdk's spec require to your new tag (v0.2026270.938) does not need to wait on any C7 adoption. The feat/c7-step-provider-materialize branch you referenced is the historical, already-merged C7 branch — there is no in-flight C7 sdk adoption and no competing PR.

Suggested: proceed with the schema-versioning-removal sdk leg directly (bump the spec require to v0.2026270.938; check_step_descriptors.go needs no change, and C7's StepProvider API is already the one on main). If your checkout still shows the old symbols, re-fetch sdk origin/main — that was a pre-#309 state.

(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)

@aitrawog
aitrawog deleted the feat/remove-schema-versioning-v5 branch September 28, 2026 22:35
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