From df22a1382cc4d39c9806cea4500838de60c83b4b Mon Sep 17 00:00:00 2001 From: jochen Date: Tue, 24 Nov 2026 21:48:33 +0100 Subject: [PATCH] Design 08 sign-in-page: the first code review's answers in the design lines The review found a grant the runtime would still refuse, a tool check standing alone, names judged in place from a record rather than from resolved, and an opener killed at its bound; the lines now say what the code must do for each. --- .../sign-in-page-lead-answers.md | 14 +++++ .../01-to-be/08-milestones/sign-in-page.md | 55 +++++++++++++------ 2 files changed, 51 insertions(+), 18 deletions(-) diff --git a/03-DESIGN/01-to-be/08-milestones/sign-in-page-lead-answers.md b/03-DESIGN/01-to-be/08-milestones/sign-in-page-lead-answers.md index 3bd57bb8..11b17ce1 100644 --- a/03-DESIGN/01-to-be/08-milestones/sign-in-page-lead-answers.md +++ b/03-DESIGN/01-to-be/08-milestones/sign-in-page-lead-answers.md @@ -111,3 +111,17 @@ PREPARE CHECK. The node-engine says no running for a module restarted in place a L-1. The resource `sign-in-state` (§12's folder) carries `unknown` `module` (ADR 0422 §3: the module's own process reacts, as its README says and its tests show). The watcher leaves a path it does not know (anything but `watch.sock`, `check-address`, `pending/` and its files, `names.json`, `sequence`) as it is and writes it to the journal once per path; the README (§24) says so and one unit test (§25) shows it. Not `move-out` (ADR 0422 §4 would move the module's own files at every look), not `program` (§2: no other program writes there). L-2. The fact `private-interface` renders the literal `mesh0`. Quick, not thorough: the private network's interface on the laptop is `mesh0`, and netcheck and networkmanager's configuration already name it literally; one value every module reads is the thorough fix, outside this milestone (a finding the lead carries; the laptop's assignment names the tunnel `wg0`, which contradicts what runs). + +## Code review round 1 + +Lead answers to code review round 1 of the milestone sign-in-page (fix-1981@g14, 2026-11-24). Each names what settles it. + +C-1 (grants: membership). The tool runner's membership lists the held seat's own-node machine event too (onMachine), so its runtime's mayPublish lets it publish; tests on node-uplink's sign-in-asked. subject itself, and the whole test publishes through the runtime's check, not straight to the stream. Principle: evidence over assertion; §4a. +C-2 (validator: a tool check alone). networkmanager's service resource (NetworkManager's unit) carries health of kind unit, so the watcher's tool check stands beside a check of another kind (ADR 0227 rule 8, ADR 0240 rule 2), as zfs's process watch stands beside its units' unit checks (read in mesh-catalog main, modules/zfs). §27 changes from "the service resource as it is today" to that. +C-3 (mesh-sdk test copies). Copy the three definitions byte for byte from mesh-networking and mesh-contracts at their heads, and fix the two tests' decision text to match. Principle: a copy is a copy. +C-4 (guard: names in place). The guard judges "in place" from the domains resolved holds on the link now (rawDomainsOf), not from its applied record alone, and sets them again when they are missing; a test where the network manager rewrites the link's domains and one where resolved restarts. §7. +C-5 (i3: the opener's bound). cmd/i3-tools runs the opener with its own run that stops waiting at 10 s without killing the opener (DMC-8); a test with an opener that outlives the bound and keeps running. +C-6 (generated packages). systemd-resolved and i3 import noderesolver and nodedisplaysession at the zero version and answer with their types; uplink-names' names is an array as the definition says. DQ-12. +C-7 (/var/lib/node-resolver unknown). It stays: mesh-catalog's checks/owned refuses a directory without unknown (ADR 0422 §8). Its value is "module", as L-1: the guard leaves a path it does not know as it is and writes it to the journal once; README line and a unit test. Not "program" (no other program writes there, ADR 0422 §2). +C-8 (bounds). The watcher socket's 5 s and the names file write's 15 s are stated constants in the design lines, as R2-7 holds for 60 s, 10 s and 256. Principle: a bound is stated; a setting only where machines differ. +NOTES taken: (a) node-resolver's real definition adds outside_writes to routes' answer, which systemd-resolved answers today (U-M3: every existing field carries over); (b) a refused open writes a hand-act too (DQ-7: each call); (c) fallback.json's since is the time of the guard's first round, never zero; (d) the watcher redials the system bus only on the socket's file event and on rating-again, never in a loop. mesh-catalog-connectivity's stale generated files on trunk stay a finding outside the milestone. diff --git a/03-DESIGN/01-to-be/08-milestones/sign-in-page.md b/03-DESIGN/01-to-be/08-milestones/sign-in-page.md index 2ce27dd8..d80b35d0 100644 --- a/03-DESIGN/01-to-be/08-milestones/sign-in-page.md +++ b/03-DESIGN/01-to-be/08-milestones/sign-in-page.md @@ -104,7 +104,8 @@ by nothing (DMC-6). `routes`'s answer gains `uplink_names` `{names, link, refused}`: `names` are the names of the applied list (§8) that resolved holds on that link now (DQ-3), never the file's, with `refused` the reason resolved last refused them, or empty (H-N6); and `mesh_resolvers` `{silent, since}`: whether the mesh's resolvers are silent now, by ADR 0688's guard, and since when (S-N5). Why 8 - names: the network manager has one check address; 8 leaves room and keeps the guard's round small. + names: the network manager has one check address; 8 leaves room and keeps the guard's round small. `routes` keeps + every field it answers today, `outside_writes` included, which systemd-resolved answers now (U-M3; note a). 3. **`node-display-session` is defined whole, with the verb `open`** (ADR 0687 §4, changing ADR 0208 §3; ADR 0613 §1, §3; ADR 0636 §5). In `mesh-contracts` the definition holds `reload`, `workspaces` and `windows` as `i3` answers them today and every field today's definition holds, its `receives` unchanged (U-M3); `reload` gains `force` as an @@ -137,9 +138,11 @@ by nothing (DMC-6). **4a. The grants part grants the tool runner its node's machine events of the seats its carried modules hold** (DMC-1). mesh-delivery's grants part composes the tool runner's account, which is per node, with the publish of the event subjects carrying its own node of every seat a module it carries holds, so a bundle's - `sign-in-asked.` is let through (and nftables' `allowances-changed` with it); no other node's subject. Its - test: a tool runner carrying a holder of `node-uplink` is granted `mesh.seat.node-uplink.event.*.` and - no other node's. + `sign-in-asked.` is let through (and nftables' `allowances-changed` with it); no other node's subject. The + tool runner's membership lists that own-node event too, so its runtime's check of what it may publish lets the + bundle publish it (C-1). Its tests: a tool runner carrying a holder of `node-uplink` is granted and lists + `mesh.seat.node-uplink.event.sign-in-asked.` and no other node's; the whole-module test of §25 publishes + through the runtime's check, never straight to the stream. ## The resolver answers the check's names (`systemd-resolved`) @@ -152,8 +155,12 @@ by nothing (DMC-6). `/var/lib/node-resolver/uplink-names`, root's, mode 0644, one name per line, empty for an empty list, whole: it runs `sudo -n install -m 0644 -o root -g root /dev/stdin /var/lib/node-resolver/uplink-names.new` with the lines on its input, then `sudo -n mv -f /var/lib/node-resolver/uplink-names.new /var/lib/node-resolver/uplink-names` (U-M5). The - `sudo` module's one rule for `${machine:account}` covers both; no module carries sudo rules of its own. The module - declares the directory `/var/lib/node-resolver` (root, 0755) as its resource. When the module leaves, the + `sudo` module's one rule for `${machine:account}` covers both; no module carries sudo rules of its own. The write + is bounded at 15 s, a stated constant (C-8); past it the verb is refused naming the bound and the file is left as + it was. The module declares the directory `/var/lib/node-resolver` (root, 0755) as its resource, with `unknown` + `module` (ADR 0422 §3, §8; C-7): the guard leaves a path there it does not know (anything but `uplink-names`, + `uplink-names.new` and `uplink-names.applied` and its file written beside) as it is and writes it to its journal + once per path; not `program`, since no other program writes there (ADR 0422 §2). When the module leaves, the node-engine keeps the directory while it holds files, as data, listed by `cleanup list`, and nothing reads it then (DMC-6); the names stay until a call with an empty list or a person's cleanup (S-N6). Why a file on the machine: the guard, as root, reads only the machine and resolved, as it does today; the file holds @@ -170,7 +177,9 @@ by nothing (DMC-6). configuration already name it so. One value every module reads is the thorough fix, outside this milestone. It sets that link's domains, through resolved, to the domains the link has plus one routing-only domain `~` per name, keeping every search domain and routing domain it has, and takes the names off the link it gave them to before, - when that differs. A round in which they are in place changes nothing. It never sets a link's servers, its default + when that differs. **In place** is judged from the domains resolved holds on the link now, never from its applied + record alone: when the network manager rewrote the link's domains, or resolved restarted, the names are set again + in that round (C-4). A round in which they are in place changes nothing. It never sets a link's servers, its default route for names (that stays ADR 0688's fallback alone), its addresses or its routes (ADR 0117 §13, §14; ADR 0247 §13): the link stays one a network manager gave servers and not one `route` routed, so ADR 0688's fallback gives it its default route back while the mesh's resolvers are silent, as before. The guard leaves the applied uplink @@ -183,7 +192,8 @@ by nothing (DMC-6). refuses the names, the guard writes the refusal into `refused` and to its journal once per change of the refusal, never every round (H-N6, R2-13). It writes a journal line when the link changes and when the names change, never every round. **Its state for `routes`** (S-N5, R2-2): at each of ADR 0688's two turns it writes - `/run/node-resolver/fallback.json`, root's, mode 0644, `{silent, since}`, which `routes` reads. The guard makes + `/run/node-resolver/fallback.json`, root's, mode 0644, `{silent, since}`, which `routes` reads; at its first round + it writes the state it finds, `since` that round's time, never zero (note c). The guard makes `/run/node-resolver` (root, 0755) when it is missing; it goes at the next boot, and the guard's first round writes the file again. 9. **Its tests** (ADR 0687, *How it is checked*, clause 2), unit, within the module's budget: the names given are @@ -193,10 +203,13 @@ by nothing (DMC-6). is still given its default route back while the mesh's resolvers are silent (ADR 0688's test of that, issue 1981's AC1, still passes), a link with no search domain of its own and only the uplink names included (DMC-2); the link chosen is the lowest-metric one that is neither routed nor the private network's, none when there is none, the - private interface read from its fact (DQ-1, DQ-2); each refusal of §2; the socket's `routes` equal to the bus's; `routes` answers `uplink_names` from resolved, with `refused`, and + private interface read from its fact (DQ-1, DQ-2); the names set again after the network manager rewrites the + link's domains and after resolved restarts (C-4); an unknown path in its folder left and journalled once (C-7); a + names file write past its 15 s bound refused with the file left as it was (C-8); each refusal of §2; the socket's `routes` equal to the bus's; `routes` answers `uplink_names` from resolved, with `refused`, and `mesh_resolvers`. -10. **Its README** says the verb, the two files, the guard's new duty, the commands of §6 and that `uplink-names` - sets only how resolved answers names over a link, never the link. +10. **Its README** says the verb, the two files, the guard's new duty, the commands of §6, that the guard leaves an + unknown path in `/var/lib/node-resolver` as it is and journals it once (C-7), and that `uplink-names` sets only + how resolved answers names over a link, never the link. ## The uplink's holder reacts on its own machine (`networkmanager`) @@ -224,7 +237,8 @@ by nothing (DMC-6). `names.json` and `sequence` as it is, and writes it to its journal once per path. Not `move-out`, which would move the module's own files at every look (ADR 0422 §4); not `program`, since no other program writes there (§2). When the module leaves, the node-engine keeps it while it holds files, as data, listed by `cleanup list`, and nothing reads it then (DMC-6). In it: - - `watch.sock` (mode 0600), the watcher's socket, made at its start: one JSON line asked, one answered. `state` + - `watch.sock` (mode 0600), the watcher's socket, made at its start: one JSON line asked, one answered, within + 5 s, a stated constant (C-8); a bundle's ask past it counts as no answer. `state` answers the watcher's state (§23's read); `rating-again` makes the watcher subscribe again, read the rating now and act on it as on a change. - `check-address`, written whole by the watcher (beside and renamed over) at its start and whenever the network @@ -263,7 +277,7 @@ by nothing (DMC-6). sends; nothing runs on a timer, and the check itself stays the network manager's. When its system bus connection drops, it writes that to its journal and subscribes again when the system bus's socket comes back (a file event of the kernel on the socket's folder), then reads the rating and acts on it as on a change; `rating-again` (§12) - does the same at once. It runs as `${machine:account}`, which on a machine with a graphical session is the + does the same at once. It redials the system bus only at those two, never in a loop (note d). It runs as `${machine:account}`, which on a machine with a graphical session is the person's (ADR 0689 §1). 15. **It opens the page and tells the person, at three moments** (ADR 0689 §1, §4). With the check on: when the rating becomes PORTAL on the active connection; at its own start when the rating already is PORTAL; and when the @@ -378,7 +392,10 @@ by nothing (DMC-6). 26. **Nothing names a network in it** (ADR 0687 §6): §33 holds for its code, configuration and tests. 27. **Its manifest** declares the process of §11, the directory of §12, the `consumes` and `invokes` of §13, the five tools of §23 under `tools` (the manifest validator refuses a tool health check whose tool is not listed; DMC-5), and - keeps its claim of `node-uplink`, its package, its configuration file and its service as today. The prepare + keeps its claim of `node-uplink`, its package and its configuration file as today. Its service resource + (`NetworkManager.service`, still with no state, ADR 0117 §4) gains `health` of kind `unit`, so the watcher's tool + check stands beside a check of another kind (ADR 0227 rule 8, ADR 0240 rule 2), as zfs's watch stands beside its + units' checks (C-2). The prepare confirms, on each machine that runs `networkmanager`, that the tool runner runs as the same account as the watcher, `${machine:account}`, since the folder of §12 is that account's alone (mode 0700), and writes it in the milestone file (R3-6). @@ -391,7 +408,8 @@ by nothing (DMC-6). three verbs, as the tool `node-display-session.open`. It checks the address by §3's refusals and percent-encodes it by §3's encoding; it finds the session's bus and runtime directory with its `desktop` package, used only to find the session; its opener runs in `cmd/i3-tools`, not in the shared `desktop` package, whose `Exec` kills a - command at its deadline, so its 10 s bound is its own (DMC-8). It asks `xdg-mime query + command at its deadline: its own run stops waiting at 10 s without stopping the opener, which goes on (DMC-8, + C-5). It asks `xdg-mime query default x-scheme-handler/` for the program, refusing when there is none, and runs `systemd-run --user --collect --quiet --wait -- xdg-open
` with the address as one argument, never a command line: not through i3's IPC `exec`, which hands a shell a line. The run's outcome is decided as §18 decides it (10 s), and the @@ -399,8 +417,8 @@ by nothing (DMC-6). directories. With no graphical session it refuses, as its other tools answer. Its manifest declares the package `xdg-utils` present (ADR 0303 §2). It writes one journal line per call, the address, opened or refused, and the program or the reason (R2-14). **`open` is an act**: each call is written to the log of acts done by hand through - `seat:mesh-hand-acts.hand-act`, with its caller and why, as issue 935 asks and as nftables writes its acts; its - manifest `invokes` it (DQ-7). + `seat:mesh-hand-acts.hand-act`, with its caller and why, as issue 935 asks and as nftables writes its acts, a + refused call too, with its reason (note b); its manifest `invokes` it (DQ-7). 30. **`i3` hears nothing of the uplink** (ADR 0689 §3, replacing ADR 0687 §5). It consumes no `node-uplink` event and reads no kept event at its session's start, so ADR 0443 §3 holds untouched. Checked by the milestone's code review: no consumer of `node-uplink`'s events and no read of kept events in `i3`. @@ -409,7 +427,8 @@ by nothing (DMC-6). https, a file path and each other refusal of §3; an address holding `'`, `;`, a space, `$(`, `,` and `"` is handed on percent-encoded as one argument and no shell reads it (R2-9); an opener that fails is refused with its status and names no program; one that ends well answers `opened` with the program; one still running at its bound answers - `opening`; each call writes one act to the log of acts done by hand (DQ-7). The live tests are the main file's acceptance test 3. + `opening` and keeps running after it (C-5); each call, a refused one too, writes one act to the log of acts done + by hand (DQ-7, note b). The live tests are the main file's acceptance test 3. ## Words and checks