From 7f0b0f3b42c7e93713e46c4833d3dbdeab869bbc Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 4 Nov 2026 12:01:18 +0100 Subject: [PATCH] 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 --- go/seats/meshvault/contract.go | 4 +++- go/seats/meshvault/contract_test.go | 2 +- go/seats/seats.go | 2 +- seats/mesh-vault/fixtures/verbs.json | 3 ++- seats/mesh-vault/seat.json | 9 +++++++-- ts/src/mesh-vault.ts | 4 +++- ts/src/seats.ts | 9 +++++++-- 7 files changed, 24 insertions(+), 9 deletions(-) diff --git a/go/seats/meshvault/contract.go b/go/seats/meshvault/contract.go index bf04ecc..e5beead 100644 --- a/go/seats/meshvault/contract.go +++ b/go/seats/meshvault/contract.go @@ -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"` } diff --git a/go/seats/meshvault/contract_test.go b/go/seats/meshvault/contract_test.go index 56dbe3b..63f54dc 100644 --- a/go/seats/meshvault/contract_test.go +++ b/go/seats/meshvault/contract_test.go @@ -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 { diff --git a/go/seats/seats.go b/go/seats/seats.go index d3d6151..371a5fd 100644 --- a/go/seats/seats.go +++ b/go/seats/seats.go @@ -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", diff --git a/seats/mesh-vault/fixtures/verbs.json b/seats/mesh-vault/fixtures/verbs.json index 4f2608e..a031109 100644 --- a/seats/mesh-vault/fixtures/verbs.json +++ b/seats/mesh-vault/fixtures/verbs.json @@ -6,7 +6,8 @@ "node": "ace", "module": "messenger", "name": "token", - "warrant": "w-1" + "warrant": "w-1", + "ask": "a1" } } ] diff --git a/seats/mesh-vault/seat.json b/seats/mesh-vault/seat.json index a6a753d..4cb5d2c 100644 --- a/seats/mesh-vault/seat.json +++ b/seats/mesh-vault/seat.json @@ -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": { diff --git a/ts/src/mesh-vault.ts b/ts/src/mesh-vault.ts index 89e9fee..7c51701 100644 --- a/ts/src/mesh-vault.ts +++ b/ts/src/mesh-vault.ts @@ -313,13 +313,15 @@ export type AbandonAnswer = Record; /** 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; } diff --git a/ts/src/seats.ts b/ts/src/seats.ts index bf9c0dd..eec8f18 100644 --- a/ts/src/seats.ts +++ b/ts/src/seats.ts @@ -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" },