# Authentication and Hub Readiness

Duuble separates public participation from access to private Hub context. Phone
confirmation and contact access are not one combined gate.

## Capability levels

| Level | State | Main capabilities |
| --- | --- | --- |
| 1 | Anonymous session | Read public content and profiles, draft locally, report, and block. |
| 2 | Registered public profile | Vote, comment publicly, follow, save, share, and manage a public profile. |
| 3 | Phone-confirmed | Create public posts and reposts. Contact access is not required for General, public-profile, or personal-feed behavior. |
| 4 | Hub-ready | Enter and act in Hub surfaces after phone confirmation, profile setup, and the one-time contacts-read acknowledgement. Hub membership and role checks still apply. |

## Privacy boundary

- The API never receives a user's full contact book.
- The device sends only phone numbers explicitly selected for an invitation action.
- `contacts_synced_at` records the one-time Hub-readiness acknowledgement after the
  device successfully reads granted or OS-limited contacts.
- An accessible empty address book is valid.
- Public profile identity remains separate from the private identity projected to
  active co-members inside a Hub.

## Content-context rules

- General, public-profile, and personal-feed reads do not require contact access.
- Public or `public_hub` content shown in General uses the public participation gate.
- Entering the actual Hub context requires level 4 and active membership.
- Private locked Hub content is visible only to its author or an active member of an
  allowed Hub.
- Public comments expose public identity. Hub discussion messages use the dedicated
  Hub identity projection and never expose phone information outside an authorized
  active Hub context.

## Relevant endpoints

- [`POST /auth/anonymous/session`](./routes/auth-anonymous-session.md)
- [`POST /auth/firebase/token`](./routes/auth-firebase-token.md)
- [`GET /users/me/onboarding/status`](./routes/users-me-onboarding-status.md)
- [`PUT /users/me/onboarding/profile-basics`](./routes/users-me-onboarding-profile-basics.md)
- [`PUT /users/me/onboarding/contacts`](./routes/users-me-onboarding-contacts.md)
- [`GET /users/me/hub-profile`](./routes/users-me-hub-profile-get.md)
- [`PATCH /users/me/hub-profile`](./routes/users-me-hub-profile-patch.md)

The repository's internal canonical contract additionally contains release history and
QA records. Those operational details are intentionally excluded from this public
engineering document.
