KB-2AF5
P3D — B3-A2b birth_registry Exemption Policy Update — Agent Prompt
5 min read Revision 1
p3dbirth-systemb3a2bbirth-registryexemptionpolicy-updateprompt
P3D — B3-A2b birth_registry Exemption Policy Update — Agent Prompt
Date: 2026-05-12 Mode: PG WRITE — narrow policy UPDATE only Mainline: P3D_BIRTH_SYSTEM_COMPLETION_PACK
Mission
Execute B3-A2b birth_registry exemption policy update.
Mark birth_registry as exempt from B3-A birth trigger installation because it is the birth system table itself and naïve birth-trigger wiring would create self-birth recursion.
Governing decisions
- B3-A2 design patched by GPT and confirmed by Opus.
- B3-A2a variant function equivalence probe PASS_ACCEPTED_WITH_NOTE.
- This task only updates policy metadata for
collection_registry.collection_name='birth_registry'.
Approved target row
collection_name = birth_registry
Approved values
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_by = GPT_B3A2_REVIEW
coverage_decided_at = now()
Important: Do not write SYSTEM_MANAGED to coverage_scope_status. Current CHECK constraint allows only:
IN_SCOPE
USER_EXCLUDED
FUTURE_SCOPE
ORPHAN_REGISTRY
SYSTEM_MANAGED is semantics inside coverage_exemption_reason, not a scope-status literal.
Hard boundaries
- UPDATE only
public.collection_registryrow wherecollection_name='birth_registry'. - No INSERT.
- No DELETE.
- No DDL.
- No trigger creation/drop/alter.
- No function creation/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.
Required gates inside one transaction
- Acquire advisory transaction lock:
pg_advisory_xact_lock(hashtext('p3d_birth_b3a2b_birth_registry_exemption')). - Verify
public.collection_registryexists. - Verify all 6 B3-P policy columns exist:
coverage_statuscoverage_scope_statuscoverage_exemption_reasoncoverage_review_ownercoverage_decided_atcoverage_decided_by
- Verify CHECK constraint allowed values for
coverage_statusincludeBIRTH_EXEMPT_SYSTEM_LOG_OR_AUDIT. - Verify CHECK constraint allowed values for
coverage_scope_statusincludeIN_SCOPEand do not require/expectSYSTEM_MANAGED. - Verify exactly one row exists in
collection_registrywithcollection_name='birth_registry'. - Capture old values for exact rollback:
coverage_statuscoverage_scope_statuscoverage_exemption_reasoncoverage_review_ownercoverage_decided_atcoverage_decided_by
- Verify current row is not already in a conflicting exemption state. If already exactly matches approved target values except timestamp/actor, report
already_exempt=true; do not rewrite unless safe and justified. - UPDATE only the approved target row.
- Post-update verification: row has approved values.
- Verify no
fn_birth_registry_autoorfn_birth_registry_auto_idtrigger was created onbirth_registryby this task. - Prepare exact rollback SQL restoring old values per captured row.
Execution requirements
- Single transaction.
- Advisory lock.
- Compiled SQL logged before execution.
- Rollback SQL logged.
- Post-commit verification.
- STOP on mismatch.
Required report path
knowledge/dev/laws/dieu44-trien-khai/reports/p3d-birth-system-b3a2b-birth-registry-exemption-policy-update-report.md
Required final response fields
b3a2b_birth_registry_exemption_status=PASS|PASS_ALREADY_EXEMPT|BLOCKED|FAILED
target_collection=birth_registry
rows_updated=<N>
already_exempt=true|false
transaction_committed=true|false
rollback_values_captured=true|false
coverage_status=BIRTH_EXEMPT_SYSTEM_LOG_OR_AUDIT
coverage_scope_status=IN_SCOPE
system_managed_semantics_in_exemption_reason=true|false
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
If any gate fails:
- STOP before mutation.
- Write a BLOCKED report with exact failing gate and live evidence.