Skip to content

feat(spec): P14a status + OCI wire types (sdk producer half) - #28

Merged
atrawog merged 2 commits into
mainfrom
feat/p14a-status-oci
Jul 12, 2026
Merged

atrawog merged 2 commits into
mainfrom
feat/p14a-status-oci

Conversation

@atrawog

@atrawog atrawog commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Summary

The sdk producer half of P14a (status subsystem + OCI registry/merge → plugins). Adds the CUE-sourced host↔plugin / render wire types the command:status and verb:oci plugin candies exchange — a plugin imports only the sdk, so these types are the contract. Additive API only; consumer plugin candies + core rewiring are the P14a superproject half (merges after P11+P12, C7).

What's in it

  • schema/status.cue → spec: #DeploymentStatus (the charly status table + --json shape, RECURSIVE nested), #PortMapping, #ToolStatus; spec/status_types.go hand-writes the SubstrateKind enum + 5 consts (scalar-enum-with-consts, charly_names.go precedent) with a #SubstrateKind CUE enum for wire-boundary validation.
  • schema/oci.cue → spec: #MergeRequest/#MergeReply (the verb:oci merge envelope — consumed by P8b's transitional HostBuild("merge") → InvokeProvider("verb","oci",OpMerge) swap, R3 one shape), #ImageUserInput/#UserInfo (base-image adopt-user probe).
  • spec/status_wire_test.go: 3 parity tests.

SDD spike findings (RDD schema spike)

  1. RECURSIVE struct generates faithfully — #DeploymentStatus.nested: [...#DeploymentStatus] → Nested []*DeploymentStatus (gengotypes breaks the self-cycle with a pointer slice; JSON byte-identical to a value slice → status --json parity holds).
  2. JSON-tag fidelity EXACT — required CUE fields → json:"kind" (no omitempty), optional → ,omitempty — byte-identical to the current hand-written core struct → the spaced "kind": "pod" form the command check probes assert on.

Change class + R10 (sdk contract, additive API)

Per the sdk change class R10 = go test + reproducible cue:gen:

$ go test ./...            → ok (spec 0.368s, kit, deploykit, vmshared, loaderkit all PASS)
$ task cue:gen (2nd run)   → no-op (reproducible; git diff empty)
$ golangci-lint run ./spec → 0 issues
$ gofmt -l <changed>       → clean
$ go test ./spec -run 'TestDeploymentStatus|TestOCIWire' → 3/3 PASS
    - TestDeploymentStatusJSONParity     (byte-identical to documented golden)
    - TestDeploymentStatusOmitemptyBoundary (required-field presence contract)
    - TestOCIWireRoundTrip

R1 documentation-divergence RCA (recorded in CHANGELOG)

The program plan asserts P2(B) moved BoxMetadata + sub-types + label consts + CapabilityLabelMap to sdk/spec. It never landed — type BoxMetadata struct exists ONLY at charly/labels.go:166. BoxMetadata is a ~40-field type-graph HUB whose sub-types (VolumeMount/LabelSecretEntry → P11, CollectedAlias → P14b) are owned by in-flight cutovers; CUE-sourcing it under the R8 baked-label byte-parity constraint requires those tags frozen first → deferred to task P2B-completion (post-P11+P14b). ParsePortMapping (the third named helper) is already in sdk/kit.

Attribution

Assisted-by: Claude (fully tested and validated) — sdk change class gate fully met (go test + reproducible cue:gen + wire round-trip parity tests + lint clean).

R0–R10

  • R0 skills loaded; R1 doc-divergence RCA'd + recorded; R3 one-shape (P8b consumes the same MergeRequest); R5 additive (no deletions); R8 wire-tag fidelity locked by tests; R10 sdk-class gate green (above). Superproject-half runtime gates (verify-status golden, live merge parity) ride the consumer PR after P11+P12.

Assisted-by: Claude (fully tested and validated)

