Repository navigation
feat(loaderkit)!: relocate the unified-config loader WALK out of charly core (K1) - #37
Conversation
…ly core (K1) The kind-blind ORCHESTRATION half of charly core LoadUnified — the import-queue walk, the discover walk, the namespaced-import mounts, and the per-document parse — relocates into sdk/loaderkit.Walk, which returns a generic spec.LoadedProject envelope. The registry-coupled MATERIALIZE + root-wins MERGE stays host (charly core). K1 of the v2 plugin-host program: the loader becomes a plugin-servable, kind-blind mechanism (boundary law clause D — it consults host-threaded DATA plus six kind-blind host seams, never the provider registry directly). - NEW spec.LoadedProject envelope family (schema/loadedproject.cue): docs (root file + flat imports, in walk order) + discovered manifests + namespace subtrees + a per-walk id. NamespaceMount carries either a DEFINITION (inline project) or a symbolic REFERENCE (ref/refID) for a repo-identity cycle-break / diamond re-import, so the host materialize shares the same project by id (register-before-recurse) and preserves the former loader pointer identity across the intentional mutual import (main to cachyos and back). - NEW spec.Threaded + spec.DocParser (spec/loader_seam.go): the loader-seam CONTRACT types moved here from loaderkit so BOTH the host and the loader plugin reference them without importing each other. loaderkit.ParseDoc takes spec.Threaded. - NEW loaderkit.Walk + WalkSeams (walk.go/directives.go/discover.go): the relocated orchestration, driven by six kind-blind host callbacks (Parser/Boundary/Threaded/ ResolveRef/GateDoc/RepoIdentity). No materialize, no merge, no registry access. - NEW sdk/kit loader primitives (loader_directives.go/loader_discover.go/loader_classify.go): the kind-blind config-directive types + fs walk shared by BOTH charly core AND loaderkit (R3, one home). BREAKING (in-tree consumers updated same-landing): loaderkit.DefaultParser REMOVED (the compiled-in candy/plugin-loader is the sole parser; the host FATALs on a nil parser); loaderkit.Threaded + loaderkit.DocParser moved to spec. Verified: sdk go build + go test + TestGenReproducible + golangci-lint 0; consumed green by charly full test suite (incl. TestImportNamespace_DivergentVersionMutualCycle, the namespace cycle-break equivalence) + the K1 7-bed concurrent roster (7/7 PASS). Assisted-by: Claude (fully tested and validated) Claude-Session: https://claude.ai/code/session_01CCo9NzoUXrqkq5vbkWJLM3
|
Brought up to date with sdk main
|
pr-validator (V-K1chain) — APPROVED ✅Change class: charly/sdk Go (cross-repo K1 producer half — the loader WALK relocation). Independently re-derived (trusting no author claim), on the FINAL merged head
Decision: APPROVED. Net PR diff ( Assisted-by: Claude (analysed on a live system) |
pr-validator (V-K1chain) merge-time version stamp for #37. Assisted-by: Claude (fully tested and validated) Claude-Session: https://claude.ai/code/session_01RiTCtnrPV5gfPzG4BaJ6a4
…re is the materialize half (K1) The kind-blind WALK+PARSE orchestration of LoadUnified now lives in sdk/loaderkit.Walk; charly core keeps ONLY the registry-coupled MATERIALIZE + root-wins MERGE and replays them over the returned spec.LoadedProject envelope via a single new driver file (loader_driver.go). K1 of the v2 plugin-host program — the loader is now a plugin-servable, kind-blind mechanism, and core's ONLY sdk/loaderkit import is the one inventoried loader_driver.go (P16 gate-(b) target), which dies at the K5 OpLoad-envelope unit. - NEW charly/loader_driver.go — the single core→loaderkit file; hostWalkProject builds the six kind-blind host seams; materializeLoadedProject replays host decode→materialize→merge over the envelope (identical to the former inline loadUnifiedInto). materializeDiscoveredNode is the ONE discovered-node fold shared with the layers candy-scan (R3). - REMOVED (hard cutover, no aliases): loadUnifiedInto, mergeUnifiedDocs, loadNamespaceCached, in-core validateNamespaceAlias, the loaderkit.DefaultParser fallback (activeLoaderParser is a spec.DocParser set by the compiled-in candy/plugin-loader, guarded by a FATAL requireLoaderParser). - Consumes the merged sdk half (opencharly/sdk#37 → b95165f / v0.2026194.1400). Validated independently by pr-validator V-K1chain: go build/vet/test + gofmt + golangci-lint 0 + task cue:gen reproducible no-op re-run on the final head; TestImportNamespace_DivergentVersionMutualCycle green; the K1 7-bed concurrent roster (7/7 PASS) corroborated on disk; the R5 claim-keyed sweep of the moved loader-seam type names verified clean. Assisted-by: Claude (fully tested and validated)
What this does
K1 — the sdk half. Relocates the kind-blind ORCHESTRATION of charly's
LoadUnified(import-queue walk, discover walk, namespaced-import mounts, per-document parse) intosdk/loaderkit.Walk, returning the new genericspec.LoadedProjectenvelope. The registry-coupled MATERIALIZE + root-wins MERGE stays in charly core (the consumer superproject PR, opened after this merges). This is the K1 step of the v2 plugin-host program — the loader becomes a plugin-servable, kind-blind mechanism (boundary law clause D).#LoadedProjectis envelope-spine member 2 of 3 (spec.ParsedProject→spec.#LoadedProject→spec.#ResolvedProject), CUE-sourced and composable, strictly upstream of the K5 resolved-envelope (verified no def-name collision with the S-K5 spike).Contents (13 files, +1063/−58)
spec.LoadedProjectfamily (schema/loadedproject.cue→ generated):docs+discovered+namespaces+ per-walkid.#NamespaceMount= a DEFINITION (inline project) or a symbolic REFERENCE (ref/refID) for a repo-identity cycle-break / diamond re-import, so the host materialize shares the project by id (register-before-recurse) and preserves the former loader's pointer identity (main↔cachyos mutual import).spec.Threaded+spec.DocParser(spec/loader_seam.go): the loader-seam CONTRACT types, moved here from loaderkit so host + loader plugin reference them without importing each other.loaderkit.Walk+WalkSeams(walk.go/directives.go/discover.go): the relocated orchestration, driven by six kind-blind host callbacks (Parser/Boundary/Threaded/ResolveRef/GateDoc/RepoIdentity) — library dependency-injection, not new host channels.sdk/kitloader primitives (loader_directives.go/loader_discover.go/loader_classify.go): the config-directive types + fs walk shared by charly core AND loaderkit (R3, one home).loaderkit.DefaultParser(the compiled-in candy/plugin-loader is the sole parser; host FATALs on a nil parser);loaderkit.{Threaded,DocParser}→ spec.Change class
Code (runtime) — the producer half of a cross-repo K1 landing. Per git-workflow B2, this sdk PR merges first; the superproject consumer PR (loader_driver.go + the core deletions + the candy/plugin-loader bump + the sdk gitlink/go.mod bump) is opened after, with its own R10 against the merged sdk tag.
R10 evidence (fully tested and validated)
SDKgates:go build ./...= 0,go test ./...pass,TestGenReproduciblegreen,golangci-lint run ./...= 0,gofmtclean,candy/plugin-loaderstandalone (GOWORK=off) build + lint 0.Consumed GREEN by the charly full test suite (incl.
TestImportNamespace_DivergentVersionMutualCycle— the namespace cycle-break equivalence, old-loader-vs-new-walk) and by the K1 7-bed CONCURRENT roster (frozen tree: super base0d7472d+ sdk base2977d5c, per-tree binaryv2026.194.1340):R0–R10 checklist
DefaultParser/loaderkit.{Threaded,DocParser}deleted, no aliases; grep clean.#LoadedProjectCUE-first (schema →task cue:gen), reproducible; a schema spike proved the self-recursive family generates.Assisted-by: Claude (fully tested and validated)