C-W: a want awaiting its hand placement is held

The assigner holds the want of a node whose node-engine does not state want:version in the
want's hold field, its words awaits-hand-placement; the client takes that hold beside a put's
and refuses a hold with other words.

Builds: design 47 H §772; lead answer H-A-73

Claude-Session: https://claude.ai/code/session_01JG73KHUnBze48rdua8u2sy
This commit is contained in:
2026-11-20 03:09:23 +01:00
parent 83d454217f
commit f9fa0ec2b2
2 changed files with 9 additions and 2 deletions
@@ -52,6 +52,10 @@ const (
// nothing restored (design 47 G §710).
const RevertLive = seat.WantsByWantNodeModuleValueRevertLive
// HoldAwaitsHandPlacement is the words of a want the assigner holds for a node whose node-engine does not state
// want:version: it awaits its hand placement (design 47 H §772, H-A-73). Beside a put it is the one held want.
const HoldAwaitsHandPlacement = "awaits-hand-placement"
// NodeWord is the last part of a node's own key.
const NodeWord = "node"
@@ -178,8 +182,8 @@ func checkWant(w Want) error {
}
return nil
}
if w.Hold && !w.Put {
return fmt.Errorf("wants: only a put holds a want")
if w.Hold && !w.Put && w.Words != HoldAwaitsHandPlacement {
return fmt.Errorf("wants: only a put, or a want awaiting its hand placement (%s), holds a want", HoldAwaitsHandPlacement)
}
if err := checkFingerprint(w.Fp, "a want's fingerprint"); err != nil {
return err
@@ -43,6 +43,8 @@ func TestWantsAreWhatTheEarlierCodecWrote(t *testing.T) {
"revert": {Want{Fp: a, Self: true, Revert: RevertLive, Words: "live"}, `{"v":1,"fp":"` + a + `","revert":"live","words":"live","self":true}`},
"removed": {Want{Removed: true, Words: "gone"}, `{"v":1,"removed":true,"words":"gone"}`},
"a placement's build": {Want{Fp: a, Version: "0.1.14"}, `{"v":1,"fp":"` + a + `","version":"0.1.14"}`},
// design 47 H §772, H-A-73: a node whose node-engine reads no want by version is held, awaiting its hand placement.
"awaits its hand placement": {Want{Fp: a, Version: "0.1.15", Pipeline: "main.3589", Rank: 1, Hold: true, Words: HoldAwaitsHandPlacement}, `{"v":1,"fp":"` + a + `","version":"0.1.15","pipeline":"main.3589","rank":1,"hold":true,"words":"awaits-hand-placement"}`},
} {
t.Run(name, func(t *testing.T) {
raw, err := EncodeWant(row.w)
@@ -61,6 +63,7 @@ func TestWantsAreWhatTheEarlierCodecWrote(t *testing.T) {
for name, w := range map[string]Want{
"old fingerprint": {Fp: "src1:abc"},
"hold without put": {Fp: a, Self: true, Hold: true},
"hold with other words": {Fp: a, Hold: true, Words: "awaits"},
"rank without pipeline": {Fp: a, Rank: 1},
"pipeline without rank": {Fp: a, Pipeline: "main.3589"},
"rank below 1": {Fp: a, Pipeline: "main.3589", Rank: -1},