Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/interplane-forge/blob/main/docs/NODES.md # interplane-forge INTERPLANE Forge Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `interplane-forge / docs / NODES.md` 139 lines ยท 9696 bytes Raw Blame History Source # Node health, the floor-edge restarts, and what forged runs outside Omega Lane E of L1008 (card t_`e5e50a41`). Evidence words: IMPLEMENTED (in this tree), HOST_TESTED (run on the Spark with the named test), DEPLOYED (live), NOT_RUN. ## What forged runs outside Omega Every outside program is started with `execprog`: an argument list, no shell, no `PATH`, an empty environment, stdout into a pipe, stderr to `/dev/null`. Program Started from What for Replacement `/usr/bin/git` `server/util.om` `fexec` (every git page), `nodes/srch.om` `nsrun` (search), `dl/dl.om` (archives) read-only `archive`, `blame`, `cat-file`, `diff`, `for-each-ref`, `format-patch`, `grep`, `log`, `ls-tree`, `rev-list`, `rev-parse`, `show` on allow-listed storage (12 subcommands, from the `fka` after each `fkgit` / `fkgiti` in the composed source) README row 1: a seeded-Omega object reader (zlib inflate, pack index, tree walk). First step done in this lane: `symbolic-ref HEAD` (repository home, commits, branches and tags, in-repository search, and the clone panel) is replaced by `nodes/head.om`, which reads the storage `HEAD` file; parity in `nodes/tests/ab.sh check`. Next: loose and packed refs, then objects. `/usr/bin/ssh-keygen` `social/20crypt.om` `ssh-keygen -Y verify` of a Radicle-key sign-in signature README row 2: Ed25519 verify in Omega. Not built in this lane. The node snapshot writer `nodes/snap.om` is its own program, not part of forged. It runs `/usr/bin/sqlite3 -readonly` (the node's two databases) and `rad node status` / `rad node events` (through `/usr/bin/env HOME=...`, because `rad` finds its node socket from `HOME`). Those stay host programs: sqlite3 is how the node's own database is read, and `rad` is the node's own interface. ## Node snapshot `nodes/snap.om`, built by `./run.sh deploy` as `server/nodes-snap`, run by `infra/spark/aien-nodes.service` as `nodes-snap follow`: - writes the snapshot at start; - then follows `rad node events`, the node's own stream of what it just did (a sync, an announcement, a peer coming or going). After an event the snapshot is written again, at most once per 30 s; - with no event nothing runs: there is no timer. When the stream ends (the node restarted) it exits with status 6 and systemd starts it again 30 s later. `nodes-snap` with no argument writes once and exits (0 written, 3 or 4 a database query failed, 5 the file could not be written). Any argument other than `follow` is refused with exit 2 and nothing written. The file is `~/.local/state/aien-factory/nodes.txt`, mode 0600, replaced by rename. Format 2, one item per line: - `2`, the format - unix time it was written - our node id, `z6MkfZDue1TbaNFi3ZzcD9uiTeduPLC52ucdFVuLKZwexxhK`; readers refuse any other - connected peers: rows of `rad node status` marked connected - and on: `RID scope copies behind reach wait` for every repository the node has a sync record for Field Meaning Source scope 2 seed all, 1 seed followed, 0 not seeded here `policies.db` table `seeding`, policy `allow` copies other nodes that told us which version of our signed refs they hold `node.db` table `repo-sync-status`, rows of other nodes behind of those, how many do not hold our latest version head differs from our own row's head reach seconds our latest version took to reach the slowest node that holds it that node's row time minus our row time wait seconds our latest version has been out while some copy still lacks it; 0 when none is behind write time minus our row time The writer lists every repository it finds, at most 131072 bytes; a snapshot that would not fit is not written (exit 5), so a cut-off last line never reaches a reader. Readers accept a line only in this exact shape: a RID of 1 to 64 ASCII letters or digits, then five numbers of 1 to 19 ASCII digits, single spaces, nothing else. The time and peer lines must be 1 to 19 digits too. Anything else (markup, quotes, a 30-digit number, a 250-byte line) is dropped whole; a bad header means "not measured". Each reader then shows only its own public allow-list: - forge `/status` and `/status.json` (`nodes/stat.om` `nsshape`, `nsdigs`): the forge allow-list (the first table of RIDS.md, minus the deny list). Every loop over a line stays inside its bound because the line has this shape, so no snapshot content can stop the server. The page never runs a program. - the factory floor (`server.py` `nodes_view`, aien-factory patch): the first table of RIDS.md, the same shape, this node's id only, a final newline and at most 262144 bytes; it shows "N peers, M behind" in the machine bar. Tests (HOST_TESTED, see READY file for the run): - `nodes/tests/snap.sh`: the writer against copies of the live node databases, compared line by line with an independent SQL computation of the same numbers; poisoned repository ids put into the copy (markup, a field separator, a 111-byte id) are never written, and a mutant without the id length guard stops with trap 4 on the long id; a mutant that never counts "behind" fails the comparison; a 512-byte buffer gives exit 5 and no file, and without the refusal it writes a cut-off file; missing database and missing output directory give their exit codes and no file; an argument other than `follow` (for example `once`) gives exit 2 and no file; follow mode against a stand-in event stream writes exactly at start, 30 s and 60 s after two events, never in the silent tail, and exits 6 when the stream ends. - `nodes/tests/ab.sh check`: `/status` and `/status.json` from fixture snapshots: public rows with their numbers, links under `/` and `/forge/`, withdrawn and unlisted RIDs never shown, poisoned lines never shown, malformed and overlong lines dropped with the server still answering, JSON parses, old format, wrong node id, a 25-digit time and missing file all give "not measured", a day-old snapshot is flagged, POST is refused. The previous build of this page stopped on such lines (trap 4); that run is the negative control (READY file). - `floor-reader-test.py` (hand-off evidence, not in this repository): the floor reader on the same cases. ## aien-floor-edge restarts: root cause The unit carries the public floor page to the hub: `ssh -NT -o ExitOnForwardFailure=yes -o ServerAliveInterval=15 -o ServerAliveCountMax=3 -R 127.0.0.1:4748:127.0.0.1:4748 hub`, `Restart=always`, `RestartSec=5`. On 2026-11-08 it restarted 1313 times. Timeline (UTC, from the Spark user journal, the hub `ssh` journal and the hub `tailscaled` journal): Time Where Line 19:48:37 hub tailscaled `timeout opening (TCP => :22)`: the private link between the two machines dropped 19:49:06 Spark, ssh of the unit `Timeout, server hub not responding`: after 3 x 15 s without an answer the Spark side gave up and exited 19:49 to 19:52:42 Spark each restart: `connect to host hub port 22: Connection timed out` 19:52:49 Spark link back; each restart now: `remote port forwarding failed for listen port 4748` 19:52:49 to 21:59:43 hub sshd 1298 lines `error: bind [127.0.0.1]:4748: Address already in use`; the forge tunnel's port 18480 failed the same way 21:59:48 hub a new session (sshd-session 959915) binds 4748; the floor is reachable again; Spark ssh pid `3065115` has held it since Cause: the hub never noticed that the old session was dead. Hub sshd ran with `ClientAliveInterval 0` (it never asks a silent client whether it is still there), so the only thing that could end the old session was the kernel's TCP keepalive: `tcp_keepalive_time` 7200 s, then 9 probes 75 s apart. WolframLanguageEvaluator: `7200 + 9*75` -> 7875 s = 2 h 11 min 15 s. WolframLanguageEvaluator: `DateObject[{2026,11,8,21,59,43}] - 7875 s` -> 19:48:28, which is inside the outage, consistent with the hub hearing nothing from the Spark after about 19:48:28. So the old session, and with it its listener on 127.0.0.1:4748, lived on for 2 h 11 min after the link dropped, and every new forward in between was refused. The restarts were a symptom: the Spark end was right to reconnect; the hub end held the port. Reproduction (`nodes/evidence/control-before.txt`, 2026-11-09T05:52Z): open a throwaway forward `ssh -N -R 127.0.0.1:47999:127.0.0.1:9 hub`, then freeze that client with SIGSTOP (it stops answering, like a dead link). After 75 s the hub still listened on 47999 (`HELD`), and a second forward was refused: `Error: remote port forwarding failed for listen port 47999`, exit 255. ## Fix (on the hub, DEPLOYED 2026-11-09T05:55Z) `/etc/ssh/sshd_config.d/60-aien-client-alive.conf` on the hub: ``` ClientAliveInterval 15 ClientAliveCountMax 3 ``` sshd now asks a silent client every 15 s and drops it after 3 unanswered asks, so a dead session lets go of its forwarded ports within 45 s instead of 2 h 11 min. Checked with `sshd -t` (syntax OK), `systemctl reload ssh`, `sshd -T` (`clientaliveinterval 15`, `clientalivecountmax 3`), and a new session opened after the reload. Undo: remove the file and `systemctl reload ssh`. Same test after the fix (`nodes/evidence/after-fix.txt`, 2026-11-09T05:55Z): after 75 s frozen the hub had released 47999 (`FREE`), and a second forward bound it and held it for the 20 s test window (timeout exit 124). The live floor and forge tunnels were not restarted. The earlier attempt in this lane had installed a polling wrapper (`floor-edge.sh` plus a systemd drop-in) on the Spark without review. It treated the symptom, so it was removed on 2026-11-09 and the unit runs its original `ssh` command again.