Deferred from the Oct 2026 design review (schema is a single baseline now, so this is cheap before first release).
Credentials
api_keys, service_account_keys, integrations.key_hash, sessions, incident_ack_tokens, invites, device_logins, oidc_logins each carry their own hash/lookup/expiry code (apiKeyUser, serviceAccountFor, sourceForKey, randomToken, randomServiceAccountToken). Only api_keys has expires_at. Consider one credentials(kind, principal_id, key_hash, expires_at, last_used_at) table and one resolver.
Actors
Incident actors are bolted on as parallel columns: incidents.acknowledged_by + acknowledged_by_service_account_id; incident_events has user_id, service_account_id, actor_user_id, actor_service_account_id with two XOR constraints, and user_id means the actor for most events but the assignee for assigned. Consider a principals supertype or actor_kind + actor_id plus a separate subject_user_id. Related: #36 (assignable service accounts).
Also while in the schema
service_accounts.name is globally UNIQUE; make it (team_id, name) (a 409 currently reveals other teams' account names).
Authorization predicates are spread over AdminOnly, requireSelfOrAdmin, requireTeamOwner, callerOwnsTeam, callerMayManageServiceAccount, handleCreateTeam's inline check: one authorize(caller, action, resource) policy file, with an audit event for admin overrides.
Four code paths create users and six insert team_members: one createUser and one addMember.
Deferred from the Oct 2026 design review (schema is a single baseline now, so this is cheap before first release).
## Credentials
`api_keys`, `service_account_keys`, `integrations.key_hash`, `sessions`, `incident_ack_tokens`, `invites`, `device_logins`, `oidc_logins` each carry their own hash/lookup/expiry code (`apiKeyUser`, `serviceAccountFor`, `sourceForKey`, `randomToken`, `randomServiceAccountToken`). Only `api_keys` has `expires_at`. Consider one `credentials(kind, principal_id, key_hash, expires_at, last_used_at)` table and one resolver.
## Actors
Incident actors are bolted on as parallel columns: `incidents.acknowledged_by` + `acknowledged_by_service_account_id`; `incident_events` has `user_id`, `service_account_id`, `actor_user_id`, `actor_service_account_id` with two XOR constraints, and `user_id` means the actor for most events but the assignee for `assigned`. Consider a `principals` supertype or `actor_kind` + `actor_id` plus a separate `subject_user_id`. Related: #36 (assignable service accounts).
## Also while in the schema
- `service_accounts.name` is globally UNIQUE; make it `(team_id, name)` (a 409 currently reveals other teams' account names).
- Authorization predicates are spread over `AdminOnly`, `requireSelfOrAdmin`, `requireTeamOwner`, `callerOwnsTeam`, `callerMayManageServiceAccount`, `handleCreateTeam`'s inline check: one `authorize(caller, action, resource)` policy file, with an audit event for admin overrides.
- Four code paths create users and six insert `team_members`: one `createUser` and one `addMember`.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Deferred from the Oct 2026 design review (schema is a single baseline now, so this is cheap before first release).
Credentials
api_keys,service_account_keys,integrations.key_hash,sessions,incident_ack_tokens,invites,device_logins,oidc_loginseach carry their own hash/lookup/expiry code (apiKeyUser,serviceAccountFor,sourceForKey,randomToken,randomServiceAccountToken). Onlyapi_keyshasexpires_at. Consider onecredentials(kind, principal_id, key_hash, expires_at, last_used_at)table and one resolver.Actors
Incident actors are bolted on as parallel columns:
incidents.acknowledged_by+acknowledged_by_service_account_id;incident_eventshasuser_id,service_account_id,actor_user_id,actor_service_account_idwith two XOR constraints, anduser_idmeans the actor for most events but the assignee forassigned. Consider aprincipalssupertype oractor_kind+actor_idplus a separatesubject_user_id. Related: #36 (assignable service accounts).Also while in the schema
service_accounts.nameis globally UNIQUE; make it(team_id, name)(a 409 currently reveals other teams' account names).AdminOnly,requireSelfOrAdmin,requireTeamOwner,callerOwnsTeam,callerMayManageServiceAccount,handleCreateTeam's inline check: oneauthorize(caller, action, resource)policy file, with an audit event for admin overrides.team_members: onecreateUserand oneaddMember.