Skip to content

feat(spec): CUE-source ResolvedBox/BuilderMap/AggregatedCandyCaps (#55 step3 unit 3a) - #4

Merged
atrawog merged 2 commits into
mainfrom
feat/55-step3a-resolvedbox-spec
Jul 29, 2026
Merged

atrawog merged 2 commits into
mainfrom
feat/55-step3a-resolvedbox-spec

Conversation

@atrawog

@atrawog atrawog commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

#55 step-3 unit 3a — the producer leg: ResolvedBox becomes a CUE-sourced spec contract

The build↔deploy ResolvedBox (the plan's #1 entanglement) becomes a shared opencharly/spec type so core + buildkit + plugins share ONE contract. This is the producer leg; sdk (embedding wrapper) and superproject (consume) legs follow in the B2 chain.

What lands

  • schema/resolvedbox.cue — CUE defs #ResolvedBox (30 wire-clean fields), #BuilderMap ({[string]: string}), #AggregatedCandyCaps (plain struct). SDD single-source.
  • spec/cue_types_gen.go — generated by task cue:gen (DO-NOT-EDIT banner); the spec.ResolvedBox/BuilderMap/AggregatedCandyCaps types.
  • spec/resolved_box.go — hand file, methods only (SupportsTag/SupportsBuild/BuilderFor/HasBuilder/AllBuilder — methods aren't generated).

SDD discipline (gengotypes spike-forced)

A cue exp gengotypes spike (v0.16.1) confirmed all 30 wire-clean fields generate faithfully (required !→no-omitempty, optional ?→omitempty). The spike forced a real correction: 4 fields carrying json:"-" (CandyCaps/BakedMetadata/RenderCandyOrder/ActiveInits — the documented json:"-" CANNOT-table entry) genuinely can't be CUE-emitted, so they moved onto the sdk embedding wrapper (buildkit.ResolvedBox), not this def.

Wire-key note (verified safe)

CUE emits snake_case keys vs the former bare Go-name keys; verified no user-facing break — charly box inspect already marshals via the separate snake_case ResolvedBoxView (prior S-K5 ruling), and the one direct-marshal test folds case via canonKey.

Verification

go build/vet/test ./... green; TestGenReproducible PASSES (regen is a no-op — independently re-run). No consumer in this module (spec is leaf).

Producer-first B2: this spec PR → sdk consumer PR → superproject leg (which also carries #55 step-3 units 3b/3c).

Assisted-by: Claude Code Anthropic Claude Opus 4.8 (analysed on a live system)

atrawog added 2 commits July 29, 2026 15:24
…step3 unit 3a)

Adds #ResolvedBox/#BuilderMap/#AggregatedCandyCaps as CUE defs (schema/resolvedbox.cue),
generating the wire-clean render-context data-carriers sdk/buildkit's ResolvedBox embeds.
Excludes the buildkit-owned vocabulary pointers (DistroConfig/DistroDef/BuilderConfig) and
the four json:"-" render-cache fields (CandyCaps/BakedMetadata/RenderCandyOrder/ActiveInits)
per the gengotypes CANNOT-table exception (no construct for a marshal-suppressed field) —
both classes stay hand-kept on the sdk/buildkit embedding wrapper. Methods
(SupportsTag/SupportsBuild/BuilderFor/HasBuilder/AllBuilder) are hand-written alongside the
generated types (gengotypes has no construct for behavior).

Assisted-by: Claude Code Claude Opus 4.5 (analysed on a live system)
…tion)

Merge-time CHANGELOG entry finalized by the fresh pr-validator for the merge-time
CalVer v0.2026210.1533 (spec Go-module tag scheme). The producer-leg cutover
itself (schema/resolvedbox.cue + generated Go + methods) is bb6cba0.

Assisted-by: Claude Code Anthropic Claude Opus 4.8 (analysed on a live system)
@atrawog
atrawog merged commit 172027b into main Jul 29, 2026
@atrawog
atrawog deleted the feat/55-step3a-resolvedbox-spec branch July 29, 2026 13: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.

1 participant