Stage 1 Report 04 — Identity Resolution Foundation
Stage 1 — 04 fn_birth_resolve_identity Foundation (Supertrack D)
Function
fn_birth_resolve_identity(p_collection text, p_row jsonb DEFAULT NULL) RETURNS jsonb — STABLE (no write). Reads collection_registry.birth_code_column / birth_code_strategy / birth_identity_source / governance_role / species_code; species + composition_level from species_collection_map + entity_species (same source the live gateway uses). Replaces the hardcoded TG_ARGV code-field map.
Two modes:
- p_row IS NULL → eligibility/preflight: returns status only (entity_code NULL). QT-001/backfill can know which collections are eligible BEFORE any birth.
- p_row provided → resolves the actual
entity_code.
Status values: ELIGIBLE_COLUMN / ELIGIBLE_SYNTHETIC (preflight), RESOLVED / RESOLVED_SYNTHETIC / FALLBACK_SYNTHETIC (resolution), BLOCKED_UNCLASSIFIED / BLOCKED_NO_CODE_COLUMN / BLOCKED_NO_IDENTITY / BLOCKED_UNKNOWN_STRATEGY / UNKNOWN_COLLECTION (fail-closed). Output also carries confidence, code_field, code_strategy, identity_source, governance_role, species_code, composition_level, missing_reason.
Never invents identity: for unclassified strategy/source it returns entity_code=NULL with a missing_reason — it does not synthesize a key. Fail-closed for unknown collection/strategy.
Strategy dispatch (BIRTH_REQUIRED = 74)
| birth_code_strategy | n | preflight status |
|---|---|---|
| column | 27 | ELIGIBLE_COLUMN (entity_code = row→>birth_code_column; fallback collection::id only if column empty but id present) |
| legacy_id_single_colon | 3 | ELIGIBLE_SYNTHETIC (collection::id) |
| synthetic_id | 1 | ELIGIBLE_SYNTHETIC |
| unclassified | 43 | BLOCKED_UNCLASSIFIED |
Coverage view — v_birth_identity_resolution_coverage (live)
ELIGIBLE_COLUMN 27 (resolvable) · ELIGIBLE_SYNTHETIC 4 (resolvable) · BLOCKED_UNCLASSIFIED 43 (blocked) = 74. 31 resolvable / 43 blocked.
Unclassified inventory — v_birth_identity_unclassified_inventory (the 43)
Exposes all 43 BIRTH_REQUIRED collections with unclassified strategy/source: 34 observed, 6 governed (apr_action_types, apr_approvals, apr_request_types, dot_domain_rules, field_type_equivalences, normative_relations), 3 locked (binding_registry, nrm_approval_rules, nrm_doc_type_config). These are the Stage 2 classification work-list.
Regression guard — v_birth_identity_regression_guard (5/5 PASS, live)
unclassified_never_invents_identity (entity_code NULL for ALL 43) · unclassified_count_43 · unknown_collection_failclosed · resolver_is_no_write_stable (provolatile in s/i) · column_strategy_all_eligible (ALL 27).