# diverge-viewer — read this first

The Diverge viewer. The product's owner sets the product and its words; the SDK's owner owns everything below the
daemon seam. This file is committed so every session and worktree
inherits it.

## The seams
- `src-tauri/src/daemon/mod.rs` — `Daemon`, one method per daemon verb the app uses (`agents::{templates::{create, get},
  create, delete, message, list, edit, tag, untag}`, the root `logs` read with an agent as its subject, `standalone_tools::{templates::create, create, edit, register,
  attach_agent_instance, detach_agent_instance, attach_agent_template, detach_agent_template, delete, list}`). `StubDaemon`
  (feature `stand-in`) now; `WireDaemon` when a daemon ships. The app doesn't use the tools verbs for rooms: a daemon-attached
  tool bypasses the app, which seals agents' calls and asks the person first. It lists your tools, and attaches one to an
  agent or takes it back, only when you do so on the Agents map (`standalone_tools_{list, attach, detach}`, a tool named
  by the words an agent's list item uses for it).
  - **Agents come from templates.** New agent makes (or finds: same template, same id) the template the form describes
    (image, memory, disk, settings) with `agents::templates::create`, then `agents::create` from its id (name, machine,
    mounts). An agent's name is optional; it is named for good by its template and index. The app keys an agent by
    `daemon::agent_key` (its name, else `<template>#<index>`) everywhere — tabs, rail, logs, messages, mounts, the door —
    and `daemon::reference_of` turns a key back into the `reference::Agent` every request takes. `AgentView` carries
    `template`, `index`, `creator` and `tags`; the Agents map shows them. The image an agent runs is its template's
    (`agents::templates::get`). No image is built yet, so each of the six has its own placeholder digest
    (`Kind::digest`, since a template's id leaves the image's references out) and is named in a reference.
  - **Lists stay open, and the app follows one.** `agents::list` answers `Added`… `Listed` and then what changes (an
    agent come into the filter `Added`, one in it that differs `Changed`, one gone `Removed` as last sent); a log line
    changes nothing it says (its `logs_index` is as of the last change of state). `daemon::agents_listed` reads it once and
    cancels (so do `tools_listed` and `machines::volumes_listed`). **The live list** (`src-tauri/src/fleet.rs`): the app
    holds exactly one agents list open for its life, asked again a second after it ends or fails, kept by template and
    index (a rename is a change), and on every change sends the whole list with a generation number, as the tabs do
    (`agents_watch`; the page never reconciles deltas and never asks on a clock), with where it stands
    (waiting, live, refused, failed). Each snapshot carries **the tree** (`fleet::tree`, also `agents_tree`): agents you
    made at the top, an agent another made under its maker, agents one of your tools made under that tool, agents whose
    maker isn't listed in one group last; working first, then newest; each agent with its cards waiting on you (followed
    from the door). A self-made or ringed maker is placed once. Built without the stand-in, the list is whole, empty and held open.
  - **Logs are typed.** No `jq` on the wire: a read is narrowed by kind (`type`), span and count, and every item comes
    typed; a message's parts are `User` items carrying who sent them. Views' presets are kinds of item.
  - A `Forbidden` answer (the daemon's grants) shows as the daemon refusing, in `common.forbidden`.
- `src-tauri/src/machines.rs` — `Machines`: the provider protocol's volume verbs, addressed to one machine. Since
  `e28031bbd` a volume is its provider's own; the daemon has none. The wire doesn't say yet how the app reaches a machine's verbs.
  The stand-in daemon implements both seams (it knows every agent's mounts, so it keeps every machine's holds).
- Meeting up with the real daemon = writing `WireDaemon` and `WireMachines`, nothing else.
- Everything returns **the SDK's real `diverge_sdk` types** (one crate since `9b338da70`, no features). Every
  conversion to our view types is an exhaustive `match` (never `_ =>`) so a new variant from him fails our build.
- The contract is `diverge-sdk-rs/src/{daemon,provider/endpoints/{volumes,containers/{tools,agents}},shared,container_proxy/inside}/**` at `origin/p2p-provider-binary` —
  never a doc. `CONTRACT_PIN` holds the commit we built against. Start every session with the drift check in it and
  say in one line whether anything moved.
- `providers::{list, add, remove}` are **ours until the wire has them** (a product ruling: add a machine inside the app). Machine
  names are the app's (`machine_names.json`); the daemon's name stays underneath.
- **Mounts are remembered by the app** (`agent_mounts.json`, by agent key): the daemon never reports an agent's mounts
  and the app's `agents::edit` states all three lists anew, so the app offers "Mounts" only for agents it made.
- **Spaces** (`src-tauri/src/spaces/mod.rs`): the social layer on the provider protocol's tool rooms —
  `containers::tools::run` (host; a room's container names the tool template it is an instance of), joining by id with
  the host's yes, the MCP exchanges (a room's verbs, resources, notifications), the container's files (a room's table)
  and `transfer`. The SDK's types on the wire; what rides inside them is ours (below). Since `1371081c1` the provider
  wire has no join by id (`containers::tools::connect` and the run's `authorize` channel are gone; a tool is reached
  across daemons with `standalone_tools::{register, connect}`), so `spaces::{Authorize, Answer}` are ours, the shapes
  the wire had, until the app joins rooms that way. `StubSpaces` runs the real room program in process until rooms are
  hosted on the wire.
