Files
Manoj Bajaj 63bd4c90aa refactor!: unify local and hosted into a single deployment flow
The daemon branched on AUTHSOME_DEPLOYMENT_MODE and ran two parallel
implementations of nearly every ownership concept. "Local and hosted
behave the same" was asserted in prose (ADR 0006) but never enforced in
code, so the paths were free to drift, and the synthetic local principal
let a second local identity silently inherit the admin principal.

Collapse to one flow, identical for every deployment: authsome init
registers an identity and gets back a browser claim URL; the user
registers email+password (first principal becomes admin); that principal
confirms the claim; PoP calls are then authorized.

- Remove AUTHSOME_DEPLOYMENT_MODE, get_deployment_mode(),
  LOCAL_PRINCIPAL_EMAIL, the Local*/Hosted* resolver and bootstrap
  classes, and the AuthService(deployment_mode=...) parameter.
- OwnershipResolver and IdentityBootstrapService become single concrete
  classes (the former hosted, claim-based implementations).
- Admin gating is purely role-based: non-admin principals are blocked in
  every deployment (previously implicitly allowed in local mode).
- The server UI always requires a hosted browser session; remove the
  vestigial HealthResponse.mode field.
- CLI ensure_identity_ready was already mode-agnostic; it now prints the
  claim URL to stderr for headless use.

Add ADR 0007 recording the decision; amend ADR 0006 and CONTEXT.md.

BREAKING CHANGE: existing local installs have an unclaimed identity under
local@authsome.internal and are rejected until the user registers a
principal (email+password) and claims the identity.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Entire-Checkpoint: d31cf246f6f2
2026-05-29 13:18:41 +05:30
..