SD-M2c: retire takes ask

The ask's id beside the warrant (the hand act's id), as own-retired carries it (A4's request).

Claude-Session: https://claude.ai/code/session_01JG73KJNrH5EgFXMKKYSrig
This commit is contained in:
2026-11-04 12:01:18 +01:00
parent a6e3b3bb4f
commit 7f0b0f3b42
7 changed files with 24 additions and 9 deletions
+3 -1
View File
@@ -329,13 +329,15 @@ type AbandonAnswer = map[string]any
// RetireInput is what retire takes.
type RetireInput struct {
// the id of the operator's ask the warrant answers
Ask string `json:"ask"`
// the module
Module string `json:"module"`
// the own secret's name
Name string `json:"name"`
// the node
Node string `json:"node"`
// the operator's warrant for this node, module and name
// the operator's warrant for this node, module and name: the hand act's id
Warrant string `json:"warrant"`
}
+1 -1
View File
@@ -39,7 +39,7 @@ func TestFixtures(t *testing.T) {
decode: func(b []byte) (any, error) { var v map[string]any; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.mod\\.[a-z0-9-]+\\.event\\.rotation-done$")},
{name: "own-retired", subject: "mesh.mod.mesh-vault.event.own-retired", given: "{\"ask\":\"a1\",\"caller\":\"mesh-config\",\"module\":\"messenger\",\"name\":\"token\",\"node\":\"ace\"}", wire: "{\"ask\":\"a1\",\"caller\":\"mesh-config\",\"module\":\"messenger\",\"name\":\"token\",\"node\":\"ace\"}",
decode: func(b []byte) (any, error) { var v OwnRetiredHolderEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.mod\\.[a-z0-9-]+\\.event\\.own-retired$")},
{name: "retire on a warrant", subject: "", given: "{\"module\":\"messenger\",\"name\":\"token\",\"node\":\"ace\",\"warrant\":\"w-1\"}", wire: "{\"module\":\"messenger\",\"name\":\"token\",\"node\":\"ace\",\"warrant\":\"w-1\"}",
{name: "retire on a warrant", subject: "", given: "{\"ask\":\"a1\",\"module\":\"messenger\",\"name\":\"token\",\"node\":\"ace\",\"warrant\":\"w-1\"}", wire: "{\"ask\":\"a1\",\"module\":\"messenger\",\"name\":\"token\",\"node\":\"ace\",\"warrant\":\"w-1\"}",
decode: func(b []byte) (any, error) { var v RetireInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
}
for _, c := range cases {
+1 -1
View File
@@ -214,7 +214,7 @@ func List() []Seat {
Input: map[string]any{"properties": map[string]any{"node": map[string]any{"description": "the node whose rotation is abandoned", "type": "string"}}, "required": []string{"node"}, "type": "object"},
Output: map[string]any{"description": "the holder's answer", "type": "object"}},
{Name: "retire", Description: "Retire one module's own secret, by node, module and name, on the operator's warrant bound to exactly those three (design 32 *A value no longer read*). Emits own-retired.", Optional: true,
Input: map[string]any{"properties": map[string]any{"module": map[string]any{"description": "the module", "type": "string"}, "name": map[string]any{"description": "the own secret's name", "type": "string"}, "node": map[string]any{"description": "the node", "type": "string"}, "warrant": map[string]any{"description": "the operator's warrant for this node, module and name", "type": "string"}}, "required": []string{"node", "module", "name", "warrant"}, "type": "object"},
Input: map[string]any{"properties": map[string]any{"ask": map[string]any{"description": "the id of the operator's ask the warrant answers", "type": "string"}, "module": map[string]any{"description": "the module", "type": "string"}, "name": map[string]any{"description": "the own secret's name", "type": "string"}, "node": map[string]any{"description": "the node", "type": "string"}, "warrant": map[string]any{"description": "the operator's warrant for this node, module and name: the hand act's id", "type": "string"}}, "required": []string{"node", "module", "name", "warrant", "ask"}, "type": "object"},
Output: map[string]any{"properties": map[string]any{"retired": map[string]any{"description": "the secret is gone", "type": "boolean"}}, "required": []string{"retired"}, "type": "object"}},
}},
{Name: MeshConfig, Scope: "mesh", Grain: "whole", Decision: "novox/hq ADR 0348, ADR 0565",
+2 -1
View File
@@ -6,7 +6,8 @@
"node": "ace",
"module": "messenger",
"name": "token",
"warrant": "w-1"
"warrant": "w-1",
"ask": "a1"
}
}
]
+7 -2
View File
@@ -529,14 +529,19 @@
},
"warrant": {
"type": "string",
"description": "the operator's warrant for this node, module and name"
"description": "the operator's warrant for this node, module and name: the hand act's id"
},
"ask": {
"type": "string",
"description": "the id of the operator's ask the warrant answers"
}
},
"required": [
"node",
"module",
"name",
"warrant"
"warrant",
"ask"
]
},
"answer": {
+3 -1
View File
@@ -313,13 +313,15 @@ export type AbandonAnswer = Record<string, unknown>;
/** is what retire takes. */
export interface RetireInput {
/** the id of the operator's ask the warrant answers */
"ask": string;
/** the module */
"module": string;
/** the own secret's name */
"name": string;
/** the node */
"node": string;
/** the operator's warrant for this node, module and name */
/** the operator's warrant for this node, module and name: the hand act's id */
"warrant": string;
}
+7 -2
View File
@@ -1426,6 +1426,10 @@ export const list: readonly Seat[] = [
"description": "Retire one module's own secret, by node, module and name, on the operator's warrant bound to exactly those three (design 32 *A value no longer read*). Emits own-retired.",
"input": {
"properties": {
"ask": {
"description": "the id of the operator's ask the warrant answers",
"type": "string"
},
"module": {
"description": "the module",
"type": "string"
@@ -1439,7 +1443,7 @@ export const list: readonly Seat[] = [
"type": "string"
},
"warrant": {
"description": "the operator's warrant for this node, module and name",
"description": "the operator's warrant for this node, module and name: the hand act's id",
"type": "string"
}
},
@@ -1447,7 +1451,8 @@ export const list: readonly Seat[] = [
"node",
"module",
"name",
"warrant"
"warrant",
"ask"
],
"type": "object"
},