Repository navigation
refactor(charly): externalize deploy/IR machinery to sdk (P4) - #34
Conversation
charly core now consumes the deploy/IR machinery from the sdk (deploykit/kit/spec/sshx, landed in the paired sdk PR) via thin alias re-exports (deploykit_*_aliases.go, kit_*_aliases.go) — every call site compiles unchanged. The concrete runtime Candy stays in charly and implements the new deploykit.CandyModel interface (candy_model_accessors.go); the charly-coupled compiler legs inject as seams (install_build_act.go, install_build_services.go, deploykit_candymodel_alias.go). Deletes the moved-out core in the same change (hard cutover): install_build, deploy_chain, deploy_executor*, env, envfile, http_fetch, install_ledger, reverse_ops, runtime_config, step_view (+ their tests). candy/plugin-vm repoints SSHTunnel to sdk/sshx. The move orphaned nine unused alias re-exports (externalStepKindPrefix, stepsToView, argHasImageTag, appendOrReplaceEnv, deriveChildExecutor, appendHopForFlatPath, resolveAutoEnable, detectEngine) and the dead stripManagedBlock (its behavior moved to kit.RemoveManagedBlockAt) — all deleted, their stale doc-comments swept to the surviving deploykit/kit symbols (R5); golangci-lint run ./... → 0 issues. Bumps the sdk submodule pointer to the merged P4 sdk main (8456739) + go.mod require to its tag v0.2026190.848 (in-tree resolution rides replace => ../sdk). Assisted-by: Claude (fully tested and validated) Claude-Session: https://claude.ai/code/session_01W8GPhuyWWs5XwJyJYtCaxE
…/IR → sdk) Version-stamp for PR #34: rename the placeholder CHANGELOG to the merge-time CalVer generated by pr-validator at merge. Behavior-neutral externalization of the deploy/IR machinery to sdk/{deploykit,kit,spec,sshx}. Assisted-by: Claude (fully tested and validated) Claude-Session: https://claude.ai/code/session_01WyLf4kmnqdRkBk2NJ7RZTb
pr-validator — APPROVED ✅Change class: Independent re-derivation (fresh context; nothing taken on the author's word):
Cross-repo pin (B6): Decision: Verified independently — this is a clean, behavior-neutral externalization of the deploy/IR machinery to Assisted-by: Claude (analysed on a live system) |
…reflect P8b drive-in-candy (#81) Bumps the plugins submodule gitlink 118a4e74 -> b527c3f (opencharly/marketplace#36 merged, plus the already-merged all-docs #32/#33/#34). The full submodule old..new range is 100% documentation (SKILL.md + CHANGELOG), so the pointer bump is the Documentation-only change class. Carries the R5 claim-keyed correction of the stale box-build "engine stays host-side behind HostBuild(image/containerfiles)" claim: the box-build podman DRIVE now lives in candy/plugin-build (P8b) and the pure-compute helpers in the sdk libraries (#24). Verified independently: forward bump (old is an ancestor of new), range all-documentation, skills load cleanly (valid frontmatter, no manifest change). Assisted-by: Claude (documentation reviewed)
The mechanical half of #34: pre-commit-gate now requires a CHANGELOG/<YYYY.DDD.HHMM>.md entry at EVERY legal attribution tier (not only the two runtime tiers), closing the #35 gap where a `documentation reviewed` commit in a CHANGELOG-tracking repo could skip its history entry. The pure-submodule-pointer-bump exemption (only_gitlinks) is preserved. - .claude/hooks/pre-commit-gate.sh — assert_changelog fires for any declared tier (`if not is_amend and tiers:`); dead RUNTIME_TIERS deleted (R5); needs_diff = bool(tiers). - .claude/hooks/gate_test.py — +3 cases (docs-tier no-CHANGELOG BLOCK; docs-tier +CHANGELOG ALLOW; pure docs submodule-pointer-bump exempt) via a new mksubbump helper. 68/68 green. - CLAUDE.md — hooks-doctrine bullet R1/R5 claim-key sweep off "runtime-tier". - plugins gitlink 34a302b → f8b7f4a (plugins #37 tag-unify + #38 agents hooks-doctrine). Validated by a fresh pr-validator: gate_test 68/68 + an independently reproduced old-vs-new differential (OLD=ALLOW, NEW=BLOCK) proving the new coverage fails without the fix. Assisted-by: Claude (analysed on a live system)
…il closed (#35) The mechanical half of #35 (a follow-up to #34, found while landing it). The pre-commit-gate parsed the attribution tier ONLY from the git commit command string, so an external -F <file> (the #38/#83 form) or a $(...) substitution hid it and all three tier-dependent checks (attribution-absence, docs-only-diff, the #34 CHANGELOG requirement) silently failed OPEN. - .claude/hooks/pre-commit-gate.sh: scan_commit_args captures -F/--file values + REUSE_OPTS; new read_file_tiers() reads readable -F files (capped, never a device); tier = shared TIER_RE.findall(cmd) + file_tiers (R3); fails CLOSED on $(...)/backtick/piped-or-unreadable -F/editor, exempts --amend/reuse. - .claude/hooks/gate_test.py: the old -a -F fail-open case flips to fail-closed, +9 new cases. 77/77 green. - plugins gitlink f8b7f4a -> 6c46690 (the agents-skill hooks-doctrine correction, #35 plugins half, #39). RDD: a heredoc body is in the command string, so heredoc was never a hole. Validated by a fresh, independent pr-validator: gate_test.py 77/77 on the final code + a NEW-test-vs-OLD-gate differential proving 7 fail-open holes now BLOCK; the change strengthens the gate and preserves every legitimate commit form. Assisted-by: Claude (analysed on a live system)
… (P11) (#86) The pod config-WRITE (quadlet .container / .pod / sidecar / cloudflare tunnel .service generation + writing) moves out of charly core into the deploy:pod plugin (Ruling C, Q1=(a)): `charly config` resolves the QuadletConfig + computes paths + runs side-effects, then connects deploy:pod on-demand and Invokes OpConfigWrite (spec.PodConfigWriteRequest — opaque RawBody + host paths); the plugin renders + os.WriteFiles byte-identically. The GenerateQuadlet mechanism + resolved-runtime types + enc-coupled volume resolver relocate to sdk/deploykit (consumed via aliases). sdk gitlink f0f37fa -> 2716be0 (merged producer sdk #34, v0.2026194.615); go.mod require bumped. The former hand-written tunnel wire mirror is deleted -> aliased to CUE-sourced spec.TunnelConfig/TunnelPort. R10: pod bed roster GREEN 3/3 on a fresh `charly update` (check-pod 306s, check-sway-browser-vnc-pod 535s, check-sidecar-pod 219s) — the config step exercises the new plugin write path, the update step is the fresh rebuild. Validated by a fresh independent pr-validator: gitlink forward + tag-verified, bed summaries cross-checked on disk, isolated re-build/test (gofmt/vet/test/ golangci-lint-0/byte-parity harness/cue:gen reproducible), R5 grep clean, kernel boundary resolve-to-envelope confirmed. Assisted-by: Claude (fully tested and validated)
* build(tools): K-wave 2 residue ledger — the per-file CSV contract + its mechanical validator
The opening commit of the K-wave 2 residue-ledger program (the operator-approved plan at
plans/kwave2-residue-ledger-plan.md, 2026-08-05). It ships the program's contract and the tool
that judges it, before any residue moves.
K-wave 1's target was an aggregate ESTIMATE, so its outcome could never be validated against the
original number — mid-course re-classifications were legitimate but lived in prose. This program
fixes the process: the contract is charly/KWAVE2_LEDGER.csv, one row per file
(file,baseline_loc,disposition,target_loc,cone), and acceptance is tools/ledger-validate exiting 0
against the tree. The aggregate is COMPUTED from the rows, never asserted first, and a disposition
can change only by a ledger-amendment commit — silent renumbering is mechanically impossible.
BASELINE RE-PINNED to the K-wave 1 terminus 58f9878b (tag v2026.217.0608): 133 prod files,
17,189 LOC (top-level charly/*.go excluding _test.go, wc -l). The plan pinned 17,137/133 at
a0e9be3d; that same sha measures 17,189 with this method, so the tree never differed — the plan's
figure was censused earlier on the same branch. Traced: 7c6bcfc4 17,137 -> cf04638a 17,138 (+1,
the hostprobe-seam comment sweep) -> d68b2e66 17,189 (+51, the `Merge origin/main` the terminus
CHANGELOG itself names: #207's --repo prescan and the Kong `long:`-tag fix). File count is 133
throughout. Every baseline_loc in the CSV is measured at this sha, never copied from the plan.
Cone R1's stated aggregate does not match its own rows and is recorded here as measured, not as
stated: R1 says "2,097 LOC pure" but its 12 pure rows measure 1,407. Every other cone's arithmetic
is exact against the tree (R2 957, R3 365, R4 320, R5 268+200, R6 218, contested 543/-21/378), and
all 46 named files exist at exactly the LOC the plan states. The computed non-contested removable
is therefore 3,735, not 4,425; with the contested release the program targets 4,278 plus the R1
MIXED rows the pre-cone spike still has to measure. Whether R1's file list is instead incomplete
by ~690 LOC is an operator call, and the plan's own change control (a ledger-amendment commit) is
the mechanism if rows must be added.
The four dispositions: DELETE (the file must not exist), THIN (survives at <= target_loc), STAY
(survives, no LOC constraint), THIN-TBD (a mixed row whose thin target the cone's pre-cone spike
has not measured — never satisfied, and the -frozen check stays red while any remain). Line counts
reproduce wc -l exactly, so any ledger figure is checkable from the shell.
Proof: go build/vet/test green on the new module (25 cases, GOWORK=off — it is its own module
outside go.work, the tools/gomod-canonical and tools/golden-compile precedent), with the red/green
arms the gate needs to be non-vacuous: a DELETE row whose file is still present must fail, a THIN
row over target must fail, a THIN row deleted rather than thinned must fail, and a STAY row deleted
must fail. All three modes were then run live against the real untouched tree and their output
retained: -progress prints the starting scoreboard (2 of 46 satisfied — only the two STAY rows,
satisfied by definition at rest; 44 pending, 4 TBD) at exit 0, the default acceptance gate is RED
at exit 1 naming all 44, and -frozen is RED at exit 1 naming the 4 unmeasured R1 rows. The
acceptance output independently re-confirms every baseline_loc against the tree.
Additive only: a new standalone tool module plus a CSV. The charly workspace build is unaffected,
and the gomod-canonical gate globs candy/plugin-*/go.mod so it does not scan this module. The
built binary joins the existing tools/<name>/<name> .gitignore convention.
Assisted-by: Claude Code Anthropic Claude Opus 5 (analysed on a live system)
* ledger: freeze the R1 mixed targets + the ruling-1 cascade rows (operator-approved)
The R1 pre-cone spike measured the four THIN-TBD rows per-function
(defines-vs-calls, per-submodule caller traces): validate_project_host
THIN(80), generate DELETE(0) — the render-seam floor's last two methods die
by the LocalPkg/EmitPluginOp precedents recorded in the seam's own history —
host_build_buildengine THIN(65, incl. the 20-line context-ignore B pair
folded from generate.go), cue_schema THIN(38).
Ruling 1 (operator-approved 2026-08-05, AskUserQuestion in-session): the
manifest's CUE stay-claim is FALSE — sharedCueSchema is the spec-embed
concat, not the cross-plugin splice; the six loaderkit CUE methods are
spec.CueSchema-PARAMETERIZED and compiled-in plugin-loader builds its own
schema (the plugin-migrate twin already does, 'no longer shares charly's
core cueSchemaCtx'). Cascade rows added under the same approval:
validate.go DELETE(0) (every function leaves — fold to candy/plugin-box,
which already imports loaderkit) + the nine cue_kind_*.go D-rows (45 LOC,
dying with registerCueKind/cueKindDefs, whose only consumer is
coreCueSchema().KindDef; the M kind dispatch reads spec.KindValueDefs).
Ledger now 56 rows, -frozen GREEN, scoreboard 2/56 at rest. Row-computed
end-state: 17,189 − 3,735 − 543 − 830 − 226 = 11,855.
Assisted-by: Claude Code Anthropic Fable 5 (analysed on a live system)
Claude-Session: https://claude.ai/code/session_015CXB8CkzwZeXPzbqKjsuYj
* refactor(core)!: #55 K-wave2 cone R1 ruling 1 — the CUE schema leaves the kernel
Deletes 11 charly/ files and thins cue_schema.go 130 -> 54 by moving the
compiled CUE schema and its kind -> def table to the loader that validates
against it (sdk/loaderkit/cue_schema.go, this commit's sdk leg).
Deleted (ledger rows, K-wave 2 cone R1):
charly/cue_defaults.go (25) applyCueDefaults wrapper
charly/cue_node.go (17) validateNodeDocCUE wrapper
charly/cue_kind_android_reg.go (7)
charly/cue_kind_box.go (9)
charly/cue_kind_candy.go (11)
charly/cue_kind_check.go (3)
charly/cue_kind_deploy.go (3)
charly/cue_kind_k8s.go (3)
charly/cue_kind_local.go (3)
charly/cue_kind_pod.go (3)
charly/cue_kind_vm.go (3)
cue_schema.go keeps ONLY what two in-core clause-M mechanisms need: the
plugin-schema SPLICE (plugin_loader.go unifies each plugin's served schema_cue
onto this base to gate its authored input) and the structural-kind VALUE gate
(provider_kind_invoke.go's validateKindValueCUE). Gone from it: registerCueKind
/ cueKindDefs / cueKindDef, the coreCueSchema() handle constructor, and the six
same-named wrappers that forwarded that handle through the ProjectLoader seam.
Both remaining core symbols are now LAZY (sync.OnceValue) — previously the base
schema compiled eagerly at package init for every invocation including
"charly version"; the second compiled copy the loader now owns is therefore not
a net startup cost.
Callers reach the loader directly instead of through a core wrapper:
loader_threaded.go GateDoc: requireProjectLoader().ValidateNodeDocCUE
materialize.go requireProjectLoader().ValidateNodeDocCUE
host_build_config_resolve requireProjectLoader().ApplyCueDefaults
provider_kind_invoke.go requireProjectLoader().CueDocFromYAML
validate.go all four CUE validators via the seam
R1 DOC-DIVERGENCE FIX (KERNEL_MANIFEST.md:172, assigned by this cone's brief).
The manifest justified validate.go staying core because coreCueSchema() was
"the HOST's SPLICED cross-plugin CUE schema ... a live, non-marshalable object".
REFUTED at the tree: coreCueSchema() returned {cueSchemaCtx, sharedCueSchema,
cueKindDef}, and sharedCueSchema was ONLY schemaconcat.ConcatSchema(sdkschema.FS)
— the BASE schema. No plugin fragment was ever unified into it; the plugin splice
is a SEPARATE value built in plugin_loader.go and used solely to gate that
plugin's own authored input. So no non-marshalable cross-plugin graph pinned
these validators to the host and no new seam family was needed. The manifest row
and the stale "cascade check" paragraph asserting the K1 CUE files did not move
are both corrected; the nine cue_kind_*.go / cue_defaults.go / cue_node.go rows
are deleted and cue_schema.go's row is rewritten (census test green).
Gates: go build + go vet clean (charly, spec, sdk, candy/plugin-loader);
gofmt clean; go test ./charly/ ok (171s, incl. TestKernelManifestBidirectional);
spec + plugin-loader tests ok; sdk tests ok under the workspace. The
GOWORK=off sdk/deploykit setup failure (a test importing candy/plugin-egress,
which resolves only through go.work) reproduces on the stashed clean tree — a
pre-existing workspace-scope artifact, not a regression from this change.
Tier is honest for a mid-flight bank on the accumulation branch: unit-proven,
no bed run yet. The program's full R10 roster + the B2 PR chain (with the
CHANGELOG entry) are paid once at the terminus, where this tier is re-stamped
to what the roster earns.
Assisted-by: Claude Code Claude Opus 5 (1M context) (analysed on a live system)
* refactor(core)!: #55 K-wave2 cone R1 ruling 2 — generate.go leaves the kernel; the render-seam dies
Ledger rows satisfied: charly/generate.go DELETE(0). R1 11/26 -> 12/26, overall 13/56 -> 14/56.
charly/generate.go is DELETED. Its four claims to kernel residency were each traced to the tree and
each failed:
- createRemoteCandyCopies + candyByName: PRODUCTION-DEAD. Byte-faithful twins have served every
live caller since the K3 host-prep move and the overlay-render relocation
(candy/plugin-build/host_prep.go:129, candy/plugin-deploy-pod/overlay.go:453). Only tests and
comments still named the core copies.
- resolveInlineBuilderSeam + resolveBuilderStage (with tasks.go's wrapper): the file's own header
called the builder-emit cluster "registry-coupled and stays core". It only CALLED the registry —
the defines-vs-calls test — and the identical OpResolve dispatch had already been running
plugin-side for the detection and external builder legs. Moved to sdk/deploykit beside them.
- newCandyScanGenerator: existed solely to populate the render-seam floor's Generator cache. With
the render seam gone the cache has no readers, so the constructor, the cache, and the
HostBuild("buildengine-prep") leg that fed it all die together.
- baselineContextIgnore + parseEmbeddedContextIgnoreBaseline: a genuine B-clause fact (a separate
Go module cannot //go:embed charly/charly.yml), FOLDED into host_build_buildengine.go beside
hostBuildContextIgnoreBaseline, its only reader.
The Generator struct itself COLOCATES into builder_venue.go as the two scalars the pod-overlay
step-emit actually reads (ExtraCandyRefs, DevLocalPkg). A file for a two-field struct whose only
consumer is buildEngineContext would be dumping, not structure.
Also deleted, as dead once their last caller went:
- charly/host_build_render_seam.go — the whole "render-seam" host-builder.
- charly/builder_preresolve.go — ensureBuildersConnected. Its "genuinely host-only" claim did not
hold: it duplicated connectPluginByWordRef, which InvokeProvider already falls back to. Its
header additionally described a deploy-time pre-pass whose call site had ALREADY relocated to
candy/plugin-bundle — stale prose guarding dead code.
- charly/provider_builder_external.go — comment-only residue after its word->candy map moved to
spec beside the ExternalizedBuilders set it is keyed identically to (R3; the two halves of one
D-fact had drifted into two files in two modules).
Latent gap closed in the same seam (R3, one connect rule for every builder dispatch):
candy/plugin-bundle's deploy-time pre-pass Invoked with an EMPTY ExtraRef, so it only ever reached
Pass-1 — a box/<distro> submodule deploy triggering a builder purely by DETECTION but vendoring the
plugin candy nowhere had no Pass-2 to fall back to. Both its Invokes now carry
spec.ExternalBuilderPluginRef(word), identical to the build-time resolve.
Coverage moved with the code, not dropped: TestCreateRemoteCandyCopies_StagesRemoteCandySource and
TestGeneratorCandyByNameRemoteQualifiedKey guarded two RCA'd regression classes (the "candy not
found" overlay-emit failure and the remote-candy staging COPY failure) but lived in charly while the
live twins carried no tests at all. They are ported to candy/plugin-build and candy/plugin-deploy-pod
against the surviving implementations, the second with an explicit vacuity guard asserting the remote
candy really is qualified-keyed.
R5 sweep (per-submodule, whole-tree): every deleted identifier's surviving references are either my
own deletion notes or past-tense history. Present-tense claims that a render-seam still exists were
corrected across charly, sdk and four candies (R1 claim-keyed). KERNEL_MANIFEST.md drops the four
rows for deleted files; the tasks.go, host_build_buildengine.go and builder_venue.go rows are
rewritten with fresh justifications, and the reverse-channel three-legs whitelist drops
"render-seam" and "buildengine-prep".
Gates: go build/vet/test green (charly, spec, sdk + the three touched candies, out-of-workspace ones
under GOWORK=off); gofmt clean; `task cue:gen` second run a no-op; `task build:binary` + `charly
version` 2026.217.0717 with the changed error string confirmed present in the binary via strings;
`charly box validate` exit 0 zero warnings at the root AND -C box/fedora; TestKernelManifestBidirectional
green.
Submodule legs: spec 0827e73, sdk fdff12b.
Assisted-by: Claude Code Claude Opus 5 (analysed on a live system)
* refactor(core)!: #55 K-wave2 cone R1 — the remote-repo fetch leaves the kernel
Ledger rows satisfied: charly/refs.go DELETE(0) + charly/refs_threaded.go DELETE(0).
R1 12/26 -> 14/26, overall 14/56 -> 16/56.
charly core is no longer a party to a remote-repo fetch. Both files are deleted:
- refs.go held same-named wrappers whose entire body was ASSEMBLING spec.RefsCollectSeams — the
resolved downloader, the command:migrate dispatch, the local-template substrate resolve, the
CHARLY_REPO_OVERRIDE value — and handing them to the relocated mechanism. Core was not defining
anything there; it was resolving three peers and reading one env var on the loader's behalf. The
defines-vs-calls test calls that an R-item, so the assembly moves to candy/plugin-loader
(refs_seams.go), which builds the legs from the ctx-threaded executor and reaches each peer over
InvokeProvider. The ProjectLoader seam methods drop their `seams` parameter and take ctx.
- refs_threaded.go held activeRefsDownloader + requireRefsDownloader: the typed handle core
resolved a compiled-in refs plugin to. With the loader reaching the backend as a peer there is
nothing left to wire, so plugin_inproc.go stops wiring it.
candy/plugin-refs gains an Invoke leg (OpResolve, CUE-sourced #RefsDownloadInput/#RefsDownloadReply)
because a peer plugin cannot hold a typed handle to another plugin the way core could. Both faces
run the SAME Download, so an alternative refs plugin overriding it for an OCI/S3 backend serves both
without knowing the wire face exists — the swappability the P7 seam exists for survives intact.
R3 consolidation folded in: the literal
`specexec.ContextWithExecutor(context.Background(), specexec.NewInProcExecutor(&inprocExecutorClient{...}))`
was copy-pasted at TEN production sites across the check / preempt / validate / loader / command
dispatch. This cutover needed it at seven more. All are now one `hostInProcCtx()`
(plugin_inproc_reverse.go, beside the client it constructs); each call still builds its own stateless
server + executor, so nothing about lifetime or isolation changes.
Coverage moved with the logic, not dropped (the test-double trap this relocation would otherwise
have sprung): TestEnsureRepoDownloaded_MutableRefAlwaysDelegates swapped charly's package-level
activeRefsDownloader, which no longer exists. Stubbing through the host registry would have tested
the dispatch rather than the decision, so the test moves to candy/plugin-loader/refs_fetch_test.go
and drives loaderkit.EnsureRepoDownloaded — where the cache-hit-vs-delegate decision actually lives —
with a stub Downloader. Porting it surfaced an incomplete fixture (a nil MigrateCache leg panicked in
the delegate path, which production never hits because refsSeams always supplies all four); the
ported test now supplies it AND asserts the migrate call pattern, so it covers strictly more than
before. TestRefsDownloaderRegisteredAtInit is restated as TestRefsProviderRegisteredAtInit: the
invariant it protected — the backend must be resolvable before the first fetch — is unchanged, only
its modern form is registry resolution rather than a non-nil package var.
COLD-CACHE PROOF (the gate that actually matters for a fetch-path change; a warm-cache pass would
prove nothing): `CHARLY_REPO_CACHE=<fresh dir> charly -C box/fedora box validate` printed
"Downloading github.com/opencharly/charly:v2026.201.0706...", exited 0 with zero warnings, and left a
populated `github.com/opencharly/[email protected]` tree (+ .ref/.download/.lock) in the fresh
cache — a real git clone driven end-to-end through the new loader-plugin -> InvokeProvider ->
plugin-refs path.
Other gates: go build/vet/test green (charly, spec, sdk, plugin-loader + six touched candies, the
out-of-workspace one under GOWORK=off); gofmt clean; `task cue:gen` reproducible; `task build:binary`
+ `charly version` 2026.217.0803 with the new loader error string confirmed in the binary via strings;
`charly box validate` exit 0 zero warnings at root AND -C box/fedora; TestKernelManifestBidirectional
green after dropping the refs.go / refs_threaded.go rows and rewriting main_repo.go's (its
justification named refs.go as the mechanism it feeds); three-legs whitelist rows for
box-fetch-resolve / buildengine-ensure-repo / buildengine-collect-remote-refs restated against the
seam. R5 sweep per-submodule on every deleted identifier; the two surviving present-tense mentions
(spec's RefsCollectSeams doc, sdk's refs_collect header) corrected rather than left pointing at
deleted core functions.
Submodule legs: spec 6e1cbec, sdk bafc97b.
Assisted-by: Claude Code Claude Opus 5 (analysed on a live system)
* refactor(core)!: #55 K-wave2 cone R1 — the project load-entry files leave the kernel
Ledger rows satisfied: charly/config.go DELETE(0), charly/format_config.go DELETE(0),
charly/main_repo.go DELETE(0). R1 14/26 -> 17/26, overall 16/56 -> 19/56.
Three files deleted, routed per the orchestrator's confirmed (a)+(b) split (msg 3b56e2ff, rule 4b):
what carried LOGIC relocated to the owning plugin, what was a bare forward colocated onto the seam
that owns it. Neither row is claimed by inlining.
(a) LOGIC relocated to candy/plugin-loader:
- ResolveProjectRepo (main_repo.go) — spec.NormalizeRepoSpec + a default-branch resolve wrapped
around one fetch. It is the same clone-and-cache machinery the loader plugin took over in the
previous commit; it stayed behind only because the seam did not carry it yet. New seam method
ProjectLoader.ResolveProjectRepo(ctx, spec).
(b) BARE FORWARDS colocated into loader_threaded.go, which DECLARES the seam they call:
- LoadUnified, LoadConfig, LoadBuildConfigForBox/LoadDefaultBuildConfig, ErrNoCharlyYml +
noCharlyYmlErr, and the ResolveProjectRepo forward.
Inlining these into their ~40 call sites instead (LoadUnified alone is referenced across 30 files)
would have GROWN the kernel to make three files disappear — the cosmetic-gaming pattern the ledger
forbids. The file grows 253 -> 336 LOC and becomes the loader-seam facade: the handles, the
registry-derived D-snapshot, the callback seams, and now the load entry points that forward into
them. Reported measured, not asserted (rule 4b).
Dead surface removed on the way past:
- BuildFile (format_config.go) — the on-disk build.yml schema struct. ZERO references anywhere in
the tree beyond its own declaration; the unified loader superseded it long ago.
- LoadConfigRaw — had decayed to a verbatim alias of LoadConfig, kept "for call sites that
previously distinguished raw-vs-merged loads". No such call site remains.
- resolveIntPtr COLOCATED to host_build_retention_defaults.go, its only consumer.
COLD-CACHE PROOF, twice, because this touches the fetch entry points and warm greens prove nothing:
- `CHARLY_REPO_CACHE=<fresh> charly -C box/fedora box validate` — "Downloading
github.com/opencharly/charly:v2026.201.0706...", exit 0, zero warnings, cache populated.
- `CHARLY_REPO_CACHE=<fresh> charly --repo default box list boxes` — the relocated resolver
end-to-end: cloned github.com/opencharly/charly:main, then resolved the whole transitive
namespace tree (8 distinct repo fetches, including distro-arch / distro-cachyos / distro-fedora)
through loader-plugin -> InvokeProvider -> plugin-refs, and listed the boxes. exit 0.
Other gates: go build/vet/test green (charly, spec, sdk, plugin-loader + EIGHT touched candies, the
out-of-workspace one under GOWORK=off); gofmt clean; `task cue:gen` a no-op; `task build:binary` +
`charly version` 2026.217.0836; `charly box validate` exit 0 zero warnings at root AND -C box/fedora;
TestKernelManifestBidirectional green after dropping the three deleted-file rows and rewriting
loader_threaded.go's row to state the colocation and why it is not inlining.
R5 sweep per-submodule on every deleted identifier. Four surviving references named a deleted FILE
rather than a deleted symbol (candy/plugin-vm x2, candy/plugin-box, charly's own init_def_label_test)
and were repointed at loader_threaded.go; the spec-side pair rides the spec leg.
Submodule leg: spec 632385d (sdk unchanged this bank).
Assisted-by: Claude Code Claude Opus 5 (analysed on a live system)
* refactor(core)!: #55 K-wave2 cone R1 A2 unit 1 — the fetch legs leave the kernel
Two `buildengine-*` reverse legs DELETED from charly/host_build_buildengine.go (271 -> 224 LOC).
Neither was a mechanism the kernel DEFINES; both only CALLED a relocated mechanism on the plugin's
behalf, which the defines-vs-calls test classifies as an R-item:
- buildengine-collect-remote-refs — re-derived cfg (LoadConfig) + the local candy scan
(scanLocalCandies) HOST-side purely to hand them straight back to loaderkit.CollectRemoteRefsOpts.
candy/plugin-build already holds both: cfg from uf.ProjectConfig() (resolve.go step 1) and
localScanned as the fetch fixpoint's own seam parameter. Nothing needed re-deriving.
- buildengine-ensure-repo — a bare forward to loaderkit.EnsureRepoDownloaded.
candy/plugin-build now drives both itself over loaderkit.RefsSeamsFromExecutor — the ONE shared
executor-backed refs-legs builder hoisted into sdk/loaderkit in this cutover's sdk leg, so the plugin
does NOT grow a second private copy of what candy/plugin-loader already had (R3). Of the three
ScanSeams legs only ScanRemote still crosses to the host: its per-candy manifest parse threads the
registered DocParser + the registry-derived Threaded snapshot.
The two helpers the plugin needed moved to the shared fabric module rather than being duplicated
across the boundary (spec leg): boxResolveOpts -> spec.BoxResolveOpts (the box-selection rule, R3
single source for build AND generate) and withLocalRawRefs -> spec.WithLocalRawRefs (the
pinned-remote-dep augmentation), the latter leaving charly/layers.go.
Parity detail worth recording: ensureRepoLeg builds its seams INSIDE the closure, once per call,
never hoisted to construction time. The deleted host leg read CHARLY_REPO_OVERRIDE at the moment of
each fetch, and resolveProjectEnvelope's LocalSuperproject branch sets that env var around the
resolve with a deferred restore — caching the seams would freeze the override and silently change
which tree a fetch resolves against.
Gates:
- workspace build (61 modules) + go vet charly/spec/sdk + go test ./charly: PASS
- out-of-workspace candies (28, GOWORK=off): PASS [the go.work loop misses these]
- gofmt, task cue:gen no-op on a clean tree: PASS
- TestReverseChannelIsThreeLegs: caught the 2 now-stale whitelist rows; trimmed in this same commit
(the whitelist only ever shrinks), then green. TestKernelManifestBidirectional green with the
host_build_buildengine.go row rewritten to its fresh justification.
- charly box validate (root + -C box/fedora): exit 0, zero warnings
- R9: task build:binary -> 2026.217.0856; binary-content markers confirm the change is really in
the binary (the relocated loaderkit error string present; "buildengine-ensure-repo" absent).
- RUNTIME, COLD CACHE (this cutover IS the fetch path — a warm green would prove nothing):
CHARLY_REPO_CACHE=<fresh> ./bin/charly --repo default box list boxes -> exit 0, zero warnings,
full namespaced box list resolved through the new plugin-side EnsureRepo + CollectRemoteRefs legs.
Coverage: charly/box_selection_test.go moves to spec (the test-double rule — an orphaned test goes
where the logic landed), strengthened with TestWithLocalRawRefs, which covers a function that had NO
test while it was charly-private and is now called directly from the plugin's own fetch leg.
Ledger: no row is CLAIMED by this unit. host_build_buildengine.go is THIN(65) and measures 224 here;
layers.go is a cone-C row still in flight. Reported measured, not asserted (rule 4b).
Assisted-by: Claude Code Claude Opus 5 (analysed on a live system)
* refactor(core)!: #55 K-wave2 cone R1 A2 unit 2 — the candy-manifest parse leaves the kernel
charly/layers.go 511 -> 191 LOC (-320). host_build_buildengine.go 224 -> 223, and with unit 1 the
buildengine-* family is down from 7 registered legs to 4.
`buildengine-scan-remote` DELETED — the LAST ScanSeams leg still crossing to the host. It existed for
exactly one reason: the per-candy manifest parse (parseCandyYAML) appeared to need the clause-B
buildCandy factory, so no plugin could parse a manifest itself.
That was DISPROVEN BY MEASUREMENT, not argued away. parseCandyYAML's node-form branch ran
parsedNodeToGeneric(pn) -> buildCandy(gn) -> decodeNodeValue(gn) -> genericToParsedNode(gn) ->
DecodeNodeValue(pn') — a pn -> genericNode -> pn IDENTITY round trip. An RDD spike compared it
against the pure loaderkit sequence over the whole real corpus (324 candy manifests across candy/
and box/): 321 node-form manifests plus all 3 error paths, BYTE-IDENTICAL, zero diffs.
So the mechanism relocated (sdk leg -> loaderkit.ParseCandyManifest) and core keeps only what is
genuinely host-side:
- RegisterBuildVocabulary — now a one-line setter over spec.CandyVocab (the two process-global
caches candyYAMLFormatNames/candyYAMLDistroNames and looksLikeDistroOrFormatKey are gone).
- parseCandyYAML — a 3-line forward into the CandyScanner seam, supplying the two host-side values
the mechanism takes as parameters (loaderThreaded(), candyVocab).
Both COLOCATE onto loader_threaded.go, the file that DECLARES the seam they call — the owner-colocate
rule, not an inline-into-callers spread that would have grown the kernel to shrink one file.
buildCandy/candyIsImage STAY core. Their genuine clause-B consumers are the discovered-candy
pre-check and foldCandyKind — a DIFFERENT call path this cutover does not touch. The doctrine is
unchanged; what changed is that the manifest parse was never actually on it.
Coverage (test-double rule — no orphaned test deleted or faked):
- candyBodyGuardErr (cue_test_helpers_test.go) called the two guard functions directly while they
were charly-private. They are now unexported inside the relocated mechanism, so the helper drives
the REAL production path instead: it writes the body into a kind-keyed manifest and calls
parseCandyYAML. That is STRONGER than the pre-move form — it proves the guards are still REACHED
by a real parse, not merely that the functions exist. Verified live: all three guard classes fire
with their exact production messages (unknown top-level key, misplaced `rpm:` -> `distro:` map,
removed `depends:`). Its 3 consumers (layers_test, format_config_test) are unchanged.
- TestRejectLegacyTopLevelFormatAndDistroKeys repoints to spec.NewCandyVocab(...).
LooksLikeDistroOrFormatKey — the relocated rule — keeping the real testdata/build.yml fixture.
Gates:
- workspace build (61 modules) + go vet charly/spec/sdk + go test ./charly: PASS
- out-of-workspace candies (28, GOWORK=off): PASS
- gofmt, task cue:gen reproducible: PASS
- TestReverseChannelIsThreeLegs: caught the stale buildengine-scan-remote whitelist row; trimmed in
this same commit. TestKernelManifestBidirectional green, both touched rows rewritten with fresh
justifications (layers.go 511 -> 191, host_build_buildengine.go -> 223).
- charly box validate (root + -C box/fedora): exit 0, zero warnings
- R9: task build:binary -> 2026.217.0940; content markers confirm the change is in the binary (the
relocated parse's error string present, "buildengine-scan-remote" absent).
- RUNTIME, COLD CACHE on the exact changed path (a warm run would prove nothing — this cutover IS
the remote fetch+parse path):
CHARLY_REPO_CACHE=<fresh> ./bin/charly box generate fedora.check-pod
-> exit 0, 0 warning lines, 0 error lines, 7 repos downloaded cold, .build/check-pod emitted.
That drives candy/plugin-build's resolve through the new plugin-side EnsureRepo +
CollectRemoteRefs + ScanRemoteCandy legs, parsing every remote candy manifest in-plugin.
Ledger: no row CLAIMED. layers.go is a cone-C row (DELETE(0) as frozen) measuring 191 here;
host_build_buildengine.go is THIN(65) measuring 223. Both reported measured, not asserted (rule 4b);
the consolidated amendment is team-lead's, on the numbers this cone finally reaches.
Assisted-by: Claude Code Claude Opus 5 (analysed on a live system)
* refactor(core)!: #55 K-wave2 cone R1 A2 unit 3 — the local candy scan leaves the kernel
`buildengine-scan-local` DELETED. With units 1+2 the buildengine-* family is down from 7 registered
legs to 3 (connect-plugins, namespaced, context-ignore-baseline), and host_build_buildengine.go from
271 to 220 LOC.
The leg ran scanLocalCandies host-side — LoadUnified + ApplyDiscover + projectCandiesScanned — for a
caller that ALREADY HELD a loaded project. candy/plugin-build gets its *spec.UnifiedFile from
loaderkit.LoadUnifiedViaExecutor, whose walk runs `discover:` at each project boundary exactly as the
host's LoadUnified + ApplyDiscover pair does (verified in loaderkit/walk.go's walkProject, a faithful
port of that same sequence — checked rather than assumed, since a plugin-side uf missing its
discovered candies would have been a silent regression, not a build failure).
So the only piece the plugin genuinely lacked was the scan BODY, which relocated to
loaderkit.ProjectCandiesScanned alongside the manifest parse unit 2 moved. The leg was core
re-deriving an input its caller already had, in order to call a mechanism that no longer lives here —
an R-item on both counts.
Core keeps projectCandiesScanned as a one-line forward through the CandyScanner seam (import purity),
serving charly's own ScanCandy/ScanAllCandyWithConfigOpts callers and the surviving
`buildengine-namespaced` leg. The host leg's project-less fallback (legacyScanCandiesDirScanned)
needs no plugin analogue: every plugin caller returns the empty-project envelope before reaching the
scan when LoadUnifiedViaExecutor reports no project.
Gates:
- workspace build (61 modules) + go vet charly/spec/sdk + go test ./charly: PASS
- out-of-workspace candies (28, GOWORK=off): PASS
- gofmt, task cue:gen reproducible: PASS
- TestReverseChannelIsThreeLegs green after trimming the now-stale whitelist row (same commit);
TestKernelManifestBidirectional green with the host_build_buildengine.go row rewritten to 220 and
its fresh four-leg justification.
- charly box validate (root + -C box/fedora): exit 0, zero warnings
- R9: task build:binary -> 2026.217.1005
- RUNTIME, COLD CACHE on the changed path:
CHARLY_REPO_CACHE=<fresh> ./bin/charly box generate fedora.check-pod
-> exit 0, 0 warning lines, 0 error lines, 7 repos downloaded cold.
- R8 (emitted artifacts, not just exit codes): 4 Containerfiles written by that run —
.build/fedora.check-pod/Containerfile (101 lines, correct ARG BASE_IMAGE + FROM stages), plus
fedora.fedora / fedora.fedora-builder / fedora.fedora-nonfree. Timestamps confirm they are that
run's output, not a stale tree.
Doc sweep (R5): plugin-build's pkg.go + resolve.go headers named the deleted leg in their
host-round-trip lists; both corrected to the plugin-side call.
Ledger: no row CLAIMED. layers.go measures 191 (row DELETE(0)); host_build_buildengine.go measures
220 (row THIN(65)); unified.go measures 281 (row DELETE(0), a facade-remainder row still in flight).
Reported measured, not asserted (rule 4b).
Assisted-by: Claude Code Claude Opus 5 (analysed on a live system)
* refactor(core)!: #55 K-wave2 cone R1 A2 unit 3b — the namespace walk leaves the kernel
Delete the "buildengine-namespaced" host leg and its collectNamespaceScanEntries
recursion. The buildengine family is now TWO registered kinds (was seven).
WHY IT WAS RESIDUE. The leg recursed the project's import-namespace tree host-side
and emitted a flat spec.NamespaceScanReply of per-namespace (scanned, downloads)
pairs, which candy/plugin-build then walked AGAIN to fold into the resolved-project
envelope — the same recursion paid twice across a process boundary, over a
*spec.UnifiedFile the plugin already held from loaderkit.LoadUnifiedViaExecutor.
Its two per-namespace steps were the only thing that ever justified it, and neither
is core-only any more: the local candy scan is loaderkit.ProjectCandiesScanned (unit
3a) and the reachability walk is loaderkit.CollectRemoteRefsOpts over
loaderkit.RefsSeamsFromExecutor (unit 1). So the leg was core CALLING relocated
mechanisms on the plugin's behalf over inputs its caller already had — an R-item by
the defines-vs-calls test, on both counts.
WHAT REPLACES IT. candy/plugin-build's fillNamespacedBoxes (resolve_legs.go) does the
whole walk in ONE plugin-side pass: per namespace it scans, collects, runs the fetch
fix-point (ScanCandyFromLocal), and folds (deploykit.RawCandyPair +
deploykit.FillNamespaceBoxViews), then descends. foldNamespaceScanEntries and
resolveNamespaceUFByPath are gone — with the walk and the fold unified there is no
flat list to re-descend by dotted path. The ResolveProjectSeams.FillNamespacedBoxes
seam now genuinely owns its recursion: the assembler calls it once with prefix "" and
a fresh visited set.
PRESERVED VERBATIM, and documented at the new function so it cannot be re-broken by
someone reading only the new code:
- the nsDir fallback (a namespace's candy from: paths are relative to the
NAMESPACE's own RootDir, falling back to the outer project dir);
- the visited cycle-guard, keyed on the *spec.UnifiedFile POINTER (the loader mounts
a back-imported ancestor as the SAME in-progress node, so a mutual import
terminates);
- DFS pre-order (fold a namespace, then descend), matching the flat reply's former
append order;
- the UNCONDITIONAL reachability walk. It must never be re-guarded by
`if len(scanned) > 0`: CollectRemoteRefsOpts walks sub.Box to collect the BOXES'
candy @-refs, so a namespace that vendors no candies of its own but whose boxes pin
remote ones (every distro submodule) still has refs to fetch. That guard is the
coneK1load regression, R1-bisected to b367e5d5;
- opts stays spec.BoxResolveOpts(nil, includeDisabled) — nil RequestedBoxes, so a
namespace walk is never narrowed by the ROOT request's box selection.
MEASURED, NOT CLAIMED. charly/host_build_buildengine.go 220 -> 100 LOC: 66 lines from
the leg deletion, the rest from folding six per-leg "DELETED" tombstone comment blocks
into one present-tense header (CLAUDE.md puts history in CHANGELOG/, and those blocks
were roughly 55 lines of it duplicated into source). The KWAVE2 ledger row targets
THIN(65); 100 is the honest measurement and is reported to the orchestrator as a
measured amendment rather than squeezed. The two survivors are clean E/M/B/D escapes —
hostBuildConnectPlugins registers project plugin candies into providerRegistry (M, the
plugin-loading mechanism), hostBuildContextIgnoreBaseline serves a directive read from
charly's OWN //go:embed charly.yml (B/D). There is no K1-IOU remainder in this file.
COVERAGE. TestFillNamespacedBoxes_QualifiedView is PORTED, not deleted or faked: it no
longer feeds a canned NamespaceScanReply but drives the production walk off the root
uf's own Namespaces map, and its fake executor now PANICS on any HostBuild kind other
than the generic loader-threaded snapshot — so re-introducing any namespace host
round-trip fails it loudly. The reverse-channel three-legs table drops its
buildengine-namespaced row; the KERNEL_MANIFEST row is rewritten to the measured 100.
TWO INCIDENTAL DOC DIVERGENCES fixed in place (R1; both were false before this change).
validate_project_host.go claimed loadProjectForResolve was "also still used by
build_overlay.go's fail-fast call" — grep says build_overlay.go never calls it. And
with this leg gone loadProjectForResolve has exactly one caller and its diags==nil
fail-fast branch has no production caller left; that is documented in place and dies
with the function in the validate unit that follows.
Assisted-by: Claude Code Claude Opus 5 (1M context) (fully tested and validated)
* refactor(core)!: #55 K-wave2 cone R1 unit B — the validate rules leave the kernel
Delete charly/validate.go entirely and cut charly/validate_project_host.go from 325 to
90 LOC. `charly box validate` now runs EVERY rule inside candy/plugin-box; the host
answers one registry question and nothing else.
WHY IT WAS RESIDUE. The "validate-project-checks" HostBuild seam made the host
RE-LOAD and RE-SCAN the whole project (LoadConfig + ScanAllCandyWithConfigOpts +
LoadUnified + ApplyDiscover) purely so it could run three validators over data
candy/plugin-box already held — the boundary law's named re-derivation R-pattern. The
two documented reasons for keeping them there were both already false when written:
- "they need the HOST's spliced cross-plugin CUE schema, a live non-marshalable
cue.Value graph". They do not. CueDocFromYAML / ValidateEntityClosedCUE /
ValidateCandyManifestCUE / ValidateNodeFormSteps are FREE FUNCTIONS in
sdk/loaderkit, compiled against loaderkit's OWN schema since cone R1 ruling 1, and
the spec.ProjectLoader methods core called were bare forwards to exactly them. The
plugin splice built in plugin_loader.go is a separate value that gates one plugin's
authored input and was never unified into this schema. (KERNEL_MANIFEST.md already
recorded this refutation against validate.go's own row.)
- "validateRemoteCandies needs a spec.RefsCollectSeams bridge that does not exist".
It exists: loaderkit.RefsSeamsFromExecutor, which candy/plugin-build has paired
with loaderkit.CollectRemoteRefsOpts at two call sites since cone R1 A2.
WHAT MOVED. validateCandyCUESchemas / validateProjectCUESchemas / validateRemoteCandies
(plus boxEntityWireYAML / isNodeFormFile) land VERBATIM in
candy/plugin-box/validate_schema_rules.go, driven off the raw config the plugin already
self-loads — hoisted so ONE loadRawProjectConfig now feeds both these and the
raw-config rules (R3). Diagnostic ORDER is preserved exactly: resolve findings, then
these, then the per-kind/op + graph + raw-config findings.
The candy set they run over is byte-identical either way, which is what makes this a
move and not a rewrite: the envelope's deploykit.NewSpecCandyModel adapters are the
SAME values loaderkit.FinalizeScannedCandies builds for the host scan — same
constructor, same already-bare GetRequire/GetIncludedCandy refs (spec.FinalizeCandyRefs
bare-strings them before any CandyReader is wrapped, as charly/refs_test.go's own
fixture marker independently records).
WHAT STAYS. The provider REGISTRY, a kernel M-mechanism. hostBuildValidateWordSets
("validate-word-sets") answers ProviderCapabilities + ActCapableVerbs over an inventory
the PLUGIN supplies: the `plugin:` words it enumerated from its own envelope, plus the
declared capability strings of its out-of-tree plugin candies. That second half absorbs
plugin_prescan.go's now-callerless registerExternalVerbsFromCandies — the registration
still mutates the registry host-side, it just stops re-scanning the project to discover
what to register. No load, no scan, no host-side diagnostics, no project data on the
wire in either direction. The request/reply are CUE-authored (spec leg), never
hand-written.
Also deleted: loadProjectForResolve / loadedProject / addLoadDiag /
runHostNaturalValidateChecks / diagSeverityError (the re-derivation path) and the
production-dead validateProjectForBuild, whose six fixture-test callers now drive
dispatchValidateForTest in the new charly/validate_dispatch_test.go — a deliberate
mirror of candy/plugin-build's validateProjectLeg, so the tests keep exercising the
real dispatch instead of a stub.
COVERAGE. TestValidateCandyCUESchema_ClosednessThroughRealPipeline is new and drives
the WHOLE pipeline (the sibling cue_candy_reject_test.go calls the seam directly and
would stay green even if nothing wired the rule in — exactly the regression a
relocation risks). Red/green proven: unwiring validateCandyCUESchemas fails it
("expected validation error, got nil"), restoring it passes. The orphaned
TestRegisterExternalVerbsFromCandies is PORTED, not dropped, and split to where its two
halves now live: TestValidateWordSets_DeclaredExternalRecognition (host — registration
by class + act-capability) and candy/plugin-box's
TestFetchValidateWordSets_ExternalProvidersOnly + _PluginWordsFromBothPlans (plugin —
the envelope-derived inventory, incl. the builtin-candy exclusion).
R1 claim-keyed doc sweep: nine comments across candy/plugin-box, candy/plugin-build,
charly and the two submodules described the old arrangement in the present tense; all
corrected, including the two gate tables (KERNEL_MANIFEST.md's row, now measured at 90,
and reverseChannelHostBuilderWhitelist's kind).
GATES. Workspace gate PASS (61 modules build + vet + go test ./charly + 28 GOWORK=off
candies + gofmt). task cue:gen no-op (sha256 identical across a second run).
task build:binary 2026.217.1046, R9 by content marker: validate-word-sets / "box
validate: registry word sets" / "candy %q: CUE schema" / "remote candy name conflict"
PRESENT; validate-project-checks / "box validate: host-natural checks" / "pre-build
validation: the validate capability" ABSENT. charly box validate exit 0 zero warnings
at root AND -C box/fedora. Live end-to-end: a scratch project with a typo'd candy key
surfaced `candy "badcandy": CUE schema: ... bogus_typo_field: field not allowed` from
the relocated plugin path. Bed check-exampledeploy PASS (steps=6: deploy-add,
bring-up-members, check-live, update, cleanup, cleanup-members). R5 per-submodule grep
over every relocated/deleted identifier across . spec sdk plugins docs box/* pkg/*:
hostBuildValidateProjectChecks and validateProjectChecksBuilderKind return ZERO; the
rest resolve only to their new homes, CHANGELOG history, or the plugins/ skill rows
already booked as task #34.
Assisted-by: Claude Code Claude Opus 5 (1M context) (fully tested and validated)
* refactor(core)!: #55 K-wave2 cone R1 unit 3 — charly/unified.go leaves the kernel
Delete charly/unified.go (281 LOC). Nothing about the unified config format lives in a
file of its own any more: the one piece of LOGIC left it relocated, the forwards moved to
the file that owns their seam, and four accessors turned out to have no production caller
at all.
WHAT WAS ACTUALLY IN IT. By this point the file was ~250 lines of relocation receipts
around 7 symbols, and each fell into exactly one of the (a)/(b) arms:
(a) LOGIC — canonicalRef, the import-ref resolution behind spec.WalkSeams.ResolveRef.
Its body is kind-blind ref vocabulary (ParseRemoteRef) plus a default-branch resolve
plus EnsureRepoDownloaded — no registry, no host state — so core was CALLING a
mechanism, not defining one. It is loaderkit.CanonicalRef now, behind the new
ProjectLoader.CanonicalRef seam (spec + sdk legs), and hostWalkSeams' ResolveRef is
a three-line closure. Same route ResolveProjectRepo took out of main_repo.go.
(b) BARE FORWARDS — ApplyDiscover and projectCandiesScanned, each a one-or-two-line
call into a seam loader_threaded.go DECLARES (RunDiscover + hostWalkSeams;
CandyScanner + parseCandyYAML). They colocate onto that file, joining the LOAD-ENTRY
forwards K-wave 2 already moved there from config.go / format_config.go /
main_repo.go — whose section header had, prematurely, already called unified.go
deleted. It is now.
(c) PRODUCTION-DEAD — Distros, Builders, resolveInits, ProjectCandies. Grep across
charly/ non-test proves zero production callers: the build-vocab CONFIG projections
are loaderkit's Project{Distro,Builder,Init}Config (reached via
LoadBuildConfigForBox) and the candy scan runs through ScanAllCandyWithConfigOpts.
unified.go's own header already conceded they were "the map-shaped accessors the
tests read". They are MOVED, not deleted, into charly/vocab_accessors_test.go —
their nine test call sites assert real behaviour (that the embedded vocabulary
decodes, that discovery synthesizes the right candies) over the SAME mechanisms, so
the coverage is unchanged while production carries none of it.
R1 CLAIM-KEYED SWEEP. Deleting the file falsified every doc that named it as a current
home. Corrected across all three repos: charly's distro_resolve.go, layers.go (it named
unified.go as where UnifiedFileName is defined — it is spec.UnifiedFileName),
load_executor_host.go x2, and the KERNEL_MANIFEST rows (unified.go's row deleted,
loader_threaded.go's re-measured at 399 and its forward list extended, layers.go's,
load_executor_host.go's, node_build.go's, node_candy.go's and the K1-IOU clause key all
re-worded); sdk's discover.go + load_unified.go; spec's config.go, deploy_tree_validate.go
and the android/deploy CUE prose. Past-tense port-provenance notes ("the K1 port of
charly/unified.go's discover walk") are deliberately LEFT: naming where relocated code
came from stays true.
NOT DONE, AND WHY — host_build_deploy_plugins_connect.go (36 LOC) is NOT deleted. Its two
statements are os.Getwd plus loadDeployPlugins, and loadDeployPlugins' body is the SAME
LoadConfig + ScanAllCandyWithConfigOpts + collectReferencedPluginWords + loadProjectPlugins
derivation that hostBuildConnectPlugins runs for the build path. Removing the host-side
derivation is exactly the serializable candy-plugin descriptor payload booked as task #36,
and doing the deploy half now would have to reshape the shared derivation this unit was
told to leave alone. Reported with the call-chain evidence rather than forced to zero by
inlining, which would be the cosmetic gaming the residue ledger forbids.
GATES. Workspace gate PASS (61 modules build + vet + go test ./charly + 28 GOWORK=off
candies + gofmt). task cue:gen no-op. task build:binary 2026.217.1126; R9 content markers
for the relocated fetch path ("downloading remote ref", "resolving default branch for")
PRESENT. charly box validate exit 0 zero warnings at root and -C box/fedora.
TestKernelManifestBidirectional caught the stale unified.go row before commit (that is the
gate working) and is green after the rewrite, as is TestReverseChannelIsThreeLegs.
COLD-CACHE PROOF (this unit changes the import-ref FETCH path, so a warm cache would prove
nothing): with CHARLY_REPO_CACHE pointed at a verified-empty dir, `charly box validate` at
the ROOT — whose charly.yml carries three NAMESPACED remote imports, the exact
CanonicalRef input — fetched distro-arch v2026.204.1300, distro-cachyos v2026.204.1336,
distro-fedora v2026.216.0232, the nested distro-arch v2026.200.2132 that cachyos itself
imports, and three charly pins, then exited 0 with zero warnings. (The -C box/fedora cold
run is NOT evidence for this seam: that project's `import:` is empty, so its downloads came
from candy refs, not CanonicalRef.)
Assisted-by: Claude Code Claude Opus 5 (1M context) (fully tested and validated)
* refactor(core)!: #55 K-wave2 cone R1 unit C — measure the three stay-targets honestly
C is a MEASURE-THE-HONEST-STAY unit, not a deletion: a caller census proved nothing in
layers.go / node_parsed.go / node_desugar.go is dead, so all three ledger rows amend
UPWARD from DELETE(0). The one thing that WAS dead turned out to be in the sdk, not core.
node_parsed.go 133 -> 100. The materialize plumbing (materializeNodeInto's accumulator
seed/copy-back + materializeProject's per-document loop) colocates onto materialize.go
(145 -> 188), which already owns every other host-coupled materialize leg AND
hostMaterializeProjectSeams, the seam both are reached through. Colocation, not shrinkage:
the pair's lines moved, they did not leave the kernel. What remains in node_parsed.go is
exactly the genericNode BRIDGE its header now claims — the conversion the
bootstrap-critical candyIsImage/buildCandy routing and validateKindValueCUE's raw-discValue
check still need, plus normalizeNodeInto, the test-facing entry. Row: THIN(100).
node_desugar.go 63 -> 71 (stale-header rewrite only; zero code change). Its clause was
WRONG and is corrected: the row read
"parse-time plugin-verb sugar desugar", but the desugar MECHANISM is not here — it is
sdk/loaderkit/parse.go's desugarEntityPlan/desugarStep, which reads primaries as DATA off
the spec.Threaded snapshot. What is here is the host TABLE that snapshot is built from:
kind-recognition DATA consulted by word (clause D — loaderThreaded() projects it into
spec.Threaded.Primaries before every parse) plus registerPluginPrimary mutating it from the
provider registry (clause M). Neither half moves without the registry, so nothing honestly
leaves. Row: THIN(71) — 71 is the MEASURED post-rewrite count, not the 63 this file
carried before the header was corrected.
Checking that clause is what surfaced the real find, landed in the sdk leg: a
byte-identical DEAD COPY at sdk/kit/plugin_primary.go, whose header claimed charly's two
registration call sites called kit.RegisterPluginPrimary directly. They never did — import
purity forbids charly importing sdk/kit — so the K4 relocation was authored but never
wired, leaving two SEPARATE mutable maps of one registry. Zero consumers in any of the 13
repos; deleted.
layers.go 191, unchanged. By the defines-vs-calls test this file DEFINES no mechanism:
scanCandyFromLocal is a bare forward into requireProjectLoader().ScanCandyFromLocal and
scanSeamsFor only builds the closures that seam takes. What keeps it kernel is WHO CALLS
it. Of the seven production callers of ScanAllCandyWithConfigOpts, three are the plugin
BOOTSTRAP path (plugin_loader.go's loadDeployPlugins + hostBuildConnectPlugins,
plugin_prescan.go, provider_command_external.go): the host must scan candies to FIND AND
CONNECT plugins before any plugin exists to be asked — the same irreducible-bootstrap
argument that keeps candyIsImage/buildCandy core. The other four (check_cmd.go,
oci_step_emit.go, host_build_buildengine.go, host_build_check_load_plugins.go) are R-items
owned by the check/build/oci cones, but relocating them removes CALLERS, not lines from
this file, so they will not shrink it either. Row: THIN(191).
GATES. Workspace gate PASS (61 modules build + vet + go test ./charly + 28 GOWORK=off
candies + gofmt). task build:binary 2026.217.1142; R9 by content marker — the live
primaries path ("collides with an authored #Op field") PRESENT, the deleted duplicate's
symbol (kit.RegisterPluginPrimary) ABSENT from the binary. charly box validate exit 0 zero
warnings at root AND -C box/fedora, which parses the whole candy corpus through the
desugar. Bed check-exampledeploy PASS (steps=6). TestKernelManifestBidirectional +
TestReverseChannelIsThreeLegs green with all four rows rewritten (layers.go,
materialize.go, node_parsed.go, node_desugar.go). R5 per-submodule sweep over
materializeNodeInto / materializeProject / pluginPrimaries / plugin_primary.go /
RegisterPluginPrimary across . spec sdk plugins docs box/* pkg/*: every hit resolves to a
new home, a manifest row, or CHANGELOG history.
NO COLD-CACHE RUN, deliberately: this unit touches no fetch/clone/download path (a
same-package function relocation, a comment rewrite, and a zero-consumer sdk deletion). The
cold-cache proof was paid where it belonged, in unit 3, which moved the import-ref fetch.
Assisted-by: Claude Code Claude Opus 5 (1M context) (fully tested and validated)
* docs(ledger)!: #55 K-wave2 — the ONE consolidated ledger amendment (17 rows, authority-cited)
Per plan rule 4 (a disposition changes only by an amendment commit citing its AUTHORITY)
and rule 4b (no row freezes unspiked; the 2026-08-05 row-audit applies retroactively),
this is the single consolidated amendment the program's execution was gated on. After it,
the ledger moves only by rows being satisfied. Row-computed end-state: 17,189 − 4,162 =
13,027 (supersedes the pre-audit 11,855, which double-counted work K-wave 1 had already
executed and carried 13 unspiked DELETE(0) labels the per-function audit refuted).
AUTHORITY 1 — the 24-row per-function defines-vs-calls audit (2026-08-05, executed under
rule 4b after the three-row R1 amendment incident; verdicts transcript-recorded verbatim):
bundle_add_cmd.go DELETE(0) → THIN(75) deriveChildExecutorForPath registry-coupled
host_build_resolve_target_add.go DELETE(0) → THIN(65)
pod_lifecycle_verb.go DELETE(0) → STAY dispatchLifecycleTarget, shared M
host_build_deploy_node_del_dispatch.go DELETE(0) → THIN(35)
gpu_shim.go DELETE(0) → THIN(30)
check_cmd.go DELETE(0) → THIN(110) resolveCheckRunnerContext STAY-called
checkspec.go DELETE(0) → THIN(55) opActsInBuildDeploy serves validate-word-sets
commands.go DELETE(0) → THIN(45) podUpdateCmd + isTerminal STAY-called
deploy_target_dispatch.go DELETE(0) → STAY S3b core half, registry M
unified_targets.go THIN(341) → STAY the manifest's A9 per-symbol table classes
~533/541 as M/B/D/E; the ~200 extraction
was K-wave 1's, already executed
AUTHORITY 2 — plan rule 1 (every number is a wc -l at the artifact), measured by cone R1's
banked units (commits 0222c5c5/e536b957…/7cd3cbbb/fe5f8fa9/0057c6a6, gates pasted there):
layers.go DELETE(0) → THIN(191) nothing dead; 3 of 7 callers are the
plugin-bootstrap scan (irreducible-B, the
candyIsImage argument); 509→191 achieved
node_parsed.go DELETE(0) → THIN(100) materialize plumbing colocated to
materialize.go (145→188, net-zero pair);
the genericNode bridge stays
node_desugar.go DELETE(0) → STAY clause CORRECTED: the desugar mechanism is
sdk/loaderkit/parse.go's; this is the host
primaries TABLE — D (loaderThreaded
projects it) + M (registry mutation).
Kernel-legal, nothing honestly leaves
validate_project_host.go THIN(80) → THIN(90) measured post-thin (unit B, 325→90)
cue_schema.go THIN(38) → THIN(54) measured post-thin (unit 1, 130→54)
AUTHORITY 3 — the K-wave-exit doctrine (boundary law: residue leaves via a NAMED exit,
tracked task #36 connect-plugins descriptor payload) + the no-gaming rule (no inlining to
fake a zero):
host_build_buildengine.go THIN(65) → THIN(100) measured (270→100, 7→2 kinds); #36 takes
it to ~70-75 next
host_build_deploy_plugins_connect.go DELETE(0) → STAY its 2 statements ARE the #36
derivation; deletion needs #36's payload
Validator: 31/56 satisfied, R1 COMPLETE 26/26, zero TBD; `ledger-validate -progress` green.
No code touched — documentation-only change class.
Assisted-by: Claude Code Claude Fable 5 (documentation reviewed)
Claude-Session: https://claude.ai/code/session_015CXB8CkzwZeXPzbqKjsuYj
* charly: dissolve service_render.go + consolidate the arbiter token normalizer (K-wave 2 cone R2, bank A)
service_render.go (119 LOC) DELETED — its two families split per the ledger:
(a) the egress family (egressValidate/ValidateEgress/ValidateEgressValue +
init(){spec.ValidateRecord=...}) moved to candy/plugin-bundle/egress.go —
the SOLE ledger writer (deploy_target.go's recordDeploy/recordVenueLedger)
now binds the egress seam in-process and reaches verb:egress by
InvokeProvider (the vm_egress_shim.go precedent); loud-on-missing-provider
preserved 1:1 (a reachable-but-failing provider aborts the write loudly).
(b) resolveInitConfigViaPlugin + invokeInitResolve (25 LOC, M kind-dispatch
callback wrappers) colocated into the NEW charly/init_resolve.go beside
resource_resolve.go/distro_resolve.go — honest +25 M kernel mass (like
materialize.go's +43), noted in the manifest's new init_resolve.go row.
R3 consolidation: the six byte-identical token-list normalizers repoint to
spec.DedupeNonEmpty (spec/spec/token_set.go) — charly/preempt.go, gpu_allocate.go
(core), candy/plugin-preempt/arbiter_support.go + arbiter.go, candy/plugin-check/
bed_session.go, candy/plugin-vm/vm_util_shims.go + vm_arbiter_shim.go. All local
copies deleted; the seam.cue + loaderkit prose repoint in the same sweep.
Egress shim tests relocated: charly/egress_test.go -> candy/plugin-bundle/
egress_test.go (a stub executor proves the shim's marshalling/reply-decode/
loud-provider/graceful-degrade contract — the real schema is tested in
candy/plugin-egress). The golden cloud-init fixtures + renderer-vs-schema proof
moved to candy/plugin-egress/testdata/ + egress_test.go; tools/golden-cloudinit
writes the new path.
R5 sweep: KERNEL_MANIFEST.md service_render.go row -> init_resolve.go row;
AGENTS.md/CLAUDE.md + plugin-kube + provider.go + vendor README + plugins skills
repoint the egress shim's home. No CHANGELOG (paid once at terminus).
Assisted-by: Claude Code AI (deepseek-v4-flash:0731-cloud) (analysed on a live system)
* charly: dissolve the deploy-from-box seam; from-box pod path is plugin-side (K-wave 2 cone R2, bank B)
bundle_from_box_cmd.go (89 LOC) + host_build_deploy_from_box.go (34 LOC) DELETED
(ONE unit): the `charly bundle from-box` POD path now runs ENTIRELY in
candy/plugin-bundle (from_box_pod.go) — it reaches deploy:pod's ops.OpConfigSetup
by exec.InvokeProvider("deploy","pod",OpConfigSetup,...), the exact peer-dispatch
idiom this package's deploy_from_box.go already uses for deploy:k8s's OpEmit — no
HostBuild round-trip. The quadlet-mode systemd service start + the direct-mode
skip move with it.
spec.HostEnv threads as DATA onto the generic COMMAND dispatch (OpRun) for every
command plugin — charly/provider_command_external.go's dispatchInProcCommand adds
host_env_json (computed in-core, the #200 "threads as DATA, does not anchor a
seam" precedent / KERNEL_MANIFEST.md:39; os.Executable() is only correct in-core,
R10 bed-found bug #5); command:bundle's runBundleCommand decodes + stashes it and
from_box_pod.go forwards it verbatim into PodConfigSetupRequest.HostEnvJSON.
Class-generic, no provider word (F11-safe); the other command plugins ignore the
extra key.
Dead code removed with the seam: #DeployFromBoxRequest/#DeployFromBoxReply CUE
types (spec leg), the reverse_channel_three_legs_test whitelist row, both
KERNEL_MANIFEST rows, and every comment naming bundle_from_box_cmd.go /
deploy-from-box (bundle_cmd, command, host_seams, plugin, deploy_from_box,
plugin-pod/pod_cmd, builder_venue, plugins skills).
Coverage: from_box_pod_test.go drives the InvokeProvider dispatch (asserts the
marshalled PodConfigSetupRequest incl. ExplicitRef + threaded HostEnvJSON), the
derived vs explicit deploy name, the quadlet systemctl start (stubbed), and the
empty-ref guard — the pre-move path had no unit test at all.
Assisted-by: Claude Code AI (deepseek-v4-flash:0731-cloud) (analysed on a live system)
* charly: dissolve the deploy-del-resolve seam; del resolution is plugin-side (K-wave 2 cone R2, bank C)
host_build_deploy_del_resolve.go (46 LOC) DELETED + bundle_add_cmd.go thinned
214 -> 73 + host_build_deploy_node_del_dispatch.go thinned 56 -> 35 (the del
family):
- The del RESOLUTION (deployDelCmd struct, resolveDelNode, podDeploymentArtifactExists)
moved to candy/plugin-bundle/del_resolve.go — the plugin already threads the merged
deploy tree plugin-side (resolveTreeViaLoader, which also connects the deployment's
plugins), so BundleDelCmd.Run() resolves the node in-process instead of round-tripping
through the "deploy-del-resolve" HostBuild seam. bundle_add_cmd.go keeps ONLY the
floor-M host machinery (deriveChildExecutorForPath — registry-coupled M — and
loadConfigForDeploy — build-shared); its header + deriveChild comment were rewritten
to the reduced scope.
- host_build_deploy_node_del_dispatch.go keeps the registry-coupled terminal
(ResolveTarget + target.Del + the teardown gates) but drops the resolveNode default +
vm:-prefix stripping (the plugin now guarantees a resolved node + a clean name; the
RCA #9 comment condenses to its load-bearing fact).
- R3: the del resolution's container probe uses the new shared kit.ContainerExists;
candy/plugin-pod's token-identical copy repoints to it (charly core keeps its own —
import purity, spec/container.EngineBinary is the allowed equivalent).
- Tests: TestPodDeploymentArtifactExists + TestResolveDelNode moved to
candy/plugin-bundle/del_resolve_test.go (adapted to the free-function + kit stub);
charly/bundle_del_diagnostics_test.go keeps TestUnresolvedDeployTargetError.
- R5: KERNEL_MANIFEST rows (del_resolve deleted, bundle_add + node_del_dispatch
re-claused M), reverse-channel whitelist row, plugin_loader.go + every plugin-bundle
comment listing deploy-del-resolve as a live seam, plugins install-plan SKILL.
Coverage: the check-exampledeploy bed's [cleanup] step (`charly bundle del`) runs the
new plugin-side resolveDelNode + thinned dispatch live.
Assisted-by: Claude Code AI (deepseek-v4-flash:0731-cloud) (analysed on a live system)
* charly: dissolve the config-resolve seam; resolve-target-add thinned (K-wave 2 cone R2, bank D)
host_build_config_resolve.go (168 LOC) DELETED + host_build_resolve_target_add.go
thinned 126 -> 52:
- The "config-resolve" HostBuild seam is gone. Its three consumers self-serve via
sdk/loaderkit: candy/plugin-vm's hostConfigResolve now resolves the runtime
(kit.ResolveRuntime), the project (loaderkit.LoadUnifiedViaExecutor), the kind:vm
entity (loaderkit.ResolveVmEntityViaExecutor + loaderkit.ApplyCueDefaults —
vmshared.VmSpec IS spec.ResolvedVm, so the former VmJSON wire round-trip was
identity), the resources (spec.ResolvePluginKindViaPlugin over
loaderkit.ResolveResourceViaExecutor), the Claimant (already plugin-side), and the
VmState (loaderkit.ResolveVmStateViaExecutor). candy/plugin-deploy-vm's
resolvePriorVmState + candy/plugin-kube's hostConfigResolveVmState repoint to the
same loaderkit reader (R3, one home).
- host_build_resolve_target_add.go keeps ONLY the floor-M terminal (spec.
ReconstructParentExec over the registry-coupled deriveChildExecutorForPath,
loadConfigForDeploy, ResolveTarget + utgt.Add); the plan re-materialization
(spec.PlansFromViews) + EmitOpts construction (spec.EmitOptsFromResolveTargetAdd)
+ the ancestor loop (spec.ReconstructParentExec) moved to spec helpers.
- #ConfigResolveRequest/#ConfigResolveReply CUE types deleted (spec leg).
- Tests: plugin-deploy-vm + plugin-kube rewire their seam stubs to the package-var
seams (resolvePriorVmState / hostConfigResolveVmState); loaderkit gains
VmStateFromBundleConfig coverage.
- R5: KERNEL_MANIFEST rows (config-resolve deleted, resolve-target-add re-claused
M), reverse-channel whitelist, embedded seam.cue/buildresolve.cue prose, and every
comment naming the config-resolve seam (plugin-vm hostConfigResolve +
vm_backend_resolve, plugin-deploy-vm lifecycle, plugin-kube k3s_post, preempt.go,
plugin-check, plugins skills).
Coverage: check-exampledeploy's [deploy-add] runs the thinned resolve-target-add
terminal live; the VM-state self-serve i…
Summary
P4 of the core-minimization program (superproject / consumer half; the producer is the merged sdk PR #14,
v0.2026190.848@8456739). Externalizes the deploy/IR machinery into the sdk and deletes the moved-out core.sdk/{deploykit,kit,spec,sshx}via thin alias re-exports (deploykit_*_aliases.go,kit_*_aliases.go) — every call site compiles unchanged.Candystays in charly and implements the newdeploykit.CandyModelinterface (candy_model_accessors.go) — zero test-fixture churn.install_build_act.go,install_build_services.go,deploykit_candymodel_alias.go:CompileActOp/CompileServiceSteps/OpInContext).install_build,deploy_chain,deploy_executor*,env,envfile,http_fetch,install_ledger,reverse_ops,runtime_config,step_view(+ tests) — 19 files;runtime_config.go → runtime_config_values.go(the charly-sidecharly configCLI that stays).candy/plugin-vmrepointsSSHTunnel→sdk/sshx.sdksubmodule pointer0106208 → 8456739+charly/go.modrequirev0.2026189.1805 → v0.2026190.848(in-tree resolution ridesreplace => ../sdk).Dead-code sweep (go-quality). The move orphaned 9 unused alias re-exports (
externalStepKindPrefix,stepsToView,argHasImageTag,appendOrReplaceEnv,deriveChildExecutor,appendHopForFlatPath,resolveAutoEnable,detectEngine) + the deadstripManagedBlock(its behavior moved tokit.RemoveManagedBlockAt) — all deleted, stale doc-comments swept to the survivingdeploykit/kitsymbols (R5).golangci-lint run ./...→ 0 issues.Change class
charlyGo code (cross-cutting IR/compiler/loader) — behavior-neutral. CLI surface +charly.ymlschema unchanged. No schema/generated file touched here (the P4 CUE change was in sdk PR #14, already merged) → SDD gate N/A for this diff.R10 evidence — full 17-bed roster + 3-bed re-gate, all green (fresh-rebuild
updateincluded)Full roster (pre-sweep superset code), all
summary.yml=ok: truewith fresh-rebuild steps:3-bed re-gate on the amended (dead-code-free) binary (rebuilt via
task build:charly, R9): check-localok:true60s · check-podok:true193s (update+feature-run-rebuild) · check-k3s-vmok:true169s (update 65s). The dead-code deletions are behavior-neutral (every deleted symbol had 0 callers), so the full-roster proof carries; the re-gate confirms the final code on all three substrate mechanisms.go test ./...green both repos;gofmt -lclean;golangci-lint run ./...= 0 both repos;go build ./...green against the merged sdk 8456739. Cross-cutting-IR gate per the R10 change-class matrix, fanned out concurrently at max parallelism (concurrency mandate).R0–R10
sortStrings, incompleteappendHopForFlatPathR5 sweep) were RCA'd + fixed, not deferred.CandyModelinterface + alias re-exports, no<name>-host/-podduplication.git grepfinds moved/deleted identifiers only via alias re-exports +CHANGELOG/(verified repo-wide, incl. skills/docs).v0.2026190.848), this consumer pins its exact merged commit.Assisted-by: Claude (fully tested and validated)