feat(core): add normal resize recovery - #57
Conversation
zikolach
left a comment
There was a problem hiding this comment.
AI-assisted comprehensive review (Pi coding agent). I reviewed the OpenSpec proposal/design/deltas/tasks, public API, owner scheduling, stale/stop behavior, recovery/live publication, append chronology, cursor/mouse/control ownership, diagnostics/redaction, JVM/Native scope, PTY coverage, and documentation.
I found two blocking contract/design issues and one documentation mismatch in the inline comments. The implementation is otherwise unusually thorough: the text-only authority boundary, one-write publication, live-only differential baseline, fail-fast validation, diagnostics, and test coverage are well structured.
Validation performed:
mill core.test: passed (135 test classes)mill scalafmtCheck scalafixCheck: passedopenspec validate --all --strict: 15/15 passedgit diff --check: passed- focused local same-geometry probe: failed as described inline
- GitHub CI: both JVM/package and macOS terminal-conformance jobs pass
Review readiness: needs design clarification/fixes before merge, primarily so an application can actually select only the invalidated durable tail rather than necessarily over-replaying on viewport growth.
Summary
NormalResizeRecoveryProviderand positiveNormalResizeRecoveryContextAPIs plus opt-inTUIOptions.normalResizeRecoverypreviousFrame, preserve live-frame-relative cursor/mouse/layout state, and place later appends inrecovered -> appended -> live frameorderSafety and scope
The first version returns ordinary
Vector[String]lines rather thanComponentRender, so recovery cannot acquire component, cursor, image, cleanup, or raw-terminal authority. Siglyph retains no transcript and cannot inspect emulator scrollback; applications remain responsible for current-width semantic tail selection and terminal-dependent deduplication.No terminal backend API or third-party runtime dependency changed.
Validation
mill core.test— passedSIGLYPH_NATIVE_CLANG=/usr/local/opt/llvm/bin/clang SIGLYPH_NATIVE_CLANGPP=/usr/local/opt/llvm/bin/clang++ mill coreNative.test— 38 test classes passedSIGLYPH_NATIVE_CLANG=/usr/local/opt/llvm/bin/clang SIGLYPH_NATIVE_CLANGPP=/usr/local/opt/llvm/bin/clang++ mill __.compile— passedmill scalafmtCheck— passedmill scalafixCheck— passedscripts/test-terminal-pty.sh— passed on macOSopenspec validate --all --strict— 15 passed, 0 failedgit diff --checkManual Kitty/iTerm2/conventional-emulator persistence checks are documented but were not available in this non-emulator test environment. PTY coverage verifies byte ordering,
CSI 3 Jabsence, synchronized output, append chronology, and restoration without claiming emulator persistence.Closes #56