delivery: a composition's digest leaves its plan out, as a have, a want and the apply name it by its resources (ADR 0593 §6)

Claude-Session: https://claude.ai/code/session_01NcbgfJ9Gum47zkFKWRaovL
This commit is contained in:
2026-11-02 18:25:13 +01:00
parent ba82dd64b1
commit bb59fd8fa3
2 changed files with 9 additions and 4 deletions
+4 -2
View File
@@ -50,7 +50,8 @@ type Composed struct {
// Plan is the module's whole provisioning plan as the node-engine hands it to the provisioner (templates, files,
// own secrets by name, items, collections, provisions; never a value), composed node-wide (novox/hq ADR 0593 §6,
// §8): the provisioner makes every plan from it. Nil when the module hands the provisioner nothing; only on a
// module's key. It is part of the encoding, so the digest moves when the plan does.
// module's key. It is part of the encoding (SameComposed sees a plan change) but not of the digest
// (ComposedDigestOf): a have, a want and the apply name a composition by its resources.
Plan *catalogue.Plan
// Refused is why the module cannot be composed at this fingerprint on this node, the rest of the node composed
// (ADR 0593 §6): a refused composition holds no resource, filled file, data or plan, and has no digest
@@ -233,7 +234,7 @@ func DecodeComposed(data []byte) (Composed, error) {
return c, nil
}
// ComposedDigestOf is a composition's digest, "sha256:<hex>", of its encoding without its signature. A want names it
// ComposedDigestOf is a composition's digest, "sha256:<hex>", of its encoding without its signature and its plan. A want names it
// (ADR 0539 clause 1), the controller writes it beside the composition, and the signature signs it.
//
// A refused composition has no digest: it is refused, naming the module (ADR 0593 §6).
@@ -242,6 +243,7 @@ func ComposedDigestOf(c Composed) (string, error) {
return "", fmt.Errorf("delivery: the composition of %s on %s is refused (%s) and has no digest", c.Module, c.Node, c.Refused)
}
c.Signature = nil
c.Plan = nil
raw, err := EncodeComposed(c)
if err != nil {
return "", err