fix(tui): harden split input and paste recovery - #699
Closed
yxlyx wants to merge 2 commits into
Closed
Conversation
Dropped and delayed terminal sequences could cancel live work, execute pasted control bytes, retain stale modifiers, or leak protocol tails into the composer. Preserve bounded framing evidence across reads, fail closed on ambiguous debris, keep paste dispatch ahead of controls, and make turn/background spawn failures non-blocking across the fullscreen TUI runtime.\n\nAdd reached simulation, parser, batching, and offline PTY regressions for every affected idle, live-turn, compact, bash, and file trajectory.\n\nCo-Authored-By: Codegraff <blackfloofie@codegraff.com>
Rebasing the input-recovery fix onto v0.0.282 pushed two touched modules over the source ceiling. Move their existing test blocks into reached siblings and set the suite floor to the deterministic macOS pass count, where the remaining platform test is reported as a skip rather than a pass.\n\nCo-Authored-By: Codegraff <blackfloofie@codegraff.com>
12 tasks
Owner
|
Folded onto Kept 283's #704 tuiguard deadlines (ThreadPool + killpg) and the 1868 suite floor; added Tier 1 green on the push (TUI 505/505, tuiguard 18/18). #537 closed from the release branch. This PR can close as superseded once you are happy — leaving that to you. |
16 tasks
Owner
|
Shipped in v0.0.283 via #703 ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
/modelmutation while background compaction owns the shared runtime context.Why
Problem / failure mode
The audit findings in #537 shared one state-machine failure: when terminal input was split, delayed, truncated, or filled the read buffer, the TUI could lose framing and reinterpret protocol bytes as user controls. That could cancel live work, quit during paste, erase a draft through stale Super state, fabricate wheel/click events, type protocol debris, or freeze the renderer if thread creation failed.
Reason for this approach
Recovery now distinguishes strong evidence (a dropped non-lone sequence head) from an ambiguous genuine Escape. Strongly evidenced heads retain exact bounded framing; mismatches fail closed and fresh human input wins. Paste markers restore paste state before same-read payload, while all runtime trajectories share the same guarded batch dispatcher. This fixes the root state transitions rather than adding per-sequence string filters.
Constraints and trade-offs
[Alice].Rejected alternatives
Thread.spawnfailure preserved completion at the cost of freezing all input and rendering.Verification
scripts/eval-tier1.sh: greenscripts/test-tui-escape-split.pyCloses #537.