Repository navigation
feat(loader): dispatch config parse through a loader plugin + kill the typed uf.* maps (P6) - #57
Conversation
…e typed uf.* maps (P6) Consumer half of P6 (loader to plugin), ONE cutover with two coupled halves. Parse relocation. The node-form config PARSE now runs in sdk/loaderkit, served by the compiled-in candy/plugin-loader (loaderkit.DocParser); core dispatches every document through activeLoaderParser.ParseDoc and DELETES its own parse. New: ClassLoader (provider.go), activeLoaderParser + loaderThreaded (loader_threaded.go), materializeProject (node_parsed.go). Deleted (R5): parseNode / parseNodeTree / classifyKind (node_parse.go) + desugarEntityPlan / desugarStep (node_desugar.go) + the orphaned stepKeywordSet + genericNode.raw; only the genericNode TYPE stays. Map-killing (loader incomplete seam closed). The last typed per-kind loader maps fold to the generic map[string]json.RawMessage, so the kernel holds no per-kind Go map (boundary law): - uf.Box / Config.Box -> boxMap; decode-on-demand accessors in uf_box_generic.go (BoxConfig/HasBox/BoxNames/SetBox/allBoxNames/eachBox). - uf.Candy -> candyMap; decode-on-demand in uf_candy_generic.go (decodeInlineCandy/ encodeInlineCandy/SetCandy). InlineCandy.manifest exported -> Manifest (json __manifest, yaml -) so it survives the opaque round-trip. - R3: the twin mergeBoxMap / mergeCandyMap collapse into the existing mergeRawTemplateMap (byte-identical add-if-not-exists). - ~30 core consumers switch to the accessors; test literals fold via boxMapOf. The byte-equivalence tests (TestSubstrateKind_BothShapesByteEquivalent, TestCandyKind_BothShapesByteEquivalent, plugin_candy_kind_e2e) prove it neutral. Cross-repo: sdk gitlink -> the merged P6 commit (tag v0.2026192.0733); charly/go.mod require bumped (in-tree resolution rides replace => ../sdk). Assisted-by: Claude (fully tested and validated)
pr-validator — CHANGES REQUESTED ❌Change class: cross-repo (charly/sdk Go) — cross-cutting loader/parse/materialize change. I re-derived compliance independently (trusting no author claim). Nearly everything checks out — but the R5 hard-cutover sweep is incomplete: the functions this cutover DELETES ( Checklist
Blocking findings (R5 hard-cutover sweep — R1 doc-divergence)
Production (non-test) code — strongest violations:
Test files this PR edited (call converted to
The PR's own grep self-test ( What to fix (same commit, update in place — do not close/recreate)
Decision: FAIL. Not merged; PR stays open. Blocking: R5 hard-cutover reference sweep left Assisted-by: Claude (analysed on a live system) |
… in go.mod (P6) Review-round fix for PR #57. R5 reference sweep (the prior self-test grepped only `func <name>` definitions, missing reference sites): the deleted parseNode / parseNodeTree names — and a false gn.raw field reference introduced in node_parsed.go — are removed from comments (unified.go, plugin_prescan.go, node_parsed.go, cue_kinds_corpus_test.go, node_parsed_test.go) and from stale t.Fatalf error labels in five node/plugin tests (now genericNodesFromDoc, the helper actually called). The full `git grep` over the deleted identifiers now returns only CHANGELOG context. Comment / test-string only — zero runtime change. go.mod: the sdk require is the CANONICAL tag v0.2026192.733 (not the mis-stripped v0.2026192.0733 the sdk merge first produced — a leading-zero patch is invalid semver, which broke module-mode `go build`). The canonical tag was added at the same merged commit 2026eeb per the `HHMM stripped` scheme (07:33 -> 733); in-tree resolution rides `replace => ../sdk`, unchanged. Assisted-by: Claude (fully tested and validated)
pr-validator — APPROVED ✅Change class: cross-repo (charly/sdk Go) — loader/materialize refactor + typed-map fold Fresh independent re-derivation (no author claims trusted); every gate re-run locally.
Decision: APPROVED. This is the consumer half of P6, landed as one atomic cutover: the node-form parse relocates to Assisted-by: Claude (analysed on a live system) |
…plugin consumer) Rename the placeholder CHANGELOG to the validator-generated merge-time CalVer and match its H1. Version stamp added by pr-validator at merge; folded by --squash. Assisted-by: Claude (fully tested and validated) Claude-Session: https://claude.ai/code/session_01W8GPhuyWWs5XwJyJYtCaxE
… live-stdio reverse channel (#106) The superproject leg of the F12 interactive/streaming reverse-channel (#62) — pairs with the merged sdk PR #44 (executor legs + carrier). charly shell / charly cmd / charly logs --follow move off their inline syscall.Exec / os/exec bodies onto the F12 executor reverse channel: the host RESOLVES the venue command (the #59 resolution inventory stays core), the owning deploy plugin runs it over the served venue executor via RunInteractive/RunStream, and the operator's terminal (inherited host-side by the reverse-channel server) drives it — stdio never crosses the wire. - Dispatch: LifecycleTarget.Attach + substrateLifecycle.Attach + externalDeployTarget.Attach + grpcSubstrateLifecycle.Attach; the venue executor is resolved GENERICALLY via VenueExecutor (vm → guest SSHExecutor ssh -t, pod → nil → host ShellExecutor podman exec/run -it; NO arbiter bracket). grpcSubstrateLifecycle.Logs threads a resolved plan for a substrate with a logs resolver. - Resolvers (pod_lifecycle_resolve.go): resolvePodShellPlan/CmdPlan/LogsPlan RELOCATE shell.go/cmd.go/commands.go verbatim; R3 resolvePodRuntimeImage is the shared image-context head with resolvePodStartDirect. Plugin bodies: pod OpAttach→podAttach (RunInteractive), OpLogs→RunStream (the podCli("logs") reentry DELETED); vm OpAttach→vmAttach over the guest SSHExecutor. OpShell stays the #57 charly service capture leg. - Verb rewires: shell→lt.Attach(tty=true), cmd→lt.Attach(tty=false)+notify wrapper, logs→lt.Logs. R5: shell.go −264 (buildShellArgs/buildExecArgs/shellQuoteArgs relocated; execCommand/findExecutable deleted). Closes the #57 M-core register IOU rows for cmd/shell/logs-follow. - Deliberate rename (orchestrator-approved): substrateLifecycle.TeardownExecutor → VenueExecutor (two consumers now: bundle-del teardown + the F12 Attach leg); the wire Op sdk.OpTeardownExecutor keeps its name for wire stability. - R2 fix: dispatchLifecycleTarget connectPluginByWord(ClassDeployTarget, node.Target) so shell/cmd/logs work on an UNCONFIGURED image. - Bumps the sdk submodule to the merged e2cc807 (tag v0.2026195.501) + charly/go.mod require. Validated by a fresh pr-validator against sdk@e2cc807: coordinates verified exactly; workspace go build/test/vet clean, golangci-lint 0, gofmt clean, both touched candies standalone green, cue:gen + pluginsgen reproducible; R5 rename/deletion sweep clean; F12 consumers live-proven on the stamped binary 2026.195.0216 with both acceptance lanes green. Completes the #62 cutover. Assisted-by: Claude (fully tested and validated)
…imeout non-fix RCA on a live check-k3s-vm bed REFUTED #61's stated root cause (kubeconfig-wait timeout too tight): with wait_second bumped 120->300 the bed STILL failed at 5m, while guest inspection showed k3s healthy (API up ~44s) and the kubeconfig present and world-readable. The real defect is charly's artifact-retrieval reading a context that can't see the present guest file (intermittent — passed 07-25) — a separate, deeper bug that gets its own RCA cutover. Reverted the non-fix (wait_second back to 120); the batch lands the one genuine, proven fix (#57 command expect_non_zero, check-pod 13/13 live+fresh-rebuild). #58/#63 already-fixed on main; #60 probe absent. Assisted-by: Claude Code Anthropic Claude Opus 4.8 (fully tested and validated)
Summary of changes
P6 (loader → plugin) — the superproject consumer, ONE cutover with two coupled halves.
(1) Parse relocation. The node-form config PARSE now runs in
sdk/loaderkit, served by acompiled-in loader plugin candy; core dispatches every config document through it and DELETES its own
parse.
(2) The typed uf. per-kind maps die.* The last typed loader maps —
uf.Box(
map[string]BoxConfig) anduf.Candy(map[string]*InlineCandy) — fold to the generic kind-keyedmap[string]json.RawMessage, closing the loader incomplete seam so the kernel holds no per-kind Gomap (boundary law).
candy/plugin-loader— a compiled-in plugin candy implementingloaderkit.DocParser(the defaultnode-form parse). Registered at init() before the first load — no bootstrap cycle. In
compiled_plugins:.ClassLoader(provider.go) — the newloaderprovider class.activeLoaderParser(loader_threaded.go) — the registered config front-end, wired at registrationwhen a provider implements
loaderkit.DocParser(plugin_inproc.go), swappable.loaderThreaded()snapshots the registry-derived kind-recognition DATA the parse consults.
mergeUnifiedDocsdispatches each document toactiveLoaderParser.ParseDoc→spec.ParsedProject→materializeProject(node_parsed.go) folds it into the*UnifiedFile.parseNode/parseNodeTree/classifyKind+desugarEntityPlan/desugarStep+ the orphanedstepKeywordSet+genericNode.raw. Only thegenericNodeTYPE stays.uf.Box/Config.Box→boxMap;uf.Candy→candyMap(bothmap[string]json.RawMessage). Newuf_box_generic.go+uf_candy_generic.gocarry the decode-on-demandaccessors (
BoxConfig/SetBox/eachBox/…,decodeInlineCandy/SetCandy).InlineCandy.manifestexported →
Manifestso it survives the opaque round-trip. TwinmergeBoxMap/mergeCandyMapcollapseinto the existing
mergeRawTemplateMap(R3). ~30 core consumers switch to the accessors; test literalsfold via the
boxMapOfconstructor.charly/go.modrequire bumped.Change class
cross-repo (charly/sdk Go). Order: sdk P6 PR (merged + tagged) → this superproject consumer.
How R10-tested — exact gate, commands, and pasted output
gate is the disposable pod/VM/group check roster fanned out CONCURRENTLY against the final integrated
tree, PLUS
go test ./...(charly + loaderkit + spec). The host-locallocal:beds mutate the operatorworkstation (not a disposable target) and are excluded per R10 disposable-only purity; their unique
ShellExecutor deploy-leg is untouched by this loader/materialize change, and the byte-equivalence unit
tests cover the fold's correctness deterministically.
Attribution tier
fully tested and validated— the parse + map-killing run on every load across the concurrent disposableroster on a fresh rebuild;
go testgreen (charly + loaderkit + spec).CLAUDE.md rule compliance — HOW each is satisfied (or
N/A)/charly-internals:go+/charly-internals:pluginloaded.ok: true. No flake framing.deferred — parse-relocation + uf.* fold land together as ONE P6 cutover.
sdk/loaderkit; the twinmergeBoxMap/mergeCandyMapcollapse into the single
mergeRawTemplateMap.no sleep/magic-number/shim.
desugar*+mergeBoxMap/mergeCandyMap+ the unexportedmanifestfield deleted (grep above); no transitional/dual-mode path.go test.N/A— no Containerfile/OCI-label generation change (the fold is loader-side;charly box validate+ the image-building beds confirm generation is neutral).task build:charlyrebuilt from the final fix commit (2026.192.0806); the fresh binary containsloaderkit.DocParserwiring; no new OS dep. NOTE: the sdk merge first produced a mis-stripped tagv0.2026192.0733(leading-zero patch = invalid semver, broke module-mode build); the fixup commit requires the CANONICALv0.2026192.733(added at the same merged commit2026eebper theHHMM strippedscheme).disposable: truepod/VM/group beds only, fresh rebuild, zerowarnings; the loaderkit tests + the CUE-corpus/candy/substrate byte-equivalence tests FAIL without the
parse/materialize/fold.
fold behaviour-neutral before core's typed maps were deleted.
candy/plugin-loadershipsdescription:+ aplan:check.swappable plugin; the typed per-kind loader maps (the last incomplete seam) fold to the generic
kind-keyed representation, so the kernel holds no
spec.<Kind>map — every image/layer is opaque JSON aconsumer decodes on demand.
disposable: truebeds only.gitlink in one PR.
CHANGELOG/2026.192.0705.mdstaged (placeholder CalVer; the pr-validator finalizes).Assisted-by: Claude (fully tested and validated)