Repository navigation
test(auth): isolate native account capture fixtures (carries #26587) - #28060
Conversation
…sh-native-auth-fixture-recovery # Conflicts: # Packages/macOS/CmuxNext/Sources/CmuxNextApp/AppServices.swift
|
cmux status (one comment, edited in place; each line is updated by the job that owns it) Review App of this head (app.zip, kept 1 day)
web and size checks: green Shipped in:
|
|
Found 3 test failures on Blacksmith runners: Failures
|
|
Review (codex-review-box/gpt-6-astra high, lane-place): SHIP at 10d8447 SHIP No findings. |
A newer verdict blocks 6798537 (no independent SHIP at the head).
|
Review (next-review patch-id; carried): SHIP at 6798537 The independent SHIP at 10d8447 carries to this head: the PR's own change ( |
|
Owned by an agent session · session |
CloudAuth: keep base's openInForeground for Sign In opens and this PR's capture-fixture guard (a capture never opens a browser). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-b8ece53aeb76d4388def
A newer verdict blocks 73f8ba7 (no independent SHIP at the head).
|
Review (next-review patch-id; carried): SHIP at 73f8ba7 The independent SHIP at d5fb1ff carries to this head: the PR's own change ( |
…uxNextCodeRouter (app_lines) (#29655) 2ba8429 (#28060, "test(auth): isolate native account capture fixtures") adds 67 CmuxNextApp Swift lines (AccountsService.swift +60, AppEnvironment +7) with no exception row; arch-ratchet's app_lines row refuses it alone (TIP RED, STATUS 2398). #28060's own provider-side capture code leaves the App for CmuxNextCodeRouter, which owns every type it uses (ProviderKeyStoring, FileReading, LocalServerProbing, KeychainProbing, AccountLabelSaltProviding, AccountLabeler, DetectionEnvironment): ProviderCaptureFixture holds the virtual provider home, the in-memory key store, the fixed label salt and labeler, the empty detection inputs (no environment, no file, no Keychain, no loopback server, no saved key), and the capture's terminal line and page URL. AccountsService keeps a thin use: it holds one only while the DEBUG-only authCaptureFixture flag is on (`capture`), and each of #28060's branches reads it (`capture?.home ?? ...`, `capture?.keys() ?? ...`, `if let capture { return capture.detectionEnvironment(...) }`, ...). Behavior is unchanged: the flag is false in a release build, so `capture` is nil there, as the removed `#if DEBUG` branches were. AuthCaptureFixtureTests reads the same names (AppEnvironment.authCaptureFixture, services.accounts.keys, detectionEnvironment()). CmuxNextApp -53.
…ng-scoped keys) #28060 gave CloudAuth a capture-fixture key-value store (authDefaults); the integration scopes the cmux.auth.* keys to the staging project for signed NEXT DEV (authDefaultsKey). Both are kept: the fixture store, with the scoped keys. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-548f18c0a6d1ebb48240
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-3x.png)
Carries #26587 (its commits unchanged, from the dead
launch-polishlane) merged with currentfeat-cmux-next. #26587's branch is not alane/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/compilein CI, a focused fleet run ofAuthCaptureFixtureTests, and an independent review. (At #26587's head d037873,AuthCaptureFixtureTestspassed on the fleet, keyland-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-fixturenow 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/printfmarker 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_argscapture state field. No capture service permissions or schema changes.Leo asked:
The fixture makes the actual onboarding paths in #26529 and #26535 reproducible in isolated captures.
Validation
python3 scripts/cmux-next/prepush-gate.pypasses at003a3d5c3c8f90c1b895cea8259271ea5874749c. Fleet joba99f19cf1cf507ea81bcda11is submitted for that exact head to compile the app and runscripts/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.offlineassertions, 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
Need help on this PR? Tag
@codesmith-botwith 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(orCMUX_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.feat-cmux-next.Written for commit 88b8309. Summary will update on new commits.