From d7a9b9688b768a11459bd9a65bb954361b35be77 Mon Sep 17 00:00:00 2001 From: jochen Date: Sat, 24 Oct 2026 21:17:14 +0200 Subject: [PATCH] Let the judgement beside a composition say unchanged: equal to the declaration the node last applied (issue 1943; ADR 0540 clause 9) The first want at the switch skips the record hold only where the composition changes nothing on the node. --- go/delivery/composed.go | 10 +++++++--- go/delivery/composed_keys_test.go | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/go/delivery/composed.go b/go/delivery/composed.go index d22151a..0509bbb 100644 --- a/go/delivery/composed.go +++ b/go/delivery/composed.go @@ -120,6 +120,10 @@ const ( JudgedNeither Judgement = "neither" // JudgedCannot is a move that cannot be judged, because the composition the node runs is gone or cannot be read. JudgedCannot Judgement = "cannot-judge" + // JudgedUnchanged is a composition equal to the module's slice of the declaration the node last applied, for a node + // whose have names no composition yet (the first want at the switch, novox/hq ADR 0540 clause 9): applying it + // changes nothing on the node, so it needs no person's yes. + JudgedUnchanged Judgement = "unchanged" ) var digestForm = regexp.MustCompile(`^sha256:[0-9a-f]{64}$`) @@ -187,14 +191,14 @@ func (c ComposedDigest) check() error { if c.Against == "" { return fmt.Errorf("delivery: a move judged %s names the composition it is judged against", c.Judgement) } - case JudgedNeither: + case JudgedNeither, JudgedUnchanged: case JudgedCannot: if c.Words == "" { return fmt.Errorf("delivery: a move that cannot be judged says why") } default: - return fmt.Errorf("delivery: the judgement %q is not %s, %s, %s or %s", c.Judgement, JudgedRecreates, - JudgedMovesData, JudgedNeither, JudgedCannot) + return fmt.Errorf("delivery: the judgement %q is not %s, %s, %s, %s or %s", c.Judgement, JudgedRecreates, + JudgedMovesData, JudgedNeither, JudgedCannot, JudgedUnchanged) } if c.Policy != "" || c.PolicyFrom != "" { if !oneOf(c.Policy, composedPolicies) { diff --git a/go/delivery/composed_keys_test.go b/go/delivery/composed_keys_test.go index fc03a5e..5882208 100644 --- a/go/delivery/composed_keys_test.go +++ b/go/delivery/composed_keys_test.go @@ -80,6 +80,7 @@ func TestComposedDigestValue(t *testing.T) { {Digest: digest, Judgement: JudgedRecreates, Against: against, Words: "the container's image changes"}, {Digest: digest, Judgement: JudgedMovesData, Against: against}, {Digest: digest, Judgement: JudgedCannot, Words: "the composition the node runs is gone"}, + {Digest: digest, Judgement: JudgedUnchanged, Words: "equal to the declaration the node last applied"}, {Digest: digest, Judgement: JudgedNeither, Policy: "record", PolicyFrom: "person", PolicyWhy: "the operator: its data"}, {Digest: digest, Judgement: JudgedNeither, Policy: "roll", PolicyFrom: "default"}, {Digest: digest, Judgement: JudgedNeither, Against: against, UserListOnly: true, Words: "only the bus's user list changes"},