feat(slice-2): accounts domain — request_code/verify/get_account (INV-2/INV-3/INV-6)

Email-canonical get-or-create, peppered-hash one-time codes with 10-min TTL, single-use,
5-attempt cap, and 60s resend cooldown; uniform new-or-known (no enumeration, §6.6). All
identity rules in the domain layer once (INV-6); scenario + invariant tests green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-10 10:31:32 -07:00
parent 2d15f1a2cb
commit 95680c9960
6 changed files with 407 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
"""accounts — domain models (SD-0001 §6.3)."""
from __future__ import annotations
from dataclasses import dataclass
@dataclass(frozen=True)
class Account:
"""A person's identity on the platform. Email is the canonical key (INV-2)."""
id: int
email: str