Review the complete change from its base, including local edits and new files. Stop at the first failing gate and record its cause. Resume at the earliest affected gate after a repair. Collect the pre-edit reproduction before changing source. Contribution commands · Writing conventions.
Before writing a plan, read the public API,
the documented examples and real callers. Trace the request through
Terminal, Screen, Snapshot, RegionView, RowView,
Formatter, render, aio and testing as applicable. Check
both the direct entry point and every sibling that exposes the same
behavior. Record the names of the callers and the shared invariant.
Name the API flaw in the plan. Use the project's pre-1.0 policy when an asymmetric or leaky interface needs repair. Change it at the owner and update callers, examples and migration notes when the contract changes. Preserve supported behavior through related paths and remove obsolete workarounds. Keep imports directed toward the core. Sans-I/O architecture · Transport and diagnostics.
| Layer | Owns |
|---|---|
Parser (parser) |
Byte grammar, VT500 transitions, decoded control parameters and dispatch to a sink. Parsing is independent of display state and I/O. |
Grid (_grid, screen, _ucd) |
Stored cells, width and grapheme boundaries, wraps, scrollback, reflow and rectangular views over the grid. |
Terminal and presentation (terminal, modes, style, config, profiles) |
Terminal effects, modes, replies, events and committed frames. Snapshot exposes captured state. Formatter and render present it. |
Input (input) |
Encodes host input using the terminal modes. |
Transport (aio) |
Moves bytes, drains replies, and owns stream and POSIX PTY lifetime, cancellation and backpressure. |
tmux integration (contrib/tmux) |
Capture decoding, pane and window composition, and tmux control-mode state. |
Diagnostics and adapters (testing, pytest_plugin, contrib/syrupy) |
testing compares one frame at a time. The pytest plugin owns fixtures. The Syrupy adapter owns containers and .ambr syntax. |
- Test-only watermarks or slots on
ScreenorSnapshot. Fix the stored cell or wrap invariant when it is wrong. - Rebuilding a viewport by splicing scrollback, guessing wraps or indents,
or applying prose whitespace rules to a cell grid. Let callers set
TMPDIRand geometry. Pick the documented logical-text surface for the pinned revision when the assertion concerns text. Usestripfor plain captured command output andvt_screenfor a frame. - Container or
.ambrparsing inlibvt.testing. Keepformat_vt_diff_linesscoped to a single serialized frame and handle framework syntax in the adapter. Use Syrupy's serializer for its snapshot format. - Deriving a URI rule from a path scrubber. A caller supplies a regex
for the displayed URI spelling. Handle host-specific terminal behavior
on
Profilewhen evidence shows a genuine host difference. - Dual shims that keep the same public flaw at two entry points. Route through the shared owner and test the callers that depend on it.
Start with the applicable section of a public specification. For nontrivial
terminal semantics, compare pinned source from at least three independent
permissive lineages. Count a frontend and its shared engine once. Describe
where a host diverges and identify any corresponding Profile behavior.
For a pure adapter or documentation change, name the applicable contract
and explain which terminal comparisons are inapplicable.
Standards and reference lineages.
Use public standards and permissively licensed material such as MIT,
ISC, Apache-2.0 and BSD. Before reading or searching external source or
fixtures, pin the revision, read its LICENSE or COPYING, and
check the applicable per-file, nested and vendored notices. Inspect a
file's header for its terms before reading its implementation. Limit
searches to paths whose terms you verified. Record the revision, files
and terms alongside the observations.
Quarantine GPL, LGPL, AGPL and MPL implementations, including kitty, pyte, libvte, asciinema, fish-shell and helix. Exclude their code and fixtures from source reads, searches, adaptations and translations. When useful, observe a permitted runtime as a black box with independently derived inputs. Treat pyte this way. ADR 0001.
Replay a minimal stream whole and split inside UTF-8 and controls. Match geometry, modes and any ordered resizes. Compare exact state or replies. Record the first divergent byte or event with expected and observed state, or record agreement. For a multiplexer, distinguish application bytes from the attached-client wire. Use private sockets for native tmux and record the server version. Record concrete gaps and keep unrun checks unverified.
Honor the Python 3.12 compatibility floor, empty runtime dependencies and
the root import contract. import libvt performs no I/O and leaves
asyncio, pty and pytest unloaded. Keep supported signatures
precise. Run a valid call and a plausible misuse through ty.
Review truncation, cancellation, end of stream and retries where relevant.
Update examples, docs, CHANGES and MIGRATION when their public
contracts change. Project gates.
Make the regression fail for the stated reason on the pinned base before editing. For a PR-only defect, record the base result and fail on the untouched PR head. Run the test with the repair, deliberately break the repaired behavior in a disposable checkout, observe the intended failure, restore and retest. Exercise the public entry points the report names.
Use exact rows, cursor, wrap state, style spans and copy-on-write isolation for screen regressions. Choose the boundaries that can trigger the defect.
- One column, a wide glyph at the last column, combining clusters,
background-color erase on a styled blank (
used > 0,text_used == 0), and scrollback boundaries. - Held and committed
?2026frames and ordered resizes. - Native POSIX and Windows spellings, clipped regions and explicit URI rules for path handling.
- Stream and PTY EOF, cancellation, backpressure and private socket ownership for transport and multiplexer changes.