Repository navigation
fix(loaderkit): exempt a from: whose structural kind folded no template here - #300
Conversation
…te here
R1: a kind:check bed whose from: names a template folded by a STRUCTURAL kind whose
provider did not run in THIS process false-failed "not defined", and since
ValidateCheckBeds returns on the first error, that ONE bed aborted validation for
the whole project. Measured live: candy/plugin-deploy-vm prepare-venue re-loads the
project via LoadUnifiedViaExecutor (a read-only plugin-side load with NO connect
pass and without plugin-kube compiled in), so a project declaring a kindcluster: bed
made EVERY vm bed un-runnable ("resolve kind:vm entity k3s-vm: ... check-kindcluster
references kindcluster entity check-kindcluster-cluster which is not defined").
Fix: when a bed's from: does not resolve AND its target kind folded ZERO templates
in this scope (kindTemplatesAbsentHere), the cross-ref cannot be judged here -- the
provider never ran, so PluginKinds[target] is empty through no authoring fault. That
case is exempt. The signal is LOCAL to the uf (folded templates), NOT the
host-computed StructuralDeclaredFields snapshot: a plugin process receives the
host's "connected" snapshot while its own template map is empty. A kind that folded
SOME templates (but not this ref) is a real typo and stays rejected; a built-in
resource kind is never exempt.
Test: TestValidateCheckBeds_UnconnectedKindFromExempt fails without the fix.
Review — PASSHead SHA: Change class: code — sdk library change ( Security screen: PASS — no scope mismatch, secrets, exfiltration, supply-chain edit, or guardrail change in the T3 sense ( Checklist: All applicable rules PASS or NA — diff↔body consistent (exemption keys on Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
Review — PASSHead SHA: Security screen: PASS — no T3 scope mismatch, secrets, exfiltration, supply-chain edit, or guardrail weakening. Checklist: All applicable rules PASS or NA. Diff↔body reconcile: the exemption keys on Comment intake: 1 comment (github-actions[bot] PASS) — Tool-limited: cannot re-run Go build/vet/test or the live repro; cross-checked the pasted outputs (BUILD OK, the FAIL block, the before/after repro) for internal consistency — bed/entity names, error strings, and test names all reconcile with the diff. Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
…on) (#24) Consumes the merged loaderkit fix (opencharly/sdk#300): a check bed whose from names a template folded by a structural kind whose provider did not run in THIS process (plugin-kube is absent from this plugin) no longer false-fails not defined. Because ValidateCheckBeds returns on the first error, that ONE bed aborted validation for the whole project, so prepare-venue re-load made EVERY vm deploy fail in a project that declares such a bed. Bumping the pin picks up the exemption. Co-authored-by: AI Worker <ai@local>
fix(loaderkit): exempt a
from:whose structural kind folded no template hereR1 — a real project-wide validation defect, found while wiring the KubeVirt R10 beds
(charly#676).
The anomaly
ValidateCheckBedsrequires akind:checkbed'sfrom:cross-ref to resolve. Itreturns on the FIRST error, so ONE mis-resolving bed aborts validation for the WHOLE
project. Measured live:
Every VM bed becomes un-runnable, not just the kindcluster one. Reproduced on
pristine
origin/mainwith a pre-existing main bed (check-charly-vm) — so itis not a caller's fault.
Root cause
candy/plugin-deploy-vm'sprepare-venuere-loads the project vialoaderkit.LoadUnifiedViaExecutor— a read-only plugin-side load that has noconnect pass and does not compile in every structural-kind provider (plugin-kube,
which folds the
kindclustertemplate, is absent). So in that processPluginKinds["kindcluster"]is empty and the same-filefrom:cannot resolve — eventhough the SAME file validated fine host-side, where the provider IS connected.
The existing
declaredStructuralKindUnconnectedhelper only exempts a targetlessbed, not a bed with an unresolvable
from:.Summary of changes
loaderkit/validate_check_beds.go— when a bed'sfrom:failsResolveEntityRefand its target kind folded zero templates in this scope
(
kindTemplatesAbsentHere), the cross-ref cannot be judged here (the provider neverran) → exempt. The signal is local to the
uf(folded templates), NOT thehost-computed
StructuralDeclaredFieldssnapshot: a plugin process receives thehost's "connected" snapshot while its own
PluginKinds[target]is empty.rejected.
vm/pod/…) is never int.StructuralKinds→ neverexempt.
loaderkit/validate_check_beds_unconnected_kind_test.go— new: the un-folded caseis exempt (fails without the fix); the folded-but-bad-ref case is still rejected; the
built-in case is unaffected.
How tested
Live end-to-end — the real reproduction (a project with a
kindcluster:bed + avm:bed), run against aplugin-deploy-vmbuilt with this sdk (local override):Rulebook compliance
fix removes the cause (an unresolvable-here cross-ref is no longer fatal), not the
symptom.
ResolveEntityRefresolution.go build/testat the shipped pin.is the named
kubevirt-check-bedsbatch.Change classification
ValidateCheckBedscross-ref exemption).real reproduction; the full KubeVirt bed R10 is the named batch.
Assisted-by: opencode ollama-cloud/deepseek-v4.1-flash (analysed on a live system)