Skip to content

feat(schema): add the kindcluster substrate kind - #162

Merged
github-actions[bot] merged 4 commits into
mainfrom
feat/kind
Sep 25, 2026
Merged

github-actions[bot] merged 4 commits into
mainfrom
feat/kind

Conversation

@aitrawog

@aitrawog aitrawog commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary of changes

Add kindcluster — a local Kubernetes-in-Docker cluster substrate provisioned by
the upstream kind tool (kubernetes-sigs/kind v0.33.0) — to the spec schema,
completing the SDD foundation the plugin-substrate / plugin-kube / charly-core /
layer-kind consumer legs build against.

The word is kindcluster, not kind: the bare word collides with this
schema's own source: {kind: …} discriminator and with kind's own
kind: Cluster config field.

Every file in the diff:

File Change
schema/kindcluster.cue (new) #Kindcluster, #KindclusterNode, #KindclusterPortMapping
schema/node.cue #ResourceKind += kindcluster; #KindclusterValue; "5 substrates" comment sweep
schema/deploy.cue #Deploy.target += kindcluster; NEW #KindclusterDeployVenue
schema/status.cue #SubstrateKind += kindcluster; comment sweeps
schema/substrate_template.cue #ResolvedKindcluster + resolve input/reply + union arm
schema/resolvedproject.cue #ProjectTemplates += the kindcluster map
deploy/deploy_ops.go hand-written Go comment: the canonical target-list wording (pod|vm|kubernetes|local|android → …|kindcluster)
spec/status_types.go hand-written Go: SubstrateKindcluster const
spec/loadmodel.go hand-written Go: Kindcluster() accessor; the projection's arm; ByKind("kindcluster")
spec/{cue_types_gen.go,vocab_gen.go} generated (charly task cue-gen)
schema/kindcluster_test.go, spec/loadmodel_templates_multialias_test.go tests

Schema surface

  • #Kindcluster:
    • engine?: #EngineName — the container engine kind provisions node containers
      with. It maps 1:1 to kind's KIND_EXPERIMENTAL_PROVIDER
      (podman/docker/nerdctl), so engine selection rides the authored
      #EngineName vocabulary with no separate selector. This is what makes the
      docker/podman/nerdctl integration free.
    • node_image?: string — the digest-pinned kindest/node:vX@sha256:….
    • nodes?: [...#KindclusterNode] — topology (role, per-node image,
      extra_port_mappings).
    • kubeconfig_context, default_namespace, admission_policy, and the SAME
      cluster-policy sub-blocks the kubernetes: template uses
      (storage/ingress/image_default/pod_default/defaults) — R3, one
      policy surface for both cluster kinds.
  • #KindclusterValue: (#Kindcluster | #DeployValue) — the host-side value gate
    for template OR deploy shape.

RDD (why this shape)

All high-risk unknowns were proven live on this host before the schema was
written: kind works on docker (Ready in 16 s), rootless podman (13 s), and
rootless nerdctl (16 s, after containerd-rootless-setuptool.sh install); the
engine word is exactly KIND_EXPERIMENTAL_PROVIDER; kube: addons is k3s-only
(kind ships kindnet, no Traefik/ServiceLB). Full evidence in the umbrella
plan/kind-integration.md.

How R10-tested — exact gate, commands, and pasted output

Gate for this change class (contract module): charly task cue-gen
reproducibility + go build ./... + go test ./... + the new tests that fail
without the change.

$ ./bin/charly task cue-gen
task bootstrap-cue: 1 step(s), 0 failed
task wire-gen: 1 step(s), 0 failed
task cue-gen: 2 step(s), 0 failed
  [pass] run — gengotypes + schemagen the generated Go
  [pass] check — regen is reproducible — TestGenReproducible passes on the committed tree

$ GOWORK=off go build ./...      # clean, exit 0

$ GOWORK=off go test ./...       # every package ok, 0 failures

The changed path executes live in the new tests:

$ GOWORK=off go test ./schema/ -run Kindcluster -count=1 -v
--- PASS: TestKindclusterAcceptsPolicyTemplate
--- PASS: TestKindclusterValueAcceptsDeployShape
--- PASS: TestKindclusterRejectsUnknownKey
--- PASS: TestKindclusterRejectsUnknownEngine
--- PASS: TestKindclusterAcceptsKubernetesPolicyBlocks
ok  	github.com/opencharly/spec/schema

