From 6ea23b67315dbde00cdae687753c0362c1aca098 Mon Sep 17 00:00:00 2001 From: jochen Date: Tue, 3 Nov 2026 13:29:21 +0100 Subject: [PATCH] =?UTF-8?q?The=20sandbox's=20composer=20marks=20a=20node?= =?UTF-8?q?=20it=20does=20not=20judge=20in=20the=20contract's=20field=20(M?= =?UTF-8?q?achine.NotJudged),=20neither=20composed=20nor=20refused,=20neve?= =?UTF-8?q?r=20by=20a=20prefix=20of=20its=20reason=20(ADR=200593=20=C2=A79?= =?UTF-8?q?;=20the=20prepare's=20seams=20finding=20on=20"not=20judged")?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/composer/composer.go | 7 ++++--- internal/composer/composer_test.go | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/internal/composer/composer.go b/internal/composer/composer.go index 92961f1..61aad6c 100644 --- a/internal/composer/composer.go +++ b/internal/composer/composer.go @@ -222,7 +222,7 @@ func machine(in compose.Input, node, depth string, declarations bool) Machine { // own composition: the sandbox cannot compose them as the node does, so it does not judge the node, and names // it (ADR 0593 §9), never a failure of the change and never a silent pass. if folded := foldedUnsaid(in, node); len(folded) > 0 && in.ComposedHow == nil { - return Machine{Composes: true, Reason: NotJudged + strings.Join(folded, ", ") + + return Machine{NotJudged: NotJudged + strings.Join(folded, ", ") + " (its own composition carries them as they run, and the sandbox cannot): " + err.Error()} } return Machine{Reason: err.Error()} @@ -237,8 +237,9 @@ func machine(in compose.Input, node, depth string, declarations bool) Machine { return m } -// NotJudged opens the reason of a machine the sandbox does not judge: its node-engine sent an input that does not say -// how it composes (compose.Input.ComposedHow), and the node runs modules folded in its own composition. +// NotJudged opens the words of a machine the sandbox does not judge (Machine.NotJudged, the contract's field, ADR 0593 §9): +// its node-engine sent an input that does not say how it composes (compose.Input.ComposedHow), and the node runs modules +// folded in its own composition. The machine is then neither composed nor refused; a reader decides by the field. const NotJudged = "not judged: its node-engine sends no running state for " // foldedUnsaid is each module node runs folded in its own composition (Node.InOwn) whose manifest names a build: what diff --git a/internal/composer/composer_test.go b/internal/composer/composer_test.go index 3e669aa..73ecf12 100644 --- a/internal/composer/composer_test.go +++ b/internal/composer/composer_test.go @@ -132,7 +132,7 @@ func TestARequestItCannotRunIsRefused(t *testing.T) { if err != nil { t.Fatal(err) } - if m := older.Cases[0].Machines["a"]; !m.Composes || !strings.HasPrefix(m.Reason, NotJudged+"bus") { + if m := older.Cases[0].Machines["a"]; m.Composes || !strings.HasPrefix(m.NotJudged, NotJudged+"bus") || m.Reason != "" { t.Errorf("an older engine's input of a node with a folded module: %+v", m) } in.ComposedHow = &compose.ComposedHow{Node: "a", Builds: map[string]string{}}