KB-5AD6
P3D — B3-A2b birth_registry Exemption Policy Update — Report
7 min read Revision 1
p3dbirth-systemb3a2bbirth-registryexemptionpolicy-updatereportPASS
P3D — B3-A2b birth_registry Exemption Policy Update — Report
Date: 2026-05-12 Mode: PG WRITE — narrow policy UPDATE only Mainline: P3D_BIRTH_SYSTEM_COMPLETION_PACK Status: PASS
Mission
Mark public.collection_registry row for collection_name='birth_registry' as exempt from B3-A birth trigger installation due to self-birth recursion risk (birth_registry IS the birth system table).
Gate Results (all PASS)
| # | Gate | Result |
|---|---|---|
| 1 | Advisory xact lock pg_advisory_xact_lock(hashtext('p3d_birth_b3a2b_birth_registry_exemption')) |
acquired |
| 2 | public.collection_registry exists |
✓ true |
| 3 | All 6 B3-P policy columns present (coverage_status, coverage_scope_status, coverage_exemption_reason, coverage_review_owner, coverage_decided_at, coverage_decided_by) |
✓ 6/6 |
| 4 | chk_collection_registry_coverage_status includes BIRTH_EXEMPT_SYSTEM_LOG_OR_AUDIT |
✓ |
| 5 | chk_collection_registry_coverage_scope_status includes IN_SCOPE |
✓ |
| 6 | chk_collection_registry_coverage_scope_status does NOT include SYSTEM_MANAGED (and not used) |
✓ confirmed (allowed: IN_SCOPE, USER_EXCLUDED, FUTURE_SCOPE, ORPHAN_REGISTRY) |
| 7 | Exactly 1 row for collection_name='birth_registry' |
✓ n=1 |
| 8 | Captured old values for rollback | ✓ (see below) |
| 9 | Not already in target exempt state | ✓ pre-state was BIRTH_REQUIRED |
| 10 | UPDATE applied to approved target row only | ✓ UPDATE 1 |
| 11 | Post-update verification matches approved target values | ✓ all 5 string fields match |
| 12 | No fn_birth_registry_auto / fn_birth_registry_auto_id trigger created on birth_registry |
✓ count=0 |
| 13 | Rollback SQL prepared | ✓ (see below) |
CHECK constraint evidence
chk_collection_registry_coverage_status:
CHECK (((coverage_status IS NULL) OR (coverage_status = ANY (ARRAY[
'BIRTH_REQUIRED', 'BIRTH_EXEMPT_STRUCTURAL_JUNCTION',
'BIRTH_EXEMPT_SYSTEM_LOG_OR_AUDIT', 'BIRTH_EXEMPT_DERIVED_CACHE',
'BIRTH_DEFERRED_NEEDS_REVIEW', 'UNCLASSIFIED_NEW']))))
chk_collection_registry_coverage_scope_status:
CHECK (((coverage_scope_status IS NULL) OR (coverage_scope_status = ANY (ARRAY[
'IN_SCOPE', 'USER_EXCLUDED', 'FUTURE_SCOPE', 'ORPHAN_REGISTRY']))))
SYSTEM_MANAGED is not a valid coverage_scope_status and was not written there. The SYSTEM_MANAGED: token appears only as semantic prefix inside coverage_exemption_reason.
Captured Pre-State (rollback source of truth)
| Column | Old value |
|---|---|
coverage_status |
BIRTH_REQUIRED |
coverage_scope_status |
IN_SCOPE |
coverage_exemption_reason |
NULL |
coverage_review_owner |
NULL |
coverage_decided_at |
2026-05-12 09:06:17.511249+00 |
coverage_decided_by |
b3p_policy_population |
Compiled UPDATE SQL (executed)
BEGIN;
SELECT pg_advisory_xact_lock(hashtext('p3d_birth_b3a2b_birth_registry_exemption'));
-- (re-verified gate7 + gate9 under lock via DO blocks)
UPDATE public.collection_registry SET
coverage_status='BIRTH_EXEMPT_SYSTEM_LOG_OR_AUDIT',
coverage_scope_status='IN_SCOPE',
coverage_exemption_reason='SYSTEM_MANAGED: self-referential birth system table — recursive trigger risk',
coverage_review_owner='GPT_B3A2',
coverage_decided_at=now(),
coverage_decided_by='GPT_B3A2_REVIEW'
WHERE collection_name='birth_registry';
-- (gate11 post-update verify + gate12 trigger-absence verify via DO blocks)
COMMIT;
psql echo:
BEGIN
pg_advisory_xact_lock
DO -- gate7+gate9 under lock
UPDATE 1
DO -- gate11 post-verify
DO -- gate12 trigger-absence
COMMIT
Rollback SQL (exact restoration)
BEGIN;
UPDATE public.collection_registry SET
coverage_status='BIRTH_REQUIRED',
coverage_scope_status='IN_SCOPE',
coverage_exemption_reason=NULL,
coverage_review_owner=NULL,
coverage_decided_at='2026-05-12 09:06:17.511249+00',
coverage_decided_by='b3p_policy_population'
WHERE collection_name='birth_registry';
COMMIT;
Post-Commit Verification (live)
post_commit_row:
| collection_name | coverage_status | coverage_scope_status | coverage_exemption_reason | coverage_review_owner | coverage_decided_at | coverage_decided_by |
|---|---|---|---|---|---|---|
birth_registry |
BIRTH_EXEMPT_SYSTEM_LOG_OR_AUDIT |
IN_SCOPE |
SYSTEM_MANAGED: self-referential birth system table — recursive trigger risk |
GPT_B3A2 |
2026-05-12 11:04:48.432696+00 |
GPT_B3A2_REVIEW |
post_commit_triggers on public.birth_registry (non-internal):
trg_birth_auto_certify -- pre-existing (unchanged)
trg_birth_change_flag_matrix -- pre-existing (unchanged)
trg_count_birth_registry -- pre-existing (unchanged)
No fn_birth_registry_auto / fn_birth_registry_auto_id trigger was created by this task. Trigger inventory on birth_registry is byte-identical to pre-state.
Hard-Boundary Compliance
| Boundary | Status |
|---|---|
UPDATE only public.collection_registry where collection_name='birth_registry' |
✓ honored (UPDATE 1) |
| No INSERT | ✓ |
| No DELETE | ✓ |
| No DDL | ✓ |
| No trigger create/drop/alter | ✓ |
| No function create/patch | ✓ |
| No species / entity_species / species_collection_map changes | ✓ |
No birth_registry table mutation |
✓ |
| No B3-A3 trigger install | ✓ |
| No Phase 5C2 | ✓ |
| No UI cutover | ✓ |
Final Response Fields
b3a2b_birth_registry_exemption_status=PASS
target_collection=birth_registry
rows_updated=1
already_exempt=false
transaction_committed=true
rollback_values_captured=true
coverage_status=BIRTH_EXEMPT_SYSTEM_LOG_OR_AUDIT
coverage_scope_status=IN_SCOPE
system_managed_semantics_in_exemption_reason=true
no_trigger_created=true
no_ddl=true
no_function_patch=true
no_birth_registry_table_mutation=true
no_species_mutation=true
no_5c2_migration=true
report_path=knowledge/dev/laws/dieu44-trien-khai/reports/p3d-birth-system-b3a2b-birth-registry-exemption-policy-update-report.md
next_recommended_action=GPT_REVIEW_B3A2B_THEN_B3A_READINESS_RERUN