Harden terminal catch-up stream safety#399
Merged
Merged
Conversation
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.
Summary
This is the all-at-once terminal catch-up stream-safety implementation. It makes long-hidden terminal catch-up fast, loss-explicit, and safe across server replay batching, xterm parser semantics, attach races, side-effect parsing, stream identity, and WebSocket backpressure.
Major pieces:
terminalOutputBatchV1gated batch outputdocs/superpowers/Local proof on current HEAD
HEAD:
568befab7c9e7c44c6cc5a4e32aaaff2ad97b4a4npm run checkpassed through the coordinator on a clean worktree.full-suite|568befab7c9e7c44c6cc5a4e32aaaff2ad97b4a4|dirty:0|node:v22.21.1|linux|x64npm run perf:audit:visible-first -- --output /tmp/freshell-terminal-catchup-audit-568befab.json --scenario terminal-reconnect-backlog --profile desktop_localpassed.568befab7c9e7c44c6cc5a4e32aaaff2ad97b4a4npm run test:e2e:chromium -- test/e2e-browser/specs/terminal-background-freeze-catchup.spec.tspassed.test-results/terminal-background-freeze-d47cd-t-silent-gaps-or-quarantine-chromium/terminal-background-freeze-catchup.jsonbuffered_resumedgit diff --checkpassed.Focused proof already run on the same code path before the final doc-only plan cleanup:
Final adversarial review result before the doc-only cleanup:
NO BLOCKER. The reviewer specifically checked protocol v6 enforcement, server stream identity fail-closed paths, retention-loss stream retagging, client stale attach/stream rejection, invalid batch fail-closed behavior, and lost-range checkpoint blocking.Browser acceptance scope
The local PR gate is the production-style visible-first audit plus the process-suspend stop/resume positive control on an isolated local server. Real Windows Chrome long-background soak remains useful release/user-acceptance evidence, but it is not a blocker for this PR; CDP freeze and Xvfb tab switching were previously shown not to prove stopped browser execution in this environment.