- Shipped
- June 29, 2026 at 2:14 PM UTC
- Author
- Kamo
- Commit
- 2de61f8
Closes a pre-existing double-active hole in the MLOS loan-identifier registry: index (a) **************** only constrains (org, type, VALUE) for the 10 REGISTRY-NATIVE single-active types, so two ACTIVE native rows of the SAME (loan_file_uid, type) but DIFFERENT values could both commit (e.g. a renumber racing a registerNative with a different value — distinct value keys, no conflict). New partial-unique index **************** (loan_file_uid, type) WHERE status='ACTIVE' AND external_system_reference IS NULL AND type IN (the 10 native types) enforces at most one ACTIVE native id per (loan, type) — the (loan,type) analogue of index (c) for OWNED_ELSEWHERE mirrors. The type IN(...) list mirrors index (a); keep in sync with **************** (the §6.2 drift guard). Idempotent CREATE … IF NOT EXISTS; prod has no violating duplicate-active native rows (verified).