Finalize user-engine contracts and operability

This commit is contained in:
2026-05-22 21:45:30 +02:00
parent b81a9e05da
commit ce2d620f4e
12 changed files with 392 additions and 15 deletions

32
docs/ui-contracts.md Normal file
View File

@@ -0,0 +1,32 @@
# UI Handoff Contracts
Future self-service and scope-admin UIs should consume user-engine through a
transport adapter that preserves the service shapes below.
## Self-Service Account UI
Required backend operations:
- `me` to resolve the current actor, user, account, and identity links.
- `effective_profile` with the actor tenant and optional application id.
- `projection` with `SELF_SERVICE` for editable user-visible fields.
- `set_profile_value` for fields whose catalog mutability includes `USER`.
- `audit_records` or a filtered audit transport for recent user-visible
account activity.
## Scope Admin UI
Required backend operations:
- `resolve_tenant_context` before all tenant-scoped screens.
- `set_tenant_account_status` for in-scope account state.
- `add_membership` for tenant/team membership changes.
- `projection` with `ADMIN` or a future admin transport projection.
- `tenant_diagnostics` for onboarding and support readiness checks.
## Fixtures
Use `user_engine.testing.scenarios` for human, tenant admin, platform
operator, delegated agent, invalid, expired, local issuer, and missing-tenant
fixtures. UIs should keep fixtures at the transport boundary and avoid
embedding identity-provider logic.