Skip to content

feat(loader)!: relocate the loader ORCHESTRATION to sdk/loaderkit; core is the materialize half (K1) - #93

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 superproject half (consumes the merged sdk half, opencharly/sdk#37 → b95165f / v0.2026194.1400). 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. 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.

Contents (22 files: +461/−656; unified.go −649, new loader_driver.go +217)

  • NEW charly/loader_driver.go — the single core→loaderkit file. hostWalkProject builds the six kind-blind host seams (Parser/Boundary/Threaded/ResolveRef/GateDoc/RepoIdentity); materializeLoadedProject replays the host decode→materialize→merge over the envelope — identical to the former inline loadUnifiedInto (root-wins doc order, explicit-entry-wins discovered nodes, embedded-defaults, and namespace pointer-sharing by id for the mutual-import cycle-break). 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 plain spec.DocParser set by the compiled-in candy/plugin-loader, guarded by a FATAL requireLoaderParser), and the dead namespaceAliasRe/MaxIncludeDepth.
  • candy/plugin-loader: ParseDoc implements spec.DocParser. sdk gitlink → b95165f, charly/go.mod require → v0.2026194.1400.

Change class

Code (runtime) — the consumer half of the cross-repo K1 landing (sdk#37 merged first, per B2). Base c8d2bd9 (post-P14a #92). The 20 loader files are disjoint from P14a's status/oci delta.

R10 evidence (fully tested and validated)

Full re-verification on the reconciled tree (base c8d2bd9 + this cutover + sdk b95165f): go build ./... = 0, full go test . PASS (60s, incl. TestImportNamespace_DivergentVersionMutualCycle — the namespace cycle-break equivalence), golangci-lint run = 0, gofmt clean.

K1 7-bed CONCURRENT roster (orchestrator-owned; frozen tree super 0d7472d + sdk 2977d5c, per-tree binary v2026.194.1340) — all through the relocated loaderkit.Walk + loader_driver + host materialize, launched simultaneously (max parallelism incl. the 4-way eval-vm flock):

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
Clean teardown: zero leftover domains.

The charly-side loader code is byte-identical across the P14a super/sdk merges (additive-disjoint — P14a touched status/oci + plugin_loader.go, not the config-load path), and the reconciled tree re-passes the full suite — so the roster evidence stands.

Migration residue (K1 IOU register — see the CHANGELOG)

  • The one core→loaderkit import (loader_driver.go) → K5 OpLoad exit.
  • The six WalkSeams with lifecycle classes: Boundary/Threaded/ResolveRef/Parser = PERMANENT-LEGIT; GateDoc/RepoIdentity = UNTIL-K5.
  • deploy_ref.go (reassigned K4→K1): LOAD-DOMAIN ref-resolver, coupled to the host ParseRemoteRef family → STAYS host + IOU-registered (moves with the ref-parse family; not churned in for LOC).

R0–R10 checklist

  • R0 skills loaded. RDD: the cycle-break pointer-identity risk proven on the real equivalence test (failed first run → symbolic id-ref fix → passes).
  • R1: the base-advance + sdk-race anomalies RCA'd (main advanced; disjoint; not contamination).
  • R3: shared config primitives → sdk/kit (one home); one discovered-node fold.
  • R5: hard cutover — deletions + no aliases; git grep over charly/ returns only loader_driver.go historical context.
  • R7/R10: full 7-bed cross-cutting roster on the final frozen code (7/7 PASS) + full suite on the reconciled tree.
  • R9: sdk gitlink → b95165f + charly/go.mod require → v0.2026194.1400.

Assisted-by: Claude (fully tested and validated)

…re is the materialize half (K1)

The superproject half of K1. The kind-blind WALK+PARSE half of charly's LoadUnified
now lives in sdk/loaderkit.Walk (see sdk v0.2026194.1400); 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. 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 driver file (P16 gate-b target), which dies
at the K5 OpLoad-envelope unit.

- NEW charly/loader_driver.go — the SINGLE core file importing sdk/loaderkit.
  hostWalkProject builds the six kind-blind host seams (Parser/Boundary/Threaded/
  ResolveRef/GateDoc/RepoIdentity) and calls loaderkit.Walk; materializeLoadedProject
  replays the host decode->materialize->merge over the envelope — identical to the former
  inline loadUnifiedInto (root-wins doc order, explicit-entry-wins discovered nodes,
  embedded-defaults, and namespace pointer-sharing by id for the mutual-import cycle-break).
  materializeDiscoveredNode is the ONE discovered-node fold shared with the layers
  candy-scan (R3); materializeDocStream materializes the binary-embedded default vocab.
- REMOVED (hard cutover, no aliases): loadUnifiedInto, mergeUnifiedDocs, loadNamespaceCached,
  the in-core validateNamespaceAlias, the loaderkit.DefaultParser fallback (activeLoaderParser
  is a plain spec.DocParser set by the compiled-in candy/plugin-loader, guarded by a FATAL
  requireLoaderParser), and the dead namespaceAliasRe + MaxIncludeDepth. The kind-blind
  config-directive primitives moved to sdk/kit.
- candy/plugin-loader: ParseDoc now implements spec.DocParser (spec.Threaded).
- sdk submodule -> b95165f + charly/go.mod require -> v0.2026194.1400 (the K1 sdk merge).

Migration residue (K1 IOU register, in the CHANGELOG): the one core->loaderkit import
(driver, K5 exit); the six WalkSeams with lifecycle classes (Boundary/Threaded/ResolveRef/
Parser = PERMANENT-LEGIT; GateDoc/RepoIdentity = UNTIL-K5); deploy_ref.go (K4->K1) =
LOAD-DOMAIN ref-resolver, coupled to the host ParseRemoteRef family, STAYS host + registered
(moves with the ref-parse family; not churned in for LOC).

Verified: both modules build; full charly test suite PASS (60s, incl.
TestImportNamespace_DivergentVersionMutualCycle, the namespace cycle-break equivalence);
golangci-lint 0; gofmt clean; the K1 7-bed CONCURRENT roster 7/7 PASS on the frozen tree.
The charly-side loader code is byte-identical across the P14a super/sdk merges (additive-
disjoint), so the roster evidence stands.

7-bed roster (per-tree binary v2026.194.1340, all through the relocated Walk + driver + materialize):
  check-commands-local  PASS  5 steps  147s
  check-substrate       PASS  9 steps  237s
  check-builder-vm      PASS  9 steps  262s
  check-structkind      PASS  5 steps  311s
  check-group           PASS  5 steps  316s
  check-sidecar-pod     PASS  11 steps 359s
  check-local-vm        PASS  7 steps  408s

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

pr-validator (V-K1chain) — CHANGES REQUESTED ❌

Change class: charly/sdk Go (K1 consumer/superproject half). placement: CORRECT (walk→sdk/loaderkit; the registry-coupled MATERIALIZE+MERGE correctly stays core; loader_driver.go is the one inventoried join with a tracked K5 exit).

The cutover is architecturally clean and all runtime gates pass — one blocking R5/R1 finding is the only thing between this and merge.

❌ BLOCKING — R5/R1: incomplete claim-keyed sweep of the MOVED loader-seam TYPES

Leg 1 (sdk#37, merged) moved loaderkit.Threaded → spec.Threaded and loaderkit.DocParser → spec.DocParser. #93 updated the code correctly (the plugin implements spec.DocParser; activeLoaderParser is a spec.DocParser) but left the deleted type identifiers alive in comments. git grep 'loaderkit.DocParser\|loaderkit.Threaded' returns 7 live non-CHANGELOG hits, so the R5 grep self-test FAILS. (The body's "R5 grep clean" claim swept only the 3 deleted function names — loadUnifiedInto/mergeUnifiedDocs/loadNamespaceCached, which ARE clean — not the moved type names.)

Most egregious: candy/plugin-loader/plugin.go's header describes its own current mechanism with the wrong type, contradicting its own code 40 lines below (// ParseDoc implements spec.DocParser).

Sweep these (→ spec.DocParser / spec.Threaded):

# file:line current (stale)
1 candy/plugin-loader/plugin.go:2 "serves the per-document PARSE via loaderkit.DocParser"
2 candy/plugin-loader/plugin.go:3 "resolves the registered loader provider to a loaderkit.DocParser"
3 candy/plugin-loader/plugin.go:8 "the host-threaded loaderkit.Threaded"
4 candy/plugin-loader/plugin.go:33 "implements loaderkit.DocParser"
5 charly/plugin_inproc.go:61 pattern exemplar "loaderkit.DocParser / kit.RefsDownloader"
6 candy/plugin-box/plugin.go:71 pattern exemplar "loaderkit.DocParser / kit.RefsDownloader"
7 CLAUDE.md:118 boundary-law canonical example "loaderkit.Threaded" (×2) — factual type-name correction to match the shipped code; the mechanism description is otherwise unchanged

Fix: update the 7 comment references, append a fix commit, push (status resets → I re-validate). No code change needed.

✅ Everything else — verified clean (independently re-run on d9a1357)

  • Coordinates exact: gitlink = b95165f (merged sdk main); go.mod require = v0.2026194.1400; branch contains P14a feat(p14a): status → command:status (Option B) + OCI engine → verb:oci; shed go-containerregistry #92.
  • go build/vet = 0, gofmt clean, go test ./... PASS, golangci-lint = 0 issues.
  • task cue:gen (superproject) = reproducible NO-OP (charly + sdk clean).
  • TestImportNamespace_DivergentVersionMutualCycle = PASS (namespace cycle-break equivalence).
  • P16 gate-(b): git grep -l sdk/loaderkit -- charly/*.go (non-test) = ONLY charly/loader_driver.go — the one inventoried until-K5 residual (body moved out → net core-LOC NEGATIVE).
  • ZERO new/grown charly/*_aliases.go (22→22). sdk/kit already core inventory (40→43 files, K-wave-tracked).
  • DefaultParser removal SAFE (requireLoaderParser() FATALs on nil; compiled-in loader sets activeLoaderParser at init).
  • 7-bed roster corroborated on disk (.check/*/2026.194.1329) EXACTLY: steps 5/9/9/5/5/11/7, seconds 147/237/262/311/316/359/408, all ok:true, 0 failed steps. Delta re-gate vs P14a: zero source-file overlap; loader files ship identically; combined-tree go gates green.
  • CHANGELOG 6-callback lifecycle-class table present + correct.

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

atrawog added 2 commits July 13, 2026 16:28
…K1 fix)