- **The person layer is ours, not the SDK's** — the wire gives a room no way to tell members apart (a tool program sees
  one MCP client; a runner sees an address and an opaque string), and nothing on the wire names a person:
  - `diverge-viewer/room` (crate `diverge-viewer-room`): the room program.
    - A room's settings (`Args`) are signed by its host, and its id is a label plus the host's mark (`room_id`), so
      no other host can run a room by that id.
    - **Rules have numbers** (`Args.rules`; rules 1 isn't written down, so old settings sign the same bytes). A number
      the program doesn't know is refused in words; a replay picks rules by number. Under rules 1 a member is a key.
      Under **rules 2** a person is their account: admitted with its proof (genesis + newest device list), keyed by
      the account id, and any key on the list acts for them; `keys` brings a newer list (a lower number is refused),
      and a key it leaves off is refused from then on while its earlier moves still replay. The id names the host's
      account (`account_room_id`), so the host acts from any of its devices. Agents stay keys, tethered to a key on
      their person's list. A list is its root's word alone (no key on it countersigns), so continuing a room counts only the
      key that signed the settings or, under rules 2, its account; and a key one member lists can't be let in for anyone else. A receipt from a rules-2 room carries the host's account (`receipt_issuer`). Rooms the app
      makes are rules 2; a fresh name is a one-device account of its own (`Identity::proof_of`), never yours.
    - **Erasable words (rules 2).** A seal signs the arguments and also a salted digest of them (`Seal.words`, salt beside
      it). A rules-2 room keeps the digest form: it chains the digests (`Move.said` for what the move says) and keeps the words
      beside the chain; a rules-1 room keeps today's seal and bytes. `withdraw` (the author) and `erase` (the host, with a
      reason) drop a move's words, recorded as "erased by <who> under <reason>". Only what someone said can be erased
      (`erasable` in room.rs); a let-in, removal, rules change, receipt or erasure stays whole, and a move sealed whole
      before this stays too. A move that is digest-sealed, or is about one, holds only its own words (a claim names its task, it
      doesn't repeat its title; a receipt's title lives in its sealed statement). The feed says which moves the room would erase now (`erasable`). Replay accepts a move without words only when a later erasure covers it and its seal over the digest,
      place and countersign hold. `keep_copy` saves the replayed record and, on a new erasure, writes over the copy before
      it too. A receipt keeps the title it was issued with, in its statement, so erasing the task after it leaves a record that replays.
    - **A doorkeeper slot (rules 2).** `Args.keepers` names keys that may only `admit`, signed with the settings. A keeper's
      admit carries only the knocker's signed `Knocking`, which the room checks itself (this room, signed by the key it
      names, under a day old, an account naming that key, listed), plus either an invite the host sealed earlier
      (`mark_invite` with `invite_lock(mark)`; a keeper's let-in uses it up, since its mark is then in the record, and it can't be sealed again) or standing in the room this one continues. Recorded as "let in by <host>'s
      doorkeeper", marked as the host's. `drop_keeper` ends it. Nothing in the app runs a keeper yet.
    - **Sealed notes (rules 2 profiles).** A profile's settings name its owner's notes key (`Args.notes_key`, X25519, drawn
      with HKDF from the recovery words on its own path; `envelope.rs`), and only a rules-2 profile names one. A rules-2 profile
      made before profiles named it still holds and replays, and takes what visitors leave plainly. A note, a hire,
      an answer's note and a hire's result come only as envelopes (ChaCha20-Poly1305, a fresh X25519 exchange per reader,
      bound to room, verb and sealing key) to the owner's key and their author's key for that room (drawn from the key that
      seals the call); a result goes to the owner and the key the sealed ask names. The room checks shape only, refuses
      their words in the clear and a reply to them in the open; the feed and every copy hold ciphertext. The app seals
      before signing (`src-tauri/src/notes.rs`, `prepare`, on every path: screen, door, hires) and opens what it can when it
      reads a feed (`open_moves`), marking each sealed move `sealed`/`opened`.
    - Every call is sealed under the `_meta` key `network.diverge.viewer/seal` for that id, and checked against keys
      the host admitted. Someone let in unlisted is a mark of their key (`key_mark`) until they first act.
    - Every move is chained and countersigned by the room's own key, which the host's app made and named in the
      settings. What a move says must be what its sealed verb and arguments make.
    - A `Record` (settings, the record it continues, moves) is checked only by replaying it under the rules a live
      call meets (`Room::check`, `Room::from_record`). Restarts, successors and copies all take that path;
      `tests/attacks.rs` keeps the attacks it has to refuse.
    - With `--features image` it builds the tool container program (`/register`, `/schema`, `/mcp` over Streamable
      HTTP, as `container_proxy::inside::tool` states). `/register` takes the settings, the room's key
      (`room_secret`) and any record, and refuses a damaged one. rmcp lifts `_meta` into the request context, so the
      program re-attaches it before checking the seal. It never waits on its host while holding the room.
  - `src-tauri/src/identity.rs`: your usual self and fresh personas, and your agents' keys tethered to the persona they
    act for, named plainly in a fresh name's rooms. One owner-only file (`identity.json`), written whole and swapped
    in through `store.rs`, with a backup kept beside it; never the keychain (it can prompt in a popup). If it and its backup are both
    unreadable, the app signs nothing and says so; it never makes new keys over them. A keys file a newer version wrote, or one the
    system won't read, is left exactly as it is with its backup, whatever the backup holds, and nothing is signed. Counters live in
    `counters.json` and never fall behind the clock. One call at a time per key per room (`Identity::turn`).
  - **Your account** (`src-tauri/src/account.rs`, `room/src/account.rs`): made when the first-run page is finished, never
    before. Until then there is no persona, and `seal`, `state`, `fresh` and `agent_in` refuse; the stand-in's rooms
    wait too (`AppState::after_first_run`). Nothing reads the login or the machine's name (a test greps for it). Twelve
    BIP-39 words make the root (SLIP-10, hardened, `m/0'`), which signs the genesis (account id = its digest) and a
    device list (sequence 1) naming the usual persona's key as this Mac's, and is dropped. The words stay sealed in
    `identity.json` (ChaCha20-Poly1305 under an HKDF key from the device key), unconfirmed; the app opens them only to
    draw the notes key (below), which stays in memory, and no door tool reads them. A keys file from before accounts (v1) upgrades in place, is kept as
    `identity.v1.json`, and shows the first-run page naming the name an earlier version took from the login.
  - **Key marks** (`src-tauri/src/marks.rs`): where two members of one room share a name, each gets a short mark of the
    room and their key, on member lists, the host's list of everyone let in, and hire cards. Per room, so a mark never
    links a key across rooms.
  - A knock's opaque authorization carries a `Knocking`, signed by the key it names, for one room, good for a day,
    with a mark of the invite it came with, and the knocker's account. A vouch names the room it vouches someone into
    and runs out after a week. An invite is text (`diverge-invite:…`) carrying the room's rules and verbs, checked
    against the room on entry.
  - **Members back in**: where a knock arrives (`knocks_watch`), `knock_verdict` reads `Room::standing` over the
    host's replayed copy: someone let in and still in (listed or not) is answered yes with no admit and no card,
    someone removed is answered no, anyone else is a card; the knock list says which. A restart to shut someone out
    (`spaces_restart`) gives the room a new invite secret; a restart that only rebuilds it keeps the secret.
  - `records/`: the app keeps a replayed copy of every room's record, named for a digest of the room's id, with the
    copy before it beside it. An unreachable room shows from it, and someone still in it can continue it. A copy that
    won't parse, isn't that room's or doesn't replay is set aside, and the one before it carries on.
