core: refactor account module to Effect with repo/service split
Rewrite the account layer using Effect for typed error handling, schema validation, and structured concurrency. Split into three concerns: - schema.ts: branded types (AccountID, OrgID, AccessToken) and shared data classes - repo.ts: AccountRepo service owning all DB operations via drizzle - service.ts: AccountService owning HTTP orchestration (OAuth device flow, token refresh, org/config fetching) with AccountRepo as a dependency Key improvements: - Branded types enforce type safety at API boundaries - Option used consistently instead of null/undefined in internal APIs - User and orgs fetches parallelized during login poll - Schema-validated HTTP request/response bodies - Transient read retry with exponential backoff - Clock.currentTimeMillis instead of Date.now() for testability - 11 new repo tests covering all DB operations Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
K
Kit Langton committed
adc9536a16afd0d1868332e525fd5feae1a54db9
Parent: fec8d5b