V-K1chain (pr-validator) flagged an incomplete claim-keyed R5 sweep on charly#93: the deleted
FUNCTION names were clean, but the MOVED TYPE names (loaderkit.DocParser -> spec.DocParser,
loaderkit.Threaded -> spec.Threaded, relocated to sdk/spec in the K1 sdk half) were left alive in
7 comment references. Comment/docs-only fix — no code change:

- candy/plugin-loader/plugin.go (x4): the header + the ParseDoc method comment now say
  spec.DocParser / spec.Threaded (matching the code, which already implements spec.DocParser).
- charly/plugin_inproc.go:61 + candy/plugin-box/plugin.go:71: the registerCompiledPlugin
  pattern-exemplar comment -> spec.DocParser.
- CLAUDE.md:118: the boundary-law D-clause canonical example -> spec.Threaded (x2) — type-name
  only; the mechanism description is byte-identical (the DATA-snapshot contract type moved to spec;
  loaderkit.ParseDoc still reads it).

`git grep 'loaderkit.DocParser\|loaderkit.Threaded'` now returns 0 non-CHANGELOG hits. Both modules
build; candy/plugin-loader standalone builds. Squash folds this under the PR's earned
"fully tested and validated" tier.

Assisted-by: Claude (documentation reviewed)
Claude-Session: https://claude.ai/code/session_01CCo9NzoUXrqkq5vbkWJLM3
…onsumer)

