Implement registration identity model

This commit is contained in:
2026-06-15 22:06:39 +02:00
parent 2c94b40fc4
commit a36a25898e
12 changed files with 1012 additions and 12 deletions

View File

@@ -4,7 +4,7 @@ type: workplan
title: "Registration Identity And Factor Model"
domain: netkingdom
repo: user-engine
status: proposed
status: finished
owner: codex
topic_slug: netkingdom
planning_priority: high
@@ -46,7 +46,7 @@ lifecycle, sessions, and tokens remain external adapter concerns.
```task
id: USER-WP-0010-T1
status: todo
status: done
priority: high
state_hub_task_id: "2a6c93de-e320-41e6-8930-7a4099c5757a"
```
@@ -57,7 +57,7 @@ stability, visibility, privacy, and migration expectations.
```task
id: USER-WP-0010-T2
status: todo
status: done
priority: high
state_hub_task_id: "31ddb44e-b7d1-406e-9114-78c5e7f92478"
```
@@ -67,7 +67,7 @@ factor_pending, factor_verified, completed, abandoned, expired, and rejected.
```task
id: USER-WP-0010-T3
status: todo
status: done
priority: high
state_hub_task_id: "7441f064-eb49-4e66-8c1d-a2626aae020c"
```
@@ -78,7 +78,7 @@ evidence references without storing secret proofing payloads.
```task
id: USER-WP-0010-T4
status: todo
status: done
priority: high
state_hub_task_id: "7057afda-d585-48cd-bac1-f0bd0f05fef5"
```
@@ -88,7 +88,7 @@ proofing results and return normalized factor evidence for user-engine.
```task
id: USER-WP-0010-T5
status: todo
status: done
priority: high
state_hub_task_id: "f4f0da38-9810-45e7-ab4e-0619eb45b3c4"
```
@@ -98,7 +98,7 @@ complete, abandon, and resume flows.
```task
id: USER-WP-0010-T6
status: todo
status: done
priority: medium
state_hub_task_id: "c29b31cd-f2b2-41b6-86ee-9c78470abf01"
```
@@ -123,3 +123,35 @@ factor lifecycle transitions.
- Registration service facade.
- Factor verification adapter ports.
- Documentation and tests for the basic self-registration flow.
## Implementation Notes
Implemented on 2026-06-15:
- Defined NetKingdom ID semantics as the existing opaque `User.user_id` for
this first slice.
- Added `RegistrationStatus`, `IdentityFactorType`, `FactorVerification`,
`IdentityFactor`, and `RegistrationSession` domain models.
- Added registration and factor persistence to `UserEngineStore` and
`InMemoryUserEngineStore`.
- Added `FactorVerificationAdapter` for normalizing external proofing results
into safe factor evidence.
- Added `UserEngineService` registration facade methods:
`start_registration`, `attach_registration_factor`,
`complete_registration`, `abandon_registration`, `expire_registration`,
`resume_registration`, and `registration_diagnostics`.
- Added audit/outbox events for registration lifecycle transitions while
keeping factor values out of event payloads and diagnostics.
- Added `docs/registration-identity-and-factor-model.md` and public contract
updates.
- Added tests for successful email-backed registration, required-factor
enforcement, adapter-normalized factor evidence, and abandoned-session
behavior.
Verification:
```text
make test
Ran 46 tests in 0.162s
OK
```