.claude/skills/verify-miri/features/window-management-controls.md
Start, stop, and restart window management
The person using Miri starts, stops, and restarts window management from Settings > General or the menu bar menu, and stops it with the Stop shortcut. The status line says what the engine does, and Miri remembers a Stop across launches.
Sub-features
stop:Stop Window Managementstops the engine, and the status readsStopped.start:Start Window Managementstarts it, and the status readsManaging windows.restart:Restart Enginereplaces the engine process.stop-shortcut: ⌃⌥Q stops window management from any app. After a Stop, the shortcut does nothing until Start.saved-stop: after a Stop, the next launch leaves windows unmanaged until Start.crash-limit: after 3 engine crashes within five minutes, the status readsStopped after repeated engine failures, with the reasonThe engine stopped unexpectedly 3 times within five minutes. Miri stopped restarting it.waiting: while a setup check blocks start, the status readsWaiting: <check title>, andStop Window Managementshows where Start would be. Setup checks drives it.
How to get to it (user POV)
- Settings > General: the buttons under the status line.
- The menu bar menu, which Sam's bar manager hides on this Mac.
It shows the same status and buttons, and a
Configuration error on line N: …line whenconfig.tomlhas an error. - The Stop shortcut, ⌃⌥Q unless
[miri].stop_shortcutsets another chord.
Driving it with verify-miri
Preconditions:
The baseline from the index.
V settingsprinted a status, so the Settings window is open.Show General. Run
V ax test press General. ThenV ax test statusprintsManaging windows.Watch. Start
V watch 90in the background, with its output in a file, so it logs every enginestartandexitduring the steps below.Restart. Run
V ax test press "Restart Engine". The watch log shows the old engine'sexitand a new engine'sstart.Stop shortcut. Run
V key ctrl+alt-q. The status readsStopped, the watch log shows the engine'sexit, anddefaults read io.github.samanyudas.miri.dev managementStoppedprints1. OnlyStart Window Managementshows. Press ⌃⌥Q again: nothing changes, and no engine starts.Start. Run
V ax test press "Start Window Management". The status returns toManaging windows, the watch log shows a new engine, andmanagementStoppedprints0.Stop. Run
V ax test press "Stop Window Management". Within 4 s,V ax test statusprintsStopped, andmanagementStoppedprints1.Saved Stop. While stopped, run
V relaunch. It logsrelaunched test build pid <n> with no engine, andV doctorshows no engine. RunV settings, pressGeneral, and check that the status readsStopped. Then pressStart Window Management.Crash limit. Kill only the test engine three times, about 3 s apart, with
kill -9 <engine pid>. Take each process ID fromV doctor, or fromps -axo pid=,comm=where the executable is<test bundle>/Contents/Helpers/miri-engine. The status readsStopped after repeated engine failures, the reason line shows, and onlyRestart EngineandShow Logs in Findershow.Show logs. In the failed state, press
Show Logs in Finderin Settings > General or the menu. Finder becomes the frontmost app, with aLogswindow andengine.logselected. Close that Finder window afterwards.Recover. Press
Restart Engine. The status readsManaging windows.
Gotchas
- For timed sequences, press several buttons in one call, such as
V ax test press "Stop Window Management" "Restart Engine". Separate calls add about 100 ms each.axdolooks for each title again after the previous press, soV ax test press General "Stop Window Management"works from another tab. V settingsandV ax test statusprint the text after the firstStatuslabel of the tab that shows. Settings reopens on the last tab, which can be Gestures, whose status readsOff until tested: not tested yet. PressGeneralbefore you read the status.- Never find the engine by matching a whole command line. A shell whose command holds the engine path matches too, and a
killthen stops that shell. - Quit the test build with
kill -TERM <test pid>for a timed quit.osascript quitarrived 3.8 s late in the #234-#236 run. - #234, #235, and #236 closed on 2026-11-01.
Stop right after Restart now keeps Miri stopped, Restart clears a saved Stop, and Restart while a setup check blocks start shows
Waiting: <check title>. Report any of the old results as a regression. - Every engine restart re-applies the window session and can move Sam's windows. Keep these rounds short.
- The guard blocks
defaults write. Clear a saved Stop withStart Window ManagementbeforeV end. Never end a run while stopped: the previous build reads the same saved Stop and starts no engine, so Sam's windows stay unmanaged. - The menu bar menu opens through System Events as
menu bar item 1 of menu bar 2of the test app's process, even while the bar manager hides it. A System Events click on a menu item lets no app take the front, not evenSettings…. To check which app comes to the front, open the menu that way, read the item'spositionandsize, and click its center with a mouse event posted at the HID event tap.