pr-validator (V-K1chain) merge-time version stamp for #93.

Assisted-by: Claude (fully tested and validated)
Claude-Session: https://claude.ai/code/session_01RiTCtnrPV5gfPzG4BaJ6a4
@atrawog

atrawog commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator (V-K1chain) — APPROVED ✅ (supersedes the prior CHANGES-REQUESTED)

The R5/R1 blocker is fixed exactly as requested in fix commit 5e9c687 (fast-forward, comment/docs-only).

Re-validation of the fix (head 5e9c687):

  • ✅ R5 grep now clean — git grep 'loaderkit.DocParser\|loaderkit.Threaded' returns ONLY CHANGELOG history files (0 live source refs). All 7 references corrected → spec.DocParser / spec.Threaded.
  • ✅ CLAUDE.md diff scrutinized (T1/T4) — the ONLY change is loaderkit.Threaded→spec.Threaded in the two boundary-law canonical examples; rule text, wording, and loaderkit.ParseDoc are byte-identical. A factual type-name correction matching the shipped code — no rule change.
  • ✅ Comment/docs-only — every changed .go line is a comment; compiled code byte-identical to the already-bed-proven d9a1357, so the 7-bed roster stands.
  • ✅ Re-gate green on the fix: go build/vet = 0, gofmt clean, go test ./... PASS, golangci-lint = 0 issues, task cue:gen reproducible no-op.
  • ✅ Coordinates intact: gitlink b95165f, go.mod require v0.2026194.1400.

