From 40ac10790093e3b63433b745b0cc2349716b257a Mon Sep 17 00:00:00 2001 From: jochen Date: Tue, 24 Nov 2026 21:50:43 +0100 Subject: [PATCH] Copy node-resolver byte for byte from mesh-connectivity-contracts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit node-resolver.json is copied byte for byte from mesh-networking modules/mesh-connectivity-contracts/seats/node-resolver/seat.json (11a1195, after its fix giving routes' answer outside_writes as systemd-resolved does). node_resolver_test.go's decision text now matches the real definition ("novox/hq ADR 0247, ADR 0687"); its verb list already matched. This completes C-3 for mesh-sdk: all three test copies are now byte-for-byte copies of their contracts modules' definitions. Builds: design 08 sign-in-page §1, §2, §3; lead answer C-3 --- go/catalogue/node_resolver_test.go | 10 +- .../seatlisttest/seats/node-resolver.json | 133 +++++++++--------- 2 files changed, 73 insertions(+), 70 deletions(-) diff --git a/go/catalogue/node_resolver_test.go b/go/catalogue/node_resolver_test.go index 0c569a01..aef7a6ab 100644 --- a/go/catalogue/node_resolver_test.go +++ b/go/catalogue/node_resolver_test.go @@ -10,16 +10,16 @@ import ( // Defends design 08 sign-in-page §2 (novox/hq ADR 0687 §2): the seat gains the required verb // `uplink-names`, which replaces nothing of a shell command. -// The seat: node-scoped, decided by ADR 0247 (gaining ADR 0687 and ADR 0613), and its four verbs required -// of every holder — a holder exists only once the module serving them does, so nothing has to be optional -// while it catches up. +// The seat: node-scoped, decided by ADR 0247 (gaining ADR 0687), and its four verbs required of every +// holder — a holder exists only once the module serving them does, so nothing has to be optional while it +// catches up. func TestTheMachinesOwnResolverIsANodeSeatWithItsVerbs(t *testing.T) { s, ok := SeatNamed(ResolverSeat) if !ok { t.Fatalf("%s is not in the mesh's set", ResolverSeat) } - if s.Scope != ScopeNode || s.Decision != "novox/hq ADR 0247, ADR 0687, ADR 0613" || s.Delivers != "" || s.Replicated { - t.Errorf("%s is %+v; a node seat under ADR 0247, ADR 0687, ADR 0613 that delivers nothing", ResolverSeat, s) + if s.Scope != ScopeNode || s.Decision != "novox/hq ADR 0247, ADR 0687" || s.Delivers != "" || s.Replicated { + t.Errorf("%s is %+v; a node seat under ADR 0247, ADR 0687 that delivers nothing", ResolverSeat, s) } var got []string for _, v := range s.Serves { diff --git a/go/seatlist/seatlisttest/seats/node-resolver.json b/go/seatlist/seatlisttest/seats/node-resolver.json index cd31f132..6724d8c1 100644 --- a/go/seatlist/seatlisttest/seats/node-resolver.json +++ b/go/seatlist/seatlisttest/seats/node-resolver.json @@ -4,7 +4,8 @@ "scope": "node", "grain": "whole", "domain": "Connectivity", - "decision": "novox/hq ADR 0247, ADR 0687, ADR 0613", + "decision": "novox/hq ADR 0247, ADR 0687", + "description": "The node seat of the machine's own resolver (ADR 0247), as ADR 0687 §2 changes it: what it sends where (routes), one link given its own servers and taken away (route, unroute), and, from the uplink's check, the host names to resolve over the link carrying the default route (uplink-names), so a working network is rated fully connected again and a network with a sign-in page is rated as one.", "verbs": [ { "name": "routes", @@ -23,9 +24,9 @@ "required": [ "mesh", "links", - "outside_writes", "uplink_names", - "mesh_resolvers" + "mesh_resolvers", + "outside_writes" ], "properties": { "mesh": { @@ -39,20 +40,18 @@ }, "description": "every link given servers of its own" }, + "uplink_names": { + "$ref": "#/defs/UplinkNames" + }, + "mesh_resolvers": { + "$ref": "#/defs/MeshResolvers" + }, "outside_writes": { "type": "array", "items": { - "$ref": "#/defs/Displacement" + "$ref": "#/defs/OutsideWrite" }, - "description": "the resolver file's outside writes, newest first" - }, - "uplink_names": { - "$ref": "#/defs/UplinkNamesOnLink", - "description": "the names of the applied list that resolved holds on the named link now, never the file's" - }, - "mesh_resolvers": { - "$ref": "#/defs/MeshResolversSilence", - "description": "whether the mesh's resolvers are silent now, by the fallback's guard, and since when" + "description": "the resolver file's outside writes it kept, newest first: when, who wrote it as far as the file says, whether a module took it, and when the resolver's own file was put back" } } } @@ -113,7 +112,7 @@ }, "said": { "type": "string", - "description": "what was done, in words the operator reads" + "description": "what was done, in words" } } } @@ -148,14 +147,14 @@ }, "said": { "type": "string", - "description": "what was done, in words the operator reads" + "description": "what was done, in words" } } } }, { "name": "uplink-names", - "description": "Set the host names the uplink's holder checks a network's sign-in through: read from what resolved holds for the named link, not from the file. Its callers are the modules whose manifest invokes it, and the operator, through the mesh MCP server. Refused, naming the name and the reason: a name that is not a host name (a wildcard, a trailing dot, a label over 63 bytes), the root, the mesh's own domain or a name under it, or more than 8 names.", + "description": "Give the resolver the uplink's check's host names, over the link carrying the default route: the list replaces what was given before, and an empty list takes every name away. Refuses, naming the name and the reason, a name that is not a host name (a wildcard, a trailing dot, a label over 63 bytes), the root, the mesh's own domain or a name under it, or more than 8 names.", "input": { "type": "object", "required": [ @@ -170,9 +169,8 @@ "type": "string", "minLength": 1, "maxLength": 253, - "description": "a host name, in letters, digits, hyphens and dots, taken lower-cased" - }, - "description": "the list replaces what was given before; an empty list takes every name away" + "description": "a host name, letters, digits, hyphens and dots, taken lower-cased" + } } } }, @@ -211,14 +209,15 @@ "defs": { "Scope": { "type": "object", - "description": "one place resolved sends names: the machine's global servers, or a link", + "description": "one scope of the resolver's answers: the mesh's global one, or one link given servers of its own", "required": [ "servers", "domains" ], "properties": { "link": { - "type": "string" + "type": "string", + "description": "the link's name; absent for the global scope" }, "servers": { "type": "array", @@ -231,7 +230,7 @@ "items": { "type": "string" }, - "description": "the routing domains, without resolved's leading tilde: every name under one goes to these servers" + "description": "the routing domains, without resolved's leading ~: every name under one goes to these servers" }, "default_route": { "type": "boolean", @@ -239,9 +238,52 @@ } } }, - "Displacement": { + "UplinkNames": { "type": "object", - "description": "one outside write of the resolver file, as the guard says it", + "description": "the applied uplink-names list that resolved holds on the named link now", + "required": [ + "names", + "link", + "refused" + ], + "properties": { + "names": { + "type": "array", + "items": { + "type": "string" + }, + "description": "the names of the applied list that resolved holds on that link now" + }, + "link": { + "type": "string", + "description": "the link the guard gave the names to" + }, + "refused": { + "type": "string", + "description": "the reason resolved last refused them, or empty" + } + } + }, + "MeshResolvers": { + "type": "object", + "description": "whether the mesh's resolvers are silent now, by ADR 0688's guard, and since when", + "required": [ + "silent", + "since" + ], + "properties": { + "silent": { + "type": "boolean" + }, + "since": { + "type": "string", + "description": "RFC 3339, since when the silent state has held" + } + } + }, + "OutsideWrite": { + "type": "object", + "description": "one outside write of the resolver file the guard displaced, never what it held", "required": [ "id", "at" @@ -268,50 +310,11 @@ }, "ended": { "type": "string", - "description": "when the module's own file stood again, RFC 3339" + "description": "when the resolver's own file stood again, RFC 3339" }, "how": { - "type": "string" - } - } - }, - "UplinkNamesOnLink": { - "type": "object", - "description": "the applied list's names, as resolved holds them on the named link now", - "required": [ - "names", - "link", - "refused" - ], - "properties": { - "names": { - "type": "array", - "items": { - "type": "string" - } - }, - "link": { - "type": "string" - }, - "refused": { "type": "string", - "description": "the reason resolved last refused them, or empty" - } - } - }, - "MeshResolversSilence": { - "type": "object", - "description": "whether the mesh's resolvers are silent now, and since when", - "required": [ - "silent" - ], - "properties": { - "silent": { - "type": "boolean" - }, - "since": { - "type": "string", - "description": "RFC 3339, when silent is true" + "description": "how it ended" } } }