`scripts/app-sweep-probe/wait-for-desktop.sh`, `sweep-rails.sh`, and the rule in
`AGENTS.md`. No device code.
## What was being thrown away
Every harness here treated the guest's login window as a state to get past.
`wait-for-desktop.sh` typed the password and carried on, and its own doc already
recorded the tell it was walking past: `stat -f%Su /dev/console` answering
`_windowserver` rather than `root` means the guest's **WindowServer aborted**,
measured live on a macos-11 boot.
When it aborts the guest writes a `.ips` report naming the failure — the most
direct evidence this project can get about a graphics failure *inside* the
guest, as opposed to a fence this device gave up on. Logging in starts a fresh
session over the top of it and the next boot's snapshot revert discards the
overlay, so those reports have never once been read here.
It is not a rare state. The `REIMS_VGPU_SAMPLED_IDENTITY=off` boot run today hit
`_windowserver` before its probe had started, and the harness logged in and went
on to report a Maps freeze — attributing to a GPU wedge a boot whose window
server had already died.
## What it does now
The login window is a collection point, not an obstacle:
- `collect_reports` tars `/Library/Logs/DiagnosticReports` and the user's own
copy off the guest into `--reports DIR`, in one round trip, **before** a
character is typed. Read without `sudo` on purpose — this file already records
a guest `sudo` wedging with its timestamp lock held, which queues every later
`sudo` forever, and a report this account cannot read is worth less than a
boot.
- A login window with any report behind it **exits 3 without logging in**.
`--login-after-crash` overrides that and an unattended sweep must not pass it.
- A login window with *no* reports is the benign case this script already
documented — a guest that never logged in — and it logs in as before.
- The success path collects too. Autologin can restart a session over an early
abort, so a WindowServer that crashed can have a Dock by the time anything
looks; the console check cannot see that class and the report can.
`sweep-rails.sh` maps exit 3 to a `WINDOWSERVER-CRASH` row per rail and keeps
the reports under `$OUT/$rail-reports`, because a rail that crashes its window
server is not a rail whose app verdicts mean anything.
## Verified
`bash -n` on both scripts and `--help` renders. **Not verified by a boot**: no
guest has yet been made to produce a crash report through this path, so the tar
pipe and the two directory names are unexercised. The next macos-11 boot is what
tests it.
Co-Authored-By: Claude <noreply@anthropic.com>