Repository navigation
to-human: a resumed history's raw rows are the engine's scrollback (board #105) - #286
Merged
Merged
Conversation
The cause is the engine's, not the view's. On a --resume start the engine draws the resumed transcript in its first frame, before the plugins' hooks modules load (0.2 to 1 s later), so that frame is its own drawing. Once to-human loads, the engine asks it about every mounted row, and the view folds them all from its first answer: the history's marks turn it on (hasSeenMark is set from history), and native() passes nothing on the terminal. On the main screen, though, the rows the first frame pushed past the screen's top are in the terminal's scrollback, which the renderer never writes again: it skips a changed cell above the screen, and its full reset repaints the screen's rows alone. They stay raw for good, a new marked message included. Fullscreen repaints the whole alternate screen, so there the history folds to its first row. No hook reaches the scrollback, so nothing in to-human changes. The unit test pins the view's side (a resumed marked row folds from the module's first answer); live-resume-check.py pins the engine's (first frame before the module, scrollback raw on the main screen, folded in fullscreen), and fails the day the scrollback comes out folded. Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)
- The unit test counts the engine's own drawings for the row, so a first answer that came out raw fails it even though the kit redraws the invalidated mount before a find reads it (a mutant that folds only on the redraw now fails). - The live check unlinks the env file before anything else in cleanup, tolerates a missing tmux, and runs the cleanup on SIGTERM and SIGHUP. - It matches the engine's bullet off macOS (● there, ⏺ on macOS), and says "changed" only when a raw first frame was seen. - The fullscreen check proves it reached the history's top. Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)
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.
Board #105: after
claude --resume, a session's marked history drew raw (⏺ <message>…) instead of folding into the to-human report view.Cause
The engine causes this, and none of the ticket's three candidates is quite it.
--resumestart, Claude Code (2.1.304) draws the resumed transcript in its first frame before the plugins' hooks modules load. A live run measured the raw text on screen 0.8 s beforehooks module to-human … loaded. Once the module loads, the engine bumps the render version (tWn()) and asks to-human about every mounted row again, so this candidate does not explain lasting raw rows.native()passing them through: no. On the terminal surface it returns false.hasSeenMarknever set from history: no. An instrumented copy of the mod logged its first answer about every history row as folding:seen=true folding=trueon the very first call.What stays raw is the terminal's scrollback. On the main screen (the default, not
tui: "fullscreen"), rows that the first frame pushed past the screen's top are in scrollback, and the renderer never writes them again:ye < Qincli.pretty.js~862260);Al()/eot()) clears and repaints only the screen's rows.Resizing, Ctrl+L and a new marked message all leave those rows raw; each was observed live. Rows still on the screen fold as soon as the module answers. In fullscreen the whole alternate screen is repainted, and the history folds right up to its first row.
A hook cannot reach the scrollback, and the mod API has no way to reprint it, so this PR changes nothing in to-human. The fix belongs in the engine. It could load hooks modules before the first transcript frame, or hold a row that a not-yet-loaded module will draw, the same way it already holds a hooked row whose answer is pending (
drawPending). The owner runstui: "fullscreen", where this does not happen.I could not reproduce one claim from the rehearsal: that everything folds after the next marked message. In every main-screen run the scrollback stayed raw after a new message. Every other case I tried folded right after the module loaded: a short history, a module loading 4 s late, an in-session
/resume, and doperpowers loaded alongside.What this PR adds
to-human/tests/mods/to-human.test.ts: a resumed marked row folds from the module's first answer, with no earlier mark. This pins the view's side and rules out candidates 2 and 3.to-human/tests/mods/live-resume-check.py: the engine's side, live, in a temporary HOME driven through tmux. It makes a two-message history (two haiku calls), then resumes it on the main screen and in fullscreen. It checks that the first frame comes before the module loads, that the module is asked about the long row, that the band is on, that on-screen rows fold, that the scrollback head stays raw, and that fullscreen folds to the top. The scrollback check fails, naming docs(sminos): design spec — the human stream #105, on the day the engine starts repainting scrollback. A run against 2.1.304 passed all 6 checks.No version bump: nothing a session loads has changed.
Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)