test(auth): isolate native account capture fixtures (carries #26587)
Carries #26587 (its commits unchanged, from the dead launch-polish lane) merged with current feat-cmux-next. #26587's branch is not a lane/ branch, so this lander can't push to it; #26587 closes once this lands.
#26587's HOLD named its own outstanding work: an exact-head app compile, the isolation tests and an independent review. This PR does them at its own head: cmux-next/compile in CI, a focused fleet run of AuthCaptureFixtureTests, and an independent review. (At #26587's head d03787392f2656bcca99d8b0d7c735f45aa4edbe, AuthCaptureFixtureTests passed on the fleet, key land-pr26587-head-d0378739.)
No capture: a DEBUG-only test/capture fixture (CMUX_NEXT_AUTH_CAPTURE_FIXTURE=1 / --auth-capture-fixture); release builds compile it out and nothing drawn changes.
Changelog
none
#26587's description
Native auth captures currently either read the capture machine’s credentials or use showcase Accounts data, which bypasses the CloudAuth behavior being reviewed. DEBUG launches with --auth-capture-fixture now compose in-memory auth storage, an offline auth client/browser factory, and a virtual provider home while retaining the real coordinator, callback validation, Accounts model, and local pane/workspace routing.
Provider login actions execute a fixed /usr/bin/printf marker through the actual terminal route; provider browser actions open /dev/null. Provider key storage and label salt stay in memory. Release builds ignore the fixture flag.
This supports matching capture overlays for #26529 and #26535 using the existing launch_args capture state field. No capture service permissions or schema changes.
Leo asked:
“Also, we need to be fixing authentication issues, like the whole onboarding situation. Is that in? What does you improve? What does you fix? The edge cases, like you guys need to be comprehensively brainstorming all the onboarding edge cases: foot guns, paper cuts, snags, clips, whatever the f***.”
The fixture makes the actual onboarding paths in #26529 and #26535 reproducible in isolated captures.
Validation
python3 scripts/cmux-next/prepush-gate.py passes at 003a3d5c3c8f90c1b895cea8259271ea5874749c. Fleet job a99f19cf1cf507ea81bcda11 is submitted for that exact head to compile the app and run scripts/ci/package-test-lane.sh suite Packages/macOS/CmuxNext AuthCaptureFixtureTests; execution and results remain pending.
Capture-overlay builds exposed a closure-sendability compile error, now corrected with an explicit sendable closure. Independent review found recovery requests could bypass the offline client and that Release tests could touch real credentials. The coordinator now reports offline in fixture mode, both recovery methods have exact AuthError.offline assertions, and the entire fixture test file is DEBUG-only. Re-review remains pending.
Observed / Not run
Isolation tests and independent review are pending. Capture images will come from the behavior PRs using identical fixture overlays. An initial dispatch accidentally targeted the unchanged base; its zero-test result is discarded and provides no validation.
No capture: this introduces DEBUG capture dependencies, with no layout or copy change to the shipped application.
Changelog
none
Agent session: agent session
🤖 Generated with Claude Code
![View with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/view-with-codesmith-dark-v3-3x.png)
![Autofix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png)
Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
Adds a DEBUG-only auth capture fixture that isolates native auth captures from real credentials and network access.
Launched with --auth-capture-fixture (or CMUX_NEXT_AUTH_CAPTURE_FIXTURE=1), the app substitutes in-memory token/key stores, an offline auth client, a no-op browser factory, and a virtual provider home while keeping the real CloudAuth coordinator, callback validation, and Accounts routing. This makes onboarding flows reproducible in isolated fleet captures without touching a developer's keychain or contacting Stack Auth. Release builds compile the fixture out, and the capture browser opener is explicitly sendable and never opens a browser.
- Adds tests confirming the fixture is DEBUG-only and that both accounts detection and CloudAuth recovery requests use the isolated, offline dependencies.
- Carries #26587, merged with current
feat-cmux-next.