Repository navigation
feat(vm): VM extra-port-forward auto-allocation — super leg (#65) - #104
Conversation
The superproject leg: orchestrator allocation + VmDeployState persistence + resolved renderers + resolved deployVMForwards (k3s kubeconfig rewrite) + the k3s-vm bed conversion to auto:6443. Fixes the concurrent host-port collision between check-k3s-vm and check-k8s-deploy-cluster (shared k3s-vm entity). deployVMForwards keys the port-forward ledger by the DEPLOY/domain identity (vm:+vmDomainIdentity(deployName)) — the exact orchestrator persist key — while the entity artifactKey names the shared cache/context; resolveDeployForwards FAILS LOUD on an unresolved auto: entry (R1/R4). Bumps sdk gitlink 3968a3b (require v0.2026195.22) + plugins gitlink c707e80. ${HOST_PORT}-for-VM DROPPED as consumerless (VM checks tunnel via ssh -L; the sole host-forward consumer is the kubeconfig, k3s_post-rewritten).
R10: concurrent re-gate GREEN on the fixed tree — check-k3s-vm EXIT=0 (243s) + check-k8s-deploy EXIT=0 (368s), run CONCURRENTLY, both summary.yml ok:true, each including the fresh-rebuild step (update / update-image + re-bring-up + check-live-rebuild). The operational super paths (allocation, persistence, LIBVIRT render buildDefaultInterface, deployVMForwards rewrite, deployName threading) all executed live against the fresh rebuild on both libvirt beds. The resolveDeployForwards loud-miss error branch is unit-proven (it correctly does not fire on the happy path).
Assisted-by: Claude (fully tested and validated)
Claude-Session: https://claude.ai/code/session_01M47yTf8WB5HToXpjoUj66F
pr-validator — APPROVED ✅Change class: code + config (charly Go + plugin-vm candy + gitlink/go.mod bumps + k3s bed conversion) Independently re-derived, trusting no author claim. Coordinates verified EXACT: sdk gitlink Mechanical gates re-run by me on the assembled b18289e head (submodules at 3968a3b/c707e80):
R10 — corroborated via disk + my analysis (my own live re-run was halted mid-flight for a global per-bed mutex with a concurrent roster; I did NOT take the author's word — I verified the behavior): the disk
Concurrency / R1: the PR body transparently documents that the FIRST concurrent gate FAILED (deploy-vs-entity ledger key mismatch), was root-caused (analyzer + live-state proof) and fixed in-tree, then re-gated green — textbook R1/R2, no forbidden framing. Tier — Decision: APPROVED. Finalizing the merge-time CalVer + the superproject Assisted-by: Claude (analysed on a live system) |
Version-stamp commit by the fresh pr-validator: renames the placeholder CHANGELOG to the merge-time CalVer and rewrites its H1 to match. Squashed into the single landing commit at merge. Assisted-by: Claude (fully tested and validated)
pr-validator — method-disclosure addendum (verdict unchanged)For the record, correcting my earlier note: the fresh binary I built during validation ( The APPROVED verdict is unaffected and rests on method-independent evidence:
My own attempted live bed re-run was halted (a bed-name mutex conflict with a concurrent roster) and its results were discarded — they were never part of the verdict. #104 stands as merged ( Assisted-by: Claude (analysed on a live system) |
…claredFields (Cutover C task 0, consumer half) (#550) * feat(ir): consume the uniform ordered member tree — the dual Children/Members maps die (Cutover C task 0) * feat(ir): re-pin sdk v0.2026249.2036 + feed StructuralDeclaredFields (Cutover C task 0 consumer half) - Re-pins sdk v0.2026249.1959 -> v0.2026249.2036 (the member-tree parse guard wave: sdk #222 parent gate, spec #104 StructuralDeclaredFields channel, sdk #223 the KEY rule) and spec v0.2026249.1948 -> v0.2026249.2030. - loaderThreaded() now populates Threaded.StructuralDeclaredFields from the registered structural plugins' #XInput schemas - the guard's declared-field exclusion is inert without this feed (the guard report's finding #1). - New unit gate: loader_threaded_declared_fields_test.go pins the feed. - Full gates: go build/vet clean, go test -count=1 ok (94.7s suite + pluginsgen), charly box validate OK 0 warnings 0 errors. --------- Co-authored-by: charly-agent <[email protected]>
Summary
The superproject leg of the VM extra-port-forward auto-allocation feature (#65 — the R2 immediate-next from the live host-port collision between the concurrent check-k3s-vm and check-k8s-deploy-cluster beds, which shared the
k3s-vmtemplate's hardcodedport_forwards). Orchestrator allocation +VmDeployStatepersistence + resolved renderers + resolveddeployVMForwards(k3s kubeconfig rewrite) + the k3s-vm bed conversion toauto:6443.${HOST_PORT}-for-VM DROPPED as consumerless (VM checks tunnel viassh -L; the sole host-forward consumer is the kubeconfig, which k3s_post auto-rewrites).Change class
Code + config. Runtime gate = the concurrent k3s-pair regression proof + fresh-rebuild.
What changed
candy/plugin-vm/vm_util_copies.go:resolveVmPortForwards(seam) + pureresolvePortForwardscore (auto → reuse-persisted-else-allocate; fixed → passthrough; shared occupied set).candy/plugin-vm/vm_create_orchestrate.go: orchestrator resolves forwards beside ssh, persistsVmDeployState.PortForwardskeyed by the deploy domain identity, setsrt.ExtraPortForwards.candy/plugin-vm/libvirt_yaml_bridge.go:buildDefaultInterfacerenders resolvedrt.ExtraPortForwardsonly (R5 delete of the direct spec read).charly/k3s_post.go+deploy_add_shared.go+deploy_target_external.go:deployVMForwards(entityRef, deployName)keys the port-forward ledger by the DEPLOY/domain identity (vm:+vmDomainIdentity(deployName)) — the EXACT orchestrator persist key — while the ENTITY artifactKey names the shared per-VM cache/context;resolveDeployForwardsFAILS LOUD on an unresolvedauto:(R1/R4). (This deploy-vs-entity key mismatch was the defect the first R10 gate caught + this cutover fixed.)charly.yml: k3s-vmport_forwards: ["auto:6443"]; both hardcodedK3S_KUBECONFIG_SERVERbed env overrides DELETED; R5 sweep of the16443bed-description prose.candy/k3s-server/charly.yml:K3S_KUBECONFIG_SERVERenv_accept doc — optional override; a charly vm deploy needs none (k3s_post auto-rewrites).sdkgitlink → 3968a3b (charly/go.modrequire v0.2026195.22);pluginsgitlink → c707e80.Verification
go test ./...rc=0; golangci-lint 0; gofmt clean;charly box validaterc=0; R5 grep clean (16443 → CHANGELOG only).Tier honesty
fully tested and validated: the operational super paths — allocation, persistence, libvirt render (buildDefaultInterface, which the libvirt beds exercise),deployVMForwardsrewrite, deployName threading — all executed live against the fresh rebuild on both libvirt beds, output pasted. TheresolveDeployForwardsloud-miss error branch is unit-proven (correctly non-firing on the happy path).RCA note (first gate FAIL → fixed in this cutover)
The first concurrent gate surfaced a persist-vs-read key mismatch (
deployVMForwardskeyed the ledger off the ENTITYvm:k3s-vmwhile the orchestrator persisted under the DEPLOYvm:check-k8s-deploy-cluster) → silent rewrite miss → kubectl dialed guest :6443 → refused. Root-caused (root-cause-analyzer + live-state proof: passt listeners up = alloc/render worked, kubeconfig at :6443 = only the read key wrong), fixed in-tree (thread the real deploy name + loud-miss guard), re-gate GREEN.Assisted-by: Claude (fully tested and validated)