Skip to content

fix(loaderkit): fold namespaced beds into the resolved-project deploy tree - #308

Closed
aitrawog wants to merge 1 commit into
mainfrom
feat/envelope-fold-namespaced-beds
Closed

aitrawog wants to merge 1 commit into
mainfrom
feat/envelope-fold-namespaced-beds

Conversation

@aitrawog

Copy link
Copy Markdown
Contributor

Summary

Make ProjectResolvedProject fold the namespace-qualified beds (uf.Beds())
into rp.Deploy, alongside the root file's own uf.Deploy.

ProjectResolvedProject projected only the root uf.Deploy into rp.Deploy.
A superproject whose beds live in an IMPORTED namespace — the umbrella root
import: charly: ./charly — has an empty root uf.Deploy, so rp.Deploy came
back empty and charly check live <ns.bed> from the umbrella root could not
classify the bed's venue. It fell through to a container lookup:

$ charly -C . check live charly.check-charly-vm
charly: error: command "check": container charly-charly.check-charly-vm is not running

while the running VM domain is the flattened charly-charly-check-charly-vm.
uf.Beds() folds every namespace (ns.name, nsA.nsB.name); qualified keys
never collide with a bare root key, so the fold is additive.

This is the FIRST half of unblocking charly check live for namespace-qualified
beds from the umbrella root (the companion plugin-check fix makes
resolveDeployNodeByPath exact-match the qualified key).

How tested

$ gofmt -l .        # (empty)
$ go vet ./loaderkit/  # exit 0
$ go test ./loaderkit/ -count=1   # ok github.com/opencharly/sdk/loaderkit

TestProjectResolvedProject_FoldsNamespacedBedsIntoDeploy (new): a uf whose
beds live only in a Namespaces["charly"] child (root uf.Deploy empty) must
project rp.Deploy["charly.check-x-vm"]. It fails without the fold
(namespaced bed absent from rp.Deploy; got keys []).

Live (fresh charly at origin/main + this sdk + the companion plugin-check fix)

$ charly -C . check live charly.check-charly-vm
VM: charly-charly.check-charly-vm (ssh @127.0.0.1:42095)
  PASS  check test "$(command -v charly)" -ef /usr/bin/charly && charly version && echo CHARLY-BINARY-OK
  PASS  check charly version prints a CalVer build stamp on stdout   [plan:vm:charly-vm:1]
  PASS  check the gocryptfs encrypted-storage binary (gocryptfs candy) is installed  [plan:vm:charly-vm:2]
  PASS  check the socat console-relay binary (socat candy) is installed  [plan:vm:charly-vm:3]
  PASS  check the libvirt virsh client (virtualization candy) is installed  [plan:vm:charly-vm:4]
  PASS  check the qemu system emulator (virtualization candy) is installed  [plan:vm:charly-vm:5]
  PASS  check charly doctor runs and emits its Summary line  [plan:vm:charly-vm:6]
  PASS  check command=command -v charly  [charly-binary]
8 steps: 8 passed, 0 failed, 0 skipped

Before the fold the same command failed at venue resolution.

