From 91818305e7f33d696be1f421116d77d5f139507d Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 11 Nov 2026 10:39:23 +0100 Subject: [PATCH] C5: the node-engine seat says composed, running (kept last per subject, no age limit, or stopped) and capabilities-changed, acts in compose, and serves process-builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rewritten from the earlier branch to the final lines: keep as an object, stopped on running, process-builds a read for persons, sessions and healers and not optional, the compose rule with the step's default bound. The eleven verbs' callers (§393) wait on a question; the generated Go and TypeScript wait on the generator. Builds: design 47 G §177, §199, §203, §260, §261, §266, §396, §404, §440 Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ --- seats/node-engine/fixtures/events.json | 52 ++++++ seats/node-engine/fixtures/verbs.json | 39 +++++ seats/node-engine/seat.json | 233 ++++++++++++++++++++++++- 3 files changed, 323 insertions(+), 1 deletion(-) diff --git a/seats/node-engine/fixtures/events.json b/seats/node-engine/fixtures/events.json index eb2c8d7..657566e 100644 --- a/seats/node-engine/fixtures/events.json +++ b/seats/node-engine/fixtures/events.json @@ -65,5 +65,57 @@ "at": "2026-11-04T10:05:00Z", "why": "returned" } + }, + { + "name": "composed is said", + "of": "event:composed", + "subject": "mesh.seat.node-engine.event.composed.ace", + "given": { + "v": 1, + "node": "ace", + "module": "nats", + "fingerprint": "src2:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "digest": "sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", + "at": "2026-11-09T20:00:00Z" + } + }, + { + "name": "running is said, its node and module in its subject", + "of": "event:running", + "subject": "mesh.seat.node-engine.event.running.ace.nats", + "given": { + "v": 1, + "node": "ace", + "module": "nats", + "fingerprint": "src2:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "manifest": "sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc", + "at": "2026-11-09T20:01:00Z" + } + }, + { + "name": "running says a module stopped on the node, with no fingerprint", + "of": "event:running", + "subject": "mesh.seat.node-engine.event.running.ace.nats", + "given": { + "v": 1, + "node": "ace", + "module": "nats", + "stopped": true, + "at": "2026-11-11T09:00:00Z" + } + }, + { + "name": "capabilities-changed is said", + "of": "event:capabilities-changed", + "subject": "mesh.seat.node-engine.event.capabilities-changed.ace", + "given": { + "v": 1, + "node": "ace", + "capabilities": [ + "build-go", + "docker" + ], + "at": "2026-11-09T20:02:00Z" + } } ] diff --git a/seats/node-engine/fixtures/verbs.json b/seats/node-engine/fixtures/verbs.json index 3375279..8c72985 100644 --- a/seats/node-engine/fixtures/verbs.json +++ b/seats/node-engine/fixtures/verbs.json @@ -117,5 +117,44 @@ "health": "the seat list is held from the bootstrap", "error": "seatlist: no answer" } + }, + { + "name": "process-builds asks one module", + "of": "verb:process-builds.input", + "given": { + "module": "nats" + } + }, + { + "name": "process-builds answers each process's build", + "of": "verb:process-builds.answer", + "given": { + "node": "ace", + "processes": [ + { + "module": "nats", + "process": "nats.service", + "kind": "service", + "fingerprint": "src2:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "started": "2026-11-09T19:00:00Z" + }, + { + "module": "route-proxy", + "process": "route-proxy", + "kind": "container", + "unknown": "started before the node-engine handed MESH_FINGERPRINT", + "started": "2026-11-01T08:00:00Z" + } + ] + } + }, + { + "name": "process-builds answers an error", + "of": "verb:process-builds.answer", + "given": { + "node": "ace", + "processes": [], + "error": "the service manager did not answer" + } } ] diff --git a/seats/node-engine/seat.json b/seats/node-engine/seat.json index f04b6ff..1a08c68 100644 --- a/seats/node-engine/seat.json +++ b/seats/node-engine/seat.json @@ -5,8 +5,14 @@ "grain": "whole", "domain": "Core", "decision": "novox/hq ADR 0563", - "description": "The node seat every node's engine holds (novox/hq ADR 0563, ADR 0618 §3, §4): its hand acts on the operator's warrant, its read-only judgements, its compositions and what it reads of a manifest. Each verb is answered on this node's subject, mesh.seat.node-engine.tool.., and each event is published on mesh.seat.node-engine.event.., the node's name its last token.", + "description": "The node seat every node's engine holds (novox/hq ADR 0563, ADR 0618 §3, §4): its hand acts on the operator's warrant, its read-only judgements, its compositions and what it reads of a manifest. Each verb is answered on this node's subject, mesh.seat.node-engine.tool.., and each event is published on mesh.seat.node-engine.event.., the node's name its last token, or, for an event whose subject names , there (composed., running..): the grants part grants a node's account only its own node's subjects (ADR 0363 §2).", "held-by-the-engine": true, + "acts": [ + { + "step": "compose", + "on": "every" + } + ], "verbs": [ { "name": "hand-over", @@ -704,6 +710,29 @@ "answer": { "$ref": "#/defs/SeatList" } + }, + { + "name": "process-builds", + "description": "The build each process on this node was started with (design 47 *The revision view*): per service and container the fingerprint the node-engine handed it in MESH_FINGERPRINT, or why it is unknown, and when it started. Narrowed by module. Reads only.", + "callers": [ + "persons", + "sessions", + "healers" + ], + "input": { + "type": "object", + "properties": { + "module": { + "type": "string", + "description": "only this module's processes" + } + }, + "additionalProperties": false + }, + "answer": { + "$ref": "#/defs/ProcessBuilds" + }, + "class": "read" } ], "events": [ @@ -734,6 +763,31 @@ "body": { "$ref": "#/defs/ManifestReadsChanged" } + }, + { + "name": "composed", + "subject": "composed.", + "body": { + "$ref": "#/defs/Composed" + } + }, + { + "name": "running", + "subject": "running..", + "keep": { + "max-age-days": 0, + "last-per-subject": true + }, + "body": { + "$ref": "#/defs/Running" + } + }, + { + "name": "capabilities-changed", + "subject": "capabilities-changed.", + "body": { + "$ref": "#/defs/CapabilitiesChanged" + } } ], "family": { @@ -2664,6 +2718,183 @@ "state", "since" ] + }, + "Composed": { + "type": "object", + "description": "an entry composed on a node (design 47 *What each step says*)", + "properties": { + "v": { + "type": "integer", + "description": "the layout's version" + }, + "node": { + "type": "string", + "description": "the node" + }, + "module": { + "type": "string", + "description": "the module" + }, + "fingerprint": { + "type": "string", + "description": "the fingerprint of the want composed" + }, + "digest": { + "type": "string", + "description": "the digest of the composition (design 47 G 404)" + }, + "at": { + "type": "string", + "description": "when, RFC 3339", + "format": "date-time" + } + }, + "required": [ + "v", + "node", + "module", + "fingerprint", + "digest", + "at" + ] + }, + "Running": { + "type": "object", + "description": "a module running healthy on a node at a build: what the node-engines of other nodes and the grants part decide a seat's pass from (ADR 0660 §2), kept last per subject with no age limit", + "properties": { + "v": { + "type": "integer", + "description": "the layout's version" + }, + "node": { + "type": "string", + "description": "the node" + }, + "module": { + "type": "string", + "description": "the module" + }, + "fingerprint": { + "type": "string", + "description": "the fingerprint of the build it runs; none with stopped" + }, + "manifest": { + "type": "string", + "description": "the digest of that build's manifest, the indexer's manifest of it, read by digest from the catalog half" + }, + "at": { + "type": "string", + "description": "when it was seen running healthy, RFC 3339", + "format": "date-time" + }, + "stopped": { + "type": "boolean", + "description": "true when the module no longer runs on the node: no fingerprint or manifest then (design 47 G 365, 404); mesh-sdk's SeatsToPassOn counts such a module as not running there" + } + }, + "required": [ + "v", + "node", + "module", + "at" + ] + }, + "CapabilitiesChanged": { + "type": "object", + "description": "a node's capabilities changed, which the assigner places by", + "properties": { + "v": { + "type": "integer", + "description": "the layout's version" + }, + "node": { + "type": "string", + "description": "the node" + }, + "capabilities": { + "type": "array", + "items": { + "type": "string" + }, + "description": "its capabilities now" + }, + "at": { + "type": "string", + "description": "when, RFC 3339", + "format": "date-time" + } + }, + "required": [ + "v", + "node", + "capabilities", + "at" + ] + }, + "ProcessBuild": { + "type": "object", + "description": "the build one process of a module was started with", + "properties": { + "module": { + "type": "string", + "description": "the module" + }, + "process": { + "type": "string", + "description": "the service's unit or the container's name" + }, + "kind": { + "type": "string", + "description": "service or container", + "enum": [ + "service", + "container" + ] + }, + "fingerprint": { + "type": "string", + "description": "the fingerprint handed to it in MESH_FINGERPRINT; empty when it was started without one" + }, + "unknown": { + "type": "string", + "description": "why its build is unknown: started before the node-engine handed MESH_FINGERPRINT, or the value could not be read" + }, + "started": { + "type": "string", + "description": "when it was started, RFC 3339", + "format": "date-time" + } + }, + "required": [ + "module", + "process", + "kind" + ] + }, + "ProcessBuilds": { + "type": "object", + "description": "what process-builds answers", + "properties": { + "node": { + "type": "string", + "description": "the node" + }, + "processes": { + "type": "array", + "items": { + "$ref": "#/defs/ProcessBuild" + }, + "description": "every process the node-engine started, by module" + }, + "error": { + "type": "string", + "description": "why they could not be read" + } + }, + "required": [ + "node", + "processes" + ] } } }