Factor nonblocking `start_qtractor()` from the blocking Qt-loop
adapter and expose guest readiness, completion, outcome, and owned
cancellation through `QtractorSession`.
Replace `MainWindow.closeEvent()` process-wide `SIGINT` with the
session shutdown callback. Publish readiness after `_async_main()`
enters all startup scopes, then restore shared Qt state and globals
after guest completion.
Add a headless regression which starts and closes two real Tractor
runtimes under one pytest-owned `QApplication`.
Prompt-IO: ai/prompt-io/opencode/20260903T205404Z_aadfd1cf_prompt_io.md
(this patch was generated in some part by `opencode` using `gpt-5.6-sol` (`openai`))
Own XDG config roots before Piker or Qt imports and restore the
caller's process environment when pytest exits.
Also,
- force offscreen rendering through an explicit `--headless` flag
- restore QSettings, config globals and PyQtGraph registries per test
- prove one QApplication can serve repeated tests without state leaks
- document each teardown phase and a future public config-path API
(this patch was generated in some part by `opencode` using `gpt-5.6-sol` (`openai`))