ENG-note: notHandedWhy's impossible branch says it is a fault in the node-engine's composition (review of issue 1966)

Claude-Session: https://claude.ai/code/session_01JG73KJNrH5EgFXMKKYSrig
This commit is contained in:
2026-11-04 11:43:46 +01:00
parent 05418b4fe5
commit 60358d01e9
2 changed files with 13 additions and 1 deletions
+5 -1
View File
@@ -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
@@ -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)
}
}