test(auth): boot-integration coverage for the account registry + document it#118
Merged
Conversation
…ment it Closes the release-readiness coverage gaps a slice-3 critic flagged (no bugs found — these lock in the integration wiring that unit tests can't reach in-process because PATHS is import-time captured). Two subprocess boot tests (real `maximal start` against a temp COPILOT_API_HOME, mirroring start-unauthenticated): - a legacy single-record token is migrated into accounts.json on first boot (migration-tagged, active), and boot still binds despite the bad token; - a registry with activeKey:null + an inactive account boots cleanly to unauthenticated (no dead-end) and leaves the remembered account intact. Also documents the multi-account registry in CLAUDE.md (Config and state): schema-v2 store, migration, quick-switch, sign-out-forgets, no-lock RMW.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Release-hardening for slice 3 (multi-account). A release-readiness critic found no bugs in the merged feature (#114–#117) but flagged integration paths that unit tests can't reach in-process (PATHS is captured at import time). This adds reliable subprocess boot tests + documents the registry.
Two subprocess boot tests (
tests/start-multi-account.test.ts, mirroringstart-unauthenticated, realmaximal startagainst a tempCOPILOT_API_HOME):github_tokenis migrated intoaccounts.json(schema v2, migration-tagged, active) on first boot, and the server still binds despite a bad token (degrades, doesn't block).activeKey: null+ an inactive account (the state after signing out of the active account while another remains) boots cleanly to unauthenticated (no dead-end / crash) and leaves the remembered account intact.Docs: a "multi-account registry" entry in CLAUDE.md → Config and state (schema, migration, quick-switch, sign-out-forgets, no-lock RMW + why it's safe on the single sidecar).
Why these
The critic rated them SHOULD-DO (not blocking); they cover the release-critical wiring — boot reading the migrated active account, and the no-dead-end guarantee after sign-out. Skipped: an automated
uninstall --purgetest (the purge is a self-evident 2-path array literal and a subprocess uninstall would touch real install artifacts).Testing
bun test— 854 pass / 0 fail (+4). check:fast clean. Release-silent (test:/docs:), so it doesn't affect the slice-3 release that fix(auth): surface fatal Copilot rejection on device-code sign-in; add cancel + busy feedback #114–feat(shell): multi-account quick-switch UI (slice 3, PR 3/3) #117'sfeat:commits already cut.