ADR 0001: Clean-room MIT provenance, PyPI namespace, and Python 3.12+ floor¶
Status¶
Accepted. 2026-11-21.
Context¶
libtmux (>= 3.11), tmuxp (>= 3.11), and Python terminal test suites
need an in-memory virtual terminal emulator and streaming VT parser without
copyleft license obligations (tmux-python/libtmux#886). Existing pure-Python
and GTK terminal libraries carry copyleft terms (pyte under LGPL-3.0,
libvte under LGPL-3.0, and asciinema’s virtual terminal engine under
GPL-3.0-or-later) and omit contemporary terminal extensions used by tmux
and modern TUIs: DEC mode ?2026 synchronized output, DEC mode ?2027
Unicode grapheme clustering, ITU T.416 colon-delimited SGR subparameters
(4:3, 38:2::R:G:B, 58:2::R:G:B), OSC 8 hyperlinks, OSC 133 semantic
shell prompts, OSC 7501 program status, Kitty keyboard stacks (CSI u), and
SIXEL / Kitty graphics placement and erase tracking.
Three packaging and runtime constraints govern the package boundary:
Distribution and import name availability: Candidate package names
pyvt(https://pypi.org/project/pyvt/) andvt(https://pypi.org/project/vt/, also used asimport vtbyvt-py) are already registered on PyPI, whereaslibvtis available and matches thelibtmux/libvcsnaming family.Python interpreter floor: Raising
requires-pythonto>= 3.14(to use stdlibcompression.zstdor PEP 649 runtime semantics) would block adoption inlibtmux,tmuxp, and downstream CI matrices running Python 3.12 and 3.13.Pure-Python wheel portability: Shipping a mandatory C, Zig, or Rust extension complicates universal wheels, free-threaded CPython builds (
PYTHON_GIL=0), PyPy, WebAssembly sandboxes, and offline CI runners.
Decision¶
libvt ships as a standalone, MIT-licensed, pure-Python (py3-none-any.whl)
distribution under the libvt package and import name with
dependencies = [] and requires-python = ">=3.12,<4.0":
Clean-room license firewall: Every parser transition, escape parameter rule, character-width table, and test vector is derived strictly from public standards (ECMA-48, DEC STD 070, ITU T.416, Paul Flo Williams’ VT500 parser state diagram, Unicode UAX #11 and UAX #29) and permissively licensed (
MIT,ISC,Apache-2.0,BSD) specifications and implementations (tmux,ghostty/libghostty-vt,alacritty_terminal,weztermVT crates,zellij,ratatui, and the RexOSC 7501specification).Copyleft quarantine: Source code under
LGPL,GPL,AGPL, orMPL(includingpyte,libvte,asciinema,fish-shell, andhelix) MUST never be read, translated, or copied when developing or testinglibvt.Acyclic ecosystem dependency graph:
stdlib -> libvt -> libtmux -> tmuxp.libvtnever importslibtmux.Zero-GIL thread safety: Mutable parser and SGR memoization tables live on
Parser/Terminalinstances rather than unlocked module-global dictionaries so concurrentTerminalinstances run without data races on free-threaded CPython (3.13t/3.14t).
Alternatives considered¶
Candidate |
License |
PyPI name |
Wheel |
Python floor |
Disqualifier or trade-off |
|---|---|---|---|---|---|
|
MIT |
available |
|
|
Pure-Python CPU ceiling (~10-35 MiB/s vs SIMD native) |
|
MIT |
occupied |
|
|
Name collision on PyPI and |
Python |
MIT |
occupied ( |
|
|
Excludes Python 3.12 and 3.13 consumers ( |
Inline helper inside |
MIT |
n/a |
|
|
Unusable without installing |
Mandatory |
MIT |
available |
platform wheels |
|
Requires Zig build matrix; omits |
Retain |
LGPL-3.0 |
occupied |
|
|
Copyleft license; lacks |
Consequences¶
Positive¶
Downstream MIT, BSD, Apache-2.0, and proprietary consumers depend on
libvtwithout copyleft review or native C/Zig/Rust toolchains.Python 3.12, 3.13, 3.14, 3.15, and PyPy share a single
py3-none-any.whlartifact.Instance-local caches allow parallel test workers and free-threaded Python threads to drive separate
Terminalinstances concurrently.
Tradeoffs¶
Pure-Python byte ingestion (
~10-35 MiB/son ASCII/ANSI streams) is slower than SIMD-accelerated native engines (>100 MiB/s), while still processing typical80x24TUI frames in well under a millisecond.
Risks¶
Contributors consulting copyleft terminal emulators during bug fixes. Mitigation: state the quarantine in
AGENTS.md,.github/CONTRIBUTING.md, and this ADR, and cite ECMA-48, DEC,tmux, orghosttyreferences in tests and commit messages.