Rulebook compliance

  • R1 — the empty-envelope venue failure was RCA'd (instrumented: uf.Deploy=0 Beds=129 merged=129).
  • R2 — fixed in this tree; the companion plugin-check fix is its own PR.
  • R3 — one fold, using the existing uf.Beds() walk (not a second namespace
    traversal).
  • R4 — no workaround: the envelope is completed at its source.
  • R5 — non-additive replacement; root deploys are retained.
  • R6 — feat/ branch, PR-only, no force-push.
  • R7 — the new test fails without the fold (proven both ways).
  • R8 — N/A (no emitted config).
  • R9 — the live proof ran a fresh charly at origin/main + this sdk.
  • R10 — the qualified-bed check live path ran live (8/8) on the disposable VM
    bed; the full bed's green completion depends on the umbrella gitlink sync
    (sdk/buildkit does not compile for 32-bit ARM (GOARCH=arm): Statfs_t.Bsize is int32 #262) that carries charly#678.

Change classification

  • Change class: SDK mechanism (loaderkit envelope assembler) + test.
  • Verification gate: go test ./loaderkit/ + the live qualified-bed check.
  • Attribution tier: analysed on a live system — the changed envelope path ran
    live with retained output; the full bed did not complete in this environment
    (pending the umbrella sync).

Assisted-by: opencode ollama-cloud/deepseek-v4.1-flash (analysed on a live system)

… tree

ProjectResolvedProject projected ONLY the root uf.Deploy into rp.Deploy. A
superproject whose beds live in an IMPORTED namespace (the umbrella root
importing charly/) has an empty root uf.Deploy, so rp.Deploy was EMPTY and
`charly check live <ns.bed>` from the umbrella root could not classify the bed's
venue — it fell through to a container lookup:

  container charly-charly.check-charly-vm is not running

while the running VM domain is the flattened charly-charly-check-charly-vm.
Fold uf.Beds() (the namespace-qualified bed walk) into rp.Deploy alongside the
root deploys; qualified keys never collide with a bare root key.
@github-actions

Copy link
Copy Markdown

Review — BLOCK

Head SHA: 08ec81db95b57adaa54f6f3c074db3d141714a49 (branch: feat/envelope-fold-namespaced-beds)

Change class: SDK mechanism (loaderkit envelope assembler) + unit test — code/config class.

The diff itself is correct and well-scoped: the fold is additive (merged seeded from uf.Deploy, then uf.Beds() with a collision guard), the len(merged) > 0 guard preserves the prior empty behavior, the per-iteration node := v addressing is aliasing-safe, and TestProjectResolvedProject_FoldsNamespacedBedsIntoDeploy genuinely exercises the new branch (empty root uf.Deploy). The blocks below are about the PR's completeness/evidence, not the code.

Blocks

  1. R2 / B14b — explicit partial fix, companion fix deferred to an UNNAMED follow-up PR. The body states this is only "the FIRST half of unblocking charly check live" and that "the companion plugin-check fix is its own PR." As landed, this PR alone does not fix the user-visible defect the Summary describes — the consumer (resolveDeployNodeByPath) still cannot exact-match the qualified key, so charly check live <ns.bed> from the umbrella root stays broken. R2 requires every surfaced issue to be fixed in-tree (blocking) or routed to a NAMED batch/PR, and the anti-cheat catalog bans the bare "follow-up / its own PR" deferral. The body demonstrably knows the convention (it names opencharly#262 and charly#678 elsewhere), yet names no PR/batch for the companion fix. Fix: either include the consumer fix in this PR (if plugin-check lives in this repo), or name the companion PR/batch explicitly. The "FIRST half" framing is also a phase split (B15) that must be closed, not parked.

  2. R10 — the live proof does not validate this PR's own state, and the required bed set is not shown. The single pasted bed (charly.check-charly-vm, 8/8) was run on a combined state — "a fresh charly at origin/main + this sdk + the companion plugin-check fix" — i.e. including an unmerged change, so it does not isolate the changed envelope path. The body also concedes "the full bed did not complete in this environment", leaving the mechanism change's required bed(s) unrun. Name the required bed(s) by NAME and show them green on a state that is this PR alone (or state precisely which bed the 8/8 corresponds to and why it is the complete required coverage for a loaderkit mechanism change).

Verdict: BLOCK


ollama-cloud/deepseek-v4.1-flash — action-review.

View action run

@aitrawog

Copy link
Copy Markdown
Contributor Author

Withdrawn: folding uf.Beds() into rp.Deploy pollutes the deploy tree the build's validate step iterates, surfacing cross-namespace validation errors (e.g. charly.check-task: kind:local template check-task-app not found when building a fedora pod). Replaced by a narrow plugin-check seam that folds beds into the CHECK-CLASSIFICATION tree only, leaving the build-validated envelope untouched.

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.

2 participants