G A-117: the seat mesh-recovery's ended and restored events gain why, the hand act's words for a cancel

Builds: design 47 G A-117, §560
Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
This commit is contained in:
2026-11-12 01:06:05 +01:00
parent 30389b2ed9
commit b58c4e6b14
5 changed files with 32 additions and 0 deletions
+4
View File
@@ -449,6 +449,8 @@ type EndedEvent struct {
Outcome string `json:"outcome"`
Size int64 `json:"size,omitempty"`
Snapshot string `json:"snapshot,omitempty"`
// the words of the hand act that ended it, for a cancel (design 47 G A-117, 560)
Why string `json:"why,omitempty"`
}
// The values of EndedEvent's outcome.
@@ -487,6 +489,8 @@ type RestoredEvent struct {
// how the act ended
Outcome string `json:"outcome"`
Snapshot string `json:"snapshot,omitempty"`
// the words of the hand act that ended it, for a cancel (design 47 G A-117, 560)
Why string `json:"why,omitempty"`
}
// The values of RestoredEvent's outcome.
+2
View File
@@ -25,6 +25,8 @@ func TestFixtures(t *testing.T) {
decode: func(b []byte) (any, error) { var v RestoreStartedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-recovery\\.event\\.restore-started\\.[^.*> ]+\\.[^.*> ]+$")},
{name: "restored is said", subject: "mesh.seat.mesh-recovery.event.restored.mesh-knowledge.ledger", given: "{\"act\":\"a-3\",\"at\":\"2026-11-11T10:00:00Z\",\"error\":\"restore point missing\",\"kept\":\"ledger\",\"missing\":true,\"module\":\"mesh-knowledge\",\"outcome\":\"failed\"}", wire: "{\"act\":\"a-3\",\"at\":\"2026-11-11T10:00:00Z\",\"error\":\"restore point missing\",\"kept\":\"ledger\",\"missing\":true,\"module\":\"mesh-knowledge\",\"outcome\":\"failed\"}",
decode: func(b []byte) (any, error) { var v RestoredEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-recovery\\.event\\.restored\\.[^.*> ]+\\.[^.*> ]+$")},
{name: "a cancelled act says the hand act's why", subject: "mesh.seat.mesh-recovery.event.restored.mesh-knowledge.ledger", given: "{\"act\":\"a-4\",\"at\":\"2026-11-11T10:00:00Z\",\"error\":\"cancelled\",\"kept\":\"ledger\",\"module\":\"mesh-knowledge\",\"outcome\":\"failed\",\"why\":\"the operator stopped it to look at the disk\"}", wire: "{\"act\":\"a-4\",\"at\":\"2026-11-11T10:00:00Z\",\"error\":\"cancelled\",\"kept\":\"ledger\",\"module\":\"mesh-knowledge\",\"outcome\":\"failed\",\"why\":\"the operator stopped it to look at the disk\"}",
decode: func(b []byte) (any, error) { var v RestoredEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-recovery\\.event\\.restored\\.[^.*> ]+\\.[^.*> ]+$")},
{name: "set-aside is said", subject: "mesh.seat.mesh-recovery.event.set-aside.mesh-knowledge.ledger", given: "{\"act\":\"a-4\",\"at\":\"2026-11-11T10:00:00Z\",\"id\":\"20261111T121200Z\",\"name\":\"mesh-knowledge_ledger\",\"size\":4096}", wire: "{\"act\":\"a-4\",\"at\":\"2026-11-11T10:00:00Z\",\"id\":\"20261111T121200Z\",\"name\":\"mesh-knowledge_ledger\",\"size\":4096}",
decode: func(b []byte) (any, error) { var v SetAsideEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-recovery\\.event\\.set-aside\\.[^.*> ]+\\.[^.*> ]+$")},
{name: "aside-discarded is said", subject: "mesh.seat.mesh-recovery.event.aside-discarded.mesh-knowledge.ledger", given: "{\"act\":\"a-5\",\"at\":\"2026-11-11T10:00:00Z\",\"id\":\"20261111T121200Z\",\"name\":\"mesh-knowledge_ledger\",\"size\":4096}", wire: "{\"act\":\"a-5\",\"at\":\"2026-11-11T10:00:00Z\",\"id\":\"20261111T121200Z\",\"name\":\"mesh-knowledge_ledger\",\"size\":4096}",
+14
View File
@@ -72,6 +72,20 @@
"missing": true
}
},
{
"name": "a cancelled act says the hand act's why",
"of": "event:restored",
"subject": "mesh.seat.mesh-recovery.event.restored.mesh-knowledge.ledger",
"given": {
"act": "a-4",
"at": "2026-11-11T10:00:00Z",
"module": "mesh-knowledge",
"kept": "ledger",
"outcome": "failed",
"error": "cancelled",
"why": "the operator stopped it to look at the disk"
}
},
{
"name": "set-aside is said",
"of": "event:set-aside",
+8
View File
@@ -669,6 +669,10 @@
"type": "string",
"description": "when failed"
},
"why": {
"type": "string",
"description": "the words of the hand act that ended it, for a cancel (design 47 G A-117, 560)"
},
"consumers": {
"type": "array",
"items": {
@@ -788,6 +792,10 @@
"error": {
"type": "string"
},
"why": {
"type": "string",
"description": "the words of the hand act that ended it, for a cancel (design 47 G A-117, 560)"
},
"aside": {
"$ref": "#/defs/Aside"
},
+4
View File
@@ -399,6 +399,8 @@ export interface EndedEvent {
"outcome": "done" | "failed";
"size"?: number;
"snapshot"?: string;
/** the words of the hand act that ended it, for a cancel (design 47 G A-117, 560) */
"why"?: string;
}
/** is the body of the event restore-started. */
@@ -431,6 +433,8 @@ export interface RestoredEvent {
/** how the act ended */
"outcome": "done" | "failed";
"snapshot"?: string;
/** the words of the hand act that ended it, for a cancel (design 47 G A-117, 560) */
"why"?: string;
}
/** is the body of the event set-aside. */