Skip to content

fix(accounts): distinguish Claude profile occupants - #152

Merged
andrei-hasna merged 1 commit into
mainfrom
fix/claude-identity-routing-957c65e7
Aug 10, 2026
Merged

fix(accounts): distinguish Claude profile occupants#152
andrei-hasna merged 1 commit into
mainfrom
fix/claude-identity-routing-957c65e7

Conversation

@andrei-hasna

@andrei-hasna andrei-hasna commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Fixes Hasna Accounts bug task 957c65e7-261f-4b8f-b4dc-77c5fb84c650.

Summary

  • make repair-auth check usable foreign live occupants before returning live-credential-usable
  • expose explicit profile owner/occupant identity in usage profiles output
  • apply the account-UUID recent-claim damper in pickHealthiestAccount so CLI/pick routing matches hook spread behavior

Validation

  • bun test src/repair-auth-gates.test.ts src/repair-auth-cli.test.ts src/usage-profiles.test.ts src/orphan-occupant-routing.test.ts src/auto-switch-herd.test.ts src/occupied-dir-health.test.ts src/health-launch-agreement.test.ts — 61 pass, 0 fail, 280 expect() calls
  • bun run typecheck — rc=0
  • bun test — 1652 pass, 1 skip, 0 fail, 12402 expect() calls
  • bun run build — rc=0
  • gitleaks protect --staged — rc=0, no leaks found
  • gitleaks git --log-opts origin/main..HEAD — rc=0, no leaks found
  • bun run contracts:no-cloud-scan — rc=0, verdict passed

Notes

  • no live credentials, auth files, profiles, or sessions were read or mutated; tests use fixtures only
  • no merge or publish in this worker scope

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Task: 957c65e7-261f-4b8f-b4dc-77c5fb84c650

Agent: agent-ea
@andrei-hasna

Copy link
Copy Markdown
Contributor Author

[REVIEW] GO — #152 @ 06111b4 — lens: correctness+security+gates, reviewer Xenon (1 of 1)

Candidate read:

  • Confirmed worktree HEAD 06111b4e2d8ca8e3169c166338b56ceb3af46d9a against freshly fetched origin/main bceb2e354537f4e13af0f03a34d3da37939a5c11.
  • Read the full diff for all seven changed files: src/cli.ts, src/lib/claude-auth.ts, src/lib/usage-report.ts, src/orphan-occupant-routing.test.ts, src/repair-auth-cli.test.ts, src/repair-auth-gates.test.ts, and src/usage-profiles.test.ts.
  • Read surrounding implementation and callers for identity indexing, readiness and launchability, parked-credential planning/execution, usage rendering, auto-switch claim ranking, usage-hook selection, and launch-path recovery.

Commands and exact results:

  • bun install — exit 0; setup only, 121 packages installed.
  • bun run typecheck — exit 0; PASS; tsc --noEmit reports no pass/fail count.
  • bun run test — exit 0; PASS; 1652 pass, 1 skip, 0 fail, 12,402 expectations, 1,653 tests across 100 files.
  • git status --short --branch after the gates — exit 0; worktree clean on lane-pr152.

Blocking P0/P1 findings: none.

The changed trust boundaries fail closed: a healthy foreign live occupant is distinguished from the profile owner before parked recovery can be treated as usable; operator output exposes only account UUID/email/status rather than credential or path material; and recent claims only reorder candidates that have already passed credential, cooldown, and both headroom gates, so the last usable account is not withheld.

Non-blocking follow-ups: none.

@andrei-hasna
andrei-hasna merged commit 9f56682 into main Aug 10, 2026
5 checks passed
@andrei-hasna
andrei-hasna deleted the fix/claude-identity-routing-957c65e7 branch August 10, 2026 08:44
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