Stage 1 Report 03 — Policy Decision Foundation
Stage 1 — 03 fn_birth_policy_decision Foundation (Supertrack C)
Function
fn_birth_policy_decision(p_collection text) RETURNS jsonb — LANGUAGE plpgsql, STABLE (no write). Returns {decision, reason, source_policy, coverage_status, governance_role, no_go}.
Decision map (single definition of the exempt/defer policy, replacing logic implicit in multiple scripts):
| coverage_status | decision | no_go |
|---|---|---|
BIRTH_EXEMPT% |
BIRTH_EXEMPT (skip) | false |
BIRTH_REQUIRED |
BIRTH_REQUIRED (birth) | false |
BIRTH_DEFERRED_NEEDS_REVIEW |
BIRTH_DEFERRED (defer) | false |
| not registered / null / other | UNKNOWN_BLOCK | true |
Deterministic, no-write, fail-closed for unknown/unclassified. Preserves the existing live BIRTH_REQUIRED (birth) and BIRTH_EXEMPT (skip) behaviour exactly.
Source-of-truth alignment with the live gateway
The live fn_birth_registry_auto skips only coverage_status LIKE 'BIRTH_EXEMPT%'; everything else (incl. DEFERRED and unregistered) it births. The Stage 1 policy is therefore identical for EXEMPT and REQUIRED and stricter for DEFERRED (defer) and UNKNOWN (block) — never more births than live. See report 06/07.
Test matrix — v_birth_policy_decision_test_matrix
Samples per class + named cases (entity_labels → BIRTH_EXEMPT, registry_changelog → BIRTH_EXEMPT) + __nonexistent_collection__ → UNKNOWN_BLOCK. Returns the live decision/reason/no_go per collection.
Regression guard — v_birth_policy_decision_regression_guard (6/6 PASS, live)
| Test | Pass |
|---|---|
| exempt_returns_skip (ALL 36 EXEMPT) | t |
| required_returns_birth (ALL 74 REQUIRED) | t |
| deferred_returns_defer (ALL 58 DEFERRED) | t |
| unknown_blocks_failclosed | t |
| null_blocks_failclosed | t |
| deterministic_same_twice | t |
These run the function over every collection in each class — not samples — so the proof is exhaustive over the live registry (168 collections).