Skip to content

test(auth): boot-integration coverage for the account registry + document it#118

Merged
stuffbucket merged 1 commit into
mainfrom
test/slice3-release-coverage
Jun 11, 2026
Merged

test(auth): boot-integration coverage for the account registry + document it#118
stuffbucket merged 1 commit into
mainfrom
test/slice3-release-coverage

Conversation

@stuffbucket

Copy link
Copy Markdown
Owner

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, mirroring start-unauthenticated, real maximal start against a temp COPILOT_API_HOME):

  1. Migration on boot — a legacy single-record github_token is migrated into accounts.json (schema v2, migration-tagged, active) on first boot, and the server still binds despite a bad token (degrades, doesn't block).
  2. Null-active boot — a registry with 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 --purge test (the purge is a self-evident 2-path array literal and a subprocess uninstall would touch real install artifacts).

Testing

…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.
@stuffbucket stuffbucket merged commit afd0bc4 into main Jun 11, 2026
3 checks passed
@stuffbucket stuffbucket deleted the test/slice3-release-coverage branch June 11, 2026 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant