diff --git a/internal/compose/resolution/handed.go b/internal/compose/resolution/handed.go index 5328a8b..8b7670a 100644 --- a/internal/compose/resolution/handed.go +++ b/internal/compose/resolution/handed.go @@ -161,7 +161,11 @@ func notHandedWhy(with mcat.Rendering, m mcat.Manifest, r map[string]any) (why s if why := machineWhy(with); why != "" { return why, true } - return fmt.Sprintf("its build kept a template for %s and this composition filled it itself", id), true + // Every way a handed file is not handed is named above: the module moved with templates, a template for this file, no + // merge, a machine that takes it. Reached, the composition and Handing disagree, and that is a fault in this code, said as + // one so it is reported and not read as a reason about the module or the machine (issue 1966). + return fmt.Sprintf("a fault in the node-engine's composition, to be reported: %s is moved, its build kept a template for %s, "+ + "and this machine takes handed files, yet the composition filled it itself", m.Module, id), true } // requiredByWords begins why a module only pulled in by another is on a machine (Resolution.Because): `required by diff --git a/internal/compose/resolution/handed_bound_test.go b/internal/compose/resolution/handed_bound_test.go index 52eabcd..a74af22 100644 --- a/internal/compose/resolution/handed_bound_test.go +++ b/internal/compose/resolution/handed_bound_test.go @@ -157,4 +157,12 @@ func TestAHandedModuleNamingARunTimeBoundKeyComposesOnlyWhereItIsHanded(t *testi t.Fatalf("%s: the unmarked module is refused %v", name, before) } } + + // And where nothing keeps it from being handed yet the composition filled the file itself, the reason says it is a fault + // in this code (the review of the vault's judgement, issue 1966), never a reason about the module or the machine. + whole := mcat.Manifest{Module: "bot", Moved: true, Handed: &mcat.Handed{Templates: map[string]string{"f": "templates/f"}}} + if why, handedFile := notHandedWhy(handingTo("store:5000"), whole, map[string]any{"id": "f"}); !handedFile || + !strings.Contains(why, "a fault in the node-engine's composition") { + t.Errorf("the impossible branch says %q (handed file %v)", why, handedFile) + } }