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
0005Relationship to zmx and zmoshAccepted
0006Input event types re-export libghostty-vt’s atomsAccepted (amended by 0024)
0007Mosh-class transport semantics and satellite forward-compatAccepted (forward-compat)
0008Use libghostty-vt’s types directly; stop reimplementing themAccepted (amended by 0024)
0009phux vs coder/mux: positioningAccepted
0010phux is TUI-first, non-TUI not precluded; tmux control mode reserved as compat optionAccepted (forward-compat)
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 Terminal placement: per-pane PaneActor on a LocalSetAccepted
0015Protocol layering: L1 substrate, L2 collections, L3 metadataAccepted (L2 tier dissolved by 0030)
0016TerminalId as the wire primary; PaneId is a consumer-side aliasAccepted
0017The reference TUI is not protocol-privilegedAccepted (refines 0010)
0018Lazy state synchronization is the wire’s long-arc shapeAccepted (builds on 0013)
0019Multi-pane TUI rendering: layout persistence, wire shape, and chromeAccepted
0020Layered render: ratatui chrome over libghostty pane interiorsAccepted
0021Control-plane commands and client-side selector resolutionAccepted (builds on 0017)
0022phux as a tool for agentsAccepted
0023Config UX: pure-config, defaults as a live base layerAccepted (TUI-local, builds on 0017)
0024The wire protocol owns its input atomsAccepted (amends 0006, 0008)
0025Browser web client over a WebSocket transportAccepted (builds on 0017, 0024)
0026Overlays: one theme, a real stack, and a single dispatch pathAccepted (builds on 0020)
0027Terminals are referenced, not owned: views, links, and L3 tagsAccepted (builds on 0017, 0015)
0028Runtime log controlAccepted (forward-compat, builds on 0024)
0029One cursor authority and a repaint schedulerAccepted (forward-compat, extends 0020)
0030Engine-delegated wire and projection consumersAccepted (supersedes the L2 tier of 0015)

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.