mesh-conditions: the hold reads a want's fingerprint alone

Review round 1, Must 2: the want's composed digest left mesh-sdk's motion.Want
(H-A-78); the hold read it and no longer built.

Builds: design 47 H H-A-78 (1)

Claude-Session: https://claude.ai/code/session_01JG73KHUnBze48rdua8u2sy
This commit is contained in:
2026-11-20 05:52:52 +01:00
parent a6a6135f74
commit 401289afac
2 changed files with 7 additions and 6 deletions
@@ -321,5 +321,5 @@ func decodeWant(value []byte) (motion.Want, error) {
if err := json.Unmarshal(value, &w); err != nil {
return motion.Want{}, err
}
return motion.Want{FP: w.Fp, Composed: w.Composed, Removed: w.Removed}, nil
return motion.Want{FP: w.Fp, Removed: w.Removed}, nil
}
@@ -34,8 +34,9 @@ const (
// failed delivery raises what stands at once; another module's and the machine's own are raised at once; compare lists a
// held key as held.
func TestADeliveryHoldsItsOwnFindingsUntilItEnds(t *testing.T) {
want := func(fp, composed string) []byte {
raw, _ := json.Marshal(meshwants.WantsByWantNodeModuleValue{V: 1, Fp: fp, Composed: composed})
// A want names the fingerprint alone (design 47 H, H-A-78): a have at it is the want applied.
want := func(fp string) []byte {
raw, _ := json.Marshal(meshwants.WantsByWantNodeModuleValue{V: 1, Fp: fp})
return raw
}
have := func(fp, composed string, phase, h string) haveSpec { return haveSpec{fp, composed, phase, h} }
@@ -55,10 +56,10 @@ func TestADeliveryHoldsItsOwnFindingsUntilItEnds(t *testing.T) {
said: "raised module.mesh-controller.novox.unhealthy", line: "as the delivery of version 0d1e2f3a4b5c"},
} {
r := newRig()
_ = r.k.Want("want.novox.mesh-controller", want(ctrlRunning, ctrlComposed), false)
_ = r.k.Want("want.novox.mesh-controller", want(ctrlRunning), false)
r.engineHave("novox.mesh-controller", have(ctrlRunning, ctrlComposed, motion.PhaseRunning, engineclient.HealthOK))
// The delivery starts: the assigner wants the next fingerprint; the node applies it.
_ = r.k.Want("want.novox.mesh-controller", want(ctrlNext, ctrlNextComp), false)
_ = r.k.Want("want.novox.mesh-controller", want(ctrlNext), false)
r.engineHave("novox.mesh-controller", have(ctrlNext, ctrlNextComp, motion.PhaseApplying, engineclient.HealthUnknown))
own, ownRaw := finding(t, watchman, cc.ScopeModule, "mesh-controller.novox", "unhealthy", "health", cc.Warning, r.now)
other, otherRaw := finding(t, watchman, cc.ScopeModule, "postgres.novox", "unhealthy", "health", cc.Warning, r.now)
@@ -109,7 +110,7 @@ func TestADeliveryHoldsItsOwnFindingsUntilItEnds(t *testing.T) {
}
r.k.Assignments("ace.mesh-delivery-assigner", placed["ace.mesh-delivery-assigner"], false)
r.k.Assignments("ace.node", placed["ace.node"], false)
_ = r.k.Want("want.ace.mesh-delivery-assigner", want(ctrlNext, ctrlNextComp), false)
_ = r.k.Want("want.ace.mesh-delivery-assigner", want(ctrlNext), false)
r.engineHave("ace.mesh-delivery-assigner", have(ctrlRunning, ctrlComposed, motion.PhaseRunning, engineclient.HealthOK))
seatKey, seatRaw := finding(t, selfCheck, cc.ScopeSeat, "mesh-module-assigner.ace", "holder-silent", "D3", cc.Warning, r.now)
_ = r.k.Finding(selfCheck, seatKey, seatRaw, false)