thing-tui: live terminal host (cut 8b) #26

Merged
eureka merged 19 commits from hands/thing2-tui-host into main 2026-11-29 01:54:21 +00:00

2026-11-29

Meta Vens
thing-tui: Drop restores first, then frees the one-guard slot
All checks were successful
Portable Eve contracts and browser lowering / ubuntu-latest eve-browser-lowering (pull_request) Successful in 2m24s
Portable Eve contracts and browser lowering / ubuntu-latest eve-contracts (pull_request) Successful in 43s
An enter racing a drop is refused until the terminal is given back. The race is forced with a
barrier inside the old guard's restore write, not a timing assumption.

Per thing2:ruling:tui-panic-restore-rule and thing2:finding:cut-tui-host.s3.drop-unregisters-before-restoring.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 02:44:58 +01:00
Meta Vens
thing-tui: a restore that finds the writer held writes the restore bytes to a fresh stdout
The hook, in every build, claims the restore once, writes it to a fresh io::stdout() handle and
turns raw mode off; Drop then has nothing left to write. Proven by pty probes (unwind with and
without a destructor panic, and an abort build): red before, green after.

Per thing2:ruling:tui-panic-restore-rule and thing2:finding:cut-tui-host.s3.abort-lock-held-leaves-screen-modes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 02:44:07 +01:00
Meta Vens
thing-tui: a panic on the main thread restores a guard whatever thread owns it
A main-thread panic ends the process without running a guard held by a render thread, so the
owner-only rule left the terminal raw. restores_here takes is_main as well as abort, owner and here.

Per thing2:ruling:tui-panic-restore-rule and thing2:finding:cut-tui-host.s3.main-panic-with-guard-on-worker-leaves-raw.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 02:43:38 +01:00
Meta Vens
thing-tui: one live terminal guard per process
All checks were successful
Portable Eve contracts and browser lowering / ubuntu-latest eve-browser-lowering (pull_request) Successful in 4m4s
Portable Eve contracts and browser lowering / ubuntu-latest eve-contracts (pull_request) Successful in 2m19s
A second enter or stdout() while one is alive fails with AlreadyExists, so nested and cross-thread
guards are impossible and no guard can take the terminal from another. The registry becomes one
slot; the several-guards unregistering and its test go. The refusal is pinned in their place, and
every test that builds a guard takes a lock so the suite's threads do not collide.

Per the steward's decision on thing2:finding:cut-tui-host.s2.guards-share-global-modes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 02:30:29 +01:00
Meta Vens
thing-tui: the guard's owner is the thread that last entered or drew through it
A guard moved to a render thread follows its user: that thread's panic restores before its
message, and a panic on the thread that gave it away leaves it to the owner.

Per the steward's decision on thing2:finding:cut-tui-host.s2.guard-owner-is-the-constructing-thread.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 02:29:08 +01:00
Meta Vens
thing-tui: a restore that finds the writer held still gives back raw mode
Per the steward's decision on thing2:finding:cut-tui-host.s2.restore-skipped-under-lock-leaves-raw;
the double-panic case is run in a pty (red before this commit, green after).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 02:28:14 +01:00
Meta Vens
thing-tui: under panic=abort the hook restores for a panic on any thread
Nothing unwinds to Drop there, so the owner-only rule left a worker's panic to abort the process
with the terminal still raw. Unwind builds keep the owner-thread rule.

Per the steward's decision on thing2:finding:cut-tui-host.s2.abort-profile-worker-panic-leaves-raw.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 02:28:07 +01:00
Meta Vens
thing-tui: pin that a drop unregisters only its own guard
All checks were successful
Portable Eve contracts and browser lowering / ubuntu-latest eve-browser-lowering (pull_request) Successful in 2m18s
Portable Eve contracts and browser lowering / ubuntu-latest eve-contracts (pull_request) Successful in 2m4s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 02:16:16 +01:00
Meta Vens
thing-tui: the pipeline events test says what it observes
Per the steward's decision on thing2:finding:cut-tui-host.s1.report-overclaims-and-misses-estimate;
the estimate is explained in the report.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 02:11:39 +01:00
Meta Vens
thing-tui: restore closes a synchronized update a failed frame left open
Per the steward's decision on thing2:finding:cut-tui-host.s1.restore-leaves-sync-update-open.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 02:11:29 +01:00
Meta Vens
thing-tui: the guard's surface is stdout, enter and draw
write_enter, write_restore and enter_without_raw_mode leave the public API; their tests are
unit tests in the crate. Every constructor that enters (enter, stdout) installs the hook. The
seams are pinned out of the API by compile_fail doctests.

Per the steward's decision on thing2:finding:cut-tui-host.s1.public-api-test-seams.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 02:10:41 +01:00
Meta Vens
thing-tui: pin that building a guard installs the panic hook
Per the steward's decision on thing2:finding:cut-tui-host.s1.panic-hook-install-untested.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 02:09:43 +01:00
Meta Vens
thing-tui: the panic hook restores only a live guard, on the thread that owns it
A guard registers when entered and unregisters on drop; the hook restores through the
registered guard's own writer, claims the restore once so unwinding does not repeat it, and
leaves a panic on any other thread, or after the drop, to the previous hook. Every
constructor that enters installs the hook.

Per the steward's decision on thing2:finding:cut-tui-host.s1.panic-hook-owner-blind.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 02:09:38 +01:00
Meta Vens
thing-tui: pin tolerate and the meta modifiers
All checks were successful
Portable Eve contracts and browser lowering / ubuntu-latest eve-browser-lowering (pull_request) Successful in 2m25s
Portable Eve contracts and browser lowering / ubuntu-latest eve-contracts (pull_request) Successful in 2m38s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 01:56:14 +01:00
Meta Vens
thing-tui: a draw of no ops writes nothing
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 01:52:25 +01:00
Meta Vens
thing-tui: mouse capture is not a byte sequence on Windows
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 01:51:15 +01:00
Meta Vens
thing-tui: saturated move expectation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 01:45:20 +01:00
Meta Vens
thing-tui: clamp a cursor move below crossterm's overflow
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 01:41:53 +01:00
Meta Vens
2026-11-29 01:41:25 +01:00