Repository navigation
feat(deploykit,loaderkit,spec): W9/K1 CandyReader/CandyModel/CandyView + loaderkit.ScanCandy - #71
Conversation
…ocab split + CandyModel/CandyRef promotion to spec WIP checkpoint on the held feat/w9-loader-cone branch (not yet landed). Three chunks folded so far: - spec/loaderkit vocab split: spec.ParsedRef/ParseRemoteRef/IsRemoteImageRef/ SplitRepoAndSubPath (ref_parse.go) and spec.SplitNamespaceRef/LeafName (namespace_ref.go) — pure vocab, always-legal spec import. loaderkit.RepoIdentity/ NormalizeRepoSpec/RootRepoIdentity/GitRemoteIdentity/NormalizeGitRemoteURL/ NormalizeRepoIdentity (repo_identity.go) — genuine loader-mechanism logic, consumed only by already-mechanism-coupled files. - CollectSecurity/CollectHooks aggregator split: deploykit.MergeCandySecurity (security.go) + deploykit.MergeCandyHooks (hooks_collect.go, new) — the pure candy-order-fold merge logic, with the *Config candy-tree-walk staying host-side. AppendUniqueString exported (was unexported appendUnique) for the same reuse. - CandyModel interface + CandyRef promoted to spec (spec.CandyReader, spec.CandyRefEntry — non-colliding names since spec.CandyModel/spec.CandyView/ spec.CandyRef already exist). deploykit.CandyModel = spec.CandyReader and deploykit.CandyRef = spec.CandyRefEntry stay as sdk-internal passthrough aliases (the established candy_field_aliases.go pattern) — every consumer compiled unchanged. CandyReader widened with 24 more accessors (Alias/Volume/Artifact/ Capabilities/RequiresCapabilities/Engine/Libvirt/EnvProvides/MCPProvide/Secret/ Port/PortSpecs/LocalPkgFormats + 11 Has* predicates) after a consumer-set audit that DROPPED 5 candidates (HasAnyInit/HasAnyPackages/HasApk/HasService/ HasTagPackages — zero external caller outside layers.go, pure internal composition helpers). 5 new #CandyModel CUE fields (artifact/requires_capability/ capability/secret/port) back the widening — copied verbatim from candy.cue's own shapes, zero hand-written types. Verified: GOWORK=off go build/vet/test ./... clean, golangci-lint 0 issues, gofmt clean, cue:gen reproducible (regen twice = identical diff). Assisted-by: Claude Code Anthropic Claude Sonnet 5 (analysed on a live system)
…vePackageSections to loaderkit.ScanCandy WIP checkpoint on the held feat/w9-loader-cone branch. Ports the candy-scan construction machinery (charly/layers.go scanCandy + derivePackageSectionsFromCalamares, charly/unified.go populateCandyFromYAML) into sdk/loaderkit.ScanCandy, constructing spec.CandyModel + spec.CandyView directly instead of a concrete *Candy struct that core then projects. Two design corrections found by the byte-parity spike (charly's throwaway scan_candy_parity_spike_test.go, 4/4 cases pass): - RunOps is NOT scan-computable: the pre-move runOps() filters plan: steps through opInContext/VerbCatalog, which is registry-adjacent D-data core still owns (task #39's own scope) — ScanCandy leaves it unset; the host computes it in a second pass, unchanged from today. - HasInit is NOT scan-computable either: PopulateCandyInitSystem needs the full InitConfig and runs once across every scanned candy (cross-candy), not per-candy. Same treatment. HasInstallFiles/HasContent are therefore PARTIAL predicates here (every term computable from the one candy alone) — the host completes them by OR-ing in the RunOps/HasInit terms once it computes those (boolean OR is associative, so the two-stage composition is byte-identical to the old single-pass computation — proven by the spike test simulating the host's completion step). Assisted-by: Claude Code Anthropic Claude Sonnet 5 (analysed on a live system)
…akePlugin W9 spike findings 3+4: bake_plugin: was missing from spec.CandyModel entirely (schema gap), and Require/IncludedCandy/BakePlugin were bare-stringed at scan time, before qualifyRemoteSiblingDeps gets a chance to set .Resolved on a remote candy's plain-name sibling deps. Add a hand-written spec.CandyRefs pipeline-state carrier (never a wire type) alongside the CandyModel/CandyView scan result, holding the rich CandyRefEntry lists; loaderkit.QualifyRemoteSiblingDeps + FinalizeCandyRefs run the qualify-then-bare-string steps in the correct order. CandyModel gains a bake_plugin: CUE field (task cue:gen, reproducible). WIP checkpoint on feat/w9-loader-cone — not yet wired into the host ScanAllCandy pipeline. Assisted-by: Claude Sonnet 5 (analysed on a live system)
…PathPrefix) Port the pre-move charly/layers.go ScanRemoteCandy to loaderkit: scans the wanted bare refs out of a downloaded remote repo dir via ScanCandy, then sets each result's CandyView.Remote/.RepoPath/.SubPathPrefix and runs QualifyRemoteSiblingDeps — the same post-scan "construct-then-mutate" + qualify sequence the live *Candy went through, now over the (CandyModel, CandyView, CandyRefs) triple. Bundled as spec.ScannedCandy (hand-written pipeline state, never a wire type, alongside CandyRefs). Added to the CandyScanner interface. WIP checkpoint on feat/w9-loader-cone. Assisted-by: Claude Sonnet 5 (analysed on a live system)
… wrong
W9 mutation-site-inventory finding: specCandyAdapter.HasInit(initName)
ignored initName entirely (returning ServiceFiles/Service non-empty
instead) because #CandyView carried only an aggregate has_init bool, with
no per-init-system data — the live *Candy.HasInit(name) correctly answers
"does this candy trigger init system Y" via its InitSystems map, but the
envelope had no way to express that. This silently mismatches for ANY
consumer asking about a SPECIFIC init system, including this package's own
EmitInitFragmentStages/EmitInitAssembly (an R8 OCI-label/Containerfile
surface) the moment a build routes through the resolved-project envelope
rather than the live *Candy.
Add init_systems: {[string]: bool} to #CandyModel's sibling #CandyView,
mirroring the live field exactly; fix specCandyAdapter.HasInit to read it.
Also rename loaderkit.ScanCandy -> ScanCandyManifest (avoid a name
collision with the established exported charly.ScanCandy(dir)) and add
ScanRemoteCandy + spec.ScannedCandy (bundling Model/View/Refs — same
non-wire pipeline-state rationale as CandyRefs) to the CandyScanner seam
for the upcoming ScanAllCandy pipeline port.
WIP checkpoint on feat/w9-loader-cone.
Assisted-by: Claude Sonnet 5 (analysed on a live system)
…ookup
Evidence rider for the W9 InitSystems finding: TestSpecCandyAdapter_HasInit_
PerInitLookup fixtures the EXACT shape that diverges — a packaged-only
service: entry (use_packaged:, no exec: sibling), the real
candy/qemu-guest-agent shape in the main repo. Confirms the old fake
(len(ServiceFiles)>0 || len(Service)>0) would have wrongly answered true for
HasInit("supervisord") on this candy (supervisord's service_schema does not
support packaged services), while the fixed adapter reading
CandyView.InitSystems answers false correctly; a positive case (InitSystems
carrying a real per-init trigger) proves the lookup is genuinely per-name,
not just always-false.
Assisted-by: Claude Sonnet 5 (analysed on a live system)
Prerequisite for the ScanAllCandy pipeline retype: charly core needs to call FinalizeCandyRefs at the fix-point arbitration's final step (once per winning candidate), but core may import ONLY sdk/spec + proto, never an sdk mechanism kit (import-purity). FinalizeCandyRefs is a pure, non-registry- coupled data-shape transform over already-spec-native types (CandyModel/ CandyView/CandyRefs) — the same class as CandyRefEntry.Bare()/ ToCandyRefEntries, already in spec — so it belongs there, not in loaderkit. No behavior change; loaderkit.ScanRemoteCandy's own QualifyRemoteSiblingDeps use is untouched (that one genuinely stays loaderkit-only, no core caller needs it directly). Assisted-by: Claude Sonnet 5 (analysed on a live system)
…ng (W9) Widens spec.CandyReader with the multi-consumer identity/plugin-declaration accessors the core-side type-Candy retype needs now that no concrete *Candy exists to read fields off directly: GetStatus, GetDescription, GetBakePlugin (bare-string CandyModel.BakePlugin re-wrapped as CandyRefEntry, matching GetRequire/GetIncludedCandy's existing shape), IsPluginCandy, GetPluginSource, GetPluginProviders. Adds specCandyAdapter.RawCandy() (CandyModel, CandyView) — the escape hatch for the ONE caller (charly's ResolvedProject.CandyModels/.Candies builder) that needs the raw wire structs rather than the narrower CandyReader method set, reached via a structural type assertion so charly core never imports deploykit for this. Assisted-by: Claude Sonnet 5 (analysed on a live system)
Port() serialized a non-empty Protocol as a "proto:port" PREFIX (e.g. "tcp:2222", "https+insecure:3000") for every protocol value, diverging from the pre-move *Candy.Port() semantics: populateCandyFromYAML only special-cased "udp" with a "%d/udp" SUFFIX, leaving every other protocol (tcp, https, https+insecure, …) as a bare port number. CollectBoxPorts (charly/ports.go) depends on that suffix convention via kit.StripPortSuffix — a "proto:port" prefix form fails strconv.Atoi and silently drops the port from the box's published-port list. Restores the pre-move bare/suffix convention; confirmed via charly's TestCollectBoxPorts (a protocol-tagged port fixture) after the retype's map-literal test-fixture sweep surfaced the divergence. Assisted-by: Claude Sonnet 5 (syntax check only — unit-test verified; no live charly runtime invocation)
…Ver) The sdk producer leg's own CHANGELOG entry for the CandyReader/CandyModel/ CandyView widening + loaderkit.ScanCandy port. Placeholder CalVer; the pr-validator finalizes it (git mv to the merge-time stamp) at merge. Assisted-by: Claude Sonnet 5 (analysed on a live system)
pr-validator — CHANGES REQUESTED ❌Change class: cross-repo (sdk producer leg, Checklist:
Blocking finding — R3 duplication:
|
Fix round from sdk#71's fresh pr-validator (V-sdk71), CHANGES REQUESTED: 1. R3 (BLOCKING): deploykit/security.go carried AppendUniqueString, a byte-identical copy of kit.AppendUnique (kit/append_unique.go, itself a K4-lane-B relocation whose own doc comment already claimed a kit_aliases.go passthrough that didn't yet exist). Deleted the divergent copy; deploykit/kit_aliases.go now aliases AppendUnique = kit.AppendUnique (the established alias convention this file already uses for the executor types). Its dedicated test (TestAppendUniqueString) is not simply deleted — kit.AppendUnique had ZERO test coverage of its own, so the test moves to kit/append_unique_test.go (TestAppendUnique, testing the owning implementation directly) rather than being lost. 2. CUE mirror divergence (R1 claim-divergence, rides same commit): schema/candymodel.cue's requires_capability field was `[...string]` while candy.cue's own authored shape (which the PR's doc comment claims to mirror exactly) is `[...(string & !="")]`. Fixed to match; `task cue:gen` regeneration confirmed a no-op on the generated Go (the constraint doesn't change the emitted []string shape). Verification: GOWORK=off go build/vet/test -count=1 ./... clean; golangci-lint run ./... 0 issues; gofmt -l . clean; task cue:gen no-op on cue_types_gen.go/ vocab_gen.go/version_gen.go. Assisted-by: Claude Sonnet 5 (analysed on a live system)
The round-1 fix's TestAppendUnique carried a comment narrating its migration and naming the deleted TestAppendUniqueString — an R5 violation (a code comment is not the sanctioned CHANGELOG/migration-help context for a deleted identifier). Dropped; the test needs no origin story on the owning implementation. Added the fix-round narrative to CHANGELOG/2026.198.1944.md instead (the correct home for provenance). git grep, both repos, both names — zero hits (verbatim, both exit 1): sdk: AppendUniqueString -> no matches sdk: TestAppendUniqueString -> no matches charly: AppendUniqueString -> no matches charly: TestAppendUniqueString -> no matches Assisted-by: Claude Sonnet 5 (analysed on a live system)
pr-validator — APPROVED ✅ (round 2, fresh independent re-validation)Change class: cross-repo (sdk producer leg, This is a FRESH, independent round-2 validation (new context, no inheritance from round 1's Checklist:
Additional finding — the PR's own R10 citation was incomplete; I re-ran the full bed myselfThe PR body pastes only 2 of the Full run (
Traced both: neither touches Why this is non-blocking for sdk#71 specifically: the objective R2 separability test — does Consumer sanity (independently verified, not taken on faith): Comments considered: the round-1 Cross-PR interactions considered: Decision: PASS. Both round-1 blocking findings are correctly and cleanly fixed, with the Assisted-by: Claude Sonnet 5 (analysed on a live system) |
pr-validator (round 2, V2-sdk71) finalizes the merge-time CalVer stamp on PASS: git mv the placeholder CHANGELOG/2026.198.1944.md to CHANGELOG/2026.198.2057.md and rewrite its H1 to match. Assisted-by: Claude Sonnet 5 (analysed on a live system)
…c aliases (#55 step 3-III sdk leg) (#110) * refactor(buildkit)!: DistroConfig/BuilderConfig containers → thin spec aliases (#55 step 3-III sdk leg) The value-type containers + methods + WrapDistroDef/DistroTagChain now source from spec (merged v0.2026210.2052); buildkit keeps thin type aliases (−285 LOC in format_config.go), matching its existing DistroDef/BuilderDef alias pattern. InitConfig unchanged (composition policy → #65/#71). require spec bumped v0.2026210.1533 → v0.2026210.2052. Assisted-by: Claude Code Anthropic Claude Opus 4.8 (fully tested and validated) * chore(changelog): finalize #55 step 3-III sdk-leg stamp → 2026.210.2103 Merge-time CalVer finalization by the fresh pr-validator: rename the placeholder CHANGELOG to the merge-time stamp and rewrite its H1. No code change; the buildkit alias cutover is unchanged. Assisted-by: Claude Code Claude Opus 4.8 (fully tested and validated) Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_018iiqSrY7SkJhgvqDYpiHGH --------- Co-authored-by: Claude Opus 4.8 <[email protected]>
Summary of changes
The sdk producer leg of the W9/K1 loader-cone core-minimization wave (consumer:
opencharly/charlyfeat/w9-loader-cone, HELD until this merges — see"Change class"). Widens
deploykit's candy-model vocabulary into a fullspec.CandyReaderinterface contract and ports the candy-manifest scanpipeline into
loaderkit, enabling charly's concretetype Candy structtoretype to an interface backed by two CUE-schema-sourced halves.
spec/candy_reader.go(new): theCandyReaderinterface contract.spec/candy_ref_entry.go(new):CandyRefEntry{Raw,Resolved}(richpre-qualification ref form) +
CandyRefs{Require,IncludedCandy,BakePlugin}FinalizeCandyRefs(m,v,refs)(the ONE bare-stringing step onto the wire,relocated here from
loaderkitsince bothdeploykitandloaderkitconsume it).
deploykit/spec_candy_adapter.go(widened):specCandyAdapternowimplements the full
CandyReadercontract;RawCandy()structuraltype-assertion escape hatch added;
Port()bug fixed (was emitting a lossy"proto:port" PREFIX instead of the bare-port/
"N/udp"-suffix convention).deploykit/hooks_collect.go(new) +deploykit/security.go(widened):read the new
CandyModel.Hook/.Securityfields.loaderkit/scan_candy.go(new, 402 LOC): the ported candy-manifest scanpipeline (
scanCandy/populateCandyFromYAML/derivePackageSections),producing
spec.ScannedCandy{Model,View,Refs}.loaderkit/repo_identity.go(new): repo-identity cycle-break +NormalizeRepoSpec, relocated fromcharly/ns_identity.go+charly/main_repo.go.spec/namespace_ref.go,spec/ref_parse.go(new): generic namespace-refand remote-ref-string vocab, wide non-loader-cone consumer sets.
schema/candymodel.cue,schema/resolvedproject.cue: additive CUE fields(
security,hook,artifact,requires_capability,capability,secret,port,bake_pluginon#CandyModel;init_systemson the resolved-projectcandy view) — generated via
task cue:gen, no hand-written wire structs.CHANGELOG/2026.198.1944.md: this leg's narrative (placeholder CalVer).Full narrative + both-axes metrics:
CHANGELOG/2026.198.1944.mdin this diff.Change class
cross-repo. Repos:
sdk(this PR, producer — lands FIRST),charly(consumer,
feat/w9-loader-cone, HELD pending this merge + a gitlinkrepoint),
plugins(docs-batch 6 rides separately per the orchestratingteam-lead). Landing order: sdk → plugins (independent leg) → charly (repoints
sdkgitlink to this PR's merged SHA +charly/go.modrequire version).How R10-tested — exact gate, commands, and pasted output
sdkis a pure Go library with norunnable disposable bed of its own — the gate is (a)
GOWORK=off go build/go vet/go test/golangci-lint/gofmtclean on the modulestandalone, PLUS (b) the CONSUMER's R10 bed, since charly's
go.modreplace github.com/opencharly/sdk => ../sdkresolves in-tree against this exactcommit —
charly check run check-charly-selftest-pod(a disposable podbed whose plan exercises the candy-scan/build pipeline this leg changes).
check-charly-selftest-pod | pod | FAIL (1/76) | 76 steps | 178s— runagainst
charly version 2026.198.1420(or later same-tree rebuild), runcalver
.check/check-charly-selftest-pod/2026.198.1718/(image-build:ok=true, 160s) and
.../2026.198.1547/(an earlier same-tree attempt, guarddiscussion in the consumer PR). Steps: 57 passed, 1 failed, 18 skipped. The
1 failure (
candy/claude-code:1,claude --version— native-binarynetwork-bootstrap unavailable in box-check mode) is PRE-EXISTING on
main(independently re-run on plain
origin/mainby the orchestratingteam-lead, fails identically) and unrelated to this diff — tracked
separately (
fix/claude-code-native-installer). Single bed, not across-cutting shared-state change, so no concurrent roster was required.
(
go build -buildvcs=false -ldflags "-X main.BuildCalVer=$(...)" -o ../bin/charly .) immediately before each bed run;charly versionmatchedthe rebuild each time; the bed ran on that fresh binary against a FROZEN
tree (a prior attempt hit the binary-freshness guard from a mid-run edit —
root-caused, tree frozen, rebuilt, rerun clean).
image-buildstep runs
charly box build charly-selftest --dev-local-pkg, which drivesthe FULL retyped scan→fetch→qualify→arbitrate→finalize pipeline
(
loaderkit.ScanCandy,FinalizeCandyRefs,NewSpecCandyModel,specCandyAdapter's widened accessors including the fixedPort()) forevery candy composing that box, and the InitSystems/RunOps
host-completion fixes this pipeline required. The success path AND the
init-fragment-assembly path both ran (the charly-selftest box's
supervisord.conf block, previously silently dropped mid-wave, is present in
the post-fix Containerfile — see byte-parity below).
shared-state paths (the candy-scan pipeline is per-project, no cross-project
shared state), and the bed run above is a single disposable pod, not a
cross-cutting change.
Attribution tier
analysed on a live system— build/vet/test/lint clean standalone on thisrepo; the consumer's live bed exercised the changed pipeline end-to-end
(image-build PASSED, 57/58 relevant checks passed) with the one unrelated,
independently baseline-confirmed pre-existing failure noted above.
Harness rulebook compliance
/charly-internals:plugin(the per-plugin CUE-schemacontract + SDK boundary),
/charly-internals:go(SDD pipeline,task cue:gen),/charly-internals:git-workflow(this landing sequence).root-caused before fixing (RunOps never populated;
Port()wire-formregression; the lossy
CandyView.Requireremote-ref-discovery bug; theInitSystems host-completion gap in the consumer's
loadProjectForResolve) —see the consumer PR +
CHANGELOG/2026.198.1944.md. Zero warnings in thegate output above.
explicitly classified LATENT-and-verified-unreachable (two such findings,
both documented with their sweep evidence in the consumer's
CHANGELOG/2026.198.1859.md) with the genuinely-separable remainder routedto a named follow-up batch (consumer-repo task feat(kit)!: P12a check/ADE architecture fold — movable-now sub-batch #59) — none silently parked.
FinalizeCandyRefsrelocated tospec(singlesource consumed by both
deploykitandloaderkit, was duplicated acrosspackages before); no
<name>-host/<name>-podsiblings introduced.during verification was root-caused (a mid-run tree edit) and fixed by
freezing the tree + rebuilding, not by bypassing the guard.
new/widened, zero
Dfiles in the sdk diff);git grepfor the consumerside's deleted identifiers (
type Candy struct,legacyScanCandiesDir(,populateCandyFromYAML,ns_identity, oldmain_repo.goreference)returns only historical-provenance mentions in the relocated files' own doc
comments — see the consumer PR.
commits + pushes).
go test.Containerfile itself) — the CONSUMER'S Containerfile byte-parity + the
ai.opencharly.*labels were verified in the consumer PR against a cleanpre-wave baseline (byte-identical modulo the expected tag timestamp; the
supervisord assembly block regression this leg's
InitSystemsfieldaddition + the consumer's threading fix restores is present again).
the consumer binary was rebuilt from source against this exact sdk commit
before every bed run (see above). No new runtime OS deps introduced.
disposable: truebed, fresh rebuild, per-step zero-warning output; new Go-level coverage:
spec_candy_adapter_test.go,repo_identity_test.go,namespace_ref_test.go,ref_parse_test.go,hooks_collect_test.go(new sdk-side tests) + translatedconsumer-side fixture migrations proven to fail-then-pass across the choke-
point consolidation (stash/fail/pop/pass on the pinning fixture — see the
consumer PR).
Containerfile, both proven against a clean
175266fbaseline, not anassumption) are the composition-at-latest-versions proof. ADE: N/A (no
candy/box authored in this leg). SDD:
task cue:genregeneratedspec/cue_types_gen.gofrom the additive.cuedefs; reproducible, no-opon a clean re-run.
feat/w9-loader-cone(this repo); no transitional/dual-mode path —
FinalizeCandyRefs's singlerelocation replaced its prior
loaderkit-only location outright.charly/core; thenew
CandyReader/CandyModel/CandyViewtypes are the E-envelope +M-mechanism vocabulary consumed BY the kernel and by out-of-process
plugins alike, not a kernel-side kind-branch.
disposable: truepod (check-charly-selftest-pod); no other autonomous destroy/rebuildthis leg.
gofmt -l .empty,golangci-lint run ./...0 issues,go vetclean,go test ./...green (all pasted above).CHANGELOG/2026.198.1944.mdstaged (placeholder CalVer).Assisted-by: Claude Sonnet 5 (analysed on a live system)