From 18c68fda5a3af4e5502b792dbacf9f0b00401717 Mon Sep 17 00:00:00 2001 From: jochen Date: Tue, 24 Nov 2026 21:13:21 +0100 Subject: [PATCH 1/3] Refresh the test copies of node-uplink, node-resolver and node-display-session to their whole definitions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit mesh-sdk joins the sign-in-page milestone only to replace its seatlisttest copies with the three seats' whole definitions, and to update the two tests that assert today's verbs; the seat-name constants and the package's own code stay untouched (ADR 0613 §5: nothing seat-specific is added to mesh-sdk). Builds: design 08 sign-in-page §1, §2, §3, §4 --- go/catalogue/graphical_session_test.go | 15 +- go/catalogue/node_resolver_test.go | 22 +- .../seats/node-display-session.json | 225 +++++++++++++- .../seatlisttest/seats/node-resolver.json | 247 +++++++++++++++- .../seatlisttest/seats/node-uplink.json | 275 +++++++++++++++++- 5 files changed, 762 insertions(+), 22 deletions(-) diff --git a/go/catalogue/graphical_session_test.go b/go/catalogue/graphical_session_test.go index 4cd4239b..2bf0413a 100644 --- a/go/catalogue/graphical_session_test.go +++ b/go/catalogue/graphical_session_test.go @@ -8,12 +8,14 @@ import ( // Defends novox/hq ADR 0208: the graphical session is one module per piece, on the mesh's seats. -// §2: the eleven roles are the mesh's own node seats, each with the verbs it starts with. +// §2: the eleven roles are the mesh's own node seats, each with the verbs it starts with. Defends design 08 +// sign-in-page §3 (novox/hq ADR 0687 §4): the display session gains the required verb `open`, and its decision +// gains ADR 0687 and ADR 0613. func TestTheGraphicalSessionsSeatsAreTheMeshsOwnWithTheirVerbs(t *testing.T) { want := map[string][]string{ LoginManagerSeat: {"sessions"}, DisplayServerSeat: {"displays", "layout"}, - DisplaySessionSeat: {"reload", "workspaces", "windows"}, + DisplaySessionSeat: {"reload", "workspaces", "windows", "open"}, TerminalEmulatorSeat: {"open"}, LauncherSeat: {"menu", "secret"}, NotifierSeat: {"send", "history"}, @@ -23,14 +25,19 @@ func TestTheGraphicalSessionsSeatsAreTheMeshsOwnWithTheirVerbs(t *testing.T) { CompositorSeat: nil, SecretServiceSeat: nil, } + decisions := map[string]string{DisplaySessionSeat: "novox/hq ADR 0208, ADR 0687, ADR 0613"} for name, verbs := range want { s, ok := SeatNamed(name) if !ok { t.Errorf("%s is not in the mesh's set", name) continue } - if s.Scope != ScopeNode || s.Decision != "novox/hq ADR 0208" { - t.Errorf("%s is %s-scoped under %q", name, s.Scope, s.Decision) + wantDecision := decisions[name] + if wantDecision == "" { + wantDecision = "novox/hq ADR 0208" + } + if s.Scope != ScopeNode || s.Decision != wantDecision { + t.Errorf("%s is %s-scoped under %q, want %q", name, s.Scope, s.Decision, wantDecision) } var got []string for _, v := range s.Serves { diff --git a/go/catalogue/node_resolver_test.go b/go/catalogue/node_resolver_test.go index be948652..0c569a01 100644 --- a/go/catalogue/node_resolver_test.go +++ b/go/catalogue/node_resolver_test.go @@ -7,16 +7,19 @@ import ( // Defends novox/hq ADR 0247: a machine's own resolver is a node seat, held only where something requires // `split-dns`; where it is held it writes the resolver file and the uplink's holder steps back from it. +// 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, and its three 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 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. 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" || s.Delivers != "" || s.Replicated { - t.Errorf("%s is %+v; a node seat under ADR 0247 that delivers nothing", ResolverSeat, s) + 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) } var got []string for _, v := range s.Serves { @@ -24,12 +27,15 @@ func TestTheMachinesOwnResolverIsANodeSeatWithItsVerbs(t *testing.T) { if v.Optional { t.Errorf("%s.%s is optional; its first holder serves it", ResolverSeat, v.Name) } - if v.Description == "" || v.Input["type"] != "object" || len(v.Replaces) == 0 { - t.Errorf("%s.%s has no description, no object schema or says it replaces nothing", ResolverSeat, v.Name) + if v.Description == "" || v.Input["type"] != "object" { + t.Errorf("%s.%s has no description or no object schema", ResolverSeat, v.Name) + } + if v.Name != "uplink-names" && len(v.Replaces) == 0 { + t.Errorf("%s.%s says it replaces nothing", ResolverSeat, v.Name) } } - if strings.Join(got, " ") != "routes route unroute" { - t.Errorf("%s serves %v, not routes, route and unroute", ResolverSeat, got) + if strings.Join(got, " ") != "routes route unroute uplink-names" { + t.Errorf("%s serves %v, not routes, route, unroute and uplink-names", ResolverSeat, got) } // The verbs name a link, domains and servers, and never a VPN: the resolver knows nothing of one. for _, v := range s.Serves { diff --git a/go/seatlist/seatlisttest/seats/node-display-session.json b/go/seatlist/seatlisttest/seats/node-display-session.json index a815db1d..9391afa1 100644 --- a/go/seatlist/seatlisttest/seats/node-display-session.json +++ b/go/seatlist/seatlisttest/seats/node-display-session.json @@ -2,16 +2,52 @@ "format": 1, "seat": "node-display-session", "scope": "node", - "grain": "seat-list", + "grain": "whole", "domain": "Core", - "decision": "novox/hq ADR 0208", + "decision": "novox/hq ADR 0208, ADR 0687, ADR 0613", "verbs": [ { "name": "reload", "description": "Reload the session's configuration in place, keeping its windows.", "input": { - "properties": {}, + "properties": { + "force": { + "type": "boolean", + "description": "reload even when the check finds errors" + } + }, "type": "object" + }, + "answer": { + "type": "object", + "required": [ + "reloaded", + "errors" + ], + "properties": { + "reloaded": { + "type": "boolean" + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/defs/ConfigError" + }, + "description": "the configuration's problems, found whether or not it reloaded" + }, + "why": { + "type": "string", + "description": "why it did not reload, when it did not" + }, + "i3": { + "type": "array", + "description": "i3's own outcome of each command it ran to reload; a sway holder could not give this" + }, + "watcher": { + "type": "object", + "description": "i3's own watcher status; a sway holder could not give this" + } + } } }, { @@ -20,6 +56,20 @@ "input": { "properties": {}, "type": "object" + }, + "answer": { + "type": "object", + "required": [ + "workspaces" + ], + "properties": { + "workspaces": { + "type": "array", + "items": { + "$ref": "#/defs/Workspace" + } + } + } } }, { @@ -33,6 +83,67 @@ } }, "type": "object" + }, + "answer": { + "type": "object", + "required": [ + "windows" + ], + "properties": { + "windows": { + "type": "array", + "items": { + "$ref": "#/defs/Window" + } + } + } + } + }, + { + "name": "open", + "description": "Open the address in the person's default browser. Refused, naming the reason: a scheme other than http or https (named), no scheme (a file path), no host, an address over 2048 bytes once encoded, no graphical session running, no default program for the scheme, the opener ending with a failure (its status named). The encoding: RFC 3986's unreserved characters and : / ? # [ ] @ & = + % are kept as they are; every other character is percent-encoded, as the bytes of its UTF-8 form. Nothing is refused for a character, and no shell reads the address. Its callers are the modules whose manifest invokes it and the operator, through the mesh MCP server; the sign-in reaction is not one.", + "class": "act", + "input": { + "type": "object", + "required": [ + "address" + ], + "properties": { + "address": { + "type": "string", + "maxLength": 2048, + "description": "the address to open, http or https" + } + } + }, + "answer": { + "type": "object", + "required": [ + "address", + "started" + ], + "properties": { + "address": { + "type": "string", + "description": "the address as handed on, encoded" + }, + "program": { + "type": "string", + "description": "the desktop entry that opened it (as browser.desktop); given only once the opener started" + }, + "command": { + "type": "string", + "description": "the first word of that entry's command; given only once the opener started" + }, + "started": { + "type": "string", + "enum": [ + "opened", + "opening" + ], + "description": "opened when the opener ended well within its bound, opening when it still ran at its bound" + } + } } } ], @@ -41,5 +152,111 @@ "kind": "config", "comment": "#" } - ] + ], + "defs": { + "ConfigError": { + "type": "object", + "description": "one problem the configuration check reports", + "required": [ + "text" + ], + "properties": { + "file": { + "type": "string" + }, + "line": { + "type": "integer" + }, + "text": { + "type": "string" + } + } + }, + "Workspace": { + "type": "object", + "required": [ + "num", + "name", + "output", + "visible", + "focused" + ], + "properties": { + "num": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "output": { + "type": "string" + }, + "visible": { + "type": "boolean" + }, + "focused": { + "type": "boolean" + }, + "urgent": { + "type": "boolean" + } + } + }, + "Window": { + "type": "object", + "required": [ + "window", + "title", + "workspace", + "output" + ], + "properties": { + "con_id": { + "type": "integer" + }, + "window": { + "type": "string" + }, + "class": { + "type": "string" + }, + "instance": { + "type": "string" + }, + "role": { + "type": "string" + }, + "title": { + "type": "string" + }, + "workspace": { + "type": "string" + }, + "output": { + "type": "string" + }, + "focused": { + "type": "boolean" + }, + "urgent": { + "type": "boolean" + }, + "floating": { + "type": "boolean" + }, + "fullscreen": { + "type": "boolean" + }, + "scratchpad": { + "type": "boolean" + }, + "marks": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } } diff --git a/go/seatlist/seatlisttest/seats/node-resolver.json b/go/seatlist/seatlisttest/seats/node-resolver.json index be8a91f8..cd31f132 100644 --- a/go/seatlist/seatlisttest/seats/node-resolver.json +++ b/go/seatlist/seatlisttest/seats/node-resolver.json @@ -2,9 +2,9 @@ "format": 1, "seat": "node-resolver", "scope": "node", - "grain": "seat-list", + "grain": "whole", "domain": "Connectivity", - "decision": "novox/hq ADR 0247", + "decision": "novox/hq ADR 0247, ADR 0687, ADR 0613", "verbs": [ { "name": "routes", @@ -17,6 +17,44 @@ "input": { "properties": {}, "type": "object" + }, + "answer": { + "type": "object", + "required": [ + "mesh", + "links", + "outside_writes", + "uplink_names", + "mesh_resolvers" + ], + "properties": { + "mesh": { + "$ref": "#/defs/Scope", + "description": "the global scope: the mesh's resolvers, which answer every name nothing routes elsewhere" + }, + "links": { + "type": "array", + "items": { + "$ref": "#/defs/Scope" + }, + "description": "every link given servers of its own" + }, + "outside_writes": { + "type": "array", + "items": { + "$ref": "#/defs/Displacement" + }, + "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" + } + } } }, { @@ -48,6 +86,36 @@ "servers" ], "type": "object" + }, + "answer": { + "type": "object", + "required": [ + "link", + "servers", + "domains", + "said" + ], + "properties": { + "link": { + "type": "string" + }, + "servers": { + "type": "array", + "items": { + "type": "string" + } + }, + "domains": { + "type": "array", + "items": { + "type": "string" + } + }, + "said": { + "type": "string", + "description": "what was done, in words the operator reads" + } + } } }, { @@ -67,6 +135,71 @@ "link" ], "type": "object" + }, + "answer": { + "type": "object", + "required": [ + "link", + "said" + ], + "properties": { + "link": { + "type": "string" + }, + "said": { + "type": "string", + "description": "what was done, in words the operator reads" + } + } + } + }, + { + "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.", + "input": { + "type": "object", + "required": [ + "names" + ], + "properties": { + "names": { + "type": "array", + "minItems": 0, + "maxItems": 8, + "items": { + "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" + } + } + }, + "answer": { + "type": "object", + "required": [ + "names", + "link", + "set_at" + ], + "properties": { + "names": { + "type": "array", + "items": { + "type": "string" + }, + "description": "the names now given" + }, + "link": { + "type": "string", + "description": "the link they are answered over now; empty when no link carries a default route" + }, + "set_at": { + "type": "string", + "description": "when the list was set, RFC 3339" + } + } } } ], @@ -74,5 +207,113 @@ { "path": "/etc/resolv.conf" } - ] + ], + "defs": { + "Scope": { + "type": "object", + "description": "one place resolved sends names: the machine's global servers, or a link", + "required": [ + "servers", + "domains" + ], + "properties": { + "link": { + "type": "string" + }, + "servers": { + "type": "array", + "items": { + "type": "string" + } + }, + "domains": { + "type": "array", + "items": { + "type": "string" + }, + "description": "the routing domains, without resolved's leading tilde: every name under one goes to these servers" + }, + "default_route": { + "type": "boolean", + "description": "whether names no domain routes may also go here; only the mesh's resolvers are" + } + } + }, + "Displacement": { + "type": "object", + "description": "one outside write of the resolver file, as the guard says it", + "required": [ + "id", + "at" + ], + "properties": { + "id": { + "type": "string" + }, + "at": { + "type": "string", + "description": "RFC 3339" + }, + "writer": { + "type": "string", + "description": "who the file's own header names, or empty" + }, + "taken_by": { + "type": "string", + "description": "the module that took it" + }, + "taken_at": { + "type": "string", + "description": "when it was taken, RFC 3339" + }, + "ended": { + "type": "string", + "description": "when the module'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" + } + } + } + } } diff --git a/go/seatlist/seatlisttest/seats/node-uplink.json b/go/seatlist/seatlisttest/seats/node-uplink.json index cd59ee5c..a6089fc6 100644 --- a/go/seatlist/seatlisttest/seats/node-uplink.json +++ b/go/seatlist/seatlisttest/seats/node-uplink.json @@ -2,9 +2,9 @@ "format": 1, "seat": "node-uplink", "scope": "node", - "grain": "seat-list", + "grain": "whole", "domain": "Connectivity", - "decision": "novox/hq ADR 0117", + "decision": "novox/hq ADR 0117, ADR 0687, ADR 0689, ADR 0613", "verbs": [ { "name": "resolvers", @@ -13,6 +13,80 @@ "input": { "properties": {}, "type": "object" + }, + "answer": { + "type": "object", + "required": [ + "path", + "nameservers", + "written_by_the_mesh", + "changed" + ], + "properties": { + "path": { + "type": "string", + "description": "the resolver file's path" + }, + "link": { + "type": "string", + "description": "the file it points to, when it is a symbolic link" + }, + "nameservers": { + "type": "array", + "items": { + "type": "string" + }, + "description": "the resolvers it lists" + }, + "search": { + "type": "array", + "items": { + "type": "string" + }, + "description": "the search domains it lists" + }, + "options": { + "type": "array", + "items": { + "type": "string" + }, + "description": "the options line's words" + }, + "header": { + "type": "array", + "items": { + "type": "string" + }, + "description": "the file's leading comment lines, the first four" + }, + "written_by_the_mesh": { + "type": "boolean", + "description": "the file is the one the mesh declares, by its header" + }, + "changed": { + "type": "string", + "description": "when the file was last changed, RFC 3339" + }, + "owner": { + "type": "string", + "description": "the account that owns the file" + }, + "writer": { + "type": "string", + "description": "who wrote it when the mesh did not, as far as the machine shows" + }, + "why": { + "type": "string", + "description": "why that name is given, for writer" + }, + "beside": { + "type": "array", + "items": { + "$ref": "#/defs/BesideFile" + }, + "description": "every file next to it whose name starts with its own: a backup a writer kept" + } + } } }, { @@ -22,13 +96,208 @@ "input": { "properties": {}, "type": "object" + }, + "answer": { + "type": "object", + "required": [ + "links" + ], + "properties": { + "links": { + "type": "array", + "items": { + "$ref": "#/defs/Link" + }, + "description": "every link from the kernel, with its default route and what the network manager knows of its names, the link carrying the default route first" + }, + "dns_not_read": { + "type": "string", + "description": "the network manager's names could not be read, and why" + } + } } } ], + "events": [ + { + "name": "sign-in-asked", + "subject": "sign-in-asked.", + "body": { + "$ref": "#/defs/SignInAsked" + } + }, + { + "name": "sign-in-ended", + "subject": "sign-in-ended.", + "body": { + "$ref": "#/defs/SignInEnded" + } + } + ], + "family": { + "name": "node-uplink.events", + "max-age-days": 7 + }, "paths": [ { "path": "/etc/resolv.conf", "steps-back-for": "node-resolver" } - ] + ], + "defs": { + "BesideFile": { + "type": "object", + "description": "one file beside the resolver file, a backup a writer kept", + "required": [ + "path", + "changed" + ], + "properties": { + "path": { + "type": "string" + }, + "changed": { + "type": "string", + "description": "RFC 3339" + }, + "mesh": { + "type": "boolean", + "description": "it begins as the mesh's own file does: the file a writer moved aside" + } + } + }, + "LinkDNS": { + "type": "object", + "description": "the resolvers and search domains the network manager knows for one link", + "properties": { + "servers": { + "type": "array", + "items": { + "type": "string" + } + }, + "domains": { + "type": "array", + "items": { + "type": "string" + } + }, + "manager": { + "type": "string", + "description": "the program that said so" + }, + "state": { + "type": "string", + "description": "its word for the link" + } + } + }, + "Link": { + "type": "object", + "description": "one network link on the machine", + "required": [ + "name", + "state" + ], + "properties": { + "name": { + "type": "string" + }, + "state": { + "type": "string" + }, + "kind": { + "type": "string" + }, + "addresses": { + "type": "array", + "items": { + "type": "string" + } + }, + "default_route": { + "type": "boolean", + "description": "the default route leaves through it" + }, + "metric": { + "type": "integer", + "description": "that route's metric" + }, + "dns": { + "$ref": "#/defs/LinkDNS" + } + } + }, + "SignInAsked": { + "type": "object", + "description": "the network asks for a sign-in: the page opened for it", + "required": [ + "node", + "link", + "network", + "address", + "at" + ], + "properties": { + "node": { + "type": "string", + "description": "the node's name" + }, + "link": { + "type": "string", + "description": "the interface name of the link the default route leaves through" + }, + "network": { + "type": "string", + "description": "the network's name as the network manager knows it, its connection's name" + }, + "address": { + "type": "string", + "description": "an http or https address, the one opened" + }, + "at": { + "type": "string", + "description": "the time of the change it says, never of its publish, RFC 3339 in UTC to the second" + } + } + }, + "SignInEnded": { + "type": "object", + "description": "the sign-in ended: signed in, the network left, or no longer asked", + "required": [ + "node", + "link", + "network", + "at", + "why" + ], + "properties": { + "node": { + "type": "string", + "description": "the node's name" + }, + "link": { + "type": "string", + "description": "the interface name of the link; empty only for a no-longer-asked said with no connection active" + }, + "network": { + "type": "string", + "description": "the network's name as the network manager knows it; empty only for a no-longer-asked said with no connection active" + }, + "at": { + "type": "string", + "description": "the time of the change it says, never of its publish, RFC 3339 in UTC to the second" + }, + "why": { + "type": "string", + "enum": [ + "signed-in", + "left", + "no-longer-asked" + ], + "description": "why the sign-in ended" + } + } + } + } } -- 2.54.0 From 7c3e439e32e6079cce2f126bd437470ba4c62dff Mon Sep 17 00:00:00 2001 From: jochen Date: Tue, 24 Nov 2026 21:48:49 +0100 Subject: [PATCH 2/3] Copy node-uplink and node-display-session byte for byte from their contracts modules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Code review round 1 found the test copies were not copies: a reconstruction from the holders' code drifted in a few fields and added ADR 0613 to the decision, which the real definitions do not carry. node-uplink.json is copied byte for byte from mesh-networking modules/mesh-connectivity-contracts/seats/node-uplink/seat.json (8d993ea), and node-display-session.json from mesh-contracts seats/node-display-session/seat.json (3260a68a). graphical_session_test.go's decision text now matches the real definition ("novox/hq ADR 0208, ADR 0687"). node-resolver.json and node_resolver_test.go wait for mesh-networking's fix for outside_writes. Builds: design 08 sign-in-page §1, §3; lead answer C-3 --- go/catalogue/graphical_session_test.go | 4 +- .../seats/node-display-session.json | 360 +++++++++--------- .../seatlisttest/seats/node-uplink.json | 122 +++--- 3 files changed, 254 insertions(+), 232 deletions(-) diff --git a/go/catalogue/graphical_session_test.go b/go/catalogue/graphical_session_test.go index 2bf0413a..007e2174 100644 --- a/go/catalogue/graphical_session_test.go +++ b/go/catalogue/graphical_session_test.go @@ -10,7 +10,7 @@ import ( // §2: the eleven roles are the mesh's own node seats, each with the verbs it starts with. Defends design 08 // sign-in-page §3 (novox/hq ADR 0687 §4): the display session gains the required verb `open`, and its decision -// gains ADR 0687 and ADR 0613. +// gains ADR 0687. func TestTheGraphicalSessionsSeatsAreTheMeshsOwnWithTheirVerbs(t *testing.T) { want := map[string][]string{ LoginManagerSeat: {"sessions"}, @@ -25,7 +25,7 @@ func TestTheGraphicalSessionsSeatsAreTheMeshsOwnWithTheirVerbs(t *testing.T) { CompositorSeat: nil, SecretServiceSeat: nil, } - decisions := map[string]string{DisplaySessionSeat: "novox/hq ADR 0208, ADR 0687, ADR 0613"} + decisions := map[string]string{DisplaySessionSeat: "novox/hq ADR 0208, ADR 0687"} for name, verbs := range want { s, ok := SeatNamed(name) if !ok { diff --git a/go/seatlist/seatlisttest/seats/node-display-session.json b/go/seatlist/seatlisttest/seats/node-display-session.json index 9391afa1..beda7f47 100644 --- a/go/seatlist/seatlisttest/seats/node-display-session.json +++ b/go/seatlist/seatlisttest/seats/node-display-session.json @@ -4,7 +4,7 @@ "scope": "node", "grain": "whole", "domain": "Core", - "decision": "novox/hq ADR 0208, ADR 0687, ADR 0613", + "decision": "novox/hq ADR 0208, ADR 0687", "verbs": [ { "name": "reload", @@ -12,42 +12,74 @@ "input": { "properties": { "force": { - "type": "boolean", - "description": "reload even when the check finds errors" + "description": "reload even if the configuration on disk has errors (optional)", + "type": "boolean" } }, "type": "object" }, "answer": { - "type": "object", + "properties": { + "reloaded": { + "description": "whether the reload ran", + "type": "boolean" + }, + "i3": { + "description": "the outcome of each command the reload ran, given only once it ran (optional)", + "type": "array", + "items": { + "type": "object", + "properties": { + "success": { + "type": "boolean" + }, + "error": { + "description": "why it failed (optional)", + "type": "string" + } + }, + "required": [ + "success" + ] + } + }, + "errors": { + "description": "the configuration's errors on disk, found by the check that ran first", + "type": "array", + "items": { + "type": "object", + "properties": { + "file": { + "description": "the file holding the error (optional)", + "type": "string" + }, + "line": { + "description": "the line holding the error (optional)", + "type": "number" + }, + "text": { + "type": "string" + } + }, + "required": [ + "text" + ] + } + }, + "watcher": { + "description": "the configuration watcher's status, given only once the reload ran (optional)", + "type": "object" + }, + "why": { + "description": "why it did not reload, given only when it did not (optional)", + "type": "string" + } + }, "required": [ "reloaded", "errors" ], - "properties": { - "reloaded": { - "type": "boolean" - }, - "errors": { - "type": "array", - "items": { - "$ref": "#/defs/ConfigError" - }, - "description": "the configuration's problems, found whether or not it reloaded" - }, - "why": { - "type": "string", - "description": "why it did not reload, when it did not" - }, - "i3": { - "type": "array", - "description": "i3's own outcome of each command it ran to reload; a sway holder could not give this" - }, - "watcher": { - "type": "object", - "description": "i3's own watcher status; a sway holder could not give this" - } - } + "type": "object" } }, { @@ -58,18 +90,46 @@ "type": "object" }, "answer": { - "type": "object", - "required": [ - "workspaces" - ], "properties": { "workspaces": { "type": "array", "items": { - "$ref": "#/defs/Workspace" + "type": "object", + "properties": { + "num": { + "type": "number" + }, + "name": { + "type": "string" + }, + "output": { + "type": "string" + }, + "visible": { + "type": "boolean" + }, + "focused": { + "type": "boolean" + }, + "urgent": { + "type": "boolean" + } + }, + "required": [ + "num", + "name", + "output", + "visible", + "focused", + "urgent" + ] } } - } + }, + "required": [ + "workspaces" + ], + "type": "object" } }, { @@ -85,66 +145,128 @@ "type": "object" }, "answer": { - "type": "object", - "required": [ - "windows" - ], "properties": { "windows": { "type": "array", "items": { - "$ref": "#/defs/Window" + "type": "object", + "properties": { + "con_id": { + "type": "number" + }, + "window": { + "type": "string" + }, + "class": { + "description": "optional", + "type": "string" + }, + "instance": { + "description": "optional", + "type": "string" + }, + "role": { + "description": "optional", + "type": "string" + }, + "title": { + "type": "string" + }, + "workspace": { + "type": "string" + }, + "output": { + "type": "string" + }, + "focused": { + "description": "optional", + "type": "boolean" + }, + "urgent": { + "description": "optional", + "type": "boolean" + }, + "floating": { + "description": "optional", + "type": "boolean" + }, + "fullscreen": { + "description": "optional", + "type": "boolean" + }, + "scratchpad": { + "description": "optional", + "type": "boolean" + }, + "marks": { + "description": "optional", + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "con_id", + "window", + "title", + "workspace", + "output" + ] } } - } + }, + "required": [ + "windows" + ], + "type": "object" } }, { "name": "open", - "description": "Open the address in the person's default browser. Refused, naming the reason: a scheme other than http or https (named), no scheme (a file path), no host, an address over 2048 bytes once encoded, no graphical session running, no default program for the scheme, the opener ending with a failure (its status named). The encoding: RFC 3986's unreserved characters and : / ? # [ ] @ & = + % are kept as they are; every other character is percent-encoded, as the bytes of its UTF-8 form. Nothing is refused for a character, and no shell reads the address. Its callers are the modules whose manifest invokes it and the operator, through the mesh MCP server; the sign-in reaction is not one.", - "class": "act", + "description": "Open an http or https address in the person's default browser, for any caller over the bus (ADR 0687 §4, ADR 0689 §3): any holder of the display session (i3 or sway) serves it the same way. A holder percent-encodes every character outside RFC 3986's unreserved set (letters, digits, -, ., _, ~) and the separators a URL needs (: / ? # [ ] @ & = + %) as the bytes of its UTF-8 form, and passes the address as one argument: nothing is refused for a character, and no shell reads it. Refused, naming the reason: a scheme other than http or https (named), no scheme (a file path), no host, an address over 2048 bytes once encoded, no graphical session running, no default program for the scheme, or the opener ending with a failure (its status named).", "input": { - "type": "object", + "properties": { + "address": { + "description": "the http or https address to open", + "type": "string" + } + }, "required": [ "address" ], - "properties": { - "address": { - "type": "string", - "maxLength": 2048, - "description": "the address to open, http or https" - } - } + "type": "object" }, "answer": { - "type": "object", - "required": [ - "address", - "started" - ], "properties": { "address": { - "type": "string", - "description": "the address as handed on, encoded" + "description": "the address as handed on, encoded", + "type": "string" }, "program": { - "type": "string", - "description": "the desktop entry that opened it (as browser.desktop); given only once the opener started" + "description": "the desktop entry that opened it, as browser.desktop; given only once the opener started (optional)", + "type": "string" }, "command": { - "type": "string", - "description": "the first word of that entry's command; given only once the opener started" + "description": "the first word of that entry's command; given only once the opener started (optional)", + "type": "string" }, "started": { + "description": "opened when the opener ended well within its bound, opening when it still ran at its bound", "type": "string", "enum": [ "opened", "opening" - ], - "description": "opened when the opener ended well within its bound, opening when it still ran at its bound" + ] } - } - } + }, + "required": [ + "address", + "started" + ], + "type": "object" + }, + "class": "act" } ], "receives": [ @@ -152,111 +274,5 @@ "kind": "config", "comment": "#" } - ], - "defs": { - "ConfigError": { - "type": "object", - "description": "one problem the configuration check reports", - "required": [ - "text" - ], - "properties": { - "file": { - "type": "string" - }, - "line": { - "type": "integer" - }, - "text": { - "type": "string" - } - } - }, - "Workspace": { - "type": "object", - "required": [ - "num", - "name", - "output", - "visible", - "focused" - ], - "properties": { - "num": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "output": { - "type": "string" - }, - "visible": { - "type": "boolean" - }, - "focused": { - "type": "boolean" - }, - "urgent": { - "type": "boolean" - } - } - }, - "Window": { - "type": "object", - "required": [ - "window", - "title", - "workspace", - "output" - ], - "properties": { - "con_id": { - "type": "integer" - }, - "window": { - "type": "string" - }, - "class": { - "type": "string" - }, - "instance": { - "type": "string" - }, - "role": { - "type": "string" - }, - "title": { - "type": "string" - }, - "workspace": { - "type": "string" - }, - "output": { - "type": "string" - }, - "focused": { - "type": "boolean" - }, - "urgent": { - "type": "boolean" - }, - "floating": { - "type": "boolean" - }, - "fullscreen": { - "type": "boolean" - }, - "scratchpad": { - "type": "boolean" - }, - "marks": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - } + ] } diff --git a/go/seatlist/seatlisttest/seats/node-uplink.json b/go/seatlist/seatlisttest/seats/node-uplink.json index a6089fc6..e320999d 100644 --- a/go/seatlist/seatlisttest/seats/node-uplink.json +++ b/go/seatlist/seatlisttest/seats/node-uplink.json @@ -4,7 +4,8 @@ "scope": "node", "grain": "whole", "domain": "Connectivity", - "decision": "novox/hq ADR 0117, ADR 0687, ADR 0689, ADR 0613", + "decision": "novox/hq ADR 0117, ADR 0687, ADR 0689", + "description": "The node seat of the machine's uplink (ADR 0117), as ADR 0687 §1 and ADR 0689 change it: the resolver file as it is now and every network link, read by resolvers and links; and the mesh's record of a network's sign-in page, the events sign-in-asked and sign-in-ended, published by the holder on its own machine without the bus and kept in the family node-uplink.events, 7 days. Both events are optional for a holder, and nothing in the mesh consumes them.", "verbs": [ { "name": "resolvers", @@ -29,43 +30,41 @@ }, "link": { "type": "string", - "description": "the file it points to, when it is a symbolic link" + "description": "where the file is a link, its target" }, "nameservers": { "type": "array", "items": { "type": "string" - }, - "description": "the resolvers it lists" + } }, "search": { "type": "array", "items": { "type": "string" }, - "description": "the search domains it lists" + "description": "the file's search domains" }, "options": { "type": "array", "items": { "type": "string" - }, - "description": "the options line's words" + } }, "header": { "type": "array", "items": { "type": "string" }, - "description": "the file's leading comment lines, the first four" + "description": "the file's leading comment lines, up to four" }, "written_by_the_mesh": { "type": "boolean", - "description": "the file is the one the mesh declares, by its header" + "description": "the file is the one the uplink holder declares, by its header" }, "changed": { "type": "string", - "description": "when the file was last changed, RFC 3339" + "description": "when the file last changed, RFC 3339" }, "owner": { "type": "string", @@ -77,7 +76,7 @@ }, "why": { "type": "string", - "description": "why that name is given, for writer" + "description": "why writer is named so" }, "beside": { "type": "array", @@ -107,12 +106,11 @@ "type": "array", "items": { "$ref": "#/defs/Link" - }, - "description": "every link from the kernel, with its default route and what the network manager knows of its names, the link carrying the default route first" + } }, "dns_not_read": { "type": "string", - "description": "the network manager's names could not be read, and why" + "description": "the network manager could not be asked for links' names, said rather than read as no resolvers" } } } @@ -147,7 +145,7 @@ "defs": { "BesideFile": { "type": "object", - "description": "one file beside the resolver file, a backup a writer kept", + "description": "one file beside the resolver file", "required": [ "path", "changed" @@ -166,9 +164,56 @@ } } }, + "Link": { + "type": "object", + "description": "one network link, as the links verb says it", + "required": [ + "name", + "state" + ], + "properties": { + "name": { + "type": "string" + }, + "state": { + "type": "string" + }, + "kind": { + "type": "string" + }, + "addresses": { + "type": "array", + "items": { + "type": "string" + } + }, + "mac": { + "type": "string", + "description": "the link-layer address as ip says it; left out where the link has none" + }, + "master": { + "type": "string", + "description": "the bridge or bond the link is enslaved to" + }, + "parent": { + "description": "the link it rides on: its name where that link is in this machine's namespace, else its index and namespace id; left out where none" + }, + "default_route": { + "type": "boolean", + "description": "the default route leaves through it" + }, + "metric": { + "type": "integer", + "description": "that route's metric" + }, + "dns": { + "$ref": "#/defs/LinkDNS" + } + } + }, "LinkDNS": { "type": "object", - "description": "the resolvers and search domains the network manager knows for one link", + "description": "what the network manager knows of one link's names", "properties": { "servers": { "type": "array", @@ -192,45 +237,8 @@ } } }, - "Link": { - "type": "object", - "description": "one network link on the machine", - "required": [ - "name", - "state" - ], - "properties": { - "name": { - "type": "string" - }, - "state": { - "type": "string" - }, - "kind": { - "type": "string" - }, - "addresses": { - "type": "array", - "items": { - "type": "string" - } - }, - "default_route": { - "type": "boolean", - "description": "the default route leaves through it" - }, - "metric": { - "type": "integer", - "description": "that route's metric" - }, - "dns": { - "$ref": "#/defs/LinkDNS" - } - } - }, "SignInAsked": { "type": "object", - "description": "the network asks for a sign-in: the page opened for it", "required": [ "node", "link", @@ -263,7 +271,6 @@ }, "SignInEnded": { "type": "object", - "description": "the sign-in ended: signed in, the network left, or no longer asked", "required": [ "node", "link", @@ -278,11 +285,11 @@ }, "link": { "type": "string", - "description": "the interface name of the link; empty only for a no-longer-asked said with no connection active" + "description": "empty only for a no-longer-asked said with no connection active" }, "network": { "type": "string", - "description": "the network's name as the network manager knows it; empty only for a no-longer-asked said with no connection active" + "description": "empty only for a no-longer-asked said with no connection active" }, "at": { "type": "string", @@ -294,8 +301,7 @@ "signed-in", "left", "no-longer-asked" - ], - "description": "why the sign-in ended" + ] } } } -- 2.54.0 From 40ac10790093e3b63433b745b0cc2349716b257a Mon Sep 17 00:00:00 2001 From: jochen Date: Tue, 24 Nov 2026 21:50:43 +0100 Subject: [PATCH 3/3] 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" } } } -- 2.54.0