Repository navigation
fix(sdk): namespace-aware descent stamp, deploy projection, entity resolver - #297
Conversation
…solver RCA (roster, measured live): `charly check run check-all-beds` failed EVERY namespaced VM-root bed. Three root-scope-only projections were the cause (plan §4.1): 1. `loaderkit.StampDeployDescents` iterated only the ROOT `uf.Deploy` map, so a node reached through `uf.Namespaces` kept `Descent==nil` — `deploy.IsVmVenue` false, a `vm:` root misclassified as a pod (measured: same bed `IsVM=false` namespaced vs `IsVM=true` local). 2. `deploykit.ProjectDeployConfig` projected root-only `uf.Deploy`, so a namespaced deploy (`charly.check-docs`) was absent from the merged tree. 3. `loaderkit.ResolveKindEntityBody` descended only ONE namespace level, missing a nested entity (`charly.omarchy.omarchy-vm`). Fixes: recurse namespaces in StampDeployDescents (ancestor-stack guard, mirroring Beds()); project `uf.Deploys()` in ProjectDeployConfig; resolve kind templates via `ProjectTemplates().ByKind` (recursive). Tests: descent_stamp_test.go, project_deploy_test.go, resolve_entity_ref_test.go::TestResolveKindEntityBody_NestedNamespace. Assisted-by: opencode deepseek-v4.1-flash (fully tested and validated)
Review — BLOCKHead SHA: Change class: Blocks
(Security screen T1–T4: no finding — no secrets/egress, no guardrail weakening, no dependency/ Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
Review — PASSHead SHA: Security screen: PASS — diff confined to Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
Summary of changes
Make the SDK's deploy/entity resolution namespace-aware — the SDK half of the
whole-roster failure fix (plan §4.1).
RCA (8-step, measured live)
Unexpected.
charly check run check-all-bedsfailed EVERY namespaced VM-root bed(
charly.check-agentteams-vm,charly.check-helm-vm, …). A namespaced node reachedthe bed runner with
Descent==nil→deploy.IsVmVenuefalse → avm:rootmisclassified as a pod (
vm-buildskipped;deploy-addfailed on an empty ref).Three root-scope-only projections:
loaderkit.StampDeployDescentsiterated only the ROOTuf.Deploymap.deploykit.ProjectDeployConfigprojected root-onlyuf.Deploy.loaderkit.ResolveKindEntityBodydescended only ONE namespace level.Fix
StampDeployDescentsrecurses every namespace (path-scoped ancestor guard).ProjectDeployConfigprojectsuf.Deploys()(the namespace-qualified fold).ResolveKindEntityBodyresolves viaProjectTemplates().ByKind(recursive).Change class
charly-or-sdk Go(the sdk contract module) — changes charly's runtime resolution.How R10-tested — exact gate, commands, and pasted output
Disposable target:
charly.check-agentteams-vm(disposable: trueincharly/charly.yml), a namespaced VM bed — the exact bed the RCA failed.Fresh rebuild: the proof binary was built from this tree with
replaces to thesesdk changes;
charly version→2026.269.0721.1. The RCA symptom, fixed LIVE (DEBUG line from the bed's
bedSetup):(Before — sdk main — the SAME bed was
Descent=<nil> IsVM=false, so it skippedvm-buildand misclassified as pod.)2. The bed now executes the VM sequence (not skipped):
3.
ProjectDeployConfig— the namespaced deploy is now FOUND (non-dry-run):(The first error is "no entry"; the second is a DIFFERENT, later-stage ref
resolution — proof the qualified deploy now projects.)
4. Module gate —
go test ./... -count=1(fresh, full output):5. New tests (each fails without the change):
6. Final head + diff-stats:
Rulebook compliance
/charly-internals:root-cause-analyzer+/charly-internals:strict-policy.Descent==nilmechanism was RCA'd live (the DEBUG lines) before fixing.Beds()(one namespace-fold convention).git statuschecked before the bed teardown.N/A — no emitted artifact changed.charly version→2026.269.0721).the full 128-bed roster green run is the consumer leg's gate, still landing.
Change classification
go test ./... -count=1+ the live namespaced bed(
charly.check-agentteams-vm, disposable).analysed on a live system— module battery green and thechanged resolution ran live on the bed (
IsVM=true,vm-build/vm-createPASS).Assisted-by: opencode deepseek-v4.1-flash (analysed on a live system)