Skip to content

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

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

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

Conversation

@raiseCatError

@raiseCatError raiseCatError commented Oct 10, 2026 •

Copy link
Copy Markdown
Owner

Compare Output compares chosen stored command snapshots without changing the transcript or program output. Reviewed comparison exports sanitize/redact source fragments before Markdown formatting, preserve stable selections and copy exactly the approved text. Cancellation, edit rescans, hostile boundaries and short-panel approval guards share the report safety contract. Redaction is best-effort; a failed external writer cannot guarantee rollback of prior clipboard writes.

The additive stabilization fixes catchable startup termination and frontend cleanup. SIGTERM/SIGHUP handlers precede host-probe/journal waits; stopped probe completion cannot create a journal, and saves already underway retain durability. Stop removes only the frontend's instance-owned exit callback, preventing retention across session switches while preserving unrelated listeners. Controlled regressions fail before correction and pass afterward; assertions and deadlines are unchanged.

The reattach fixture waits for the complete final-size native pager frame and prompt before a single quit key, retaining original deadlines and strict cleanup. Bounded failure-only observations distinguish repaint from quit completion. Controlled native less read/WINCH evidence establishes a signal/input hazard; it does not reconstruct historical CI failures.

Native completion retains fragmented readiness within a bounded initialization buffer and recognizes the complete LF/CRLF marker without resetting existing budgets. A real-PTY regression fails before correction and passes afterward, including naturally fragmented reads. This independently confirmed framing fix does not establish the historical Copy recovery failure cause.

Clipboard completion requires an error-free payload-write callback and the backend’s own successful exit, retaining original error/timeout/process cleanup safeguards. Real-child regressions cover suppressed finish, partial reads and callback errors after exit. Early fullscreen startup regressions submit before the notice through the actual editor/submit pipeline, including delayed journal startup; original input/abort/ownership assertions remain intact. This proves independently controlled defects/fixture assumptions, not the precise historical failure causes.

Published head: f1abe217c6a27034a93182bf423dfb45e18ef73d. Focused lifecycle/startup/clipboard, clean exact-head canonical build/full runtime/ranking/cleanup/diff verification pass. Comprehensive candidate CI 38584973991 passes every required job, including Fedora/timing; actual PR CI 38585746229 passes applicable platform/runtime/aggregate gates. Attempts: 1/1.

The earlier candidate CI 38569811366 hit its original Ubuntu shard 1/2 job limit and remains preserved and unattributed. Exact-source arm64 and hosted x64 observed controls recorded every worker and PTY exit; this separate uninstrumented confirmation passes without diagnostic scheduling overhead. The observed branch is not promoted into the feature.

Shared acceptance, exact ancestry, remaining gates and retained historical failures are tracked in #359 and the durable handoff. Historical macOS/Ubuntu failures remain unattributed; new passes do not explain them. Native pager input during concurrent resize remains a physical QA limitation. Forced SIGKILL can bypass detached-helper cleanup while trusted configuration blocks it. No release/master merge or frontend integration occurs here.

Physical QA remains unperformed in Ghostty/Terminal.app across zsh, Bash and Fish: stable snapshot selection, reviewed comparison bytes, sensitive edits/cancellation/backend failure and narrow/short review navigation. Automated/headless results do not claim this validation.

Refs #352
Refs #359

- 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.
@raiseCatError

Copy link
Copy Markdown
Owner Author

Integrated, not merged here: this head (f1abe217) is part of the release line that shipped in v0.20.0 through the authoritative release PR #392 (merge commit 65e4de55). Closing because its changes reached master by that route; the branch is kept for history.

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