test: run the shared matrix's headless cases on the daemon core (cx-gkyi1)
Runs the shared matrix's headless cases (Packages/macOS/CmuxNext/Tests/Matrix/cases.json, landed in #20195) on the daemon core in process: mux::tests::matrix::matrix_cases_hold_on_the_core. This is part 2 of cx-gkyi1, and op-ci-tiers adds it to the fast tier once it lands.
For each headless case the runner seeds a preset (single, tabs3, split2, deep, ws3, ws20) through Mux::new_for_test and applies the case's core steps. After each step it checks:
- Moves and zoom: tabs are conserved (
layout_invariants::transition_problems). - Creates and closes: no new reducer state violations (
check_state), so no empty pane and no tab placed twice. - Expectations: each step's own expectations and the case's final ones hold (order, counts, selection, focus, zoom).
It has no clock, no sleeps, no window server and no daemon process. Every failure starts with MATRIX <id>:. The test skips when Packages/macOS/CmuxNext is missing, which happens in cmux-tui-only checkouts.
move_tab cases give the final index, as the app does. The runner converts it to the core's insert-before index with the same rule as TabMoveIndex.wireIndex. $new resolves to the newest object created, which is the one the app selects after a burst of creates.
Verification
- Focused hosted run 38358702632 on 2ea4bcea2c43: lint (Linux) passed, and the matrix test passed on Linux and macOS (macOS: 1 passed in 1.05 s).
- The first run (on bbd3dd66f92b) failed 32 of 59 cases. All of them were runner mistakes: it checked conservation on creates and closes, used the wrong
move_tabindex meaning, and picked the wrong$new. None was a product bug. - Not run: the Windows
cargo check. The file is#[cfg(test)]-only.
Changelog
none
🤖 Generated with Claude Code
Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
Runs the shared matrix's headless cases (Packages/macOS/CmuxNext/Tests/Matrix/cases.json) on the daemon core in-process, so model behavior gets verified without a daemon process, clock, or window server.
- Seeds each headless case's preset (single, tabs3, split2, deep, ws3, ws20) into a test
Muxand applies the case'scoresteps through the topology operations the daemon serves. - Checks tab conservation on moves and zooms, and reducer state invariants on creates and closes; failures are prefixed with
MATRIX <id>:. move_tabsteps give the final tab index, converted to the core's insert-before index;$newresolves to the newest created object.- Cases that would pass vacuously are rejected: each headless case needs
coresteps and paired step expectations, and a missingid,by, or zoom mode is an error. - The test skips when
Packages/macOS/CmuxNextis absent, as in cmux-tui-only checkouts.