feat(db): add NIP-FI identity + final-admission schema foundation

Introduce the Phase-A NIP-FI schema as two internally-ordered migrations:
0040 lays down the core identity and base-lifecycle relations, and 0041
applies to 0040's resulting state to add the final-admission surface
(replay/receipt, audit events, invalidation, capacity, protected-object
authority, restore version deltas, and the closed admission result).

Identity is issuer-qualified (iss, sub) with no hardcoded issuer. All 15
NIP-FI relations are a durable, immutable, append-only security ledger:
both migrations widen the single SQL source of truth
community_write_fence_excluded_table so the relations are never
fence-attached, purged on community deletion, nor counted as tenant-scoped
drift by the deletion control plane's exact-set catalog check — the same
posture as product_feedback and rate_limit_violations. schema.sql keeps one
consolidated definition of that function whose body byte-matches 0041.

Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
Co-authored-by: Cea Stapleton Cordasco <261786559+cea@users.noreply.github.com>
This commit is contained in:
Will Pfleger
2026-08-28 12:01:28 -04:00
committed by Hayt
parent 2c99ee7af5
commit afed8a8845
4 changed files with 3429 additions and 8 deletions

File diff suppressed because it is too large Load Diff