Skip to content

feat(deploy)!: K4-B — move the bundle-add compile slice out of core into candy/plugin-bundle (re-hydrator + OpCompile seam) - #120

Merged
atrawog merged 4 commits into
mainfrom
feat/k4b-compile-slice
Jul 15, 2026
Merged

atrawog merged 4 commits into
mainfrom
feat/k4b-compile-slice

Conversation

@atrawog

@atrawog atrawog commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

K4-B — move the deploy COMPILE slice (BuildDeployPlan loop) out of charly/ core into candy/plugin-bundle

K4-B (the deploy-compile continuation of the K4 deploy-resolution wave): the charly bundle add deploy COMPILE slice — the BuildDeployPlan loop that turns each candy + the resolved box + HostContext into an InstallPlan — moves OUT of charly/ core INTO the candy/plugin-bundle plugin candy (the command:bundle provider's new OpCompile leg). The host now ONLY computes the per-node SELECTION (the resolved box — authored OR synthetic — projected to a spec.ResolvedBoxView, the FINAL pruned candy order, the host-side deploykit.HostContext incl. the preresolved BuilderContext) and Invokes the plugin's OpCompile with a spec.DeployCompileRequest; the plugin re-hydrates the resolved-project envelope ITSELF via HostBuild("resolved-project") (the established #67 seam), re-hydrates the box vocab via deploykit.NewSpecResolvedBox and each candy model via deploykit.NewSpecCandyModel, loops deploykit.BuildDeployPlan over the host-provided order, projects each plan to its InstallPlanView wire form, returns []InstallPlanView; the host re-materializes []*InstallPlan via deploykit.PlanFromView. The compile CALL SITE no longer lives in core.

The pure compiler (BuildDeployPlan) is a kind-blind MECHANISM already in sdk/deploykit; this cutover moves the LOOP + the per-node glue out of charly/ core into the plugin, per the kernel/plugin boundary law: a kind-blind mechanism that is NOT one of the four in-core M's (plugin loading, prescan-dispatch, the kind-decode materialize, the wire broker) is a PLUGIN. IMPORT-PURITY preserved (candy/plugin-bundle/compile.go imports ONLY github.com/opencharly/sdk); ZERO-ALIASES preserved (the BuildDeployPlan + MergePlan aliases deleted from charly/deploykit_compiler_aliases.go).

What moved / what stayed

  • DELETED from charly/bundle_add_cmd.go (~162 LOC): the old compilePlans / compileBoxPlans / compileCandyPlans / compileCandyPlansWithContext loop bodies (which called BuildDeployPlan directly in core). Call sites now use compileRefSelection / compileCandySelection / compileBoxSelection → compileViaPlugin.
  • DELETED from charly/deploykit_compiler_aliases.go: the BuildDeployPlan + MergePlan aliases (R5). Surviving: HostContext / DescribePlan / computeDeployID.
  • NEW charly/bundle_compile_seam.go — the host-side seam: compileViaPlugin (in-proc reverse channel + OpCompile + PlanFromView re-materialization) + the per-unit selection helpers that replaced the deleted loop bodies.
  • NEW candy/plugin-bundle/compile.go — the plugin OpCompile leg: re-hydrate envelope via HostBuild("resolved-project") + loop BuildDeployPlan + project []InstallPlanView. IMPORT-PURITY: imports ONLY github.com/opencharly/sdk.
  • candy/plugin-bundle/command.go — Invoke dispatches case sdk.OpCompile.
  • charly/install_build_test.go + charly/localpkg_test.go — BuildDeployPlan(...) → deploykit.BuildDeployPlan(...) + MergePlan → deploykit.MergePlan (deleted alias forced explicit sdk refs).
  • charly/layers.go — setRaw nil-slice guard (surfaced by the envelope re-hydration round-trip).
  • NEW charly/bundle_compile_parity_test.go — the K4-B compile-parity golden + the isolateProviderRegistry full-suite test-isolation fix.

Change class

charly Go runtime + candy/plugin-bundle Go runtime + sdk gitlink bump (→ sdk PR #52).

R10 evidence

  • go test ./... (full suite): ok github.com/opencharly/charly/charly 101.526s (green, ZERO warnings).
  • Targeted parity golden: "PARITY OK: 3 candies, 3 classes (map[builder:true op:true pkg:true]) — plugin OpCompile round-trip byte-faithful for the deploy compile" + "can-fail RIDER OK: perturbed Home changed ≥1 plan".
  • gofmt -l empty; go vet ./... clean; golangci-lint run 0 issues.
  • task cue:gen reproducible; TestPluginsGenReproducible PASS; task build:binary built.
  • Bed charly check run check-sidecar-pod (SHORT pod+peer-member bed, the R10 composition gate for the deploy compile slice): FRESH PASS (steps=11, exit 0, ZERO warnings) — verified twice on a fresh destroy+rebuild.
  • R5 grep self-test: git grep for the deleted compile-loop funcs + the deleted charly-aliases returns clean (no stale references).

Parity

Byte-faithful, proven by TestBundleCompileParity_PluginRoundTrip: (1) WireView parity — the plugin-compiled + re-materialized plan projects to the SAME wire JSON as the former live host-compile; (2) PlanFromView fidelity — the WireView→PlanFromView round-trip is the identity on a re-materialized plan. Across 3 fixture candies spanning 3 step classes (pkg/op/builder). A can-fail RIDER perturbs the box Home and asserts the plans DIFFER (not vacuous). Non-vacuity guarded: ≥3 candies AND ≥2 step classes.

Multi-repo (B2)

Non-blocking findings (collected for the next thematic batch)

  • Test-isolation pollution (FIXED in this cutover). The parity test (alphabetically 'b') is the first in the suite to call LoadUnified(rootDir), populating the global providerRegistry.byKey + the additive prescan globals; a later test's providerRegistry.Close() closes connections but does NOT clear byKey, so subsequent tests find stale closed providers → "grpc: the client connection is closing" + validateCheckBeds accepts k8s. Fixed with isolateProviderRegistry(t) (snapshot+restore). The deeper registry-has-no-Unregister design is a non-blocking finding for the next test-infra batch.
  • Remote --add-candy envelope gap. The resolved-project envelope currently carries only root-project boxes/candies; a --add-candy ref to a candy NOT in the root discover would miss. Not exercised by the R10 bed; tracked for the next deploy-resolution batch (docs(landing): correct CLAUDE.md + plugins to the PROVEN two-gate merge model #67-gated cone).
  • Vacuous-skip in TestBuildDeployPlan*. Pre-existing vacuous-skip (fedora-coder not in the root discover on a worktree checkout), NOT a regression; the parity golden covers the compile slice non-vacuously via a hand-built imgOld.

Attribution

Assisted-by: Claude (fully tested and validated) — full suite green + fresh-rebuild R10 bed (check-sidecar-pod) PASS (11/11 steps, ZERO warnings) + the parity golden exercised the new compile seam end-to-end over the full plugin round-trip.

Assisted-by: Claude (fully tested and validated)

atrawog added 3 commits July 15, 2026 03:40
…nto candy/plugin-bundle (re-hydrator + OpCompile seam)

K4-B (the deploy-compile continuation of the K4 deploy-resolution wave): the
charly bundle add deploy COMPILE slice — the BuildDeployPlan loop that turns each
candy + the resolved box + HostContext into an InstallPlan — moves OUT of charly/
core INTO the candy/plugin-bundle plugin candy (the command:bundle provider's new
OpCompile leg). The host now ONLY computes the per-node SELECTION (the resolved
box — authored OR synthetic — projected to a spec.ResolvedBoxView, the FINAL
pruned candy order, the host-side deploykit.HostContext incl. the preresolved
BuilderContext) and Invokes the plugin's OpCompile with a spec.DeployCompileRequest;
the plugin re-hydrates the resolved-project envelope ITSELF via
HostBuild("resolved-project") (the established #67 seam), re-hydrates the box vocab
via deploykit.NewSpecResolvedBox and each candy model via deploykit.NewSpecCandyModel,
loops deploykit.BuildDeployPlan over the host-provided order, projects each plan to
its InstallPlanView wire form, returns []InstallPlanView; the host re-materializes
[]*InstallPlan via deploykit.PlanFromView. The compile CALL SITE no longer lives in
core (the kernel/plugin boundary law: a kind-blind mechanism that is NOT one of the
four in-core M's is a plugin). IMPORT-PURITY preserved (candy/plugin-bundle/compile.go
imports ONLY github.com/opencharly/sdk); ZERO-ALIASES preserved (the BuildDeployPlan +
MergePlan aliases deleted from charly/deploykit_compiler_aliases.go).

What moved / what stayed:
- DELETED from charly/bundle_add_cmd.go (~162 LOC): the old compilePlans /
  compileBoxPlans / compileCandyPlans / compileCandyPlansWithContext loop bodies.
  Call sites now use compileRefSelection / compileCandySelection / compileBoxSelection
  -> compileViaPlugin (the new seam).
- DELETED from charly/deploykit_compiler_aliases.go: BuildDeployPlan + MergePlan
  aliases (R5). Surviving: HostContext / DescribePlan / computeDeployID.
- NEW charly/bundle_compile_seam.go: compileViaPlugin (in-proc reverse channel +
  OpCompile + PlanFromView re-materialization) + the per-unit selection helpers
  that replaced the deleted loop bodies.
- NEW candy/plugin-bundle/compile.go: the plugin OpCompile leg (re-hydrate envelope
  via HostBuild("resolved-project") + loop BuildDeployPlan + project []InstallPlanView).
- candy/plugin-bundle/command.go: Invoke dispatches case sdk.OpCompile.
- charly/install_build_test.go + charly/localpkg_test.go: BuildDeployPlan(...) ->
  deploykit.BuildDeployPlan(...) + MergePlan -> deploykit.MergePlan (deleted alias
  forced explicit sdk refs).
- charly/layers.go: setRaw nil-slice guard (a nil []string in the RawInstallContext
  carry-through, surfaced by the envelope re-hydration round-trip).
- NEW charly/bundle_compile_parity_test.go: the K4-B compile-parity golden (WireView
  parity + PlanFromView fidelity + can-fail RIDER + non-vacuity guards) + the
  isolateProviderRegistry helper (full-suite test-isolation fix).

sdk gitlink bump: b8590fb -> 2ee0808 (sdk PR #52 — OpCompile + PlanFromView + the
deploy-compile seam types).

R10: go test ./... ok (101.526s, ZERO warnings); parity golden byte-faithful (3
candies, 3 classes pkg/op/builder, can-fail RIDER OK); gofmt/vet/golangci-lint
clean; task cue:gen reproducible; bed check-sidecar-pod FRESH PASS (11/11 steps,
exit 0, ZERO warnings, verified twice). R5 grep self-test clean.

Assisted-by: Claude (fully tested and validated)
…gelog (only DeployCompileRequest/Reply are new)

R5 claim-keyed sweep (sibling doc in the same cutover): the superproject
CHANGELOG repeated the false claim that the sdk half adds CUE defs for THREE
seam types incl. ResolvedProjectRequest. The actual sdk diff adds only TWO
(DeployCompileRequest / DeployCompileReply); #ResolvedProjectRequest already
exists in schema/resolvedproject.cue from the K5-Unit-0 cutover
(CHANGELOG/2026.194.1655.md) and is NOT re-added (resolvedproject.cue diff empty).
Corrected the sdk-contract-surface bullet. Doc-only; no code or gate impact.

Assisted-by: Claude (documentation reviewed)
…v0.2026196.208)

B2: the super gitlink references the MERGED sdk main commit (654940bb, tag
v0.2026196.208, PR opencharly/sdk#52), not the feat branch. go.mod require
bumps v0.2026195.742 -> v0.2026196.208 (replace => ../sdk keeps in-tree
resolution). go build + go vet green against the repointed submodule.

Assisted-by: Claude (fully tested and validated)
@atrawog

atrawog commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — APPROVED ✅

Change class: charly/sdk Go (K4-B — bundle-add deploy-compile slice → candy/plugin-bundle OpCompile leg)

Head: 292cd7df on feat/k4b-compile-slice

Checklist (every rule)

  • [PASS] 0. security & anti-tampering: no exfiltration, no scope-mismatch (the new candy/plugin-bundle/compile.go + charly/bundle_compile_seam.go do exactly what the title claims), no weakened guardrail, no supply-chain change (sdk require → merged v0.2026196.208, replace => ../sdk unchanged). No validator-directed directive.
  • [PASS] 1. description complete: Summary, How R10-tested (check-sidecar-pod, disposable, fresh-rebuild, compile path live, pasted output), Attribution tier, CLAUDE.md rule-compliance section — all supplied.
  • [PASS] 2. change-class gate: charly Go code on the bundle-add compile path → charly check run check-sidecar-pod (pod bed whose charly bundle add exercises the compile path). No dry-run, no --no-rebuild/--keep.
  • [PASS] 3. attribution tier: fully tested and validated justified — the NEW plugin OpCompile leg + the host seam EXECUTED against the fresh rebuild (deploy-add + update), both R10 outputs pasted.
  • [PASS] 4. R0 skills: /charly-internals:go + /charly-internals:plugin + /charly-check:check + /charly-internals:cutover-policy + /charly-internals:go-quality. Plugin IMPORT-PURE (compile.go imports only github.com/opencharly/sdk + subpackages); ZERO-ALIASES shrank (2 deleted).
  • [PASS] 5. R1 / ZERO warnings: fresh bed run — ZERO warnings (grep across all step logs, excluding debug RPC chatter, empty). 11/11 steps ok.
  • [PASS] 6. R2: no pre-existing/out-of-scope split.
  • [PASS] 7. R3: ONE shared compiler (deploykit.BuildDeployPlan); compileSelectionViaPlugin is the ONE per-unit helper replacing the deleted quad.
  • [PASS] 8. R4: no sleep/retry/magic-number/ad-hoc-podman; the in-proc reverse channel is the established sdk seam.
  • [PASS] 9. R5: deleted funcs/aliases appear ONLY in comment prose — no code call sites. Tests use explicit deploykit.* qualified refs.
  • [PASS] 10. R6/R8/R9: no destructive git action; generation untouched; per-tree binary 2026.196.0214 rebuilt from PR source, bed ran on it (run-calver 2026.196.0224).
  • [PASS] 11. R10: check-sidecar-pod disposable: true; FRESH run exit 0, 11 steps, 350s, ZERO warnings; update (106s) executed LIVE; compile path executed live at deploy-add + update; parity golden TestBundleCompileParity_PluginRoundTrip PASSES (the coverage that would FAIL without the move).
  • [PASS] 12. RDD/ADE/SDD: composition proven on the disposable bed; bed carries description: + plan: with deterministic check: steps; task cue:gen no-op (run twice, tree clean); reproducibility tests PASS; no *_gen.go hand-edited; wire types CUE-sourced; no new @go(-)/hand-written schema type.
  • [PASS] 13. concurrency: the compile slice is a PURE mechanism (no shared mutable state) — NOT a shared-state path; the concurrent-roster requirement does not apply. No failure surfaced (no idle/serial cheat).
  • [PASS] 14. hard cutover: ONE atomic cutover; no Phase-2/TODO; no mid-execution scope change.
  • [PASS] 15. ARCHITECTURE GATE — placement: CORRECT. The compile loop (a kind-blind MECHANISM not among the four in-core M's) moves to the plugin — exactly the boundary law. Host keeps only the SELECTION + re-materialization. GOAL-FIT: advances the plugin-host end-state (K4-B). COUNTERFACTUAL: sdk would be wrong (it's a command-capability, not an sdk kit). Mechanical: NO new/grown charly/*_aliases.go (the alias file SHRANK); the deploykit import is pre-existing migration inventory; the residual import in the seam is the same-PR body-move exception (net core-LOC negative).
  • [PASS] 16. disposable-only autonomy: destroy/rebuild on disposable: true bed.
  • [PASS] 17. clean arch + go gates: gofmt empty; golangci-lint 0 issues (charly + plugin-bundle); go vet clean; go test green; parity golden PASSES.
  • [PASS] 18. CHANGELOG: CHANGELOG/2026.196.0137.md staged (placeholder — finalized to merge-time CalVer at merge).

R10 evidence (fresh, exit 0)

$ charly check run check-sidecar-pod
charly check run check-sidecar-pod: PASS (steps=11)
=== BED EXIT CODE: 0 ===

summary.yml (run-calver 2026.196.0224): 11 steps, 350s, all ok:true, zero warnings.
deploy-add 36s (compile path: bundle add → compileViaPlugin → plugin OpCompile) ·
update 106s (FRESH-REBUILD re-compile) · feature-run-rebuild 23s.

Decision

All 18 rules PASS. The K4-B deploy-compile slice move is architecturally CORRECT (kind-blind mechanism → plugin, IMPORT-PURE, ZERO-ALIASES shrank), R10-proven on a fresh disposable bed (exit 0, zero warnings, compile path executed live at deploy-add + fresh-rebuild update), SDD-reproducible, and R5-clean. Approved — proceeding to finalize the merge-time CalVer, squash-merge, and tag.

Assisted-by: Claude (fully tested and validated)

Finalizes the merge-time CalVer for the K4-B deploy-compile slice cutover
(the bundle-add compile loop moved out of core into candy/plugin-bundle).

Assisted-by: Claude (fully tested and validated)
@atrawog
atrawog merged commit 14ae23d into main Jul 15, 2026
@atrawog
atrawog deleted the feat/k4b-compile-slice branch July 15, 2026 02:34
github-actions Bot pushed a commit that referenced this pull request Sep 7, 2026
…s) (#558)

Consume the config:-verb wave: spec v0.2026250.957 (#117 config?/validate?
contract, #118, #119 VerbCatalog, #120 InstallVerbs), sdk v0.2026250.948
(#237 emitter), plugin-box v0.2026250.1030 (#11 config rules), plugin-egress
v0.2026250.951 (#3 crabbox-yaml egress schema). Add validate to the
uniform-API genericConceptCollisions with justification (ops.OpValidate
selector vs the config modifier — the venue precedent).

Co-authored-by: atrawog <[email protected]>
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