Adds CUE-sourced status wire types (#DeploymentStatus/#PortMapping/#ToolStatus +
the hand-written SubstrateKind enum) for the command:status plugin's fleet
fan-out + render, and OCI wire types (#MergeRequest/#MergeReply/#ImageUserInput/
#UserInfo) for the verb:oci merge engine + image-user probe (consumed by P8b's
transitional HostBuild merge -> InvokeProvider verb:oci swap, R3 one shape).

SDD spike: RECURSIVE #DeploymentStatus generates as []*DeploymentStatus (gengotypes
breaks the self-cycle with a pointer; JSON byte-identical to a value slice);
JSON-tag fidelity (required->no-omitempty, optional->omitempty) locked by
spec/status_wire_test.go against the documented charly status --json golden.

Producer half only. The BoxMetadata-hub read helpers (ExtractMetadata/
ResolveNewestLocalCalVer) defer to P2B-completion: the plan's P2(B) BoxMetadata->
spec never landed (R1 doc-divergence, recorded in the CHANGELOG), and the ~40-field
hub references sub-types owned by in-flight P11/P14b (VolumeMount/LabelSecretEntry/
CollectedAlias) that must freeze first for R8 baked-label byte-parity. ParsePortMapping
is already in sdk/kit. The consumer plugin candies + core rewiring are the P14a
superproject half (merges after P11+P12, C7).

Assisted-by: Claude (fully tested and validated)
Claude-Session: https://claude.ai/code/session_01R8UGGr3ui1959oTb5JuSif
@atrawog

atrawog commented Jul 12, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — APPROVED ✅

Change class: sdk contract additive-types (Go library + CUE schema) — NOT a runtime/bed class. The applicable R10 gate is go test ./... + reproducible task cue:gen + golangci-lint + gofmt, all re-run independently by me at the PR head (8cce985) in a scratch worktree — nothing taken on the author's word.

