Skip to content

feat(loaderkit)!: relocate the unified-config loader WALK out of charly core (K1) - #37

Merged
atrawog merged 3 commits into
mainfrom
feat/k1-loader-orchestration
Jul 13, 2026
Merged

atrawog merged 3 commits into
mainfrom
feat/k1-loader-orchestration

Conversation

@atrawog

@atrawog atrawog commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

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) into sdk/loaderkit.Walk, returning the new generic spec.LoadedProject envelope. 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).

#LoadedProject is 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)

  • NEW spec.LoadedProject family (schema/loadedproject.cue → generated): docs + discovered + namespaces + per-walk id. #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).
  • NEW 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.
  • 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) — library dependency-injection, not new host channels.
  • NEW sdk/kit loader 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).
  • REMOVED 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)

SDK gates: go build ./... = 0, go test ./... pass, TestGenReproducible green, golangci-lint run ./... = 0, gofmt clean, candy/plugin-loader standalone (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 base 0d7472d + sdk base 2977d5c, per-tree binary v2026.194.1340):

check-commands-local  PASS  5 steps  147s  ok:true
check-substrate       PASS  9 steps  237s  ok:true
check-builder-vm      PASS  9 steps  262s  ok:true
check-structkind      PASS  5 steps  311s  ok:true
check-group           PASS  5 steps  316s  ok:true
check-sidecar-pod     PASS  11 steps 359s  ok:true
check-local-vm        PASS  7 steps  408s  ok:true
All 7 through the relocated loaderkit.Walk + loader_driver + host materialize, launched simultaneously
(max parallelism incl. the 4-way eval-vm flock). Clean teardown: zero leftover domains.

R0–R10 checklist

  • R0 skills loaded (go/plugin/git-workflow/cutover-policy/strict-policy/agents).
  • RDD: the one high-risk assumption (namespace cycle-break pointer identity) was proven on the real equivalence test — it FAILED first run, fixed via symbolic id-refs, now passes.
  • R1: the base-advance anomaly RCA'd (main advanced, disjoint delta — not contamination).
  • R3: the shared config-directive primitives + discovered-node handler unified (one home).
  • R5: hard cutover — DefaultParser/loaderkit.{Threaded,DocParser} deleted, no aliases; grep clean.
  • SDD: #LoadedProject CUE-first (schema → task cue:gen), reproducible; a schema spike proved the self-recursive family generates.
  • R7/R10: full cross-cutting 7-bed roster on the final frozen code (7/7 PASS), pasted above.

Assisted-by: Claude (fully tested and validated)

atrawog added 2 commits July 13, 2026 15:41
…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
@atrawog

atrawog commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

