A9: a node whose node-engine reads no want by version is held, awaiting its hand placement

The want of a node whose node-engine does not state the word want:version of
the seat node-engine, as the engine reads keeper holds it from
manifest-reads-changed, is written with hold and the words
awaits-hand-placement; once the engine states the word, the next pass writes
the want unheld.

Builds: design 47 H §772; H-A-45, H-A-73

Claude-Session: https://claude.ai/code/session_01JG73KHUnBze48rdua8u2sy
This commit is contained in:
2026-11-20 04:57:45 +01:00
parent 4923d22ac6
commit bdbfa12aa1
3 changed files with 19 additions and 1 deletions
@@ -5,6 +5,7 @@ import (
"context"
"encoding/json"
"errors"
"git.novox.be/novox/mesh-contracts/go/seats/nodeengine"
"maps"
"mesh-delivery-assigner/internal/buckets"
"slices"
@@ -287,7 +288,11 @@ func (p *passer) wants(ctx context.Context) {
wantedOf := wantedHere(wanted[name], g.nodes, groups, gi == 0)
target, ok := p.ends.target(name, g.branch)
m := assign.Module{Name: name, Manifest: bv.manifests[name], Chosen: chosenOf(chosen, name), Nodes: g.nodes, Puts: puts[name],
Self: func(node string) bool { return placed[node] },
Self: func(node string) bool { return placed[node] },
// §772, H-A-45: a node-engine that does not state want:version gets its want held, awaiting its hand placement.
ReadsVersion: func(node string) bool {
return slices.Contains(nodes.Reads[node], nodeengine.ManifestReadWordWantVersion)
},
Target: func(string) (assign.Target, bool) { return target, ok },
Allowed: func(node, digest string) bool {
key, err := asks.RecordAskKey(node, name, digest)
@@ -50,6 +50,10 @@ type Module struct {
// Self says whether node composes the module itself: the catalogue's assignments names the node (ADR 0547 §2). Nil: no
// node does.
Self func(node string) bool
// ReadsVersion says whether node's node-engine states that it reads a want by version (the word want:version of the seat
// node-engine, design 47 H §772, H-A-45); a node whose engine does not is written its want held, awaiting its hand placement
// (H-A-73). Nil: every node does.
ReadsVersion func(node string) bool
}
func (m Module) selfOn(node string) bool { return m.Self != nil && m.Self(node) }
@@ -123,6 +127,10 @@ func Wants(m Module, wants map[string]mwc.Want) Outcome {
// The answers the want carries stay while its build does: a failed backup's (ADR 0539 §16), a held revert's, the yes.
next.Backup, next.Words, next.Revert, next.Yes, next.Release = before.Backup, before.Words, before.Revert, before.Yes, before.Release
}
if m.ReadsVersion != nil && !m.ReadsVersion(node) {
// A node-engine that cannot read a want by version is placed by hand when its machine is back (design 47 H §772).
next.Hold, next.Words, next.Backup, next.Revert = true, mwc.HoldAwaitsHandPlacement, "", ""
}
if !had || !mwc.SameWant(normal(before), normal(next)) {
out.Wants[node] = next
}
@@ -64,6 +64,11 @@ func TestAWantNamesTheNewestPassedVersion(t *testing.T) {
{"the backup answer stays while the build does", released,
map[string]mwc.Want{"ace": {Fp: fNew, Version: "1.2.3", Pipeline: "main.12", Rank: 2, Backup: mwc.BackupSkip, Words: BackupAnswerWords("skip", 0)}, "g14": want},
map[string]mwc.Want{}},
{"A9/AC1 (§772, H-A-73): a node whose engine reads no want by version is held, awaiting its hand placement", func() Module {
m := released()
m.ReadsVersion = func(node string) bool { return node == "ace" }
return m
}, nil, map[string]mwc.Want{"ace": want, "g14": {Fp: fNew, Version: "1.2.3", Pipeline: "main.12", Rank: 2, Hold: true, Words: mwc.HoldAwaitsHandPlacement}}},
{"a node no longer assigned is removed", func() Module {
m := released()
m.Nodes = []string{"ace"}