§693 / A-6: the seat mesh-wants' wanted event gains removed
Builds: design 47 G §693, A-6 (G-20) Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ
This commit is contained in:
@@ -820,13 +820,15 @@ type DifferenceEvent struct {
|
||||
|
||||
// WantedEvent is the body of the event wanted.
|
||||
type WantedEvent struct {
|
||||
At *time.Time `json:"at,omitempty"`
|
||||
Fp string `json:"fp"`
|
||||
Module string `json:"module"`
|
||||
Node string `json:"node"`
|
||||
Revision int64 `json:"revision"`
|
||||
Source int64 `json:"source,omitempty"`
|
||||
V int64 `json:"v"`
|
||||
At *time.Time `json:"at,omitempty"`
|
||||
Fp string `json:"fp"`
|
||||
Module string `json:"module"`
|
||||
Node string `json:"node"`
|
||||
// true when the assigner removes the want of that node and module (the node left, or the module was unplaced); fp is then the fingerprint last wanted there (design 47 G section 693)
|
||||
Removed bool `json:"removed,omitempty"`
|
||||
Revision int64 `json:"revision"`
|
||||
Source int64 `json:"source,omitempty"`
|
||||
V int64 `json:"v"`
|
||||
}
|
||||
|
||||
// WaitHeldEvent is the body of the event wait-held.
|
||||
|
||||
@@ -27,6 +27,8 @@ func TestFixtures(t *testing.T) {
|
||||
decode: func(b []byte) (any, error) { var v DifferenceEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-wants\\.event\\.difference$")},
|
||||
{name: "an entry wanted from a trunk revision", subject: "mesh.seat.mesh-wants.event.wanted", given: "{\"at\":\"2026-11-09T19:00:00Z\",\"fp\":\"src2:b427bdde1f100e2f52490cfa9df0c5112dd3700226b4892349f0c14a15a4af56\",\"module\":\"xclip\",\"node\":\"n1\",\"revision\":40,\"source\":3589,\"v\":1}", wire: "{\"at\":\"2026-11-09T19:00:00Z\",\"fp\":\"src2:b427bdde1f100e2f52490cfa9df0c5112dd3700226b4892349f0c14a15a4af56\",\"module\":\"xclip\",\"node\":\"n1\",\"revision\":40,\"source\":3589,\"v\":1}",
|
||||
decode: func(b []byte) (any, error) { var v WantedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-wants\\.event\\.wanted$")},
|
||||
{name: "a want removed, its node left or its module unplaced", subject: "mesh.seat.mesh-wants.event.wanted", given: "{\"at\":\"2026-11-09T19:05:00Z\",\"fp\":\"src2:b427bdde1f100e2f52490cfa9df0c5112dd3700226b4892349f0c14a15a4af56\",\"module\":\"xclip\",\"node\":\"n1\",\"removed\":true,\"revision\":41,\"v\":1}", wire: "{\"at\":\"2026-11-09T19:05:00Z\",\"fp\":\"src2:b427bdde1f100e2f52490cfa9df0c5112dd3700226b4892349f0c14a15a4af56\",\"module\":\"xclip\",\"node\":\"n1\",\"removed\":true,\"revision\":41,\"v\":1}",
|
||||
decode: func(b []byte) (any, error) { var v WantedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-wants\\.event\\.wanted$")},
|
||||
{name: "a composing wait held with its bound", subject: "mesh.seat.mesh-wants.event.wait-held", given: "{\"bound\":\"30m\",\"fp\":\"src2:b427bdde1f100e2f52490cfa9df0c5112dd3700226b4892349f0c14a15a4af56\",\"module\":\"xclip\",\"node\":\"n1\",\"part\":\"node-engine\",\"since\":\"2026-11-09T19:00:00Z\",\"step\":\"compose\",\"version\":\"src2:7dd0db8e98224f46121a5ae05c0b9c5a430eff531a5120aa40b1a59237853a3f\"}", wire: "{\"bound\":\"30m\",\"fp\":\"src2:b427bdde1f100e2f52490cfa9df0c5112dd3700226b4892349f0c14a15a4af56\",\"module\":\"xclip\",\"node\":\"n1\",\"part\":\"node-engine\",\"since\":\"2026-11-09T19:00:00Z\",\"step\":\"compose\",\"version\":\"src2:7dd0db8e98224f46121a5ae05c0b9c5a430eff531a5120aa40b1a59237853a3f\"}",
|
||||
decode: func(b []byte) (any, error) { var v WaitHeldEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-wants\\.event\\.wait-held$")},
|
||||
{name: "a wait ended, released by hand", subject: "mesh.seat.mesh-wants.event.wait-ended", given: "{\"bound\":\"30m\",\"by\":\"lead@shanks: the node is away\",\"fp\":\"src2:b427bdde1f100e2f52490cfa9df0c5112dd3700226b4892349f0c14a15a4af56\",\"how\":\"released\",\"module\":\"xclip\",\"node\":\"n1\",\"part\":\"node-engine\",\"since\":\"2026-11-09T19:00:00Z\",\"step\":\"compose\",\"version\":\"src2:7dd0db8e98224f46121a5ae05c0b9c5a430eff531a5120aa40b1a59237853a3f\"}", wire: "{\"bound\":\"30m\",\"by\":\"lead@shanks: the node is away\",\"fp\":\"src2:b427bdde1f100e2f52490cfa9df0c5112dd3700226b4892349f0c14a15a4af56\",\"how\":\"released\",\"module\":\"xclip\",\"node\":\"n1\",\"part\":\"node-engine\",\"since\":\"2026-11-09T19:00:00Z\",\"step\":\"compose\",\"version\":\"src2:7dd0db8e98224f46121a5ae05c0b9c5a430eff531a5120aa40b1a59237853a3f\"}",
|
||||
|
||||
@@ -47,6 +47,20 @@
|
||||
"at": "2026-11-09T19:00:00Z"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "a want removed, its node left or its module unplaced",
|
||||
"of": "event:wanted",
|
||||
"subject": "mesh.seat.mesh-wants.event.wanted",
|
||||
"given": {
|
||||
"v": 1,
|
||||
"node": "n1",
|
||||
"module": "xclip",
|
||||
"fp": "src2:b427bdde1f100e2f52490cfa9df0c5112dd3700226b4892349f0c14a15a4af56",
|
||||
"revision": 41,
|
||||
"removed": true,
|
||||
"at": "2026-11-09T19:05:00Z"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "a composing wait held with its bound",
|
||||
"of": "event:wait-held",
|
||||
|
||||
@@ -325,6 +325,10 @@
|
||||
"source": {
|
||||
"type": "integer"
|
||||
},
|
||||
"removed": {
|
||||
"type": "boolean",
|
||||
"description": "true when the assigner removes the want of that node and module (the node left, or the module was unplaced); fp is then the fingerprint last wanted there (design 47 G section 693)"
|
||||
},
|
||||
"at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
|
||||
+2
@@ -455,6 +455,8 @@ export interface WantedEvent {
|
||||
"fp": string;
|
||||
"module": string;
|
||||
"node": string;
|
||||
/** true when the assigner removes the want of that node and module (the node left, or the module was unplaced); fp is then the fingerprint last wanted there (design 47 G section 693) */
|
||||
"removed"?: boolean;
|
||||
"revision": number;
|
||||
"source"?: number;
|
||||
"v": number;
|
||||
|
||||
Reference in New Issue
Block a user