- **Hires** (`src-tauri/src/hires.rs`): a visitor asks one of your agents for something through your profile room; the
  room calls its host (on the wire, its own `mcp-call-tool`); you decide on a card. A hire waits until its agent is
  free, reaches it quoted as the visitor's words, and its result is read from its own run alone
  (`reporter::run_after`). In a profile that seals, the result goes back sealed whole and never onto the table (which
  everyone in the room reads); a rules-1 profile's lands on the table. A hire asked while the app was closed is picked up from
  the profile's record.
- **The agent door** (`src-tauri/src/door.rs`): the MCP server this app is for its agents — the Space verbs, the table,
  open asks, and `ask_person` (question / choice / credential by meaning; the value never reaches the agent). Every
  room move is sealed as the agent. Reading a room and acting in one both ask its person first, unless the person set
  a daily allowance for that agent in that room, for that kind of move (`Reach`: read, talk, work, pledge;
  `allowances.json`, keyed by room and the agent's slot). An allowance is spent only on what the room accepts. A card
  carries the whole call (`CardCall`, `CardHire`), worded by the screen from `src/strings.ts`. Cards wait on the
  person; nothing times out, but a card whose caller stops waiting (the call's cancellation) is withdrawn
  (`CardEvent::Withdrawn`) and a late answer does nothing.
  - Two kinds of agent (`identity::AgentId`): the daemon's, by agent key, and local ones you already run yourself, added
    with an id (`Identity::add_local`, from Machines → "Agents you run yourself"). A removed local agent's keys stay,
    marked removed: its past moves are still your agent's, it gets no new key, and its id is never reused. A slot names one agent: a daemon agent's key
    (`daemon/<key>` if it starts like a slot), or `local/<id>`. Keys are found by kind, name and persona, never by an
    entry's name, so agents of two kinds never share a key.
  - The door answers only agents it knows (the daemon's list, asked again on a miss, and the local ones added) and
    refuses any other before a key could be made. An agent reads and acts only in rooms it's in, by the room's own
    record, checked before any card; `spaces_list` and `asks_open` name only those rooms.
  - A local agent can't ask for a key (`door_tools` lists tools per kind), and room text reaches it framed as other
    people's words, the frame marked with a digest of the text so nothing inside can close it. A room's refusal is room
    text too: it comes back as a refused result, framed.
  - The keys file is version 3 since local agents: a build from before reads it as newer and leaves it alone.
  - **The door served on this Mac** (`src-tauri/src/door_serve.rs`): an rmcp server over Streamable HTTP on
    127.0.0.1, on a port picked once and kept in `door_agents.json` (never moved; taken → `door_status` says so). It
    listens only while a local agent is added, and only in the copy holding its folder. Each local agent has a token
    in `door/<id>.token` (0600) and a helper `door/<id>-headers` (0700) that prints the header; the app keeps only
    the sha256, compared in constant time. The caller is whichever token matched, never what the client says; a
    session is its opener's. Any `Origin` → 403; rmcp keeps `Host` to the loopback names. A new key stops the old one
    at once and withdraws its waiting cards. `local_agents_add` returns the Claude Code `add-json` line, naming the
    helper, never the token. Measured: a client's `notifications/cancelled`, or ending its session, withdraws a
    waiting card; a client that drops a request and says nothing leaves the card up.
- **The reporter** (`src-tauri/src/reporter.rs`): when an agent's run ends it `report`s to the person's Home, with the
  run's words only while Home is theirs alone.
- **The stand-in keeps its rooms** between launches (`tables/.stand-in-rooms.json`), rebuilt by replaying their
  records. A rooms file that won't parse or replay is set aside, and the stand-in starts again from its own past.
- **Files** (`src-tauri/src/store.rs`): every JSON file the app keeps says what it is and its version
  (`{"file", "version", "data"}`); one from before versions is read as it is. A write goes to a new owner-only file,
  synced, then renamed over the old one, which becomes `<file>.bak` where the format keeps a last good copy. A file
  that won't parse, doesn't check, or that a newer version wrote, is set aside under a new name beside it and never
  written over; the app carries on from the last good copy, or starts that file empty. A file the system won't open or
  read this time is left where it is, and the app neither reads nor writes it until it starts again. Every screen says
  which file (a record copy by its room's title), why, and what the app carried on from (`files_set_aside`, words in
  `src/strings.ts`).
- **One copy of the app per folder** (`store::hold`): the app holds `.in-use` in its folder with the system's file lock
  while it runs; the system lets go when it exits, crash or not. A second copy on the same folder (or one that can't
  tell) reads your keys and files as they are, writes nothing, answers nothing, and the screens say why.
- **The stand-in is a feature** (`stand-in`, on by default for now): `StubDaemon`, `StubSpaces`, their seeded past
  and staged scenes. `StubDaemon` behaves as the daemon does: templates held by hash, agents numbered per template,
  lists that say `Listed` and stay open, `creator: Client` on what the app makes and `User` items for what you send.
  Its seeded agents (research-notes, broken-loop, site-fixes) are made from templates, plus one site-fixes made,
  with no name, and morning-digest, made by your tool nightly-digest (attached to research-notes). site-fixes' long job
  sets a helper going a minute in (its lines carry `parent_tool_call_id`), so the map shows all three kinds of nesting.
  Its agents list is live: a tick on every change (made, deleted, a run starting or ending, an edit, tags, tools).
  Built without it (`--no-default-features`), nothing answers the seams (`absent.rs`): every list is empty, everything else says the network part isn't there yet, and so do the screens. A test checks the
  stand-in's own words are in the program only when the feature is on.
- **Setup** is `AppState::open(data)` (actions.rs); main.rs builds the menu and finds the root as the daemon does
  (`diverge-viewer/config`, crate `diverge-viewer-config`): `--config <dir>`, else `DIVERGE_CONFIG`, else `~/.diverge`.
  `<root>/viewer.yaml` names the daemon and the identity it is dialled as (`daemon.address`, `daemon.issuer`,
  `daemon.subject`, one of `<root>/identities/`, signed in by `diverge identities login`); a document naming no daemon
  stops the start. `diverge viewer config get|set|patch` edits it with the same type. Every file the app keeps is in
  `<root>/viewer/`.
- **The daemon proxy** is the SDK's `tauri_proxy` runner (the `tauri-proxy` feature): main.rs manages one `TauriProxy`
  from `viewer.yaml`'s daemon, presenting the identity through the SDK's `identities::Presenter`, and registers its six
  commands (`wire_request`, `wire_channel_request`, `wire_channel_response`, `wire_channel_response_finish`,
  `wire_status`, `wire_reset`), dialling at start and again as `viewer.yaml`'s `daemon.redial` says — every 5 seconds
  when absent, a whole number of seconds, or `never`. The page's handle over it is `src/lib/wire.ts` (`@diverge/sdk`, by workspace path, built
  by the `sdk` script before `dev`, `build` and `typecheck`). The screens still answer from the seams above.
- **Providers are OIDC identities** in the SDK; the screens keep telling a machine you dial from one that dials in.
  `view::ProviderView` maps the two onto an identity by issuer — `dial`, with the address as the subject, or `accept`,
  with the name — and the stand-in names its machines that way.
- **The menu** (main.rs): ⌘N new agent, ⌘W closes a TAB (never the window), ⌘1 Home, ⌘2 Inbox; the page handles ⌘3–9
  and ⌘[ ⌘]. ⌘+ ⌘− ⌘0 (Ctrl on Windows and Linux) zoom the whole window: the window's `zoomHotkeysEnabled` and the
  `core:webview:allow-set-webview-zoom` permission. Keep those keys off the menu (`src/window.test.ts`).
- The webview never holds a daemon connection, address or credential. Rust owns them. Its content security policy
  (tauri.conf.json) lets in only the app's own scripts and styles, pictures also from data: and blob:, and connects
  only to Tauri's IPC; so nothing in the page may be inline (`src/window.test.ts`). It applies to built windows, not
  to `pnpm tauri dev`, which loads the dev server directly.
- View types in `src-tauri/src/view.rs` generate `src/bindings/*.ts` (`cargo test -p diverge-viewer`).
- Never edit the SDK's crates. Blocked? Note it in the private questions list (kept outside this repo) and
  route around it on the stub.

## Product laws
- **The app sets nothing for anyone.** Every permission on screen says who set it (you over your own agents, a host
  over their room, whoever runs a machine over it, the network's own rules as plain facts), and only its setter can
  change it. The app ships starting positions for your own settings and says so; it adds no rules of its own.
- A claim reaches a screen only once a test proves it.
- Style comes from the protocol site's tokens: `diverge-provider-web/src/layouts/Layout.astro` on origin/main.
  Gold means ONLY "where you are". All colour goes through `diverge-theme/theme.css`, which is the theme, shared with the world (the
  viewer's page rules are `src/base.css`): every
  words-on-background pair keeps 7:1, and every edge of something you can press or type into, and the focus ring,
  keeps 3:1 (`src/theme.test.ts`, which names today's breaks; each waits on a colour pick). Spacing comes only from
  `--space-N`, font sizes only from `--text-*`, and app.css names no colour of its own (`src/tokens.test.ts`).
- Every action has two doors: all actions live in the Rust registry (`src-tauri/src/actions.rs`); no
  logic only in a click handler. The agent-facing door is the MCP server in `src-tauri/src/door.rs`.
- No popups, quickstarts, tours, modals, or anything that takes the mouse.
- Never assume who someone is — show a provider only as the daemon names it.
- Don't lead with a feed. Lead with the work: agents, runs, files, machines.
- Nothing times out and a running agent cannot be stopped (`delete` refuses active; a message can only be
  taken back before delivery). No fake stop button. Ceilings are set at create time.
- No invented numbers. The stand-in daemon is labelled as one on screen.
- Words are tabled: every user-facing string lives in `src/strings.ts`.

## Screens (draft four)
The first-run page, alone, until it's finished (what people should call you, 18 or older, a terms slot that says
Diverge's terms aren't written yet; no acceptance is recorded) · Agents (the rail's Agents heading: the live map of who
made whom, as an org chart down or across (`DEFAULT_LAYOUT`), mouse-drag to pan, no zoom of its own; each card says its
state as the rail does, its machine as the daemon names it, when it last ran, what it's doing now from a watched tail of
its log (`lib/map.ts`: `doing`, read from 60 items back; idle cards read once, only on screen; a dozen logs at once,
`lib/tails.ts`), its helpers in this run as smaller cards on a dashed line (a count once the run ends), its tools and
tags, what waits on you; "More" opens a row under it: tags, attach or detach one of your tools, remove while idle. A
tree to the keyboard: one Tab stop, arrows along the way it grows, Enter opens the conversation) · Home (feed across Spaces + fleet; tabs are filters; an ask goes to several rooms and is followed as one thread; take
an offer, or close the ask everywhere) · Inbox (agents and direct rooms, one list) · You (your names, your profile
room's hires and notes, receipts once each, credited to the room that issued them) · Spaces (knocks that check, with
notes and vouches; hosted, joined; host with an open door or not; paste an invite) · the door (an invite read before
knocking: rules and who set them, verbs, every field a knock sends and what each says (`spaces::KNOCK_FIELDS`; a test holds the knock to it); appear as your usual name or a fresh one; a
vouch) · a Space (what's happened and the table; verbs in plain words; the host's own tools: edit the rules,
recommend a room, remove someone quietly or not, restart; members with whose agent each is; your agents' allowances
by kind; the people from before, in a room you continued; an unreachable room from your copy, with how old it is and
"continue it") · Storage (volumes) · Machines · Views · New agent · a conversation (work folds into one line; cards
show the whole call; Mounts, changed while it's idle, with scratch space you choose).
Storage is per machine: pick a machine, then a volume; each volume is in one of the provider's three modes (keeps changes /
fresh each run / read only).

## Working on it
Plain words, few of them, tl;dr first. Show screenshots, don't describe. Check the code before asking the product's owner
anything; settle protocol and industry questions from the code, or make the call and note it. **GitHub: drafts live
on the `user-experience` branch** of this public repo, kept current with main (merged in) and with the SDK's branch
(`origin/p2p-provider-binary`, merged in, never rebased onto), built against it at `CONTRACT_PIN`, and are pushed only when the product's owner
says. Never push to the SDK's branches; no PRs or issues unless asked. **Nothing private enters this repo**, in files
or commit messages: planning docs, lists of questions, quotes from outside conversations, and wording or ideas that
came from them. Seed content is invented and everyday.

## Run it
`pnpm install` (from the repo root) then `cd diverge-viewer && pnpm tauri dev`. Every test, in one command:
`pnpm test:all` (the app's Rust tests, again without the stand-in, the room crate with its container program, and
vitest). A second copy on its own root: `DIVERGE_CONFIG=/some/root pnpm tauri dev`. A build from before files
carried versions reads them all as damaged and writes over them: give it a copy of the folder, never this one.

## Browser preview (reviews, cloud sessions — no Mac window needed)
`pnpm dev` and open http://localhost:1430 in any browser. Outside Tauri the page plays back
`src/preview/fixture.json`, a snapshot of what the stand-in daemon says (regenerate with
`DIVERGE_EXPORT_PREVIEW=1 cargo test -p diverge-viewer export_preview_fixture`; a plain `cargo test` leaves it alone). Nothing runs there; the rail says so.
