Decision Records

Architecture Decision Records

TL;DR. Index of every decision that has closed off a design space in phux. Format and Status: vocabulary defined in ../docs/CONVENTIONS.md. Read these when you need to know why something is the way it is — the architecture docs describe what the code is.

We write down decisions so future contributors (including future-us) can understand why the system is the way it is. Format follows Michael Nygard’s template.

Index

#DecisionStatus
0001Use RustAccepted
0002Diff-based wire protocol, not VT byte replaySuperseded by 0013
0003Single server, many sessionsAccepted
0004libghostty-vt is the canonical gridAccepted
0005Greenfield relative to zmx / zmoshAccepted
0006Input event types mirror libghostty’s APIAccepted
0007Mosh-class transport semantics and satellite forward-compatAccepted (forward-compat); impl deferred to v0.2+
0008Re-export libghostty-vt’s input/style types directlyAccepted
0009phux is a protocol substrate; Mux is a product (no overlap)Accepted
0010Frontend-agnostic server; tmux control mode reserved as compatAccepted (forward-compat); CC adapter not on the roadmap
0011phux-protocol and phux-core are independent; IdBridge is their only meeting pointAccepted
0012Window layout is a binary split tree, not n-aryAccepted
0013Libghostty bytes on the wire; structured input remainsAccepted (supersedes 0002)
0014Server-side per-terminal actor pattern (!Send Terminal on a LocalSet)Accepted
0015Protocol layering: L1 substrate / L2 collections / L3 metadata; federation + automation as cross-cutsAccepted
0016TerminalId is the wire identity for a managed terminal; PaneId is removedAccepted
0017The reference TUI is one consumer among several, with no protocol-level privilegesAccepted (refines 0010)
0018The wire is lazy state synchronization of libghostty Terminal state; ADR-0013’s pass-through bytes is the degenerate caseAccepted (builds on 0013)
0019Multi-pane TUI rendering: layout persistence, wire shape, and chromeAccepted
0020Layered render: ratatui chrome over libghostty pane interiorsAccepted
0021Control-plane verbs ride the generic COMMAND envelope; selectors resolve client-side; no session/window on the wireAccepted (builds on 0017)
0023Config UX: pure-config; defaults are a live embedded base layer; scaffold is a commented projection that never overwritesAccepted (TUI-local, builds on 0017)
0024The wire protocol owns its input atoms (phux-defined), so the codec builds on wasm32Accepted (amends 0008)
0025Browser web client over a WebSocket transport; reuses the wire codec + libghostty engine, no reimplementationAccepted (builds on 0017, 0024)

When to write an ADR

  • Picking between viable approaches with long-term consequences.
  • Closing off a design space (deciding against something).
  • Anything you’d want to explain to a new contributor on day one.

When NOT to write an ADR

  • Bug fixes.
  • Refactors that don’t change behavior.
  • Anything purely internal to a single function.

Template

# NNNN — Short title

Status: Proposed | Accepted | Deprecated | Superseded by ADR-NNNN
Date: YYYY-MM-DD

## Context
What is the situation that calls for a decision?

## Decision
What was decided.

## Rationale
Why this and not the alternatives.

## Tradeoffs
What we give up.

## Alternatives considered
Brief sketch of the other candidates and why they lost.