Design 08 sign-in-page round 3: the watcher starts at boot without the bus

The tool runner starts no bundle before it reaches the bus, so behind a sign-in
page after a cold boot nothing would open the page; the watcher becomes a process
resource of networkmanager and shares the module's own folder with its bundle,
which publishes the kept events and calls uplink-names once the bus answers.
The round's other answers are written into the lines and kept beside the part,
and design 08's section 6 moves whole into a part so the main file keeps room.
This commit is contained in:
jochen
2026-11-24 20:38:58 +01:00
parent d2f8565565
commit ffb64bc77a
5 changed files with 268 additions and 175 deletions
+5 -76
View File
@@ -916,82 +916,10 @@ resolved inside the mesh (ADR 0066).
## 6 — One statement behind exposure, filtering and certificates
*2026-09-28, preparing the control-node's convergence —
[issue 140](../../04-ISSUES/140-an-endpoints-reach-is-not-declared/00-report.md), settled by
ADR 0138.*
The three sections above each decide, independently, how far a service reaches. §3 composes a name
from a label and the node's domain. §4 opens a port to the source a listen named. §5 certifies the
names that exist, from whichever authority the proxy holds. Each is coherent on its own, and together
they mean **reachability is never stated anywhere** — it is the sum of three derivations, and a sum is
not something anyone can review or refuse.
What that costs, measured: an identity provider holding a public certificate valid 90 days and an
internal one valid 24 hours, neither asked for by any assignment, because both names existed and a
proxy certifies what it serves. And an endpoint that is not routed — git over ssh — which can be
spoken about only in the filter's vocabulary, so *this must be reachable from outside* is a setting
exactly one mechanism reads.
**An endpoint is the thing that was missing.** A module declares named endpoints: one port it serves,
what it is for, and what it would serve that to absent any instruction. A route contribution names an
endpoint rather than repeating a port number. An assignment — which is where a module's configuration
lives (ADR 0046)
— then binds each endpoint to a machine port and says how far it reaches.
One value, three readers:
| reach | the filter opens | the proxy serves | the certificate comes from |
|---|---|---|---|
| `internal` | the machine port, to the private network | the internal name | the mesh's own authority |
| `public` | the machine port, to anywhere | the public name | the public authority |
| `both` | the machine port, to anywhere | both names | each name's own authority |
| `local-network` | the machine port, to the private network and the machine's local networks | the internal name | the mesh's own authority |
*2026-10-13.* **A port may be reached from the machine's own local network, and only its private
part** (ADR 0340). A home server serves devices on its own network that will never be nodes, and until
now the only value that reached them was `anywhere`, which says the internet. A new source,
`local-network`, and the reach of the same name mean the networks the machine is attached to through
its uplink, as the node-engine reports them among its facts. Only networks wholly in a private range
count (RFC 1918, and unique local addresses for IPv6); a public subnet the machine sits on is never
counted, so the source cannot open a port to the internet. The filter renders it on that port's rule
alone, as the subnets it resolved to. A machine that reports no private network has a `local-network`
port admitted from no local network, and the rule set and the plan say so. The plan shows what each
such port resolved to, and `node` shows which attached networks counted and why the others did not.
A laptop that travels admits whichever local network it is on, which the plan makes visible.
*2026-10-02.* **The proxy serves an internal name to the private network only**
(ADR 0138,
its insight of this date). It answers public and internal names on the same listeners, so the name a
request carries is the request's own claim, not where the request came from. An internal name is
served to the machines of the mesh and to the machine itself; to anyone else it is answered as a name
never routed, in the handshake as well as the request. Without this, an endpoint with reach `internal`
would be public under a name that is easy to guess
([issue 191](../../04-ISSUES/191-a-route-with-only-an-internal-name-is-dropped/00-report.md)).
The proxy is told who the mesh is, and its routes, in its membership on the bus — the same machine
addresses the filter's "from the mesh" is rendered from
(ADR 0167).
**An endpoint that is not routed is reached and never named.** No route contribution means no name is
composed and no certificate requested, while the filter still acts on it. That is the case the model
could not express at all, and it is the ordinary case for anything that is not HTTP.
**Nothing moves until an assignment says so.** An endpoint whose assignment is silent keeps the
default its manifest states, so every machine already converged renders exactly as it does today —
the same property §4 needed when a machine gained a way to say which networks it routes.
This is what the certificate questions were waiting for. Which authority signs a name, whether a name
may appear in a public issuance log, and what must be trusted where are all answerable once an
endpoint says whether it is internal — and unanswerable while the proxy decides by composing every
name it can. It is also the fact
[issue 139](../../04-ISSUES/139-an-internal-route-name-resolves-to-the-consumers-node/00-report.md)
needs: an internal name should be composed from the machine serving the endpoint, which is the
assignment that bound it.
**How it is checked** is stated with the decision: one module with two endpoints of differing reach
asserted per chain body; the names and the certificate requests following the reach and failing
against today's behaviour, where both are always composed; an unrouted endpoint filtered and never
named; an assignment naming an endpoint the module does not declare refused where it is said; and a
silent assignment rendering byte-identically to today.
*2026-09-28, ADR 0138; extended by ADR 0340 and ADR 0167.* An endpoint a module declares, bound by its assignment to a
machine port with one reach (`internal`, `public`, `both` or `local-network`), is what the filter, the proxy and the
certificates all read. Its lines, moved whole, are in the part
[08-milestones/one-statement-of-reach.md](08-milestones/one-statement-of-reach.md).
## 7 — A network's sign-in page
@@ -1166,6 +1094,7 @@ The list is worth having in one place, because it is most of the argument:
| milestone | what it builds | part | state |
|---|---|---|---|
| one-statement-of-reach | one endpoint's reach read by the filter, the proxy and the certificates (ADR 0138, ADR 0340, ADR 0167) | [08-milestones/one-statement-of-reach.md](08-milestones/one-statement-of-reach.md) | written before milestone parts, moved whole on 2026-11-24 |
| hub-adopts-the-predecessors-tunnel | the hub takes over the tunnel it finds on an adopted node (ADR 0105, ADR 0119) | [08-milestones/hub-adopts-the-predecessors-tunnel.md](08-milestones/hub-adopts-the-predecessors-tunnel.md) | written before milestone parts, moved whole on 2026-11-24 |
| sign-in-page | a network's sign-in page opens by itself (ADR 0687, ADR 0689), closing issues 960 and 935 | [08-milestones/sign-in-page.md](08-milestones/sign-in-page.md) | designed |
@@ -0,0 +1,87 @@
---
layer: to-be
design: 08
milestone: one-statement-of-reach
updated: 2026-11-24
code: [mesh-controller, mesh-host, mesh-catalog modules/route-proxy]
decisions:
- "ADR 0138"
- "ADR 0340"
- "ADR 0167"
- "ADR 0046"
---
# Design 08, milestone one-statement-of-reach — one statement behind exposure, filtering and certificates
**What this part is.** Design 08's §6, which ADR 0138 settled (issue 140) and ADR 0340 and ADR 0167 extended, written
before designs were cut into milestone parts and moved here whole on 2026-11-24, so the main file keeps room within
its bound (playbook 02, *The shape of a design*). Its words are unchanged; each paragraph is one numbered line, a bold
lead added where it had none. Cited as "design 08 one-statement-of-reach §n". *2026-09-28, preparing the control-node's convergence —
[issue 140](../../../04-ISSUES/140-an-endpoints-reach-is-not-declared/00-report.md), settled by
ADR 0138.*
## Lines
1. **Reachability was stated nowhere.** The three sections above each decide, independently, how far a service reaches. §3 composes a name
from a label and the node's domain. §4 opens a port to the source a listen named. §5 certifies the
names that exist, from whichever authority the proxy holds. Each is coherent on its own, and together
they mean **reachability is never stated anywhere** — it is the sum of three derivations, and a sum is
not something anyone can review or refuse.
2. **What that cost.** What that costs, measured: an identity provider holding a public certificate valid 90 days and an
internal one valid 24 hours, neither asked for by any assignment, because both names existed and a
proxy certifies what it serves. And an endpoint that is not routed — git over ssh — which can be
spoken about only in the filter's vocabulary, so *this must be reachable from outside* is a setting
exactly one mechanism reads.
3. **An endpoint is the thing that was missing.** A module declares named endpoints: one port it serves,
what it is for, and what it would serve that to absent any instruction. A route contribution names an
endpoint rather than repeating a port number. An assignment — which is where a module's configuration
lives (ADR 0046)
— then binds each endpoint to a machine port and says how far it reaches.
4. **One value, three readers.** One value, three readers:
| reach | the filter opens | the proxy serves | the certificate comes from |
|---|---|---|---|
| `internal` | the machine port, to the private network | the internal name | the mesh's own authority |
| `public` | the machine port, to anywhere | the public name | the public authority |
| `both` | the machine port, to anywhere | both names | each name's own authority |
| `local-network` | the machine port, to the private network and the machine's local networks | the internal name | the mesh's own authority |
5. *2026-10-13.* **A port may be reached from the machine's own local network, and only its private
part** (ADR 0340). A home server serves devices on its own network that will never be nodes, and until
now the only value that reached them was `anywhere`, which says the internet. A new source,
`local-network`, and the reach of the same name mean the networks the machine is attached to through
its uplink, as the node-engine reports them among its facts. Only networks wholly in a private range
count (RFC 1918, and unique local addresses for IPv6); a public subnet the machine sits on is never
counted, so the source cannot open a port to the internet. The filter renders it on that port's rule
alone, as the subnets it resolved to. A machine that reports no private network has a `local-network`
port admitted from no local network, and the rule set and the plan say so. The plan shows what each
such port resolved to, and `node` shows which attached networks counted and why the others did not.
A laptop that travels admits whichever local network it is on, which the plan makes visible.
6. *2026-10-02.* **The proxy serves an internal name to the private network only**
(ADR 0138,
its insight of this date). It answers public and internal names on the same listeners, so the name a
request carries is the request's own claim, not where the request came from. An internal name is
served to the machines of the mesh and to the machine itself; to anyone else it is answered as a name
never routed, in the handshake as well as the request. Without this, an endpoint with reach `internal`
would be public under a name that is easy to guess
([issue 191](../../../04-ISSUES/191-a-route-with-only-an-internal-name-is-dropped/00-report.md)).
The proxy is told who the mesh is, and its routes, in its membership on the bus — the same machine
addresses the filter's "from the mesh" is rendered from
(ADR 0167).
7. **An endpoint that is not routed is reached and never named.** No route contribution means no name is
composed and no certificate requested, while the filter still acts on it. That is the case the model
could not express at all, and it is the ordinary case for anything that is not HTTP.
8. **Nothing moves until an assignment says so.** An endpoint whose assignment is silent keeps the
default its manifest states, so every machine already converged renders exactly as it does today —
the same property §4 needed when a machine gained a way to say which networks it routes.
9. **What the certificate questions waited for.** This is what the certificate questions were waiting for. Which authority signs a name, whether a name
may appear in a public issuance log, and what must be trusted where are all answerable once an
endpoint says whether it is internal — and unanswerable while the proxy decides by composing every
name it can. It is also the fact
[issue 139](../../../04-ISSUES/139-an-internal-route-name-resolves-to-the-consumers-node/00-report.md)
needs: an internal name should be composed from the machine serving the endpoint, which is the
assignment that bound it.
10. **How it is checked** is stated with the decision: one module with two endpoints of differing reach
asserted per chain body; the names and the certificate requests following the reach and failing
against today's behaviour, where both are always composed; an unrouted endpoint filtered and never
named; an assignment naming an endpoint the module does not declare refused where it is said; and a
silent assignment rendering byte-identically to today.
@@ -46,3 +46,22 @@ U-M3 Each seat defined whole carries every field today's definition holds unchan
U-M5 Name the programs the guard runs to write the names file (as root, with sudo -n): the exact commands, added to the module's sudo rules.
U-N6 §2 and §3 say who calls the new verbs: modules whose manifest invokes the verb, and the operator, through the mesh MCP server (the lead wrote "console", a retired word).
U-N7 A rollback line per step: what stays when systemd-resolved, networkmanager or i3 goes back one version (the names on the link until it changes; nothing else).
## Round 2
Lead answers to round 2 of the reviews by architectural domain of design/0687-sign-in-page at d2f85655 (fix-1981@g14, 2026-11-24). Each names what settles it.
R2-1 (running-and-testing must; health-and-events must). FACT read in mesh-tools 393449e, the tool runner's `node-tools serve`: the tool runner starts no bundle before it has connected to the bus (connectPatiently retries forever; runtime.Run follows the connection), so after a cold boot behind a sign-in page uplink-tools never runs. ANSWER: networkmanager's watcher and its reaction (watching NetworkManager's rating, opening the page, the notifications, keeping the events) run as a process resource of networkmanager, a service the machine starts at boot without the bus, as the zfs module's zfs-watch process does; that process declares health of kind tool, with the tool, interval, failing looks and grace named as zfs-watch's are. The bundle uplink-tools keeps the verbs and tools: it reads the watcher's state and publishes the kept events once the runner is connected, through the module's own local state between its two parts (a file under /run or a socket of the module's own, named in the design). The watcher subscribes again when its system bus connection returns, and uplink_rating_again makes it subscribe again. Tests: the two unhealthy cases (watcher not subscribed, uplink-names call failed), the resubscribe, and a whole-module integration test that starts the watcher with no bus, sees the page open, and sees the kept events published once the bus is back. Principles: a part that must work without the bus may not need the bus to start; a module's own parts share its own state; a module says how it is healthy (ADR 0240). ADR 0689 says "uplink-tools" for the reacting part: the record-writer adds a progressive insight naming the watcher process; the decision is unchanged.
R2-2 /run/node-resolver: the guard makes it (root, 0755) and it goes at the next boot; said in §8.
R2-3 The open runs beside the watcher; rating changes heard meanwhile are handled in their order.
R2-4 08-connectivity.md: move one more section that predates the milestone out into a part now, so the main file keeps room (it grew to 79.7 KB).
R2-5 networkmanager also calls uplink-names again when its bus connection comes back (an event), with one row in the tests.
R2-6 Name the reader of the events: nats.nats_stream_messages filtered to mesh.seat.node-uplink.event.*.<node>.
R2-7 The bounds of §15 (60 s), §16 (10 s) and §19 (256 kept) stay stated constants.
R2-8 Going back: a seat's definition goes back before its holders (definitions first, then holders), in reverse of the ordering edges.
R2-9 open keeps unencoded only RFC 3986's unreserved characters and : / ? # [ ] @ & = + % ; every other character is percent-encoded; §28's test adds , and ".
R2-10 Say what the publish grant covers, as read in mesh-sdk's EmitSeat and the grants part: the holder's own node's subject only, or every node's; if every node's, say so (the events are a record only).
R2-11 A kept event keeps its message id when published again, so the bus drops a duplicate.
R2-12 The watcher's read (uplink_sign_in) also counts refused publishes, shows the last session start and its outcome, and shows the resolver's refusal of the names as routes answers it.
R2-13 The guard writes resolved's refusal to the journal once per change, not every round.
R2-14 i3's open writes one journal line per call, opened or refused, with the program.
+156 -98
View File
@@ -29,26 +29,30 @@ part of the sign-in reaction calls it (ADR 0689 §3). The purpose and the whole
[§7](../08-connectivity.md#7--a-networks-sign-in-page). This part holds every line the milestone builds, cited as
"design 08 sign-in-page §n"; the lead's answers it follows are in
[sign-in-page-lead-answers.md](sign-in-page-lead-answers.md), cited by their keys (R-M2 and the like). It closes
issue 960 (§5 to §10, on the machines where the resolver runs) and issue 935 (§3, §26).
issue 960 (§5 to §10, on the machines where the resolver runs) and issue 935 (§3, §29).
**Where.** Three repositories, one delivery group with one check: mesh-networking (the contracts module
`mesh-connectivity-contracts`: §1, §2), mesh-contracts (§3) and mesh-catalog (`systemd-resolved` §5 to §10,
`networkmanager` §11 to §24, `systemd-networkd` §25, `i3` §26 to §28, the copy of the retired words §29). **Ordering
`networkmanager` §11 to §27, `systemd-networkd` §28, `i3` §29 to §31, the copy of the retired words §32). **Ordering
edges**, which the delivery plan derives: the three seat definitions before any holder that serves or publishes what
they add, and before any module whose `invokes` names it (the manifest validator refuses a name no definition holds,
design 26); `systemd-resolved` serving `uplink-names` before `networkmanager` calls it (a served verb). **No new
grant**: the grants part already grants every holder the publish of its held seats' event subjects (mesh-sdk's
`EmitSeat`, design 47 G A-10, §276, §498), so `networkmanager`'s claim of `node-uplink` is its grant to publish §1's
events, and nothing in mesh-delivery's grants part changes (R-M3).
events, and nothing in mesh-delivery's grants part changes (R-M3). The grant covers its own node's subjects only: an
event subject with a part `<node>` is granted to that node's account alone (the seat definition's `Subject` rule,
ADR 0363 §2; R2-10).
**What exists today, and its fate.** `node-uplink`'s definition gives the read verbs `resolvers` and `links` and no
events; `networkmanager`'s `uplink-tools` answers those two and watches nothing: both stay. `node-resolver` has
`routes`, `route` and `unroute`, served by `systemd-resolved`, whose guard keeps the resolver file and runs ADR 0688's
fallback (design 50 resolver-fallback): all stay. `node-display-session` has `reload`, `workspaces` and `windows`,
served by `i3`, whose own tool `i3_exec` runs a command line in the session: all stay, and `open` is the narrow verb
beside `i3_exec` that issue 935 asks for. **Going back one version** (U-N7): `systemd-resolved` back leaves the names
on the link until the network manager changes that link's domains, and nothing else; `networkmanager` back stops the
watch and the reaction, and calls nothing; `i3` back drops `open`; nothing else stays behind.
beside `i3_exec` that issue 935 asks for. **Going back one version** (U-N7, R2-8), in reverse of the ordering edges,
the holders first and the seat definitions after them: `systemd-resolved` back leaves the names on the link until the
network manager changes that link's domains, and nothing else; `networkmanager` back removes the watcher's process and
its state folder (§12) with the resource, publishes no more and calls nothing; `i3` back drops `open`; nothing else
stays behind.
## The seats' definitions
@@ -68,20 +72,21 @@ watch and the reaction, and calls nothing; `i3` back drops `open`; nothing else
http or https address, the one opened), `at` (the time of the change it says, never of its publish, RFC 3339 in
UTC to the second: ADR 0689 §2).
- `sign-in-ended`: `node`, `link`, `network`, `at`, and `why`, one of `signed-in`, `left`, `no-longer-asked`;
`link` and `network` are empty only for a `no-longer-asked` said with no connection active (§20).
`link` and `network` are empty only for a `no-longer-asked` said with no connection active (§21).
**Both are optional for a holder**: the definition marks neither as required and the manifest validator asks no
holder to publish them; a holder whose network manager cannot tell a sign-in page announces neither and says so in
its README (§25). **No part of the mesh consumes them** (ADR 0689 §2, §3); they are the mesh's record, read through
the stream by whoever asks, and a reader takes their time from `at`, never from arrival. The conformance fixtures
hold one value per event, with documentation names only (§30). Checked by the indexer's generator test over the
its README (§28). **No part of the mesh consumes them** (ADR 0689 §2, §3); they are the mesh's record, read with the
bus module's tool `nats.nats_stream_messages` filtered to `mesh.seat.node-uplink.event.*.<node>` (R2-6), and a
reader takes their time from `at`, never from arrival. The conformance fixtures
hold one value per event, with documentation names only (§33). Checked by the indexer's generator test over the
definition and `networkmanager`'s whole-module test matching a published event, subject and body, against a
fixture (design 26).
2. **`node-resolver` is defined whole, with the verb `uplink-names`** (ADR 0687 §2, changing ADR 0247 §10; ADR 0613
§1, §3; ADR 0636 §5). In `mesh-connectivity-contracts` the definition holds `routes`, `route` and `unroute` with
every field today's definition holds, their `replaces` unchanged (U-M3), and `uplink-names`, required of every
holder as the seat's other verbs are (ADR 0247 §15). Its callers are the modules whose manifest `invokes` it
(`networkmanager`, §11) and the operator, through the mesh MCP server (U-N6).
(`networkmanager`, §13) and the operator, through the mesh MCP server (U-N6).
- input `{names}`: a list of 0 to 8 host names, each a name of 1 to 253 bytes in letters, digits, hyphens and
dots, taken lower-cased. The list replaces what was given before; an empty list takes every name away.
- answer `{names, link, set_at}`: the names now given, the link they are answered over now (empty when no link
@@ -101,14 +106,16 @@ watch and the reaction, and calls nothing; `i3` back drops `open`; nothing else
the modules whose manifest `invokes` it and the operator, through the mesh MCP server; the sign-in reaction is not one (ADR 0689 §3;
U-N6).
- input `{address}`: the address to open.
- answer `{address, program, command, started}`: the address as handed on (§26's encoding), the desktop entry that
opened it (as `browser.desktop`), the first word of that entry's command, and `started`: `opened` when the
opener ended well within its bound, `opening` when it still ran at its bound (§26). `program` and `command` are
- answer `{address, program, command, started}`: the address as handed on (the encoding below), the desktop entry
that opened it (as `browser.desktop`), the first word of that entry's command, and `started`: `opened` when the
opener ended well within its bound, `opening` when it still ran at its bound (§29). `program` and `command` are
given only once the opener started (H-M2).
- 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). Every character outside RFC 3986's unreserved set and the
separators an address needs is percent-encoded, never refused and never read by a shell (U-M2).
opener ending with a failure (its status named).
- **the encoding** (U-M2, R2-9): RFC 3986's unreserved characters (letters, digits, `-`, `.`, `_`, `~`) 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.
4. **No layout of the three seats stays in mesh-sdk** (ADR 0613 §3, §5). A type mesh-sdk still holds for one of
these seats moves into the seat's contract in this milestone, with every importer, and mesh-sdk keeps no copy; the
prepare step names each one it finds, or that it found none.
@@ -128,7 +135,7 @@ watch and the reaction, and calls nothing; `i3` back drops `open`; nothing else
files with it, when the module leaves; the names stay until then, or until a call with an empty list (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
across a restart of resolved, of the guard and of the machine, and the caller states the names again at each of
its starts (§11).
its starts (§13).
7. **The guard gives the names to the link that carries the default route, every round** (ADR 0687 §2, changing
ADR 0247 §16). In each round of its pass over links (ADR 0688's round as built: every 5 s, or after
`answer-within` when that is longer; design 50 resolver-fallback §2; S-N6), the guard reads the names file and
@@ -144,10 +151,12 @@ watch and the reaction, and calls nothing; `i3` back drops `open`; nothing else
`/var/lib/node-resolver/uplink-names.applied`, root's, mode 0644, whole (written beside and renamed over): `{names,
link, at, refused}`, the list it applied, the link, when, and resolved's refusal or empty. At its start it reads
it, so after a restart it takes the names off the link it gave them to, never inferring which. When resolved
refuses the names, the guard writes the refusal to its journal and into `refused` (H-N6). It writes a journal line
when the link changes and when the names change, never every round. **Its state for `routes`** (S-N5): at each of
ADR 0688's two turns it writes `/run/node-resolver/fallback.json`, root's, mode 0644, `{silent, since}`, which
`routes` reads; gone at the next boot, written again at the guard's first round.
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` (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
answered over the link that carries the default route, and over the new one after that route moves to another
link, the old one losing them; the link keeps its search domains; a guard restarted with an applied file takes
@@ -160,70 +169,101 @@ watch and the reaction, and calls nothing; `i3` back drops `open`; nothing else
## The uplink's holder reacts on its own machine (`networkmanager`)
11. **`uplink-tools` gives the resolver its check's host name** (ADR 0687 §2; R-N6, H-M3, S-M1). At its start, when
the check address changes (§12's signal), and when it hears the node seat `node-engine`'s event `running` for a
module that holds `node-resolver` on its own node and is running, it calls `<node>/node-resolver.uplink-names`
directly with the check address's host name, or with an empty list when the address is empty. Its manifest
11. **`networkmanager` runs in two parts: a watcher started at boot without the bus, and its bundle** (ADR 0689 §1,
§2; R2-1). The tool runner starts no bundle before it has reached the bus, so after a cold boot behind a sign-in
page a bundle never runs; the part that must work without the bus may not need the bus to start. So:
- **the watcher** is a process resource of `networkmanager`, as the zfs module's watch is: its `name`
`networkmanager-sign-in`, `artifact` `tools`, `run` `./uplink-tools watch`, `user` `${machine:account}`,
started by the machine's service manager at boot and kept running, needing no bus; its `health` of kind `tool`,
with `tool` `uplink_health`, `interval` 60s, `timeout` 20s, `looks` 2 and `grace` 60s, as zfs-watch's. It
watches the rating (§14), opens the page and tells the person (§15 to §19), and keeps the events (§20, §21).
- **the bundle** `uplink-tools`, in the tool runner once it reaches the bus, as today: it answers `resolvers` and
`links`, serves the tools and the health tool (§23), publishes the kept events (§20) and calls `uplink-names`
(§13). It reads the watcher's state only through the module's own local state (§12).
ADR 0689 names `uplink-tools` as the reacting part; the record-writer adds a progressive insight naming the
watcher process, and the decision is unchanged (R2-1).
12. **The two parts share the module's own local state, in one folder** (R2-1). `networkmanager` declares the
directory `${machine:account-home}/.local/state/mesh/networkmanager` (owner `${machine:account}`, mode 0700) as
its resource; the node-engine removes it, and all it holds, when the module leaves. In it:
- `watch.sock` (mode 0600), the watcher's socket, made at its start: one JSON line asked, one answered. `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
manager's check address changes: the address on one line, empty when there is none.
- `pending/`, the kept events: one file each, `<sequence>.json` with a ten-digit sequence, holding `{subject,
message_id, body}`, written whole by the watcher and deleted by the bundle once the bus acknowledged it (§20).
- `names.json`, written whole by the bundle: its last `uplink-names` call, `{names, result, at}`, `result` one of
`ok`, `no holder` or the failure.
Nothing else reads or writes the folder.
13. **The bundle gives the resolver the check's host name** (ADR 0687 §2; R-N6, H-M3, S-M1, R2-5). At its start,
when `check-address` changes (a file event of the kernel), when its bus connection comes back (the connection's
reconnect, an event), and when it hears the node seat `node-engine`'s event `running` for a module that holds
`node-resolver` on its own node and is running, it calls `<node>/node-resolver.uplink-names` directly with the
check address's host name, or with an empty list when the address is empty, and writes `names.json`. Its manifest
`consumes` `node-engine.running`; it drops every event whose subject names another node; which module holds
`node-resolver` on its node it reads with `mesh-module-assigner.assignments` (its node, `seats`) when such an event
comes. An answer that no holder serves the verb is no failure: it is recorded as "no holder", and the machine's
resolver file then lists the mesh's resolvers, through which the check already resolves. A failed call is written
to its journal with the reason, makes its health unhealthy (§22) and is asked again at the next such event or by
its tool (§22), never on a timer (the lead's answer of 2026-11-24: events first). Its manifest `invokes`
comes. An answer that no holder serves the verb is no failure: `result` is `no holder`, and the machine's resolver
file then lists the mesh's resolvers, through which the check already resolves. A failed call is written to its
journal with the reason, makes its health unhealthy (§23) and is asked again at the next such moment or by its
tool (§23), never on a timer (the lead's answer of 2026-11-24: events first). Its manifest `invokes`
`seat:mesh-module-assigner.assignments` and `seat:node-resolver.uplink-names`. The prepare reads whether the
node-engine says `running` for a module it restarted, and writes it in the milestone file.
12. **`uplink-tools` watches the network manager's rating as it changes** (ADR 0687 §3). It hears the network
14. **The watcher watches the network manager's rating as it changes** (ADR 0687 §3; R2-1). It hears the network
manager's `PropertiesChanged` signal on the system bus for `Connectivity`, `PrimaryConnection`,
`ConnectivityCheckEnabled`, `ConnectivityCheckAvailable` and `ConnectivityCheckUri`, an event the network manager
sends; nothing runs on a timer, and the check itself stays the network manager's. It runs for as long as the tool
runner runs its bundle, as `${machine:account}`, which on a machine with a graphical session is the person's
(ADR 0689 §1).
13. **It opens the page and tells the person, at three moments** (ADR 0689 §1, §4). With the check on: when the
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
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
person's graphical session starts (§15) while the present rating is PORTAL. Each time it opens the check address
(§16) and shows the notification (§17). **Once per ask**: it acts again only after the rating has left PORTAL, a
person's graphical session starts (§17) while the present rating is PORTAL. Each time it opens the check address
(§18) and shows the notification (§19). **Once per ask**: it acts again only after the rating has left PORTAL, a
session's start and its own restart excepted; after its own restart while PORTAL it opens the page once more,
which is wanted, because what needs the person is shown (H-N7). It reads the present rating at a session's start,
never a kept event (ADR 0443 §3). With no graphical session found (§14) it opens and shows nothing and still
publishes (ADR 0689 §4).
14. **How it finds the person's session** (ADR 0689, *Consequences*). Over the system bus it asks logind for the
never a kept event (ADR 0443 §3). With no graphical session found (§16) it opens and shows nothing and still keeps
the events (ADR 0689 §4).
16. **How it finds the person's session** (ADR 0689, *Consequences*). Over the system bus it asks logind for the
sessions of its own account (`ListSessions`, then each session's `Type`, `Remote`, `State` and the user's
`RuntimePath`): the session is the one of type `x11` or `wayland`, not remote, whose state is `active` or
`online`. Its session bus is `unix:path=<RuntimePath>/bus`. Its display is in the user manager's environment,
read over that bus (the systemd user manager's `Environment`), into which the session's start block imports
`DISPLAY`, `WAYLAND_DISPLAY` and `XAUTHORITY` (ADR 0208 §17). No such session, or no display named there, is no
session. It reads no other module's files or code (ADR 0689 Considered Options).
15. **How it hears a session start.** It hears logind's `SessionNew` signal on the system bus. For a session of its
17. **How it hears a session start.** It hears logind's `SessionNew` signal on the system bus. For a session of its
own account of type `x11` or `wayland`, it waits for the user manager's environment to name a display, rereading
it at each file event of the kernel on `/tmp/.X11-unix` (an X server's socket) and on the session's
`RuntimePath` (a Wayland socket), for at most 60 s; past that it writes to its journal that the session's start
was not acted on. Then §13's third moment applies.
16. **How it opens the page** (ADR 0689 §1). It runs, with the session bus and `XDG_RUNTIME_DIR` of §14 in its
`RuntimePath` (a Wayland socket), for at most 60 s, a stated constant (R2-7); past that it writes to its journal
that the session's start was not acted on. Then §15's third moment applies.
18. **How it opens the page** (ADR 0689 §1; R2-3). It runs, with the session bus and `XDG_RUNTIME_DIR` of §16 in its
environment, `systemd-run --user --collect --quiet --wait -- xdg-open <address>`, the address as one argument and
never through a shell, so the browser runs under the person's user manager in their session and outlives the
tool runner (a child of the tool runner would be stopped with its service). Before it, it asks `xdg-mime query
default x-scheme-handler/<scheme>` the same way for the program. If the run ends within 10 s, its status decides:
success is `opened`, failure is a failed open naming the status; if it still runs at 10 s, the page is
`opening` and the run is left to go on.
17. **How it tells the person** (ADR 0689 §1). It calls `org.freedesktop.Notifications.Notify` on the session bus
of §14 (the desktop notification service), `app_name` `mesh`, only after §16's outcome (H-M2):
watcher. Before it, it asks `xdg-mime query default x-scheme-handler/<scheme>` the same way for the program. If
the run ends within 10 s, a stated constant (R2-7), its status decides: success is `opened`, failure is a failed
open naming the status; if it still runs at 10 s, the page is `opening` and the run is left to go on. The open runs
beside the watch: rating changes heard meanwhile are handled after it, in the order they came (R2-3).
19. **How it tells the person** (ADR 0689 §1). It calls `org.freedesktop.Notifications.Notify` on the session bus
of §16 (the desktop notification service), `app_name` `mesh`, only after §18's outcome (H-M2):
- opened: summary "This network asks you to sign in", body "<network>: its sign-in page is open in <program>.";
- opening: the same summary, body "<network>: its sign-in page is opening in <program>.";
- failed: the same summary with urgency critical, body "<network>: the page did not open (<reason>); open
<address> in a browser.": failure is loud;
- the rating leaving PORTAL for FULL, with a session: summary "The network is open", body "<network>: signed in.";
any other end shows nothing.
18. **Its journal** (H-N8): a line for every rating change heard (the old rating, the new one, the connection's
name), every page opened, every open that failed, every notification shown, every publish that waits and every
one sent.
19. **It publishes the events, acknowledged and in order** (ADR 0689 §2; H-M5). Each event is published on the
stream with its acknowledgement awaited. A publish refused or unacknowledged because the bus is out of reach is
kept in memory, in order, up to 256 events, and the kept ones are published in order, each with the `at` of its
change, when the bus connection says it is back (the connection's reconnect, an event); past 256 the oldest is
dropped with a journal line naming it. Every refusal is written to the journal. Kept events are lost with the
process; its next start says the present rating again (§20).
20. **When it publishes** (ADR 0687 §3, which ADR 0689 §1 keeps for how it rates). It keeps in memory whether a
sign-in is asked, and for which connection:
20. **The events are kept by the watcher and published by the bundle, in order** (ADR 0689 §2; H-M5, R2-1, R2-11).
The watcher writes each event of §21 into `pending/` (§12) at its change, with `at` the time of the change and a
`message_id` of `<node>.<event>.<sequence>` made once. It keeps at most 256 files, a stated constant (R2-7); past
that it deletes the oldest with a journal line naming it. The bundle publishes them in sequence order on the
seat's subject (§1), each with its `message_id` as the bus's message id, so a second publish of one is dropped by
the bus as a duplicate, awaiting the stream's acknowledgement, and deletes each file once acknowledged; it does so
at its start, at each file event of the kernel on `pending/` and when its bus connection comes back. A publish
refused or unacknowledged stays in `pending/`, is written to its journal and counted (§23), and is published again
at the next such moment. The kept events survive a restart of either part and of the machine.
21. **Which events it keeps** (ADR 0687 §3, which ADR 0689 §1 keeps for how it rates). The watcher keeps in memory
whether a sign-in is asked, and for which connection:
- the rating becomes PORTAL while the check is on and a connection is active, and no sign-in is asked: one
`sign-in-asked` for that connection, `address` the check address; while it stays PORTAL nothing more;
- a sign-in is asked and the rating becomes FULL: `sign-in-ended` with `signed-in`;
@@ -233,70 +273,88 @@ watch and the reaction, and calls nothing; `i3` back drops `open`; nothing else
included): `sign-in-ended` with `no-longer-asked`, so the record never holds an ask that ended unsaid;
- at its own start, with the check on: `sign-in-asked` when the rating is PORTAL, otherwise `sign-in-ended` with
`no-longer-asked`, for the active connection or with an empty `link` and `network` when none is active;
- with the check off (not enabled, or not available) it publishes nothing, at its start and after.
- with the check off (not enabled, or not available) it keeps nothing, at its start and after.
`link` is the interface of the active connection's first device, `network` its connection's name, `at` the
machine's clock at the change. A check address that is not http or https publishes nothing, opens nothing and is
machine's clock at the change. A check address that is not http or https keeps nothing, opens nothing and is
written to its journal.
21. **Its README** says that it opens the page and tells the person on its own machine without the bus, how it finds
the session (§14, §15), that it announces the two events from the network manager's own rating, that with the
check switched off it neither opens nor announces, and that it calls `uplink-names` where a holder of
`node-resolver` runs (ADR 0687 §2, §3; ADR 0689). Its review reads it.
22. **Its tools and its health** (H-M1, S-M3; ADR 0240). `uplink_sign_in` (reads): whether the watcher is
subscribed, the last rating heard and when, the ask open now (network, link, since), the asks opened and ended
since its start, the last open with its outcome and time, the last notification, the last `uplink-names` call
with its result (`ok`, `no holder`, or the failure) and time, and the publishes waiting. `uplink_names_again`
(acts): calls `uplink-names` now as §11 does. `uplink_rating_again` (acts): reads the rating now and acts on it as
on a change (§13, §20). Its health is unhealthy while the watcher is not subscribed or the last `uplink-names`
call stands failed, naming which; `no holder` is healthy.
23. **Its tests** (ADR 0687 and ADR 0689, *How it is checked*), unit, with the network manager's D-Bus signals,
22. **Their journals** (H-N8): the watcher writes a line for every rating change heard (the old rating, the new one,
the connection's name), every page opened, every open that failed, every notification shown, every session start
and what it did, every event kept and every one dropped past the bound; the bundle a line for every publish sent,
refused or left waiting, and every `uplink-names` call with its result.
23. **Its tools and its health** (H-M1, S-M3, R2-12; ADR 0240), served by the bundle:
- `uplink_sign_in` (reads): from the watcher's `state` (§12): whether it is subscribed, the last rating heard and
when, the ask open now (network, link, since), the asks opened and ended since its start, the last open with
its outcome and time, the last notification, the last session start with what it did; from the folder: the
events waiting in `pending/` and the publishes refused since the bundle's start; from `names.json`: the last
`uplink-names` call; and, where a holder of `node-resolver` runs on its node, the resolver's refusal of the
names as `<node>/node-resolver.routes` answers it (`uplink_names.refused`).
- `uplink_names_again` (acts): calls `uplink-names` now as §13 does.
- `uplink_rating_again` (acts): asks the watcher `rating-again` (§12).
- `uplink_health` (the health tool of §11): unhealthy while the watcher's socket does not answer, while the
watcher is not subscribed, or while the last `uplink-names` call stands failed, naming which; `no holder` is
healthy.
24. **Its README** says the two parts and their shared folder, that the watcher opens the page and tells the person on
its own machine without the bus, how it finds the session (§16, §17), that it keeps and the bundle publishes the
two events from the network manager's own rating, that with the check switched off it neither opens nor keeps,
and that the bundle calls `uplink-names` where a holder of `node-resolver` runs (ADR 0687 §2, §3; ADR 0689). Its
review reads it.
25. **Its tests** (ADR 0687 and ADR 0689, *How it is checked*), unit, with the network manager's D-Bus signals,
logind, the user manager, the opener and the notification service stood in, and no bus: PORTAL at a join opens
the page and shows one notification; PORTAL at its start does the same; PORTAL to FULL shows that the network is
open; PORTAL to any other rating shows nothing; a second PORTAL without a leave does nothing; a session that
starts while the rating is PORTAL opens the page once, one that starts while it is not opens nothing; with no
session it opens and shows nothing and still publishes; an opener that fails gives the critical notification;
each line of §20; nothing with the check off; no timer; a publish refused while the bus is out of reach is kept
and published in order once the bus is back, each with its change's time, and one past the bound writes a
journal line; `uplink-names` called at its start, on a changed address and on a running holder of
`node-resolver`, `no holder` recorded as healthy; each tool. **One integration test** starts `uplink-tools` whole
against a real bus holding `node-uplink`'s definition and a stand-in holder of `node-resolver`: the watcher, the
publication with its acknowledgement, the kept queue across a bus restart and the call of `uplink-names` (R-M4).
24. **Nothing names a network in it** (ADR 0687 §6): §30 holds for its code, configuration and tests.
25. **`systemd-networkd`'s README says it announces neither event and opens nothing** (ADR 0687 §1): systemd-networkd
the page and shows one notification; PORTAL at the watcher's start does the same; PORTAL to FULL shows that the
network is open; PORTAL to any other rating shows nothing; a second PORTAL without a leave does nothing; a session
that starts while the rating is PORTAL opens the page once, one that starts while it is not opens nothing; with no
session it opens and shows nothing and still keeps the events; an opener that fails gives the critical
notification; a rating change heard during an open is handled after it; each line of §21; nothing with the check
off; no timer; the system bus dropping and coming back makes the watcher subscribe again, and so does
`rating-again`; past 256 kept events the oldest is dropped with a journal line; the bundle publishes the kept
events in order with their message ids and deletes each on acknowledgement, keeps a refused one and publishes it
at the next moment; `uplink-names` called at the bundle's start, on a changed `check-address`, when the bus
connection comes back and on a running holder of `node-resolver`, `no holder` recorded as healthy; the health
tool unhealthy for a watcher not subscribed and for a failed `uplink-names` call; each tool. **One integration
test** starts `networkmanager` whole, watcher and bundle, with no bus: it sees the page opened by the stood-in
opener; then it starts a real bus holding `node-uplink`'s definition and a stand-in holder of `node-resolver`,
and sees the kept events published in order with the times of their changes and `uplink-names` called (R-M4,
R2-1).
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, and
keeps its claim of `node-uplink`, its package, its configuration file and its service as today.
28. **`systemd-networkd`'s README says it announces neither event and opens nothing** (ADR 0687 §1): systemd-networkd
cannot tell a sign-in page. Its review reads it.
## The display session's verb (`i3`)
26. **`i3` serves `open`** (ADR 0687 §4; H-M2, U-M2). Its claim of `node-display-session` serves `open` beside its
29. **`i3` serves `open`** (ADR 0687 §4; H-M2, U-M2). Its claim of `node-display-session` serves `open` beside its
three verbs, as the tool `node-display-session.open`. It checks the address by §3's refusals and percent-encodes
it by §3; it finds the session's bus and runtime directory with its `desktop` package, asks `xdg-mime query
it by §3's encoding; it finds the session's bus and runtime directory with its `desktop` package, asks `xdg-mime query
default x-scheme-handler/<scheme>` for the program, refusing when there is none, and runs `systemd-run --user
--collect --quiet --wait -- xdg-open <address>` 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 §16 decides it (10 s), and the
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
answer names the program only once it started. It reads the command from the entry's `Exec` line in the XDG data
directories. With no graphical session it refuses, as its other tools answer. Its manifest declares the package
`xdg-utils` present (ADR 0303 §2).
27. **`i3` hears nothing of the uplink** (ADR 0689 §3, replacing ADR 0687 §5). It consumes no `node-uplink` event
`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).
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`.
28. **Its README and tests** (ADR 0687, *How it is checked*, clause 4). The README says the verb, its refusals and
31. **Its README and tests** (ADR 0687, *How it is checked*, clause 4). The README says the verb, its refusals and
the encoding. Unit tests, with the session and the opener stood in: `open` refuses every scheme but http and
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; an opener that fails is refused with its status and names
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`. The live tests are the main file's acceptance test 3.
## Words and checks
29. **The catalog's copy of the retired words gains "captive portal"** (ADR 0687, *Consequences*: the glossary's
32. **The catalog's copy of the retired words gains "captive portal"** (ADR 0687, *Consequences*: the glossary's
word **sign-in page**). mesh-catalog's `retired-words` lists it, so hq's words test agrees with the copy, and no
tool or seat verb description in the change uses it.
30. **Nothing names a network** (ADR 0687 §6). Code, configuration and tests name no network, sign-in page or
33. **Nothing names a network** (ADR 0687 §6). Code, configuration and tests name no network, sign-in page or
employer: the tests use documentation names only (`example.net`, a network named `guest-example`). The milestone's
code review searches the change's code, configuration and tests for a wifi name or a host outside the
documentation domains, and finds none.
31. **The test budget** (R-N7). The prepare records each touched module's unit and integration test counts against
34. **The test budget** (R-N7). The prepare records each touched module's unit and integration test counts against
its budget in the milestone file, and the review reads them.
32. **The live cases** are the main file's acceptance tests 1 to 3. Issue 960 is resolved once the first holds;
35. **The live cases** are the main file's acceptance tests 1 to 3. Issue 960 is resolved once the first holds;
issue 935 once the third does; if the second shows the rating LIMITED instead of PORTAL, ADR 0687 is amended,
tracked by issue 960.
@@ -243,7 +243,7 @@ flowchart LR
| milestone | what it builds | part | state |
|---|---|---|---|
| zfs-owns-zfs | the zfs module's ownership of ZFS (ADR 0679), with its three node-engine prerequisites and their readers, under issue 1979 | [42-milestones/zfs-owns-zfs.md](42-milestones/zfs-owns-zfs.md) | designed |
| sign-in-page (design 08's) | `i3`'s verb `open` (ADR 0687 §4; ADR 0689 §3) | [08-milestones/sign-in-page.md](08-milestones/sign-in-page.md) §3, §26 to §28 | designed |
| sign-in-page (design 08's) | `i3`'s verb `open` (ADR 0687 §4; ADR 0689 §3) | [08-milestones/sign-in-page.md](08-milestones/sign-in-page.md) §3, §29 to §31 | designed |
The modules of the tables above were built before designs were cut into milestone parts; their remaining lines move
into a part of their own at their next amendment (playbook 02, *The shape of a design*).