Skip to content

Compare output: diff two runs of a command - #361

Draft
raiseCatError wants to merge 26 commits into
feature/copy-reportfrom
feature/compare-output
Draft

raiseCatError wants to merge 26 commits into
feature/copy-reportfrom
feature/compare-output

Conversation

@raiseCatError

@raiseCatError raiseCatError commented Oct 10, 2026 •

Copy link
Copy Markdown
Owner

Stacked on #360. Refs #352. Part of #359.

  • Entry points: Actions → Compare output…, /compare, /compare N, /compare N M.
  • Suggestion: previous run of the same command; any block can be chosen. Records are identified by object/startId from a snapshot, never by screen position.
  • Diff: bounded Myers line diff, computed lazily; changed/added/removed counts; hunks with context; unchanged regions collapsed; refuses honestly when outputs cannot be aligned.
  • View: side by side ≥140 columns, unified otherwise; n/N; explicit, labelled whitespace normalization; NO_COLOR/Safe glyph-safe text.
  • Copy: c unified diff; r comparison report through the shared report review (wrapped, redacted, exact text).
  • Honesty: records that lost output while detached carry outputIncomplete and comparisons say so.
  • delta: considered; not integrated in this slice. The native view needs no dependency, and delta's paging/TTY handoff would add a second presentation for little gain. Documented in docs/design/terminal-workflow.md.

Tests: tests/compareOutput.test.ts (randomized reconstruction, counts, hunks, headers, normalization, unaligned, 5000-line timing, panel keys and layouts, hostile text, report review), tests/compareOutputLive.test.ts (real PTY: /compare, copy diff, bare /compare, missing numbers).

Review gate

  • Automated current-head security coverage for #363 check diff content sanitization, terminal escape/Markdown injection, report review vs direct diff copy, exact clipboard bytes and narrow rendering against current HEAD.
  • Physical terminal QA remains outstanding. Stacked on Copy as Report: reviewed Markdown/plain reports from command blocks #360 and remains draft; no release/master merge.

Stabilization evidence — 2026-10-12

Published head: 032365e2ffa9fd42563ae93e66fd487b41e66841. Serialized macOS npm run verify passed on this exact head with no failures or skips. Applicable latest-head Ubuntu/macOS shards, Quality, Node 22 compatibility and aggregate CI passed: https://github.com/raiseCatError/notMyShell/actions/runs/38239217178.

Settled fullscreen handoff now restores terminal modes/full geometry/raw input while journal IO is pending. Initial saves still serialize and acknowledge only after durability; shutdown restores input before waiting for persistence. Ordinary startup retains its durable initial journal identity barrier. Held-save regressions cover both boundaries, acknowledgement and shutdown; real detached-output, fullscreen, vim/less lifecycle cases passed. The isolated tmux bridge fixture now resolves an installed host binary while retaining its private socket directory.

The unpublished broader startup candidate failed canonical duplicate-journal acceptance and was corrected before publication. The earlier 15644abd Ubuntu fullscreen failure passed unchanged-head retry, but its precise historical blocking phase remains unestablished. Complete evidence and dispositions are recorded in #359.

Report/comparison security fixes redact source fragments before generated Markdown, preserve exact review approval, reject unrenderable review geometry, and use iterative delimiter sizing for bounded hostile output. Direct diff copying remains sanitized and explicitly unredacted.

The full workflow gate remains pending both final sibling heads' canonical/CI and final Linux/Fish 3.7 acceptance. Ghostty/Terminal.app physical QA has not occurred. The PR remains draft; no master/release merge, tag or release. Refs #359, #363, #356.

- Actions → Compare output… and /compare [N [M]] (numbers as /copy shows them). The previous run of
  exactly the same command is suggested; any other completed block can be chosen. Bare /compare goes
  straight to the latest output and its previous run.
- Faithful by default: a Myers line diff over the stored output, bounded (outputs too different to
  align are said to be so instead of shown as a misleading diff). Changed, added and removed lines,
  three lines of context, unchanged regions collapsed; A is always the older run.
- Side by side at 140 columns or wider, unified otherwise; n/N between changes; w ignores whitespace,
  labelled wherever the result is shown or copied; both sides named by command, time and exit code.
- c copies a unified diff (feedback inside the panel). r opens the comparison report in the same
  review as Copy as Report: wrapped, redacted, exactly the text Enter copies.
- Output a detached session could not keep is flagged on its record (outputIncomplete) and said in
  comparisons; missing output is said, never guessed.
…reviewed, safe text

The plain diff copy now strips control and invisible characters like a report does and says when it looks sensitive and is not redacted. The comparison report cleans the diff before sizing its fence (hidden characters and Unicode line separators could close it) and writes each side's label as safe inline code.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant