Repository navigation
audit(ui): sweep every authenticated screen, and stop the admin screen that never stopped fetching - #855
Conversation
…n that never stopped fetching `smoke-authed.mjs` looks hard at four ATS screens. Nothing looked at the other ninety-four, which is what a reskin needs, so `sweep-routes.mjs` derives its route list from the app directory — it cannot drift from the router — mints a session the way the Playwright auth setup does, and captures every static route in both app modes at 1440 and 390. Alongside each PNG it records what a screenshot cannot show: where the page landed, whether it scrolls sideways, where its heading sits, and what the console and network said. 200 captures over 98 routes, committed as the "before" for releases 1-3. The first run found a screen that never finishes loading. `/office/settings/geographic` reads `core.system_config`, which grants nothing to `authenticated` (RLS is off, so PostgREST answers 42501), and its effect shows an error toast — while listing `toast` as a dependency. ToastContext memoises its value on the live `toasts` array, so showing a toast changes the hook's identity and re-runs the effect that showed it. Measured: ~35,000 requests to /rest/v1/system_config per visit, 70,104 across the sweep, the page never reaching networkidle in 180 s, and an unbounded stack of error toasts. The dependency is the half that makes it unbounded, so that is fixed here. The missing grant is a migration and is filed separately; until it lands the screen shows one honest error instead of a retry storm. Refs #852 Co-Authored-By: Claude Opus 5 <[email protected]>
…ps its data Running the sweep over the full route list on the integration branch, Metro ran out of heap 56 captures in (#680). Everything after that came back `ERR_CONNECTION_REFUSED`, and the harness recorded **140 route failures** — indistinguishable from real ones, on a branch whose whole purpose was to prove thirteen merged PRs had broken nothing. The natural response to that report is "re-run and see", which is exactly how a real failure gets waved through. `lib/dev-server.mjs` already exists for this and already says so: a smoke that cannot reach the server exits INFRA (97), never 1. The sweep used its preflight but not its mid-run check. It does now: the first unreachable route aborts with a line that does not look like an assertion, names where it stopped, and suggests the `SWEEP_ONLY` prefix to resume from. The report is also written after every capture rather than at the end. The PNGs were always on disk; the facts that make them readable — where the page landed, whether it scrolled sideways, where the heading sat — were lost with the process. Both proved themselves on the next run: the server died again during the Office mobile pass, and instead of 30 invented failures the run exited 97 with 72 usable captures on disk. Co-Authored-By: Claude Opus 5 <[email protected]>
|
Added a commit: the sweep now aborts with EXIT_INFRA when the dev server stops answering mid-run, and writes its report after every capture rather than at the end. Both came from using this harness on the release-1 integration branch. Metro ran out of heap 56 captures into a full run (#680), and everything after came back Both fixes proved themselves on the very next run: the server died again during the Office mobile pass and, instead of 30 invented failures, the run exited 97 with 72 usable captures already on disk. |
Part of #852. Release 1, epic #847.
The harness
scripts/audit/sweep-routes.mjscaptures every static route in both app modes at 1440 and 390. It derives its route list fromapps/scaffald/app, so it cannot drift from the router, and mints a session the waytests/infrastructure/playwright/setup/setup/auth.setup.tsalready does. Alongside each PNG it records what a screenshot cannot: where the page landed, whether the document scrolls sideways, where the heading sits, and every console error and 4xx/5xx.200 captures over 98 routes, committed as the "before" for releases 1–3, with
sweep.jsonandsweep.md.What it found on the first run
Fixed here
/office/settings/geographicnever finishes loading. It readscore.system_config, which grants nothing toauthenticated(RLS is off, so PostgREST answers 42501), and its effect shows an error toast — while listingtoastas a dependency.ToastContextmemoises its value on the livetoastsarray, so showing a toast changes the hook's identity and re-runs the effect that showed it./rest/v1/system_configper visitnetworkidleThe dependency is the half that makes it unbounded, so that is fixed here. The missing grant is a migration and is filed separately (#856); until it lands the screen shows one honest error instead of a retry storm.
Filed, not fixed
core.system_configgrants nothing toauthenticated/office/cms/jobsis permanently empty —z.coerce.boolean()reads"false"astrue/auth/termsand/auth/privacyredirect a signed-in user to/dashboardVerification
pnpm prepushclean. The one code change is auseEffectdependency list;/office/settings/geographicwas re-captured and now settles.🤖 Generated with Claude Code