Brought up to date with sdk main c7a3175 (P14a's producer half — enginekit + status/oci wire types + OpStatusCollect — merged mid-flight).

  • Merged origin/main into the feat branch (61ec120, fast-forward push — no force-push), NOT a rebase.
  • The only overlap was the generated spec/cue_types_gen.go (both cutovers regenerate it). Git auto-merged it cleanly (P14a's status types and the loader #LoadedProject types are in disjoint regions), and a subsequent task cue:gen over the merged .cue set (status.cue + loadedproject.cue) was a no-op — the merged generated file already equals a fresh regeneration. TestGenReproducible green.
  • Full merged sdk re-verified: go build ./... = 0, go test ./... pass, golangci-lint run ./... = 0, gofmt clean.
  • charly builds green against the merged sdk — confirming P14a's sdk changes are additive-disjoint from the loader. The K1 7-bed roster evidence (pasted in the PR body) therefore stands unchanged: the charly-side loader code is byte-identical, and the beds exercised the relocated Walk/driver/materialize path, which the additive sdk merge does not touch.

@atrawog

atrawog commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator (V-K1chain) — APPROVED ✅

Change class: charly/sdk Go (cross-repo K1 producer half — the loader WALK relocation).
placement: CORRECT — loaderkit.Walk is a kind-blind MECHANISM (imports only sdk/kit+sdk/spec+yaml+stdlib; only switch is on document SHAPE, never a concrete kind; everything registry-coupled is a WalkSeams func-field callback = library DI). Contracts live in spec, shared primitives in kit. Advances the v2 plugin-host end-state.

Independently re-derived (trusting no author claim), on the FINAL merged head 61ec120:

  • [PASS] 0. Security T1–T4 — pure loader relocation; no secrets/exfiltration/guardrail-weakening/supply-chain; scope matches the 13 files exactly; no embedded instructions to the validator.
  • [PASS] 1. Description — complete; 7-bed roster + tier + R0–R10 checklist with evidence.
  • [PASS] 2. Change-class gate — cross-cutting loader → full 7-bed concurrent roster + go gates; no dry-run/rebuild-alone fraud.
  • [PASS] 3. Attribution fully tested and validated — the relocated walk executed LIVE on fresh binary v2026.194.1340 across all 7 beds; justified.
  • [PASS] 4. R0 skills honored + spot-checked vs go SKILL + boundary law.
  • [PASS] 5. R1 — base-advance anomaly RCA'd (disjoint enginekit/status delta, I independently confirmed); golangci-lint 0 issues; ZERO warnings.
  • [PASS] 6. R2 — nothing parked; reconciliation handled in-tree.
  • [PASS] 7. R3 — directive types ONE home in kit/; loaderkit/directives.go keeps only walk-scoped alias validation. Verified.
  • [PASS] 8. R4 — no sleep/retry/magic-number; cycle-break is a symbolic id-ref mechanism.
  • [PASS] 9. R5 — DefaultParser/loaderkit.{Threaded,DocParser} deleted, moved to spec, all refs updated; grep clean (only provenance comment + CHANGELOG). No dual-mode path.
  • [PASS] 10. R6/R8/R9 — R6/R8 N/A (sdk); R9 binary rebuilt v2026.194.1340, incorporated the change (go.work use ./sdk), fresh; no new OS deps.
  • [PASS] 11. R10 — 7-bed disposable roster on the fresh binary, corroborated on disk EXACTLY: step counts 5/9/9/5/5/11/7, seconds 147/237/262/311/316/359/408, every step ok: true, one concurrent window (calver 2026.194.1329). cue:gen no-op + TestGenReproducible = coverage that fails without the change.
  • [PASS] 12. RDD/ADE/SDD @100% — RDD: cycle-break pointer identity proven on the equivalence test (failed first, fixed via symbolic id-refs). ADE N/A (sdk Go). SDD: task cue:gen re-run → byte-identical NO-OP; TestGenReproducible green; no hand-edited *_gen.go; #LoadedProject family CUE-sourced from schema/loadedproject.cue. Threaded/DocParser are MOVED pre-existing NON-wire contracts (interface carrying *yaml.Node + in-process primitive-map registry snapshot) — not new wire types, no mandate violation.
  • [PASS] 13. Concurrency — roster ran CONCURRENTLY on ONE binary (incl. 4-way eval-vm flock); loader/discover shared-state path proven under load; no idle/serial dodge.
  • [PASS] 14. Hard cutover — one atomic cutover; feat carries change + reconciliation merge, --squash folds to ONE main commit; no Phase-2/TODO.
  • [PASS] 15. ARCHITECTURE GATE — placement: CORRECT.
  • [PASS] 16. Disposable-only — beds disposable: true, VM beds torn down clean (zero leftover domains).
  • [PASS] 17. Go gates re-run standalone (GOWORK=off): build 0, vet 0, go test PASS, gofmt clean, golangci-lint v2.12.2 0 issues.
  • [PASS] 18. CHANGELOG present (placeholder → finalized at merge).

Decision: APPROVED. Net PR diff (c7a3175..61ec120) = exactly the 13 K1 files; the reconciliation merge folds cleanly (verified byte-identical cue:gen no-op proves the auto-merged cue_types_gen.go is legit). All go/cue gates re-run live; all 7 bed summaries corroborated on disk. Finalizing the merge-time CalVer and merging (squash).

Assisted-by: Claude (analysed on a live system)

@atrawog
atrawog merged commit b95165f into main Jul 13, 2026
@atrawog
atrawog deleted the feat/k1-loader-orchestration branch July 13, 2026 14:03
atrawog added a commit to opencharly/charly that referenced this pull request Jul 13, 2026
…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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant