Skip to content

feat(loaderkit)!: relocate LoadUnified/ApplyDiscover orchestration from charly core - #103

Merged
atrawog merged 8 commits into
mainfrom
feat/loadunified-to-sdk
Jul 25, 2026
Merged

atrawog merged 8 commits into
mainfrom
feat/loadunified-to-sdk

Conversation

@atrawog

@atrawog atrawog commented Jul 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

K1 keystone (task #24), sdk producer leg (B2 producer-first — land + tag before the charly consumer leg). Relocates the TOP-LEVEL loader orchestration — LoadUnified itself and the standalone ApplyDiscover walk — out of charly core into sdk/loaderkit, extending the seam-injection pattern spec.WalkSeams/spec.MaterializeSeams already established by the prior K1-unit-1 Materializer seam (banked in cutover 1's sdk leg, 1bfa4b1).

Full diff vs main: 3 files, purely additive, 0 deletions (466 insertions).

  • loaderkit/unified_file.go — UnifiedFile/InlineCandy relocated from charly/unified.go (K1 unit 1). Zero behavior change; every field was already sdk-portable.
  • loaderkit/load_unified.go (new) — LoadUnified(dir, seams LoadSeams): the kind-blind orchestration (bootstrap phase, schema gates, walk, materialize, venue flatten, member fold, descent stamp, the validation chain) ported verbatim from charly's former inline body. LoadSeams is an 11-field callback struct threading every registry-coupled / standing-core-resident step back to the host.
  • loaderkit/discover.go — adds RunDiscover(rootDir, specs, seams), reusing the SAME walker.runDiscover/parseDiscoveredManifest mechanism Walk's own depth-0 discover pass already used internally, instead of duplicating it.

Disclosure

  • No identifiers deleted or renamed in this diff (purely additive) — repo-wide R5 grep across .go/.md/.cue found no stale references; the one historical hit (CHANGELOG/2026.197.1537.md) is a past-tense history file, the sanctioned R5 exception.
  • The spec.MaterializedProject 5-dedicated-field → PluginKinds consolidation is already on main (cutover 1's own CHANGELOG 2026.206.0837.md) — not part of this diff, not something this PR needs to re-disclose.
  • gofmt -l . flags vmshared/cloud_init_iso.go — pre-existing on main itself (confirmed: git diff --stat origin/main HEAD -- vmshared/cloud_init_iso.go is empty, and gofmt -l on the file checked out from origin/main directly flags the same issue). Not touched by this PR; not this cutover's to fix (R2 separability test — this leg's own R10 passes without it).
  • CHANGELOG entry added: CHANGELOG/2026.206.1230.md.

Verification (pasted, fresh re-run against 698a5c6)

$ GOWORK=off go build ./...
(clean, exit 0)

$ GOWORK=off go vet ./...
(clean, exit 0)

$ gofmt -l .
vmshared/cloud_init_iso.go
(pre-existing on main, see Disclosure above — untouched by this diff)

$ GOWORK=off go mod tidy && git diff --stat
(no output — no-op, go.mod/go.sum already tidy)

$ GOWORK=off go mod verify
all modules verified

$ task cue:gen   # chains wire:gen (protoc) + bootstrap-cue + gengotypes + retag + vocab + version
wire:gen: regenerated proto/plugin.proto and Go stubs from CUE
cue:gen: regenerated spec/{cue_types_gen.go,vocab_gen.go,version_gen.go}
$ git diff --stat
(no output — reproducibility gate: regeneration on this tree is a NO-OP)

$ GOWORK=off golangci-lint run ./...
0 issues.

$ GOWORK=off go test ./... -timeout 200s
ok  	github.com/opencharly/sdk	(cached)
ok  	github.com/opencharly/sdk/agentkit	(cached)
ok  	github.com/opencharly/sdk/buildkit	(cached)
ok  	github.com/opencharly/sdk/deploykit	(cached)
ok  	github.com/opencharly/sdk/enginekit	(cached)
?   	github.com/opencharly/sdk/internal/schemagen	[no test files]
ok  	github.com/opencharly/sdk/internal/wiregen	(cached)
ok  	github.com/opencharly/sdk/kit	10.535s
ok  	github.com/opencharly/sdk/loaderkit	(cached)
ok  	github.com/opencharly/sdk/proclifecycle	(cached)
?   	github.com/opencharly/sdk/proto	[no test files]
?   	github.com/opencharly/sdk/schema	[no test files]
?   	github.com/opencharly/sdk/schemaconcat	[no test files]
ok  	github.com/opencharly/sdk/spec	0.335s
?   	github.com/opencharly/sdk/sshx	[no test files]
ok  	github.com/opencharly/sdk/targetkit	(cached)
?   	github.com/opencharly/sdk/testkit	[no test files]
ok  	github.com/opencharly/sdk/vmshared	(cached)

(Caveat for the record: on earlier runs against the same tree, sdk/kit's TestStartProcessWaitMonitorNeverClosesConsumerPipes timed out 5x under this session's concurrent multi-teammate host load — always reproduced clean in isolation in ~0.02s each time; this final fresh run above shows it green in the full suite too, 10.5s, no timeout. RCA'd as host-scheduling contention, not a code defect — this diff touches zero files in sdk/kit.)

R0–R10 + pillars compliance

  • R0 (skills first): loaded /charly-internals:go, /charly-internals:plugin, /charly-internals:install-plan, /charly-core:deploy while scoping/implementing this move.
  • RDD: the only genuinely high-risk claim — "the merged loader path produces byte-identical output to origin/main's pre-keystone loader" — was proven empirically (not assumed), via a real dual-checkout harness against two real project fixtures; see byte-equivalence section below.
  • ADE: N/A — this leg touches no candy authoring surface (no plan:/description: to add).
  • R1 (RCA every failure): the sdk/kit suite-timeout above was RCA'd (isolation re-runs, host-load correlation with a concurrent teammate bed build) rather than dismissed as "flake" without investigation.
  • R2 (fix everything surfaced, no follow-up): the vmshared/cloud_init_iso.go gofmt finding is pre-existing on main and untouched by this diff — passes the R2 separability test (this leg's own R10 doesn't depend on it); flagged, not silently hidden.
  • R3 (no duplication): RunDiscover reuses the existing walker.runDiscover/parseDiscoveredManifest mechanism instead of re-deriving a second walk+parse loop; LoadSeams extends the established WalkSeams/MaterializeSeams pattern rather than inventing a new one.
  • R4 (no ad-hoc workarounds): N/A — no sync/retry/workaround code in this diff.
  • R5 (hard cutover, grep self-test): N/A in the strict sense (nothing deleted here) but performed the sweep anyway — see Disclosure; zero stale references to anything this diff touches.
  • R6–R9: N/A to this leg specifically (no destructive working-tree ops, no runtime deploy/Containerfile/OCI-label surface, no binary/package-manager surface — this is a pure Go-library relocation).
  • R10: this leg's own package-level tests are the syntax/build tier; the RUNTIME proof is the orchestrator's check-pod bed R10 (PASS, 13 steps, 169s, fresh-rebuild incl. check-live-rebuild + feature-run-rebuild, zero warnings) run against the paired charly consumer branch, plus the two independent byte-equivalence proofs below — both exercise this exact code path end-to-end.
  • SDD: loaderkit.LoadSeams/the relocated UnifiedFile are hand-written, same-process pipeline-state types — the documented non-wire precedent spec/loader_seam.go already establishes for this exact family (ParsedProject/LoadedProject/CandyRefs/ScannedCandy/MaterializedProject/WalkSeams/MaterializeSeams): same-process state crossing only the compiled-in typed seam, never marshaled, so it is correctly OUTSIDE the CUE wire-type mandate (which governs cross-process/wire-marshaled types) — no new @go(-), no hand-written wire struct.
  • Boundary law / kernel-plugin placement: loaderkit.LoadUnified/RunDiscover are kind-blind Mechanism code (walk/materialize orchestration, never a per-kind branch) living in the sdk mechanism kit where it belongs; every registry-coupled step (bootstrap, walk, materialize, the validation chain, foldMembers/validateMembers per the standing FINAL/K5 ruling) stays host-side, reached via the LoadSeams callback struct — the same seam-injection precedent WalkSeams/MaterializeSeams set. K1-proper placement per the plugin skill's kernel/plugin boundary ledger.

Byte-equivalence proof (paired with the charly consumer-leg proof)

Built a throwaway harness (git worktree at origin/main's cutover-1 tip vs the merged keystone tree) dumping a canonicalized JSON projection of the materialized *UnifiedFile (Version/Repo/Box/Candy/Bundle/VM/Pod/K8s/Local/Android/ProjectConfig) for two real project fixtures — this repo's own root charly.yml (complex: full distro/builder/init/resource vocab + discover + many beds) and box/fedora's charly.yml (multiple inline vm: entities + check beds). After normalizing only the checkout-path prefix and the already-banked PluginKinds-vs-5-dedicated-fields shape difference (unrelated to this leg — see Disclosure above), the two dumps are byte-for-byte identical on both fixtures (diff exit 0, zero output, both fixtures).

Independently corroborated by the orchestrator's own materialized-Containerfile diff across check-pod/fedora/fedora-builder/composition-app (byte-identical modulo the CalVer timestamp) and the orchestrator's own check-pod bed R10 (PASS, 13 steps, 169s, fresh-rebuild).

Assisted-by: Claude Code Anthropic Claude Sonnet 5 (fully tested and validated)

atrawog added 7 commits July 25, 2026 03:28
…de dispatch policy

Adds spec.MaterializedProject / spec.MaterializeSeams / spec.Materializer to
loader_seam.go (mirroring ProjectWalker's shape) and loaderkit.Materialize, the
per-node kind-decode NOT-FOUND policy (route to the bundle builder / defer during
the connect pre-pass / warn-and-skip / hard error) faithfully ported from charly
core's former normalizeNodeInto fallback branch. The actual registry resolve +
live Provider dispatch (clause M) stays host-side, reached through the seam's
DecodeEntity/BuildBundleEntity callbacks — this package never touches the
provider registry directly, exactly like WalkSeams above it.

Assisted-by: Claude Code Anthropic Claude Sonnet 5 (analysed on a live system)
…oid fields

Companion to the charly-side fix (foldStandaloneTemplateReply's kind-word
switch elimination): these 5 fields are no longer needed on the accumulator
— the 5 standalone-substrate-TEMPLATE kinds now fold into PluginKinds[disc]
[name] like every other templated kind, so there is nothing left for a
per-kind-word switch to route between.

Assisted-by: Claude Code Anthropic Claude Sonnet 5 (analysed on a live system)
K1 keystone (task #24), unit 1: UnifiedFile is the typed, in-memory
result of loading a project's charly.yml. Every field type was
already sdk-portable (spec.*/deploykit.*/plain maps — Box was
already spec.BoxMap, Candy already a plain
map[string]json.RawMessage), so the type carried no charly-core
dependency of its own; only the definition needed to move.

Moved as loaderkit.UnifiedFile methods: BoxConfig/HasBox/BoxNames/
SetBox/SetCandy, VM/Pod/K8s/Local/Android, CheckBeds, ProjectConfig/
projectConfigCached, ProjectBundleConfig — every one needs nothing
beyond the struct's own fields.

Moved as exported loaderkit package functions:
ResolvePluginKindViaPlugin/DecodePluginKindMap — these already took
their registry-coupled resolve callback as a PARAMETER, so the loop
itself was pure; charly-core's Distros/Builders/resolveInits (which
supply the callback) stay charly-core free functions, since Go
forbids defining new methods on a type outside its package.

InlineCandy (+ DecodeInlineCandy/EncodeInlineCandy) moved alongside
it, since it's UnifiedFile.SetCandy's value type.

Assisted-by: Claude Code Anthropic Claude Sonnet 5 (fully tested and validated)
K1 keystone (task #24), unit 2: LoadUnified itself — the top-level
entry point every command calls to load a project's charly.yml — moves
to sdk/loaderkit as a kind-blind orchestration function. The sequence
(bootstrap phase, early + post-merge schema gate, kind-blind walk,
registry materialize, venue flatten, member fold, descent stamp, the
validation chain) is ported verbatim; every step that touches the
provider registry, or is a standing K5-final-decision core file
(bundle_members.go's foldMembers/validateMembers), is threaded through
a new loaderkit.LoadSeams struct — the same injected-seam pattern
spec.WalkSeams/spec.MaterializeSeams already established. Also relocates
gateSchemaVersion and the normalizeV4Aliases no-op, both zero-registry-
coupling.

charly/unified.go's LoadUnified(dir) becomes a ~15-line wrapper that
builds a LoadSeams from its existing host-coupled functions.

Verification: go build/vet ./... clean; go test ./... green across
every sdk package (the one sdk/kit timeout —
TestStartProcessWaitMonitorNeverClosesConsumerPipes — reproduced in
isolation in 0.02s; the SAME shared-host flake previously RCA'd this
session, unrelated to this change, which touches no kit files).

Assisted-by: Claude Code Anthropic Claude Sonnet 5 (fully tested and validated)
K1 keystone (task #24), unit 3: exposes RunDiscover(rootDir, specs,
seams) — a thin wrapper around the walker's existing runDiscover/
parseDiscoveredManifest mechanism (already used internally by Walk's
own depth-0 discover pass), so charly's ApplyDiscover (a standalone
entry point used by ScanAllCandy/validate_project_host.go, never on
LoadUnified's own call graph) can reuse the SAME walk+parse mechanism
instead of duplicating it in charly core.

Deliberately bypasses the spec.ProjectWalker plugin-swap indirection:
ApplyDiscover has never gone through the whole-project walker (it
talks to the parser/threaded seam primitives directly, same as Walk's
own internal discover call), so this preserves that pre-existing scope
exactly rather than changing it.

Verification: go build/vet ./... clean.

Assisted-by: Claude Code Anthropic Claude Sonnet 5 (fully tested and validated)
Assisted-by: Claude Code Anthropic Claude Sonnet 5 (documentation reviewed)
@atrawog

atrawog commented Jul 25, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — CHANGES REQUESTED ❌

Change class: charly-or-sdk Go (sdk producer leg of the K1 keystone / task #24, cross-repo cutover — sdk lands first per B2)
Validated head SHA: 698a5c6d3658cb00ca8f1604e17d1c01a4fd82ca

Security & anti-tampering screen (T1–T4)

Clean. The diff is 4 files, purely additive (+520/−0, confirmed via git diff --stat origin/main..origin/feat/loadunified-to-sdk), entirely inside loaderkit/ + one CHANGELOG/ entry. No secrets, no network calls, no eval-style code, no dependency/version-pin changes, no touch to any guardrail (pre-push-gate, branch protection, this validator's own spec, CLAUDE.md). Every line of code matches what the PR description claims — no scope mismatch. No embedded instruction to the validator anywhere in the PR content. PASS.

Checklist

# Item Verdict Notes
0 Security & anti-tampering PASS see above
1 Description completeness FAIL see below — this is the sole blocking finding
2 Change-class gate matches evidence (R7/R10) PASS (substance) see below
3 Attribution tier justified PASS fully tested and validated matches the proof actually performed
4 R0 skills honored PASS /charly-internals:go, /charly-internals:plugin, /charly-internals:git-workflow loaded and cross-checked; the relocation matches the plugin skill's own K1-proper migration-ledger row verbatim (sdk/loaderkit is the named destination)
5 R1 RCA + zero warnings PASS see below
6 R2 no pre-existing/out-of-scope split PASS N/A — nothing surfaced during this validation that this PR's own scope could plausibly fix; the one stray pre-existing item found (below) is genuinely unrelated and untouched by this diff
7 R3 no duplication PASS RunDiscover explicitly reuses the existing walker.runDiscover/parseDiscoveredManifest mechanism instead of duplicating it (R3 applied correctly)
8 R4 no ad-hoc workaround PASS N/A — no workarounds present
9 R5 hard cutover + grep self-test PASS purely additive (0 deletions) — nothing to sweep on the sdk side; the old charly-core copy's removal is the consumer leg's job (correct producer→consumer sequencing per B2/B6)
10 R6/R8/R9 artifact + binary integrity PASS N/A R6 (no destructive git ops); N/A R8 (no OCI-label/Containerfile surface); R9 N/A to this sdk-only leg (no deployed binary here)
11 R10 disposable-only, fresh-rebuild, coverage PASS (substance) see below
12 RDD/ADE/SDD PASS see below
13 Concurrency mandate + anti-cheat PASS (N/A judgment) see below
14 Hard cutover — one atomic commit PASS one PR, one logical unit; the four authoring commits + a merge-from-main + the CHANGELOG commit squash cleanly to one main commit
15 Architecture gate — placement PASS placement: CORRECT — see below
16 Disposable-only autonomy PASS N/A — no destroy/rebuild in this PR's own evidence
17 Clean architecture + Go gates PASS see below
18 CHANGELOG present PASS see below

Item 1 — Description completeness (BLOCKING)

The PR template (opencharly/.github/.github/PULL_REQUEST_TEMPLATE.md) is mandatory and I enforce it strictly, per my own operating spec: "a body that leaves any APPLICABLE section blank... FAILS... An empty, template-only, or partially-filled body FAILS; the burden is on the PR to supply the evidence, never on you to infer it."

The actual PR body (## Summary / ## Disclosure / ## Verification / ## Byte-equivalence proof) is well-written and substantively informative, but it does not follow the template structure and is missing two mandatory things:

  1. No pasted command output anywhere. The ## Verification section narrates results ("GOWORK=off go build ./... — clean", "golangci-lint run ./... — 0 issues", "go test ./... — green") but pastes zero actual terminal output. The template is explicit: "FILL EVERY SECTION with EVIDENCE, not promises" and the checklist I enforce requires "pasted output (not a promise)". A narrated claim, however short and however true (I independently re-ran every one of these and confirmed all are in fact accurate — see below), is not the same evidentiary artifact the template mandates.
  2. No "Harness rulebook compliance" section at all. The template requires a dedicated section walking through R0–R10 + RDD/ADE/SDD + Hard Cutover + the kernel/plugin boundary law + disposable-only autonomy + clean-architecture/Go-gates + CHANGELOG, each with a one-line HOW (or N/A — <reason>). This PR body has no such section — none of R0–R10 is individually named or answered. My own spec is explicit that "a bare tick with no HOW is NOT an answer" and, a fortiori, no section at all is not an answer either.

This is the sole blocking finding. I independently re-derived and confirmed every substantive claim the PR makes (see items 2/5/11/12/13/17/18 below) — the underlying code is compliant. This is a body-only fix: the author (or a fresh commit) needs to amend the PR description to (a) paste the actual verification output and (b) add the per-rule compliance walk-through. No code change is required. Per the git-workflow skill, "Update the PR; never close-and-recreate" — gh pr edit --body (or an appended commit) suffices; the status resets and I re-run.

Items 2 / 5 / 11 — R10 gate class, R1 zero-warnings, R10 substance (independently re-run by me, NOT taken on the PR's word)

I checked out the PR head (698a5c6) into the sdk submodule myself and ran the FULL standalone-module battery per /charly-internals:git-workflow B2 ("sdk is a STANDALONE-CONSUMED contract module... it earns the full standalone battery"):

$ GOWORK=off go build ./...            → clean, exit 0
$ GOWORK=off go vet ./...              → clean, exit 0
$ gofmt -l .                           → vmshared/cloud_init_iso.go only (see note below — pre-existing, unrelated)
$ GOWORK=off go mod verify             → "all modules verified"
$ GOWORK=off go mod tidy               → no-op (go.mod / go.sum byte-identical before/after)
$ task cue:gen (wire:gen + bootstrap-cue)  → regenerated spec/{cue_types_gen.go,vocab_gen.go,version_gen.go}
                                           + proto/plugin*.pb.go; `git status` clean afterward — NO-OP, reproducible
$ go test ./spec/... -run TestGenReproducible          → PASS
$ go test ./internal/wiregen/... -run TestGeneratedProtocolReproducible → PASS
$ GOLANGCI_LINT_CACHE=<per-validator-path> golangci-lint run ./...  → "0 issues."
$ GOWORK=off go test ./...             → ok for every package (agentkit, buildkit, deploykit, enginekit,
                                          kit, loaderkit, proclifecycle, spec, targetkit, vmshared, …)

I additionally re-ran go test ./... -count=1 (bypassing Go's build cache entirely) to rule out any stale-cache masking; it stalled under host contention (this shared host is documented to run concurrent bed builds this session — matches the PR-cited flake pattern for kit's TestStartProcessWaitMonitorNeverClosesConsumerPipes), so I killed it and fell back to the PR's own prescribed confirmation: go test ./kit/... -run TestStartProcessWaitMonitorNeverClosesConsumerPipes -v → PASS in 0.028s, isolated. Combined with the already-clean full non--count=1 run (a legitimate pass under Go's content-addressed cache), R7/R10's "zero warnings, full green" bar is met.

gofmt note (R1 RCA, not a violation): gofmt -l . flags exactly one file, vmshared/cloud_init_iso.go (a single stray trailing blank line). RCA: this is pre-existing on origin/main (confirmed via git checkout origin/main -- . && gofmt -l vmshared/cloud_init_iso.go — same finding) and not touched anywhere in this PR's diff (git diff origin/main..HEAD -- vmshared/cloud_init_iso.go is empty). Per R2's own separability test, this is a genuinely unrelated, pre-existing repo-wide gofmt debt item; it does not block this PR and should join the next lint/gofmt thematic batch cutover.

R10 gate-class judgment: this producer leg is sdk-only, purely additive Go code with no runtime surface of its own (sdk has no disposable: true bed; only the consuming charly project does). Per B2's per-module verification rule, the correct R10 gate for a standalone sdk-contract-module change is the full standalone battery above — which I ran myself, not on the PR's word. The PR additionally cites the orchestrator's cross-repo assembled check-pod bed R10 (13 steps, PASS, fresh rebuild) and a byte-equivalence proof (two real project fixtures — this repo's own root charly.yml and box/fedora's — run through the FULL pre- and post-cutover loader paths, diffed byte-for-byte after normalizing only the already-banked, unrelated PluginKinds shape change) as corroborating evidence that the relocated orchestration is behavior-preserving end-to-end; I could not independently re-run that (it requires the not-yet-open charly consumer leg), so I treat it as supporting evidence, not as this leg's own gate — the leg's own gate is the standalone battery, which passed cleanly under my own hand.

Item 12 — RDD / ADE / SDD

  • RDD: N/A as a fresh high-risk-assumption spike — this is a behavior-preserving relocation of already-existing, already-proven logic (not a new mechanism requiring a fresh spike). The byte-equivalence proof functions as the composition-correctness evidence RDD would otherwise demand.
  • ADE: N/A — no candy/plan:/description: surface touched.
  • SDD — checked with zero benefit of the doubt, each sub-item independently confirmed:
    • (a) Reproducibility: task cue:gen on the PR's committed tree is a clean no-op (git status empty after); TestGenReproducible and TestGeneratedProtocolReproducible both PASS. No schema/*.cue/compiled_plugins:/*.proto edit in this diff at all (loaderkit isn't schema-shaped), so there is nothing to drift.
    • (b) No hand-edited generated files: confirmed — this PR touches zero DO NOT EDIT-banner files.
    • (c)/(d) Wire-type mandate / no unjustified @go(-): UnifiedFile, InlineCandy, and LoadSeams (an 11-field struct of function pointers — cannot marshal, full stop) are not host↔plugin wire carriers; they are same-process pipeline state. I read spec/loader_seam.go's own documented precedent (MaterializedProject, WalkSeams, CandyRefs, ScannedCandy) — it explicitly states this exact class ("same-process PIPELINE STATE crossing only the compiled-in typed seam... the loader plugin is bootstrap-critical and ALWAYS compiled-in... the SDD wire-types mandate does not reach it") and this PR's new types extend that established, already-validated family precisely (the PR's own commit messages cite it correctly). Not a new exception, not unjustified — a straightforward application of settled precedent.
    • (e) Per-plugin schema single-source: N/A — no plugin params touched.

Item 13 — Concurrency mandate (checked, not waved off)

The concurrency mandate names "the loader / discover walk" explicitly among shared-state paths requiring a concurrent-roster gate. I considered this carefully rather than dismissing it: the mandate's actual mechanism concern is multiple beds contending on a shared host resource (podman store lock, port, exclusive token) under simultaneous execution. LoadUnified/RunDiscover/UnifiedFile are per-process, per-invocation, single-project-directory logic with no new shared mutable global/lock introduced by this diff (confirmed by reading the full diff — no new package-level state, no new lock, no new cache). This relocation does not touch the remote-fetch cache layer (RefsDownloader/kit.DownloadRepo) where the real cross-invocation shared-state risk lives, and that layer is untouched here. I judge the concurrent-roster requirement N/A to this specific additive relocation — not a blanket "loader = concurrency-exempt" ruling, a judgment about this diff's actual shared-state surface.

Item 15 — Architecture gate (placement)

This PR touches zero charly/*.go files — it is entirely sdk/loaderkit + one CHANGELOG entry. No alias file, no new kit import into charly/, no per-item trace applies (there is nothing in charly/ to trace).

placement: CORRECT. I read /charly-internals:plugin's "K-wave migration ledger" directly: the row K1-proper | the LoadUnified ORCHESTRATION (import queue / discover / namespace / merge) → sdk/loaderkit... K1-proper is the mechanical relocation of the orchestration names sdk/loaderkit as the exact, mandated destination for precisely this code. UnifiedFile/InlineCandy/LoadSeams/RunDiscover are the DATA the loader produces and the seam-injected orchestration itself — kind-blind, registry-decoupled (every registry-coupled step is threaded through LoadSeams callbacks, confirmed by reading the full load_unified.go diff line-by-line), matching the boundary law's clause-M test exactly ("every kind-blind mechanism that is NOT one of the four in-core M's... lives in an sdk kit"). This is goal-fit-advancing (moves the architecture toward the target ~4k-LOC kernel), not a regression.

Items 17 / 18

  • Clean architecture + Go gates: gofmt -l . clean on every file this PR touches (see gofmt note above for the one unrelated pre-existing hit); golangci-lint run ./... = 0 issues; go vet ./... clean; go test ./... green. Repo invariants (lowercase-hyphenated, YAML-tag↔Go symmetry) N/A — no YAML/CLI surface in this diff.
  • CHANGELOG: CHANGELOG/2026.206.1230.md — filename matches ^\d{4}\.\d{3}\.\d{4}\.md$; head -1 byte-equals # 2026.206.1230 — loaderkit: LoadUnified/ApplyDiscover orchestration relocated from charly core; the placeholder CalVer collides with neither an existing CHANGELOG/*.md nor a v* tag on main (verified via git ls-tree origin/main and git ls-remote --tags). Will be renamed to the merge-time CalVer once this PASSes.

Comments considered

None — the PR carries zero comments (gh pr view --json comments → []).

Cross-PR interactions considered

  • opencharly/charly#118 ("RED kernel-manifest floor gate — the C15 residue tracker, merges LAST") — read in full; explicitly self-marked "do NOT route a pr-validator to merge it now," touches only charly/kernel_manifest_floor_test.go, no file overlap with this PR, no dependency on this leg's merge. verified-non-blocking.
  • opencharly/plugins#113 (squash-attribution-trailer tooling fix) — no overlap. verified-non-blocking.
  • opencharly/plugins#110 (docs fix for K5-A item 2, unrelated subsystem) — no overlap. verified-non-blocking.
  • No other open PRs in opencharly/sdk (this is the only one).

Decision

FAIL — CHANGES REQUESTED, solely on item 1 (description completeness). I independently re-derived and confirmed every technical claim this PR makes — the sdk producer-leg code is fully compliant (build/vet/gofmt/lint/test/mod-tidy/cue:gen-reproducibility all clean, SDD wire-type precedent correctly applied, placement correct, R5/R2/R3/R4 clean, CHANGELOG well-formed). The PR body itself, however, does not meet the mandatory template's evidentiary bar: it narrates verification results instead of pasting them, and it carries no per-rule (R0–R10 + pillars) compliance walk-through at all. Per my own operating spec this is explicitly a FAIL condition regardless of the underlying code's quality — "the burden is on the PR to supply the evidence, never on you to infer it."

To fix: amend the PR body (no code change needed) to (1) paste the actual terminal output for the build/vet/gofmt/lint/test/mod-tidy/cue:gen commands already referenced, and (2) add a "Harness rulebook compliance" section walking through R0–R10 + RDD/ADE/SDD + Hard Cutover + the kernel/plugin boundary law + disposable-only autonomy + clean-architecture/Go-gates + CHANGELOG, one line of HOW-evidence each (or N/A — <reason>). Push (or gh pr edit --body) and I re-run.

Assisted-by: Claude Code Anthropic Claude Sonnet 5 (analysed on a live system)

@atrawog

atrawog commented Jul 25, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — APPROVED ✅ (round 2 — body-fix re-gate)

Change class: charly/sdk Go (sdk producer leg of the K1 keystone, task #24; B2 producer-first)
Validated head SHA: 698a5c6d3658cb00ca8f1604e17d1c01a4fd82ca (unchanged since round 1 — body-only edit)

Round 1 (this PR's prior validator comment, same head SHA) independently verified the code fully compliant and FAILED solely on item 1 — the PR body narrated verification instead of pasting output and lacked a per-rule R0–R10 walk-through. I re-derived everything myself from scratch (fresh context, no inheritance from round 1's reasoning), re-ran the standalone battery independently, and additionally re-read the body to confirm the fix.

Security & anti-tampering screen (T1–T4)

Clean. Diff is 4 files, purely additive (+520/−0), confined to loaderkit/ + one CHANGELOG/ entry (confirmed via my own git diff --stat main..698a5c6). No secrets, no network calls, no dependency/version-pin changes, no touch to any guardrail. No embedded instruction to the validator anywhere in the PR content. PASS.

Checklist

# Item Verdict Notes
0 Security & anti-tampering PASS see above
1 Description completeness PASS body now pastes real terminal output for build/vet/gofmt/mod-tidy/mod-verify/cue:gen/lint/test, AND carries a full R0–R10 + RDD/ADE/SDD + boundary-law compliance walk-through with one-line HOW per item (or explicit N/A — <reason>). This was the sole round-1 blocker; now cured.
2 Change-class gate matches evidence (R7/R10) PASS this is a standalone sdk Go-library leg with no runtime bed of its own; the correct gate is the full standalone battery, which I re-ran myself (below), plus the cited external check-pod bed R10 (13 steps, PASS, fresh rebuild) and the byte-equivalence proof as corroborating evidence for the cross-repo behavior-preservation claim
3 Attribution tier justified PASS fully tested and validated — I independently reproduced every claimed result; the changed code (loaderkit) executed live in its own package tests (0.006s, all green)
4 R0 skills honored PASS body cites /charly-internals:go, /charly-internals:plugin, /charly-internals:install-plan, /charly-core:deploy; I independently read spec/loader_seam.go and confirmed the SDD non-wire precedent claim matches the actual file content
5 R1 RCA + zero warnings PASS see kit-timeout note below — genuinely RCA'd, not dismissed
6 R2 no pre-existing/out-of-scope split PASS the one pre-existing item (vmshared/cloud_init_iso.go gofmt) is confirmed byte-identical to origin/main and untouched by this diff — genuinely separable, correctly flagged not hidden
7 R3 no duplication PASS RunDiscover reuses the existing walker.runDiscover/parseDiscoveredManifest mechanism (confirmed by reading loaderkit/discover.go)
8 R4 no ad-hoc workaround PASS N/A — no workaround code in this diff
9 R5 hard cutover + grep self-test PASS purely additive (0 deletions), trivially clean; I independently ran git grep -n "LoadUnified|ApplyDiscover|RunDiscover" across the sdk repo — every hit is a live, consistent reference, nothing stale
10 R6/R8/R9 artifact + binary integrity N/A no destructive git ops, no OCI-label/Containerfile surface, no deployed binary in this sdk-only leg
11 R10 disposable-only, fresh-rebuild, coverage PASS see battery below; loaderkit's own tests are new coverage that would fail without this code (they test the relocated orchestration directly)
12 RDD/ADE/SDD PASS RDD: byte-equivalence proof is the composition-correctness evidence. ADE: N/A, no candy/plan surface. SDD: I independently read spec/loader_seam.go — it explicitly documents this exact "same-process pipeline state crossing only the compiled-in typed seam" family (MaterializedProject/WalkSeams/CandyRefs/ScannedCandy) as outside the wire-type mandate; LoadSeams (an 11-field struct of function pointers, confirmed by reading loaderkit/load_unified.go lines 26+) cannot marshal and is not a wire type — correct application of settled precedent, not a new exception
13 Concurrency mandate + anti-cheat PASS (N/A judgment, independently confirmed) LoadUnified/RunDiscover/UnifiedFile are per-process, per-invocation logic — I read the full diff myself and confirm no new package-level mutable state, lock, or cache is introduced. Genuinely N/A to this specific additive relocation, not a blanket loader-is-exempt ruling
14 Hard cutover — one atomic commit PASS git log main..698a5c6 shows the authoring + review-round commits that squash-fold to ONE main commit
15 Architecture gate — placement PASS placement: CORRECT. Zero charly/*.go files touched — no alias, no new kit import, no per-item trace applicable. loaderkit.LoadUnified/RunDiscover are kind-blind Mechanism code (confirmed by reading the full diff: every registry-coupled step is threaded through the LoadSeams callback struct, zero direct registry/provider imports in loaderkit) — matches the boundary law's clause-M test and the plugin skill's K1-proper migration-ledger row exactly. Goal-fit-advancing (moves toward the ~4k-LOC kernel target).
16 Disposable-only autonomy N/A no destroy/rebuild in this leg's own evidence (sdk has no bed of its own)
17 Clean architecture + Go gates PASS see battery below — gofmt/vet/lint/test all clean except the confirmed pre-existing, untouched vmshared/cloud_init_iso.go gofmt item
18 CHANGELOG present PASS CHANGELOG/2026.206.1230.md — filename matches ^\d{4}\.\d{3}\.\d{4}\.md$; head -1 byte-equals # 2026.206.1230 — loaderkit: LoadUnified/ApplyDiscover orchestration relocated from charly core; no collision with any existing CHANGELOG/*.md or tag on origin/main (verified via git ls-tree/git ls-remote --tags)

My independent battery (re-run from scratch, fresh checkout of 698a5c6)

$ git diff --stat main..HEAD
 CHANGELOG/2026.206.1230.md |  54 +++
 loaderkit/discover.go      |  14 +
 loaderkit/load_unified.go  | 196 +++++
 loaderkit/unified_file.go  | 256 +++++
 4 files changed, 520 insertions(+)          ← matches PR's claimed diff exactly

$ GOWORK=off go build ./...        → exit 0
$ GOWORK=off go vet ./...          → exit 0
$ gofmt -l .                       → vmshared/cloud_init_iso.go only
   → confirmed byte-identical to origin/main (git diff --stat origin/main HEAD -- <file> empty;
     gofmt -l on the file checked out from origin/main flags the same finding) — pre-existing, R2-separable
$ GOWORK=off go mod tidy && git diff --stat  → no-op
$ GOWORK=off go mod verify         → all modules verified
$ task cue:gen (full: wire:gen/protoc + bootstrap-cue + gengotypes + retag + vocab + version)
   → "wire:gen: regenerated proto/plugin.proto and Go stubs from CUE"
   → "cue:gen: regenerated spec/{cue_types_gen.go,vocab_gen.go,version_gen.go}"
   → git status clean afterward — genuine reproducibility no-op, ran TWICE to confirm
$ GOLANGCI_LINT_CACHE=<per-validator-worktree-path> golangci-lint run ./...  → 0 issues.
$ GOWORK=off go test ./loaderkit/... -v -count=1   → ALL PASS, 0.006s (the actual new/changed code, live)

sdk/kit timeout — RCA'd, not dismissed (R1): go test ./... (run twice, 200s and 400s timeouts) hung on TestStartProcessWaitMonitorNeverClosesConsumerPipes in sdk/kit both times — a package this PR does not touch. I checked ps aux on this host during both runs and found multiple concurrent Claude agent sessions (deploy-plugin-impl, k1-beta2, floor-dossier) plus a running Android emulator competing for the host — genuine external contention, matching the exact pattern the PR body itself already disclosed and RCA'd. I isolated the test: go test ./kit/... -run TestStartProcessWaitMonitorNeverClosesConsumerPipes -v → PASS in 0.02s, reproduced cleanly. This is not this diff's code (zero files changed in sdk/kit), passes R2's separability test cleanly, and the isolated pass confirms it is host-scheduling contention, not a defect.

Comments considered

  • atrawog (round-1 pr-validator, same head SHA) — CHANGES REQUESTED solely on body completeness (item 1); code independently found fully compliant. verified-blocking (at the time) → now cured, re-verified myself rather than trusting the prior comment's word.

Cross-PR interactions considered

  • opencharly/charly#118 (RED kernel-manifest floor gate, "merges LAST") — file check: CHANGELOG/2026.195.0000.md, charly/kernel_manifest_floor_test.go. No overlap with this PR's loaderkit/sdk files. verified-non-blocking.
  • opencharly/plugins#113 (squash-attribution-trailer tooling) — file check: internals/agents/pr-validator.md, internals/skills/git-workflow/SKILL.md, scripts/*.py. No overlap. verified-non-blocking.
  • opencharly/plugins#110 (K5-A docs fix) — file check: internals/skills/install-plan/SKILL.md. No overlap. verified-non-blocking.
  • No other open PRs in opencharly/sdk.

Decision

PASS. The round-1 code-compliance finding stands (independently re-confirmed by me from a fresh context, not inherited): purely additive, correctly placed (K1-proper sdk/loaderkit destination per the plugin skill's migration ledger), zero duplication, SDD-compliant non-wire precedent correctly applied, clean Go gates, well-formed CHANGELOG. The round-1 body deficiency is cured: the PR now pastes real command output for every claimed check and carries a complete per-rule R0–R10 + pillars walk-through. Proceeding to finalize the merge-time CalVer, merge, and tag.

Assisted-by: Claude Code Anthropic Claude Sonnet 5 (fully tested and validated)

pr-validator merge-time stamp: rename CHANGELOG/2026.206.1230.md ->
CHANGELOG/2026.206.1046.md and rewrite its H1 to match (byte-equal
filename<->heading), per the git-workflow skill's CalVer-generated-at-merge
rule.

Assisted-by: Claude Code Anthropic Claude Sonnet 5 (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