Property-based TUI tests, crash/overflow fixes, and nightly bombadil fuzz#2935
Open
domenkozar wants to merge 4 commits into
Open
Property-based TUI tests, crash/overflow fixes, and nightly bombadil fuzz#2935domenkozar wants to merge 4 commits into
domenkozar wants to merge 4 commits into
Conversation
Three user-facing TUI robustness fixes, all surfaced by the new property tests: shorten_store_path_aggressive sliced paths at raw byte offsets, panicking the whole TUI on any multi-byte activity name or store path (non-ASCII package names, evaluation paths) when shortened for narrow terminals. It now truncates by character. The progress bar underflowed when a download or task reported progress beyond its expected total; the filled width is now clamped. The quit confirmation prompt and the bottom navigation hint bar overflowed the right edge on narrow and standard-width terminals; both now use compact text that fits the available width. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Adds a deterministic property-test suite (tests/tui_proptest.rs, gated behind test-all) that drives random streams of every activity event type, with adversarial unicode/control payloads, interleaved with random UI commands and resizes down to degenerate sizes. It asserts the TUI never panics, that select_activity stays within the selectable set, that the log counter never undercounts, and that rendering fits the terminal width on standard widths. This suite found the crash and overflow bugs fixed in the previous commit. Also adds an end-to-end layer for fuzzing the real binary through a PTY: a long-lived mode for tui-replay (--hold keeps the TUI alive for input, --loop replays the trace repeatedly) and a grounded bombadil terminal specification under bombadil/, with usage docs. The bombadil layer is manual only and not wired into CI. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Adds a scheduled (and manually dispatchable) workflow that fuzzes the real TUI binary through a PTY with bombadil, pinned to v0.6.0. It builds tui-replay with deterministic-tui, runs a time-limited fuzz against the long-lived replay harness with --exit-on-violation, and uploads the reproducer trace as an artifact when a property is violated. The in-process property tests already run on every PR via the existing cargo nextest --features devenv/test-all step, so this end-to-end layer runs nightly rather than per-PR (it is slow and the trace grows fast). Also drops the quit keys (Ctrl+C / q) and CONTROL_ALL from the spec's action generator: they made the harness exit mid-run, ending the session early and tripping exitSuccess. The run is now bounded by --time-limit and exits cleanly. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
🔍 Suggested ReviewersBased on git blame analysis of the changed lines, the following contributors have significant experience with the modified code:
Please consider reviewing this PR as you have authored significant portions of the code being modified. Your expertise would be valuable! 🙏 This comment was automatically generated by git-blame-auto-reviewer Last updated: 2026-06-15T22:29:41.696Z |
Deploying devenv with
|
| Latest commit: |
d2af7a5
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://bcb6d0fc.devenv.pages.dev |
| Branch Preview URL: | https://tui-property-tests.devenv.pages.dev |
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
Adds extensive automated coverage for
devenv-tuiand fixes the real bugs it surfaced.Three layers, by design: snapshots pin exact output (existing), property tests are the fast deterministic gate, and bombadil is the slow end-to-end PTY layer.
Bug fixes (found by the property tests)
shorten_store_path_aggressivesliced strings at raw byte offsets, panicking the whole TUI on non-ASCII activity names or store paths when shortened for narrow terminals. Now truncates by character.Tests
devenv-tui/tests/tui_proptest.rs(gated behindtest-all, deterministic): drives random streams of every activity event type with adversarial unicode/control payloads, interleaved with random UI commands and resizes down to degenerate sizes. Asserts the TUI never panics,select_activitystays in the selectable set, the log counter never undercounts, and rendering fits the terminal width on standard widths.cargo nextest run --features devenv/test-allstep (the feature propagates todevenv-tui/test-all).End-to-end fuzzing
tui-replay(--holdkeeps the TUI alive for input,--loopreplays repeatedly) so a terminal fuzzer always has a live program.devenv-tui/bombadil/(action generator over devenv's real keybindings + resize/scroll, plus overflow/panic-text/exit/unicode properties)..github/workflows/tui-fuzz.yml: nightly (and manually dispatchable) job that buildstui-replay, runs a time-limited bombadil fuzz with--exit-on-violation, and uploads the reproducer trace on a violation. Runs nightly rather than per-PR because it is slow and the trace grows fast.Known follow-ups (documented, not fixed here)
#[ignore]drendered_lines_fit_usable_widthtest.🤖 Generated with Claude Code