$ GOWORK=off go test ./spec/ -run ProjectTemplates -count=1 -v
--- PASS: TestProjectTemplates_MultiAliasSharedNamespace
--- PASS: TestProjectTemplates_SelfCycleTerminates
--- PASS: TestProjectTemplates_KindclusterFolds
ok  	github.com/opencharly/spec/spec

Generated artifacts verified: ResourceKinds += kindcluster,
KindValueDefs["kindcluster"] = "#KindclusterValue", and the typed Kindcluster
/ KindclusterNode / KindclusterDeployVenue / ResolvedKindcluster /
KindclusterResolveInput / KindclusterResolveReply structs are present.

R5 stale-reference sweep — executed evidence

$ grep -rn "5 substrate\|five substrate\|pod/vm/kubernetes/local/android" schema/ spec/*.go deploy/*.go | grep -v cue_types_gen.go | grep -v _test
schema/status.cue:101:// pod/vm/kubernetes/local/android/kindcluster). The host passes the scalar inputs a sdk-only candy cannot derive:
schema/version.cue:71:// pod/vm/kubernetes/local/android remain; #105 removed the schema arm and

Both survivors are accounted for: status.cue:101 is now the updated
…/android/kindcluster list; version.cue:71 is a HISTORICAL sentence inside the
#SchemaVersion changelog comment describing the PAST group-removal cutover
("pod/vm/kubernetes/local/android remain" at that cutover, before kindcluster
existed) — accurate as history, not a live claim. No live 5 substrates claim
survives.

B18 fix — idiomatic generated field names

$ grep -c "Node_image\|Kubeconfig_context" spec/cue_types_gen.go   # before the fix: 2
0
$ grep -c "NodeImage\|KubeconfigContext" spec/cue_types_gen.go
8

Rulebook compliance

  • SDD — authored + wire shapes defined in CUE first; Go generated by
    charly task cue-gen; regeneration reproducible.
  • R3 — the cluster-policy sub-blocks reuse the kubernetes: template's own
    #Kubernetes* defs; the resolve/deploy-venue wire types mirror the kubernetes
    arm rather than inventing a parallel shape.
  • R5 — stale "5 substrates" claims swept; the executed grep + its two
    accounted-for survivors are pasted above.
  • R6 — work in a session worktree; no direct push.
  • No schema-version bump: additive vocabulary growth (a new enum member + new
    defs), matching this repo's precedent (feat(spec): per-invocation RunEnv — retire bed os.Setenv isolation #159, feat(schema): add CliRequest.env + ProvidedCapability.interactive #154) — no cutover, no migration
    entry.

Change classification

  • Change class: contract-module schema + generated Go (additive), plus
    hand-written Go in three places — deploy/deploy_ops.go (a comment update to
    the canonical target list), spec/status_types.go (the SubstrateKindcluster
    const, mirroring the sibling consts), and spec/loadmodel.go (the
    Kindcluster() accessor + projection arm + ByKind case, mirroring the
    kubernetes arm).
  • Verification gate: charly task cue-gen (reproducible) + go build ./... +
    go test ./... + the new schema and loadmodel tests.
  • Attribution tier: fully tested and validated — every applicable standard
    for a contract module passed on the final tree, and the changed paths (the new
    CUE defs, the projection arm) executed live under the new tests.

Attribution evidence (A3)

The authoring runtime registers this model as provider ollama-cloud, model id
deepseek-v4.1-flash, canonical name DeepSeek V4.1 Flash (queried from the
runtime's own model registry):

provider: ollama-cloud   id: ollama-cloud/deepseek-v4.1-flash   name: DeepSeek V4.1 Flash   status: active

The harness is OpenCode. The footer footer therefore names the exact
harness/provider/model string.

Assisted-by: OpenCode DeepSeek V4.1 Flash (fully tested and validated)

Add `kindcluster` — a local Kubernetes-in-Docker cluster substrate provisioned
by the upstream `kind` tool (kubernetes-sigs/kind) — to the spec schema,
completing the CUE foundation the plugin/candy consumer legs build on.

The word is `kindcluster`, not `kind`: the bare word collides with this schema's
own `source: {kind: …}` discriminator and with kind's own `kind: Cluster` config
field.

Schema (spec/schema/):
- NEW `kindcluster.cue` — `#Kindcluster` (engine: #EngineName, node_image
  digest pin, nodes topology, kubeconfig_context, default_namespace,
  admission_policy, and the SAME cluster-policy sub-blocks the `kubernetes:`
  template uses — storage/ingress/image_default/pod_default/defaults — plus
  `#KindclusterNode` / `#KindclusterPortMapping`).
- `#KindclusterValue: (#Kindcluster | #DeployValue)` in node.cue — the host-side
  value gate for template OR deploy shape.
- `#ResourceKind` += kindcluster (nesting); `#Deploy.target` += kindcluster
  (the loader-DERIVED target enum); `#SubstrateKind` += kindcluster.
- `substrate_template.cue` — `#ResolvedKindcluster` + the resolve input/reply,
  added to the #SubstrateTemplateResolveRequest discriminated union (mirrors the
  kubernetes arm).
- `deploy.cue` — `#KindclusterDeployVenue` (cluster_name, provider, node_image,
  egress-validated cluster_config, kube_context, optional workload overlay).
- `spec/status_types.go` — SubstrateKindcluster const.

The `engine` field maps 1:1 to kind's KIND_EXPERIMENTAL_PROVIDER
(podman/docker/nerdctl), so the authored #EngineName vocabulary drives engine
selection with no separate selector — the whole docker/podman/nerdctl
integration rides the existing engine word.

Generated: cue_types_gen.go / vocab_gen.go via `charly task cue-gen`
(ResourceKinds + KindValueDefs + the typed defs), reproducible.

Coverage: schema/kindcluster_test.go — the policy template, the deploy shape via
#KindclusterValue, unknown-key rejection, unknown-engine rejection, and the
shared kubernetes policy blocks.

Additive (a new enum member + new defs), so no #SchemaVersion bump and no
migration entry — matching the spec repo's precedent for additive vocabulary
growth.

Part of the kind-integration cutover; the plugin-substrate / plugin-kube /
charly-core / layer-kind consumer legs land against this tag.
@github-actions

Copy link
Copy Markdown

Review — BLOCK

Head SHA: 0d74820d590a1b38003f8e9b9ccee8c0847a4e2d (branch: feat/kind)

Change class: contract-module schema + generated Go (additive), plus one hand-written Go comment change the body does not reflect.

Blocks

  1. A1 — the body does not account for deploy/deploy_ops.go. The diff changes deploy/deploy_ops.go (hand-written Go; comment update to the canonical target list, @@ -73,8 +73,8 @@, pod|vm|kubernetes|local|android → …|kindcluster), but the Summary of changes lists only the schema files + generated artifacts, and Change classification states the class as "contract-module schema + generated Go" — which excludes a hand-written Go source file. A1 requires the Summary to account for every file/behavior in the diff, and a diff item absent from the body's accounting is a defect (T3 scope/description↔code mismatch compounds this). Fix: add deploy/deploy_ops.go to the Summary and correct the stated change class to include the hand-written Go comment change (and its gate).

  2. B14(d) / R5 — sweep claim with no pasted evidence. The body asserts "R5 — stale '5 substrates' claims swept in the same commit," but supplies no actually-executed grep command or its output. B14(d) requires real command output for any sweep claim; "swept" is an exhaustiveness claim that the visible comment edits alone cannot prove (no evidence no 5 substrates/stale canonical-list occurrences survive elsewhere). Fix: paste the real grep (or equivalent) command and its full output demonstrating zero remaining stale occurrences.

  3. A3 — attribution model name is uncorroborated. The footer claims *Assisted-by: OpenCode DeepSeek V4.1 Flash (fully tested and validated)*. The body contains no authoring-runtime evidence corroborating the harness/provider/model string, and A3 makes a guessed or config-read name a defect. Fix: correct the <Provider Full Model Name> slot or supply the evidence that establishes it.

Verdict: BLOCK


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

View action run

The kindcluster substrate-template kind must fold into the resolved-project
envelope like every other standalone-substrate kind, so the status collector and
the deploy preresolver can resolve a `from: <kindcluster>` reference.

- `#ProjectTemplates` (schema/resolvedproject.cue) += the `kindcluster` map, and
  the CUE-generated `ProjectTemplates.Kindcluster` field follows.
- `spec/loadmodel.go` — the `(uf *UnifiedFile).Kindcluster()` derived accessor,
  the `ProjectTemplates` projection's new arm (null-guard + fillNamespacedTemplates
  copy), and `ByKind("kindcluster")`.
- `spec/loadmodel_templates_multialias_test.go` — TestProjectTemplates_KindclusterFolds.

Without this the kindcluster template bodies never reach the envelope and
`from:`-referenced kindcluster deploys fail to resolve.

Additive, no #SchemaVersion bump. Part of the kind-integration cutover.
@github-actions

Copy link
Copy Markdown

Review — BLOCK

Head SHA: 09e8d294fe9645d8d3f38a3a59a35ec221acf8d3 (branch: feat/kind)

Change class: contract-module schema + generated Go (additive) — plus one hand-written Go comment edit the body does not account for.

Placement (B16): CORRECT — kindcluster is a contract/vocabulary addition in the spec schema module, consistent with the sibling substrate kinds (pod/vm/kubernetes/local/android); the capability itself stays in the consumer plugin. No core↔sdk re-coupling, no alias growth.

Blocks

  1. A1 — the body does not account for deploy/deploy_ops.go. deploy/deploy_ops.go:76 (comment) is changed (pod|vm|kubernetes|local|android → …|kindcluster), but the Summary of changes and the Follow-up commit section list only the schema / generated / spec files, and Change classification states the class as "contract-module schema + generated Go", which excludes a hand-written Go source file. A1 requires the Summary to account for every file in the diff. Fix: add deploy/deploy_ops.go to the body and correct the stated change class.

  2. B14(d) / B10 (R5) — sweep claim with no executed evidence. The body asserts "R5 — stale '5 substrates' claims swept in the same commit" but pastes no grep command or output. B14(d) requires actually-executed command output for any sweep claim; the visible comment edits cannot prove no stale occurrences survive elsewhere. Fix: paste the real grep -rn '5 substrates' (or equivalent) and its full output.

  3. A3 — attribution name uncorroborated. The footer *Assisted-by: OpenCode DeepSeek V4.1 Flash (fully tested and validated)* is not corroborated by any authoring-runtime evidence in the body; A3 makes a guessed / config-read <Provider Full Model Name> a defect. Fix: supply the evidence establishing the harness/provider/model, or correct the name.

  4. B18 — non-idiomatic generated field names. spec/cue_types_gen.go Kindcluster emits Node_image and Kubeconfig_context (snake_case), because schema/kindcluster.cue node_image? / kubeconfig_context? lack the @go(...) overrides every sibling field uses (cf. #KindclusterDeployVenue node_image!: … @go(NodeImage), and ResolvedKubernetes.KubeconfigContext). Fix: add @go(NodeImage) / @go(KubeconfigContext) in schema/kindcluster.cue and re-run charly task cue-gen.

(Minor, non-blocking: B15 — two non-changelog commits; the intended squash collapses them.)

Verdict: BLOCK


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

View action run

The validator (B18) caught that `schema/kindcluster.cue`'s `node_image` and
`kubeconfig_context` fields lacked the `@go(...)` overrides every sibling field
uses, so gengotypes emitted non-idiomatic snake_case Go field names
(`Node_image`, `Kubeconfig_context`). Add `@go(NodeImage)` /
`@go(KubeconfigContext)` (and the remaining explicit tags for the def's other
fields) and re-run `charly task cue-gen`.

Verified: `grep -c 'Node_image\|Kubeconfig_context' spec/cue_types_gen.go` is now
0; `grep -c 'NodeImage\|KubeconfigContext'` is 8. `schema/` + `spec/` tests green.
@github-actions

Copy link
Copy Markdown

Review — BLOCK

Head SHA: a383d38d12a0a58a5c1a3761224a41baedbfba1d (branch: feat/kind)

Change class: contract-module schema (CUE) + generated Go (spec/cue_types_gen.go, spec/vocab_gen.go) + hand-written Go support (spec/loadmodel.go, spec/status_types.go) + one hand-written Go comment (deploy/deploy_ops.go) + a new schema test.

Placement (B16): CORRECT — kindcluster is a contract/vocabulary addition in the spec module, sibling to pod/vm/kubernetes/local/android; the capability stays in the consumer plugin (candy/plugin-kube). No core↔sdk re-coupling, no alias growth, no charly/ kit import.

Blocks

  1. A1 — the body does not account for deploy/deploy_ops.go. The diff changes deploy/deploy_ops.go:76 (comment: pod|vm|kubernetes|local|android → …|kindcluster), but neither the Summary of changes nor the Change classification mentions it, and the stated class ("contract-module schema + generated Go (additive)") excludes a hand-written Go source file. A1 requires the Summary to account for every file/behavior in the diff. Fix: add deploy/deploy_ops.go to the Summary and correct the stated change class (the class also includes hand-written spec/loadmodel.go + spec/status_types.go).

  2. B14(d) / B10 (R5) — sweep claim with no executed evidence. The body asserts "R5 — stale '5 substrates' claims swept in the same commit" but pastes no grep command or output. B14(d) requires actually-executed command output for any sweep claim; the visible comment edits in schema/node.cue cannot prove no stale occurrences survive elsewhere in the tree. Fix: paste the real grep -rn '5 substrates' (or equivalent) and its full output demonstrating zero remaining stale occurrences.

  3. A3 — attribution model name is uncorroborated. The footer *Assisted-by: OpenCode DeepSeek V4.1 Flash (fully tested and validated)* is not backed by any authoring-runtime evidence in the body, so the <Provider Full Model Name> slot cannot be cross-checked; A3 makes a guessed/config-read name a defect. Fix: supply the evidence establishing the harness/provider/model, or correct the name.

Comment dispositions

  • Comment 5839528801 (head 0d74820 — stale SHA): A1 → verified-blocking (still reproduces); B14(d)/R5 → verified-blocking (still reproduces); A3 → verified-blocking (still reproduces).
  • Comment 5839633041 (head 09e8d29 — stale SHA): A1 → verified-blocking; B14(d)/B10 → verified-blocking; A3 → verified-blocking; B18 (Node_image/Kubeconfig_context) → stale-superseded — commit a383d38 adds @go(NodeImage) / @go(KubeconfigContext) in schema/kindcluster.cue, and the current spec/cue_types_gen.go emits NodeImage / KubeconfigContext; B15 (multiple commits) → verified-non-blocking (three additive commits, no partial/deferred split).

Verdict: BLOCK


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

View action run

@github-actions

Copy link
Copy Markdown

Review — PASS

Head SHA: 0715685ac371fa1e02f6586cffa757a05aa53647 (branch: feat/kind)

Change class: contract-module schema (CUE) + generated Go + hand-written Go support (spec/loadmodel.go, spec/status_types.go) + one hand-written Go comment (deploy/deploy_ops.go) + tests. Placement (B16): CORRECT — a contract/vocabulary addition in the spec module, sibling to pod/vm/kubernetes/local/android; the capability stays in the consumer plugin, no core↔sdk re-coupling, no alias growth, no charly/ kit import.

Security screen: PASS — no scope mismatch (all 13 files accounted for in the body), no secrets/egress, no weakened guardrail, no supply-chain edit.

Checklist: All applicable rules PASS or NA — A1 (body accounts for every file incl. deploy/deploy_ops.go, gate + pasted output present), A2/B12 (contract-module gate: cue-gen reproducibility + build + test, new tests exercise the changed paths), A3 (model name corroborated by pasted registry output; fully tested and validated justified for the additive paths that ran live under the new tests), B10/B14(d) (executed grep + both survivors accounted for), B13 SDD (CUE-first, *_gen.go changed with source, no new exception), B18 (gofmt-clean diffs; the prior Node_image/Kubeconfig_context defect is fixed — @go(NodeImage)/@go(KubeconfigContext) in schema/kindcluster.cue and CamelCase in the generated file).

Comment dispositions (all prior heads are stale; every raised finding is resolved in the current state):

  • 5839528801 (0d74820): A1 → stale-superseded (body now lists deploy/deploy_ops.go + the hand-written Go); B14(d)/R5 → stale-superseded (grep + output now pasted); A3 → stale-superseded (registry evidence now present).
  • 5839633041 (09e8d29): A1/B14(d)/A3 → stale-superseded (as above); B18 → stale-superseded (the @go overrides are now in the diff); B15 → verified-non-blocking (additive commits, no partial/deferred split; squash collapses them).
  • 5839756435 (a383d38): A1/B14(d)/A3 → stale-superseded (as above).

Verdict: PASS


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

View action run

@github-actions
github-actions Bot enabled auto-merge (squash) September 25, 2026 21:22
@github-actions
github-actions Bot merged commit 95dc78e into main Sep 25, 2026
2 checks passed
charly-auto-merge Bot added a commit that referenced this pull request Sep 25, 2026
aitrawog pushed a commit that referenced this pull request Sep 25, 2026
main added kindcluster as a 6th substrate kind (#162) after this branch opened;
kubevirt becomes the 7th. Resolved:
- node.cue #ResourceKind: both kindcluster + kubevirt.
- resolvedproject.cue / status_types.go: both template maps + both status consts.
- cue_types_gen.go / vocab_gen.go: regenerated (not hand-merged).
Both kind value defs (#KindclusterValue, #KubevirtValue) coexist.
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