Everything from round 1 still holds: placement CORRECT (walk→sdk/loaderkit; materialize+merge stays core); P16 gate-(b) = only loader_driver.go imports sdk/loaderkit (inventoried until-K5, net core-LOC NEGATIVE); ZERO new/grown *_aliases.go; DefaultParser-removal safe; the CHANGELOG 6-callback lifecycle-class table; the cycle-break equivalence test PASS; the 7-bed concurrent roster corroborated on disk exactly.

Decision: APPROVED. Finalizing the merge-time CalVer 2026.194.1432 and squash-merging → tag v2026.194.1432. This completes K1 (sdk leg already merged b95165f / v0.2026194.1400).

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

@atrawog
atrawog merged commit 2631809 into main Jul 13, 2026
@atrawog
atrawog deleted the feat/k1-loader-orchestration branch July 13, 2026 14:34
atrawog added a commit that referenced this pull request Jul 19, 2026
…cendant-wins

main advanced with the #152/#153 plugins-submodule bumps (now at plugins
main a58da76 = post-#95); the branch recorded 9caed76 (post-#91). The
gitlink conflict resolves descendant-wins to a58da76 (a descendant of
9caed76: #93/#94/#95 are docs-only skill accuracy fixes), so the branch
cannot regress main's pointer. Delta gate: charly box validate re-run.

Assisted-by: Kimi Code Moonshot Kimi K3 (analysed on a live system)
atrawog added a commit that referenced this pull request Sep 5, 2026
…— the cache verbs need CacheStatus/ClearCache/BypassCache)
github-actions Bot pushed a commit that referenced this pull request Sep 5, 2026
…ypass (#539)

* chore(vendor): re-vendor spec v0.2026247.2009 + plugin-check update_gate (the R10 change-class switch)

* feat(cache): charly cache status|clear|refresh + the --no-git-cache bypass (the git-ref cache operator surface)

* ci: re-trigger validator

* chore(vendor): spec pin → v0.2026247.2350 (the #93 cache-surface tag — the cache verbs need CacheStatus/ClearCache/BypassCache)

* fix(go): drop the committed TEMP-LOCAL-DEV absolute-path replaces (plugin-check/sdk/spec → /home/atrawog/...) — they break the CI go gate on ubuntu-latest; the modules resolve from the proxy at the pinned require versions (go build clean)

* docs(manifest): add cache_cmd.go row — the charly cache status|clear|refresh CLI surface over the core git-ref cache (same M class as cli_model_cmd.go/plugin_cmd.go); fixes the KERNEL_MANIFEST.md gate in TestKernelManifestBidirectional

* refactor(cache): the git-ref cache command moves OUT of core into the plugin-cache command candy (R5) — delete cache_cmd.go + the Cache CLI field + the --no-git-cache flag; the singleton honors the PERSISTED bypass (spec/refs SetBypass, spec #95); plugin-cache wired as a compiled-in command plugin (compiled_plugins + go.mod pin + regenerated plugins_generated.go); KERNEL_MANIFEST.md drops the cache_cmd.go row

* chore: plugin-cache pin → v0.2026248.728 (the ADE-plan + schema-version fix)

* chore: plugin-cache pin → v0.2026248.730 (the candy-gate charly pin fix)
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