Repository navigation
feat(qa): add an in-process QA harness with side-by-side scenarios and agent skills - #1771
Conversation
Add a qa Cargo feature and a --qa launch mode that reads one JSON command per line on stdin, runs it on the GTK main loop, injects input through in-process XTEST, and replies with a state snapshot. Add the tests/qa.rs runner, scripts/qa.sh container entry point, the shared fixture manifest, and port the arrow-keys-move-focus scenario. CI and release builds check that default binaries carry no QA code.
Add click, move, wheel, drag, button_up, resize and settle commands that mirror the Python harness timings, resolve every target kind from widget bounds including popover surfaces, log synthetic input through STRATA_INPUT_LOG, and port the single-click, copy, cut, drag, panel wheel and shift-click scenarios. Route remaining direct accessible labels that targets need through the accessibility helpers.
Add type, select_with_keyboard, open_menu, activate, remember and holds commands; field, dialog, menu_items, preview, matches, pref, editor_within_viewport and state predicates; conditional when steps; and per-run pytest twin ids validated at registration. Port the remaining thirteen core scenarios covering inline renaming, conflicts and undo, the location editor, quick preview, filter results, trash and live preferences.
Add eleven mutation patches for the core scenarios without one and rewrite rename-caret, which no longer broke anything. Add scripts/qa-parity.sh and an --qa mode for e2e-mutation-check.sh that require both harnesses to pass unmodified, fail together under each patch at the same step, send the same input within one pixel, and end in the same window state. The Python harness now reads the shared fixture manifest and can log its input and final state.
Add a QA scenarios job that builds the qa feature on the quality cache and runs scripts/qa.sh in the pinned image, and a parity plan, sharded matrix and aggregate that run scripts/qa-parity.sh on pull requests touching the app or either suite. All four jobs continue on error and no required check needs them. Fix the quoting that broke the x11rb absence check and tie the release check to the qa usage constant.
Port every node of test_keyboard_navigation, test_selection, test_click_modes, test_background_selection and test_escape_selection, 173 in all, as 53 baseline-parity scenarios. Add the commands, targets and predicates they need, a baseline mode for parity on scenarios without a mutation patch, and per-scenario CI sharding. Give railed sidebar rows a stand-in accessible label that never replaces a row's own label.
…scenarios Port every node of test_pointer_intent, test_preselected_hover, test_clipboard, test_copy_conflicts, test_drag_and_drop, test_drag_animation, test_cross_volume_drop, test_sidebar_file_drops and test_marquee_scrolling, 164 in all, as 51 baseline-parity scenarios. Add in-process screen grabs mirroring the Python pixel checks, composed targets and points, cross-device fixture volumes, and a validated per-scenario state_parity_ignore for nondeterministic final focus. Name the dialog close button explicitly instead of by tooltip.
…files Each scenario ports one Python test function, so it now lives under tests/qa/scenarios/<test file>/. The runner, qa.sh and the parity script look scenarios up across the folders, and the registration test checks that every file sits in its twin's folder.
Port every node of test_inline_renaming, test_rename_visibility, test_entry_management, test_created_entry_columns and test_dialogs_and_menus, 173 in all, as 57 baseline-parity scenarios, including the remaining inline-rename parametrizations. Add toplevel and described role targets, setup steps, conditional branches on expect flags, separate field and widget memory, and the predicates these tests need. Name the folder colour dots and the Settings close button explicitly instead of by tooltip.
Port every node of test_filter_results, test_search_filter_sort and test_locations, 199 in all, as 53 baseline-parity scenarios. Add result row targets, pixel and accent checks, teardown steps, and contained fs remove and rename actions. Name parity HOME directories after the twin in both harnesses, wait for F5's reload in both unreadable-location twins so each clicks once, and label the sort-direction button explicitly.
Port test_recent, test_tabs, test_view_switching, test_column_background, test_column_headers, test_popover_scrolling, test_monitor_selection, test_quick_preview, test_preview_session and test_preview_media_controls, 122 of 126 nodes, as 57 baseline-parity scenarios; the large-table sort test stays Python-only. Release tapped keys with an XTEST server-side delay so a slow frame can no longer trigger autorepeat, add numeric compare, clipboard and flag steps, and a validated per-scenario input_parity_ignore for the PDF zoom-centre race. Label preview and pane buttons explicitly with their existing tooltip text.
…hive scenarios Port every node of test_preview_media_layout, test_preview_video, test_properties_media, test_properties_size, test_open_with, test_custom_actions, test_terminal, test_file_providers, test_file_manager_interface, test_browser_workers, test_thumbnail_worker_settings, test_archive_activation and test_archive_conflicts, 98 in all, as 53 baseline-parity scenarios. Add a private session bus, app restarts that terminate the process group like the Python harness, guarded process and filesystem steps, and generated media, archive and thumbnail fixtures. Route remaining direct accessible labels and descriptions through the helpers.
…size and accessibility scenarios Batch 7 ports 48 Python E2E functions (109 node ids) to QA twins and adds a --qa --portal mode, multi-window, restart-stream, foreign drag, HTTP and portal runner steps. Parity exemptions can now name key events and typed digit runs, and state_parity_ignore accepts ["*"]. A scenario header can carry a skip reason that keeps it out of the default run and out of parity; settings-text-size-keeps-switches uses it until its app race is fixed. The preferences fixture now honours indirect params, so the compact sidebar-reordering case applies sidebar_compact.
Batch 8 ports the 9 visual-baseline tests. A runner `baseline` step captures the root window and compares it with the committed baselines, using the Python harness's channel threshold and budget; it never writes baselines. The `fixture_root` header builds the fixture at the same fixed path as the twins, one run at a time. qa_parity pairs xdist-grouped node ids (`@<group>`) with their twins. Every collected Python scenario now has a QA twin, is Python-only, or is the twin of a skipped scenario.
Each scenario ran its variants one after another inside a single libtest test, and libtest started tests alphabetically, so a few large scenarios late in the alphabet left a long tail. A small custom harness (tests/qa/harness.rs) now runs every scenario run as its own test, ordered by a benchmarked `cost` in the scenario header. It accepts libtest's command line and output formats, so qa.sh, qa_parity, the mutation check and the CI quality shards keep working. scripts/qa_cost.py refreshes the costs. A full run at 24 threads drops from 160 s to about 115 s; at 48 threads, from 108 s to 69 s.
- Wait on a child's pidfd instead of polling its exit every 50 ms. - Pick display numbers without a global lock; -displayfd and Xvfb's own lock file already settle a race between two starts. - Let await_ready wait for the next paint instead of a 50 ms sleep. - Share one Mesa shader cache across the runs in a container. - Give the QA container a tmpfs /tmp, so per-run font writes don't fsync to overlayfs. The fixed cost per run drops from about 589 ms to 388 ms; a full run at 24 threads from 113 s to 103 s, and at 48 threads from 68 s to 63 s.
…lity scores Three project skills, committed under .agents/skills/ and linked from .claude/skills/: - qa-scenarios: writing and managing QA scenarios and the --qa protocol. - qa-drive: verifying a change by driving the app in the pinned container with the new scripts/qa-drive.sh. The container setup it shares with qa.sh moves to scripts/lib/qa-container.sh, and a script test catches drift from the runner's constants. - qa-quality: a rubric that scores a scenario's impact, coverage, criticality and diagnostic precision into the optional `quality` header field, whose shape and score formula the runner now checks. A scenario's `twin` is now optional. One without a twin lives in a snake_case feature folder, is left out of parity, and may not carry parity-only keys. hidden_files/hidden-files-persist-across-restart is the first such scenario.
…apping pairs together Re-grade the 43 scenarios whose quality notes counted the Python suite as coverage; only QA scenarios and Rust tests count now. Score nine pairs of near-duplicate scenarios side by side, so only the scenario whose behaviour is a subset of its partner's takes the lower coverage, and both notes name the partner.
# Conflicts: # .github/workflows/ci.yml # tests/e2e/harness/environment.py
…ce changes Upstream hides an empty Pinned section until a file drag reaches the sidebar, offers Keep Both for move conflicts, and extended and renamed the shortcut-reference twin to cover search editing. Mirror each in the twin scenarios.
Since c17db1a, a double-click on an archive right after a previous extraction from it finishes selects the archive without extracting it again (lgse#1772). known_bug covers a whole scenario, so the two double-click runs move to archive-double-click-extracts-subfolder, marked at the repeated activation; the keyboard and menu routes stay in archive-activation-extracts-subfolder.
Keep the license headers and the comments on non-standard behaviour: toolkit and X11 workarounds, races and timing constraints, values that must match the Python harness or another file, and container, CI and release constraints.
…dules Keep every file the harness adds under about 1000 lines. src/qa.rs, src/qa/tests.rs, src/qa/targets.rs and tests/qa.rs become module trees, src/qa/protocol.rs becomes src/qa/protocol/mod.rs so its submodules resolve the same way in the app and in the runner that includes it, and scripts/qa_parity.py keeps its CLI and re-exports over four helper modules. Moves only; no behaviour changes.
keep-both, new-entry-collision and rename-enter no longer applied after the upstream merge reworked transfers, renames and the collection editor, and upstream's own quick-preview patch went stale when the Space handler started reading search_result_for_space. Each applies the same mutation to the current code.
qa.sh exits 0 when a known_bug run still fails as expected, but exit_accounted counted that run as failing, so one known bug marked every pair in a parity run as disagreeing. The known-bug pair itself still disagrees, as parity does not accept known bugs.
Full QA parity runLocal run of Result: 385 of 401 pairs (1046 runs) agreed on every check in the full run; 16 disagreed. Update: 7e52cac fixes the 6 twin mismatches (see below), and a parity run on those 6 pairs now agrees on every check. That leaves 391 of 401 pairs agreeing. The 10 that still disagree are the known bug and the 9 filter-order pairs.
Fixed during the run
Known bug
Mismatches (both sides pass; input or state differs)The 6 twin pairs are fixed; the 9 filter-order pairs are still open. Twins changed upstream: fixed in 7e52cac (6 pairs, previously input-only mismatches):
Recursive filter results listed in a different order (9 pairs). The suspected cause below is not yet verified.
Reports are in |
Upstream's rename-visibility twins now open rename-target with the keyboard, and the model-preview twin adds a binary STL, a 3MF with geometry, camera views and mesh details. The five rename scenarios walk the cursor and press Return like their twins, and the model scenario ports the new steps. Its wait on each rendered view needs the preview's busy state, so accessibility::set_busy records it for --qa and the protocol accepts a busy state.
Parity stays a local tool (scripts/qa-parity.sh); the CI plan, shards and aggregate go, with scripts/qa_parity_ci.py and its tests. The packaging job ran the script tests as root, which the installer refuses, so they now run as the unprivileged build user; the native E2E runner test also stubs setxkbmap, which the Arch image lacks.
A file written while Strata runs reaches the listing as created, then as changed once its writer closes it; a click landing between the two loses its release, so the preview never opened. Both twins now write it first.
# Conflicts: # scripts/e2e.sh # src/main.rs # src/ui/window/device_release/tests.rs # tests/e2e/harness/environment.py # tests/e2e/harness/portal.py
…tartup and spin-button changes
|
Very interested in this. What prompted you to do this? Is this following the Primagens work on Omarchy? |
Drop the informational QA job and the policy test that required it. The release workflow still rejects a binary built with the qa feature.
… still opening Return on a folder validates it asynchronously before descending. When that took longer than the 75 ms cursor-mirror delay, the mirror showed the same folder again, which bumped the navigation generation, dropped the pending open, and left focus in the parent column. The mirror now stands down while a navigation is validating.
single-click-clipped-parent-column populated documents mid-run, and the root listing's refresh replaced the focused row just as Down and Return arrived, losing the Return; the files now exist before launch. archive-double-click-extracts-subfolder loses a repeat double-click to lgse#1772 at whichever repeat its timing window lands on, so it is skipped rather than marked known_bug at one step. The CI guide now says QA runs locally only.
…e process kill - An expect with hold_ms now fails at its timeout unless the predicate held for the whole hold; the Python twin's _settles does the same. - A menu_item target is looked up only inside a rendered menu and reports a missing menu instead of searching the whole window. - A wait that settles a target gives each settle only the time left on the wait's own timeout. - keys_until rejects an empty times list and an empty any predicate is rejected at parse time. - The runner pins a process with a pidfd before checking its parent, so a reused pid can never be killed.
A known bug fails its QA run on purpose, so its twins can never both pass. Parity now lists such scenarios as "Known bug, not compared", as it does skipped ones.
# Conflicts: # docs/e2e-testing.md
…sories rustls-webpki 0.103.16 (RUSTSEC-2026-0382) and webpki-roots 1.0.10 (RUSTSEC-2026-0381) drop the distrusted emSign intermediates that cargo-deny now rejects.
# Conflicts: # Cargo.toml
The Python twins now run against a build with invariant-checks, so qa.sh and qa-drive.sh turn it on too and both sides of parity run the same assertions.
lgse#1776 replaced the Compact and Airy radio items with density sliders, so the appearance scenarios wait on and wheel over the Columns item instead, as their Python twins now do.
…rchy variants per theme, ZIP root markers, Properties Copy path Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016cpLemtNiNbF8xyDV5PcFB
Sync lgse/strata#1771..#1816: QA scenarios replace the E2E suite, Omarchy variants per theme, ZIP root markers, Properties Copy path
Description
Adds an in-process QA harness. It drives Strata through a feature-gated
--qaJSON protocol instead of AT-SPI, and every Python E2E test now has a QA scenario running beside it.strata --qa <dir>(and--portal), behind theqaCargo feature. Input is injected with XTEST, and widget state is read from the app's own widget tree. The default build is unchanged.tests/qa/scenarios/, one per Python test function, covering 1049 runs.settings-text-size-keeps-switchesis skipped by default until its app race is fixed.tests/qa.rsuses a small custom harness that makes each run its own test and starts the costliest first. Run costs are benchmarked, recorded in each header, and refreshed withscripts/qa_cost.py../scripts/qa.shtakes about 103 s at 24 threads and about 63 s at 48.scripts/qa-parity.shcompares each QA scenario with its Python twin: pass/fail, input logs and final state, plus mutation patches for 20 core scenarios. It is a local tool; CI does not run it..agents/skills/qa-scenarios,qa-driveandqa-quality, linked from.claude/skills/.qa-scenarios: writing and managing scenarios.qa-drive: checking a change by hand with the newscripts/qa-drive.sh.qa-quality: a rubric whose scores are recorded in each scenario'squalityheader field and checked by the runner.twinis now optional, so QA-only scenarios can be written.Visual evidence
N/A: test tooling, scripts, skills and docs only. The app changes are accessibility labels that match the existing tooltips, and code behind the
qafeature.How to test
./scripts/qa.sh../scripts/qa.sh copy-leaves-source../scripts/qa-drive.sh start./scripts/qa-drive.sh send '{"query":"prefs"}'./scripts/qa-drive.sh screenshot shot.png./scripts/qa-drive.sh stop./scripts/qa-parity.sh --baseline copy-leaves-source.Expected result:
settings-text-size-keeps-switches.qa-drive.shprints a reply for each command and leaves no container behind afterstop.Related issue
No issue; the owner chose to open this without one.