Protocol-driven verification for autonomous terminal applications.
Project description
TermVerify
Protocol-driven verification for autonomous terminal applications.
TermVerify is a Python library and reference toolkit for testing terminal and TUI applications through reproducible interaction. It combines direct semantic adapters with real PTY-driven runs, then compares structured observations rather than relying only on brittle raw-terminal snapshots.
Why
An autonomous coding agent is most reliable when it can make a change, exercise the actual program, observe meaningful results, and leave behind replayable evidence. Terminal applications need this especially badly: unit tests alone do not prove that key bindings, focus, rendering, prompts, and real interaction work.
TermVerify provides a common foundation for:
- deterministic interaction transcripts and replay;
- semantic state and UI observations;
- property/state-machine testing;
- reviewed golden snapshots;
- differential tests against a reference implementation or execution mode;
- failure minimization and CI-ready artifacts.
Project status
The repository is in its foundation phase. The reviewed transcript design has
an initial codec, semantic validator, mandatory safe transcript-persistence
boundary, immutable producer-side adapter contract, and deterministic in-process
direct runtime. Requested timezone names and semantic key chords use closed,
protocol-owned v1 registries; semantic keys also have an immutable direct-dispatch
representation. The canonical transcript schema ships inside the package with a
public access API, and isolated installation checks verify the wheel and sdist
resource contract; the schema's $id resolves at
termverify.dev
as a byte-identical mirror of the committed resource, and runtime validation
remains authoritative. A strict no-regression coverage floor gates the full
suite. Release governance is defined — changelog and pre-1.0 compatibility
policy, private security disclosure, reviewed release checklist, and a
tag-triggered attested draft-artifact workflow — although no release is
authorized and nothing is published to a package index. A Windows ConPTY
adapter with Windows-matrix evidence covers native pseudoconsole ownership
and close, end-of-stream draining, process-tree teardown,
cancellation/recovery, resize epochs, and replayable evidence normalization,
and the first fully verified terminal run has landed using opt-in
cooperation-tier constraint ports: the six non-terminal constraints are
delivered to the subject's environment with truthful delivered receipts,
honored by subject cooperation rather than OS enforcement. OS-level
containment is an explicit non-goal by recorded owner decision; TermVerify
verifies applications whose authors control the subject and is not an
execution sandbox for adversarial code. Configuration values or receipt
construction alone do not prove constraint enforcement.
Design principles
- Semantic evidence first. Verify state, events, and explicit UI semantics before comparing raw ANSI output.
- Production interaction still matters. PTY/terminal tests validate the application a person or agent actually drives.
- Determinism is a contract. Seeds, clock, locale, terminal size, filesystem sandbox, and network policy are explicit.
- Human review owns baselines. Agents may propose snapshot updates; they never silently bless them.
- Harness-neutral by default. The project works with Hermes, Claude Code, Codex, OpenCode, and ordinary CI without a required proprietary integration.
Planned architecture
application under test
├── direct semantic adapter ── fast properties, replay, differential tests
└── PTY adapter ───────────── real terminal interaction and rendering evidence
│
TermVerify
├── run configuration and interaction protocol
├── observation normalization and comparison
├── transcript replay and shrinking
├── property/state-machine support
└── reports and CI artifacts
See the knowledge bundle for the durable architecture and verification model. Browser bridging is deferred until the terminal vertical slice proves a shared abstraction is necessary.
Development
Requirements: uv and Python 3.12 or newer. The minimum installer version is 3.12; the continuously supported and tested versions are currently 3.12 through 3.14. Support for later Python releases is not implied until they join the CI matrix.
uv --no-config sync --all-groups --locked
uv --no-config run pytest --cov --cov-report=term-missing
uv --no-config run ruff check .
uv --no-config run ruff format --check .
uv --no-config run mypy src tests scripts
uv --no-config run pre-commit run --all-files
uv --no-config run pre-commit run --hook-stage pre-push --all-files
uv --no-config build
uv --no-config run pre-commit install --hook-type pre-commit --hook-type pre-push
See developer workflow and contributing guide. External subjects implementing the producer contract start with the adapter-author surface.
License
Apache License 2.0. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file termverify-0.1.0.tar.gz.
File metadata
- Download URL: termverify-0.1.0.tar.gz
- Upload date:
- Size: 67.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
652ab85a31943a242844f6b8ebfe86746e08056addb6d47ef9fded660fc4dd8c
|
|
| MD5 |
3b933080b00bacd2c1047ca34b45c03c
|
|
| BLAKE2b-256 |
dd5cf86c1c15493fc873b1b0572fd669c4f3a3a0485fb82a985908a76e1b9aeb
|
File details
Details for the file termverify-0.1.0-py3-none-any.whl.
File metadata
- Download URL: termverify-0.1.0-py3-none-any.whl
- Upload date:
- Size: 76.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe8ed29ac2d488e5f898ca149d167a6f09732c22f99e7db5a2bcd0a8cb788f62
|
|
| MD5 |
046a1227eefdfbfd2cef22b0ba246059
|
|
| BLAKE2b-256 |
cc3dba0246ca21921aae5bdbfa368bf1d6a09bb6c5610d9dee7a7e2a1fe73926
|