Checklist verdict

  • [PASS] 0. Security (T1–T4) — pure type defs + tests + changelog; no secrets/exfiltration/network/eval; go.mod/go.sum untouched (no supply-chain); no hook/branch-protection/validator-spec/CLAUDE.md edit; scope matches the description exactly; no instruction aimed at the validator.
  • [PASS] 1. Description complete — filled template, SDD spike findings + sdk-class R10 evidence pasted, R0–R10 section, R1 RCA in CHANGELOG.
  • [PASS] 2. Change-class gate — sdk contract-types gate re-run by me, green. No dry-run/rebuild-alone fraud (no bed can exercise a pure library type; the Go suite is the gate and it executed).
  • [PASS] 3. Attribution tier — fully tested and validated is honest and not inflated for the sdk additive-types class: the class gate is fully met and the new wire types executed under the parity tests. No disposable runtime target exists for a contract-types change; runtime wiring is a separate consumer change.
  • [PASS] 4. R0 skills — /charly-internals:go (SDD wire mandate) + git-workflow (sdk tag scheme) read by path, validated against skill text.
  • [PASS] 5. R1 / ZERO warnings — doc-divergence RCA recorded; no warnings in any gate output.
  • [PASS] 6. R2 no split — the BoxMetadata deferral is genuinely separable (this PR's gate passes without it), dependency-gated (post-P11+P14b), honestly RCA'd — not an indefinite park. Producer-first is the B6-sanctioned cross-repo order.
  • [PASS] 7. R3 no duplication — SubstrateKind + the wire structs are sourced into ONE shared sdk contract; core already uses SubstrateKind (status_render.go, status_collect_*.go) — this unifies it. Distinct named enum follows the landed ReverseOpKind/StepKind/Gate precedent.
  • [PASS] 8. R4 — N/A (pure type defs).
  • [PASS] 9. R5 — purely additive (0 deletions on every file); no transitional/dual-mode code.
  • [PASS] 10. R6/R8/R9 — R8 wire-tag fidelity locked by tests and byte-matches core's current status_render.go/status_engine.go tags (kind/run_mode/container/host_port/container_port). R6/R9 N/A.
  • [PASS] 11. R10 — class gate re-run by me, green + reproducible; ships coverage that fails on drift (TestGenReproducible, JSON parity, omitempty boundary, OCI round-trip).
  • [PASS] 12. SDD — every wire struct is a CUE def generated by task cue:gen; I regenerated on the committed tree → byte-identical, git status clean (no hand-edited generated file). SubstrateKind = the @go(-) string-enum precedent (#ResourceKind/#BuildFormat/#BuildType) + the distinct-named-enum precedent (ReverseOpKind/StepKind) — not a novel exception. RDD spikes documented. ADE/per-plugin .cue N/A (no candy/plugin).
  • [PASS] 13. Concurrency/anti-cheat — N/A (no shared-state path); no failure dismissed as flake/pre-existing.
  • [PASS] 14. Hard cutover — one commit; no deferred work within this slice's scope.
  • [PASS] 15. Kernel/plugin boundary — wire types are the generic Envelope (E); SubstrateKind is kind-recognition Data (D). No concrete-kind leak into a kernel.
  • [PASS] 16. Disposable-only autonomy — N/A.
  • [PASS] 17. Clean architecture + Go gates — gofmt -l empty; golangci-lint run ./... = 0 issues (v2.12.2); go test ./... green.
  • [PASS] 18. CHANGELOG — placeholder CalVer, one H1, R1 RCA present.

Gate outputs (my independent re-run at 8cce985)

go test ./...            → all packages ok (spec 0.774s, kit 3.457s, deploykit, loaderkit, vmshared)
go test ./spec -run 'TestDeploymentStatus|TestOCIWire|TestGenReproducible' -v
    --- PASS: TestGenReproducible
    --- PASS: TestDeploymentStatusJSONParity
    --- PASS: TestDeploymentStatusOmitemptyBoundary
    --- PASS: TestOCIWireRoundTrip
task cue:gen (regen on committed tree) → git status EMPTY  (reproducible NO-OP)
gofmt -l <changed .go>                 → EMPTY
golangci-lint run ./...                → 0 issues
go.mod/go.sum untouched;  diff numstat → 0 deletions on all 6 files (additive)

Decision: APPROVED. The SDD wire mandate is fully satisfied — all seven wire structs are CUE-sourced and generated, regeneration is a verified no-op, and the one hand-written type (SubstrateKind) follows two landed precedents rather than introducing a new exception. The change is purely additive (no !/migration needed), the byte-parity contract is locked by tests and matches core's current shape, and every gate for the sdk contract-types class is green on my own re-run. Finalizing the merge-time CalVer, merging (squash), and tagging under the sdk Go-module scheme.

Assisted-by: Claude (analysed on a live system)

Merge-time CalVer stamp applied by the fresh pr-validator: rename the
placeholder CHANGELOG to the merge-time CalVer and update its H1 heading.

Assisted-by: Claude (documentation reviewed)
Claude-Session: https://claude.ai/code/session_01SKKjKUrEmfv5BKAxhUc9kL
@atrawog
atrawog merged commit ae98a93 into main Jul 12, 2026
@atrawog
atrawog deleted the feat/p14a-status-oci branch July 12, 2026 11:42
atrawog added a commit that referenced this pull request Jul 12, 2026
…rop transitional local copy

sdk#28 (P14a's oci.cue MergeRequest/MergeReply) is merged into sdk main. Per the one-home
dedupe ruling, delete the transitional #MergeRequest/#MergeReply from schema/buildresolve.cue
(kept only for pre-#28 compilation) and regenerate — cue_types_gen.go now carries P14a's single
MergeRequest (ImageRef/MaxMB/MaxTotalMB/Engine/DryRun) + MergeReply, which the HostBuild("merge")
seam + the candy import. buildresolve.cue defines only the BuildResolve* family now.

Assisted-by: Claude (fully tested and validated)
Claude-Session: https://claude.ai/code/session_01R8UGGr3ui1959oTb5JuSif
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