superseded by the full set from 09-23, #17–#37
description:
Review set for lichen.page.review, 0b92cb61 (reviewed) → eb5a1653 (stack). PR 9 of 16. 20 files, +2478/−2536. One commit, 8a5b182b7c53, which sets these files to their content at eb5a1653. Targets #8 (oct/08-builds). #10 stacks on this one. Tests and generated files are not in any PR; they are in main.
iroh now runs in the front server, one transport per site; no site process holds a node key or makes a connection (SITE-FRONT-BOUNDARY unit 10). Before, each site's runtime ran its own iroh endpoint; in a site process it reached the network through relays only and asked the front server for its DNS lookups.
- Git sync with peers is between the front server's hub of the site and the peer: ref exchange, packs over iroh-blobs. It runs when the hub's
mainmoves, every 30 s with one peer in turn, and at start. Collaborators' git remotes are fetched into the hub, and the site takes what itsmainlacks: the site makes no network connection for git (10c). - Peers and collaborators are read from the hub's
main(settings.toml's[iroh].peers,collaborators.toml), by git and bounded, never from a checkout. - Rooms (live editing,
lichen/sync/0): where the site runs in the front server's own process its rooms are served directly. Where it runs in a site process, the front server accepts and dials the iroh streams and bridges each room's bytes to the site, over an ordinary route that upgrades (/cms/api/iroh/room/{name}); the site runs the y-sync exchange as before (10b2). - The site is told its peers' state for the editor's peers panel (
POST /cms/api/iroh/peer-events). - The site's
[iroh]settings andcollaborators.tomlstay the site's, and keep their format.
Also here: lichen-yrs's framing loop no longer panics on a client id over 53 bits in a debug build, and small sync changes (storage check, a rebase abort only for an older lichen's pull, call groups in the three-way merge's child).
info:
Plans: SITE-FRONT-BOUNDARY-2026-10-17.md (unit 1 item 2: front-owned iroh, the key never in a site; unit 10, "the open rows"), note SITE-FRONT-BOUNDARY-U10-DESIGN-2026-10-23.md. Earlier: PER-SITE-PROCESS-2026-10-09.md P3-5 (the relays-only site network this removes).
Files
Front server (crates/lichen-server/src/):
iroh.rs— new: the per-site transport's two layers and what the server starts. Read first.iroh/runtime.rs— new: one transport per site, keyed by domain, started and stopped with the site's record (not its process); peers from the hub; sync triggers; collaborators' remotes.iroh/git_transport.rs— new: git sync between the hub and a peer (the site's 1638-line version is deleted).iroh/bridge.rs— new: bridging a site process's rooms (10b2).iroh/endpoint.rs— moved unchanged fromlichen-site.iroh/site_network.rs— new and short: the endpoint uses the server's own network (N0 preset).iroh_keys.rs— the key is the front server's (crate::iroh::SecretKey).
Site (crates/lichen-site/src/):
iroh.rs(−320) — the site keeps its rooms' protocol, collaborators and settings.ipc/iroh.rs(+174) — the routes the front server's iroh asks: peers, collaborators, peer events, the room upgrade.iroh/protocol.rs,iroh/stream.rs— the room exchange is generic over a byte stream, so a bridged connection serves it.iroh/collaborators.rs,iroh/settings.rs— parse text the front server read from the hub.iroh/git_transport.rs,iroh/runtime.rs,iroh/site_network.rs— deleted.sync/git_recovery.rs,sync/room_sync.rs,sync/threeway_merge.rs— small follow-ups.
crates/lichen-yrs/src/conn.rs — the 53-bit client-id panic fix (property test in main).
Moved in: lichen-site/src/ipc/iroh.rs (site process: it is the site half of the room bridge), lichen-server/src/iroh.rs and iroh_keys.rs (front server core, by path) and lichen-site/src/iroh.rs (site core).
Lives elsewhere
- The hub and
git/hub_files.rsthe peers are read with: #5. The PDS import into the hub (unit 10a):state.rsin #11. - The routes the iroh asks go in permission groups through
lichen-site/src/acts.rs: #3. lichen-server/Cargo.toml's iroh dependencies: #11.- Tests (
iroh/tests/*.rs, includingrooms.rs, which is the oldy_sync_protocol_test.rsrenamed; the deleted multi-peer and eventual-consistency suites) are inmain.