From 11a36eb88c7b8f11dd693b77863d263b4e194287 Mon Sep 17 00:00:00 2001 From: jochen Date: Tue, 10 Nov 2026 04:52:53 +0100 Subject: [PATCH] =?UTF-8?q?C6:=20the=20watchdogs=20seat=20declares=20prese?= =?UTF-8?q?nce's=20answer:=20with=20machine,=20that=20machine's=20online?= =?UTF-8?q?=20and=20since;=20without,=20the=20keys=20of=20the=20state=20pr?= =?UTF-8?q?esence=20(issue=201966,=20ADR=200596=20=C2=A72,=20ADR=200668=20?= =?UTF-8?q?=C2=A73;=20review=20round=203,=20finding=201)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The builder and the indexer ask whether a node's machine is heard through this verb instead of reading the watchman's state; regenerated with seatgen, whose -check names nothing new. Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ --- .../go/seats/meshwatchdogs/contract.go | 25 ++++++++- .../seats/mesh-watchdogs/seat.json | 51 ++++++++++++++++++- .../ts/seats/meshwatchdogs/src/index.ts | 24 ++++++++- 3 files changed, 96 insertions(+), 4 deletions(-) diff --git a/health-and-repair/go/seats/meshwatchdogs/contract.go b/health-and-repair/go/seats/meshwatchdogs/contract.go index 286d7dd..7c1ec32 100644 --- a/health-and-repair/go/seats/meshwatchdogs/contract.go +++ b/health-and-repair/go/seats/meshwatchdogs/contract.go @@ -202,8 +202,31 @@ type PresenceInput struct { Machine string `json:"machine,omitempty"` } +// PresenceAnswerKeysItem is a type of the contract. +type PresenceAnswerKeysItem struct { + // or part.. + Key string `json:"key"` + // the key's revision + Revision int64 `json:"revision,omitempty"` + // the key's value, online and its layout's version + Value map[string]any `json:"value"` +} + // PresenceAnswer is what presence answers. -type PresenceAnswer = map[string]any +type PresenceAnswer struct { + // without machine: how many keys the state holds + Holds int64 `json:"holds,omitempty"` + // without machine: each key of the state presence, or part.., with its value + Keys []PresenceAnswerKeysItem `json:"keys,omitempty"` + // the machine asked, with machine + Machine string `json:"machine,omitempty"` + // with machine: whether the watchman hears the machine now; false for a machine it holds no word of + Online bool `json:"online,omitempty"` + // with machine: when its presence last changed, RFC 3339; empty for a machine the watchman holds no word of + Since string `json:"since,omitempty"` + // without machine: the state read, presence + State string `json:"state,omitempty"` +} // DeadLettersInput is what dead-letters takes. type DeadLettersInput struct { diff --git a/health-and-repair/seats/mesh-watchdogs/seat.json b/health-and-repair/seats/mesh-watchdogs/seat.json index 35a4341..1efe7a8 100644 --- a/health-and-repair/seats/mesh-watchdogs/seat.json +++ b/health-and-repair/seats/mesh-watchdogs/seat.json @@ -43,7 +43,7 @@ }, { "name": "presence", - "description": "Every machine and tool runner the watchman sees connected, with its last word, and those it says silent; a machine that said it sleeps is shown as sleeping, not silent.", + "description": "Every machine and tool runner the watchman sees connected, with its last word, and those it says silent; a machine that said it sleeps is shown as sleeping, not silent. With machine, that machine's presence alone: whether the watchman hears it and since when.", "input": { "properties": { "machine": { @@ -55,7 +55,54 @@ }, "answer": { "type": "object", - "description": "who is connected and who is silent" + "description": "with machine, that machine: online and since; without, every key of the state presence", + "properties": { + "machine": { + "type": "string", + "description": "the machine asked, with machine" + }, + "online": { + "type": "boolean", + "description": "with machine: whether the watchman hears the machine now; false for a machine it holds no word of" + }, + "since": { + "type": "string", + "description": "with machine: when its presence last changed, RFC 3339; empty for a machine the watchman holds no word of" + }, + "state": { + "type": "string", + "description": "without machine: the state read, presence" + }, + "holds": { + "type": "integer", + "description": "without machine: how many keys the state holds" + }, + "keys": { + "type": "array", + "description": "without machine: each key of the state presence, or part.., with its value", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": " or part.." + }, + "value": { + "type": "object", + "description": "the key's value, online and its layout's version" + }, + "revision": { + "type": "integer", + "description": "the key's revision" + } + }, + "required": [ + "key", + "value" + ] + } + } + } } }, { diff --git a/health-and-repair/ts/seats/meshwatchdogs/src/index.ts b/health-and-repair/ts/seats/meshwatchdogs/src/index.ts index 3a5240a..8f12999 100644 --- a/health-and-repair/ts/seats/meshwatchdogs/src/index.ts +++ b/health-and-repair/ts/seats/meshwatchdogs/src/index.ts @@ -116,8 +116,30 @@ export interface PresenceInput { "machine"?: string; } +export interface PresenceAnswerKeysItem { + /** or part.. */ + "key": string; + /** the key's revision */ + "revision"?: number; + /** the key's value, online and its layout's version */ + "value": Record; +} + /** is what presence answers. */ -export type PresenceAnswer = Record; +export interface PresenceAnswer { + /** without machine: how many keys the state holds */ + "holds"?: number; + /** without machine: each key of the state presence, or part.., with its value */ + "keys"?: PresenceAnswerKeysItem[]; + /** the machine asked, with machine */ + "machine"?: string; + /** with machine: whether the watchman hears the machine now; false for a machine it holds no word of */ + "online"?: boolean; + /** with machine: when its presence last changed, RFC 3339; empty for a machine the watchman holds no word of */ + "since"?: string; + /** without machine: the state read, presence */ + "state"?: string; +} /** is what dead-letters takes. */ export interface DeadLettersInput {