Skip to content

Add direct FIRE cases for libvt - #195

Merged
tony merged 10 commits into
masterfrom
test/fire-direct
Dec 5, 2026
Merged

tony merged 10 commits into
masterfrom
test/fire-direct

Conversation

@tony

@tony tony commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

Closes #194

What changed, and why

An orchestrator can read a new working row while libvt still exposes the previous committed row. The direct FIRE suite exercises 210 distinct behaviors spanning parsing and Unicode, cursor and margins, grid edits, rendition, replies, buffers, synchronized output, replicas, application input encoding, and resize.

Each byte-driven vector reads the same checkpoints after whole-action or one-byte feeds. Nine input-only vectors encode a semantic event once. A short cursor move trips only cursor_after_move. Dropping the synchronized release trips only committed_after_release. The replica starts with alternate-screen rows and must replace them with primary rows before it applies another incremental update.

Each attempt writes fire.json with its exact feeds, profile, and named expected and observed values. The testing guide cites the rules behind the expectations and gives commands to find a report and replay its test. A committed consumer must see a green repaint even when the word stays the same. A resize invalidates a token acquired at the old geometry. Case families, sources and replay instructions

Checks run

The direct selection ran 415 items. Of 210 subject vectors, 201 ran under two feed schedules and nine ran once. Two deliberately damaged-witness controls ran under both schedules. All 415 passed in a fresh CPython 3.14.6 environment with subprocess creation blocked. The full project run passed 782 with one optional skip.

Ruff lint and format checks, ty, the full pytest suite, and just build-docs passed on Linux with CPython 3.14.6. The direct cases also passed on CPython 3.12.3 with no tmux, no libtmux, and an audit hook blocking child launches. A simulated shared reply queue failed peer isolation. Skipping the stale-epoch rebuild left the replica on ALT and failed recovery. Both faults failed under both delivery schedules. Separate mutations also caught returned stale tokens, a same-word repaint omitted from the replica, an attached hyperlink after close, dropped keyboard flag bits and an old geometry token accepted after resize. The two schedules recorded identical concatenated inputs and observations, and a recorded pytest node replayed successfully.

Tool use

Codex wrote the tests and guide from protocol references and libvt's public contracts. It ran the fault controls and checked the saved records against the inputs and expected values.

tony added 3 commits December 4, 2026 19:24
why: An orchestrator needs to tell working state, published state,
and reply bytes apart when terminal input arrives in fragments.

what:
- Replay whole actions and single bytes against the same expectations.
- Prove the cursor and publication checks catch one wrong result each.
- Rebuild a replica from foreign and stale tokens, then apply a delta.
why: Give contributors the command and protocol rules for rerunning
the cursor, publication, and recovery checks.

what:
- Show the cursor vector as a tested example.
- Describe which comparisons the two faults trip.
why: Draining the primary first can hide a reply queue shared by two
terminals.

what:
- Check the peer's working view and reply queue before draining
  the primary reply.
why: A stale replica must visibly change during a rebuild. Keep feed
bytes and observations available after pytest exits.

what:
- Restore the primary rows over a replica holding alternate rows.
- Save named results and concrete feeds from each test attempt.
- Show how to find and replay the saved cases.
why: Pytest creates the base directory without creating its parent.
A clean checkout has no .pytest_cache.

what:
- Use a standalone evidence directory in both commands.
- Explain that pytest clears a base directory when it already exists.
tony added 2 commits December 5, 2026 05:35
why: Cover parser, screen, reply, and replica behavior with enough
independently specified vectors to catch failures across those boundaries.

what:
- Add 144 authored behavior vectors through Terminal's public API.
- Check named snapshots, cell fields, replies, and applied replica rows.
- Keep exact feed calls and expected and observed values per attempt.
why: Make the scope and the recorded evidence discoverable.

what:
- Count behavior vectors separately from delivery schedules and controls.
- Cite the protocol editions and identify each demonstrated fault.
@tony
tony merged commit 8ba3fa1 into master Dec 5, 2026
9 checks passed
@tony
tony deleted the test/fire-direct branch December 5, 2026 20:42

This branch was successfully deployed

1 active deployment
docs — 42c51295 Deployed Dec 5, 2026 by tony via build (3.14) #378
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a direct FIRE test for terminal state, replies and recovery

1 participant