Skip to content

Establish the device architecture from primary sources - #201

Merged
jiweiyuan merged 1 commit into
mainfrom
docs/device-architecture
Aug 5, 2026
Merged

Establish the device architecture from primary sources#201
jiweiyuan merged 1 commit into
mainfrom
docs/device-architecture

Conversation

@jiweiyuan

Copy link
Copy Markdown
Collaborator

Documentation only — no code. Splits the design work off termiod/rust-poc (#177) so it can be reviewed and landed without waiting on the implementation.

What this adds

termiod-device-architecture.md — there is no "remote". There are devices, each running one termiod, and every UI including the Mac app is a client that attaches to one. A device's identity is its host_id, not an SSH alias; SSH is one route among several to the same machine. Keyed by alias, one VPS reachable as vps-lan / vps-wan / a tailnet name forks into three session lists; keyed by device it stays one machine with three roads.

Protocol spec brought up to the branch's state — §C.10 resumable subscriptions (bounded ring, linger, gap on overflow) and the VT-sequence snapshot format.

termiod-hot-path-and-client-classes.md — the hot path and attach join point analysis.

CLAUDE.md — the positioning and the architectural invariants that follow from it.

The correction worth reading

An earlier draft, written from press paraphrase ("the server maintaining all state"), concluded we should move to server-side state synchronisation.

Primary sources say the opposite. From Mitchell's architecture video:

instead of sending down screen diffs … we take the PTY bytes, we tee them off to all the clients, and we send them raw like SSH

And answering tmux maintainer Jonathan Slenders, who asked whether sending visible screen state on attach means the server parses too:

Yes, the server parses too. But the teeing happens ahead of the server, so the clients can parse simultaneously to the servers

That is termiod's existing anti-100× invariant, arrived at independently. The architecture needs no course change — which also means it is not a moat, and the doc says so.

We also adopt their better argument against screen diffs. We had justified keeping G off the default path with a bandwidth measurement (8.6× worse for scrolling output, measured against a real VPS). That number is real but indicts our 16-byte-per-cell encoding, not diffing as an idea. Their reason survives any encoding work:

The issue with the screen diffing is less performance and more making it very difficult to allow native scrollback, selection

A diff-fed client owns no real scrollback and cannot select across history. So G stays opt-in even after the wire cell shrinks.

Notes for review

  • Every Superlogical claim carries an evidence label (Announced / Inferred / Unknown), inherited from the existing protocol spec's policy. They have published no wire protocol and nothing here guesses at one.
  • Open questions are listed rather than papered over: host_id is not intrinsic (a cloned VM carries a duplicate), route selection under multiple reachable paths, and whether a single "current device" costs the cross-device agent roster.
  • Measurements quoted in the docs were taken on this branch against a real aarch64 VPS.

Release Notes: none — documentation only.

Add termiod-device-architecture.md: there is no "remote" — there are
devices, each running one termiod, and every UI including the Mac app is
a client that attaches to one. A device's identity is its host_id, not an
SSH alias; SSH is one route among several to the same machine, so the
same box reachable over LAN, WAN and Tailscale stops forking into three
session lists.

Correct the state-authority section against primary sources. An earlier
draft, written from press paraphrase ("the server maintaining all
state"), concluded we should move to server-side state synchronisation.
Mitchell's architecture video and his reply to tmux maintainer Jonathan
Slenders say the opposite: Superlogical tees raw PTY bytes to clients
"like SSH", and while the server does parse, "the teeing happens ahead of
the server". That is termiod's existing anti-100x invariant, arrived at
independently — the architecture needs no course change.

Adopt their better argument against screen diffs: the problem is less
performance than that a diff-fed client owns no real scrollback and
cannot select across history. That is a capability limit no amount of
encoding work removes, so G stays opt-in even once the wire cell shrinks.

Bring the protocol spec up to the branch's state: §C.10 resumable
subscriptions, and the VT-sequence snapshot format with the measurements
behind it.

Add the hot-path and client-class analysis, and CLAUDE.md, which records
the positioning and the architectural invariants that follow from it.

Refs: #164, #177
@vercel

vercel Bot commented Aug 5, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
landing Ready Ready Preview Aug 5, 2026 4:37pm

Request Review

@jiweiyuan
jiweiyuan merged commit 7afd7cc into main Aug 5, 2026
2 checks passed
@jiweiyuan
jiweiyuan deleted the docs/device-architecture branch August 5, 2026 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant