From 7c3e439e32e6079cce2f126bd437470ba4c62dff Mon Sep 17 00:00:00 2001 From: jochen Date: Tue, 24 Nov 2026 21:48:49 +0100 Subject: [PATCH] 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" + ] } } }