P3D — B3-A2a Variant Function Equivalence Probe — Agent Prompt
P3D — B3-A2a Variant Function Equivalence Probe — Agent Prompt
Date: 2026-05-12 Mode: READ-ONLY ONLY Mainline: P3D_BIRTH_SYSTEM_COMPLETION_PACK
Mission
Run B3-A2a Variant Function Equivalence Probe.
The proposed whitelist of fn_birth_registry_auto_id is conditional. Determine whether fn_birth_registry_auto_id is a safe contract sibling of fn_birth_registry_auto for the 3 variant-bound tables.
Context
- B3-A2 design was patched by GPT and confirmed by Opus.
- Do not infer equivalence from
_idsuffix. - Whitelist is not validator-green until this probe is reviewed by GPT.
Hard boundaries
- No INSERT.
- No UPDATE.
- No DELETE.
- No DDL.
- No trigger creation/drop/alter.
- No function creation/patch.
- No policy update.
- No B3-A3 trigger install.
- No Phase 5C2.
- No UI cutover.
Writing the final report to Agent Data is allowed.
Required live checks
-
Resolve both functions live from
pg_proc:public.fn_birth_registry_autopublic.fn_birth_registry_auto_idCapture OIDs, argument signatures, return type, language, volatility, owner.
-
Use
pg_get_functiondef()to capture both function definitions. -
Compare semantics, not just names:
- How
entity_code/ entity id is derived. - How
species_codeis resolved. - How
composition_levelis resolved. - How
collection_nameis resolved. - How
birth_registryINSERT is built. - Differences in guards, status, origin, owner, timestamps, exception handling.
- How
-
List all enabled non-internal triggers bound to either function, with:
- table
- trigger name
- timing
- event
- row/statement
- enabled state
- tgfoid
-
For the 3 variant-only tables:
governance_relationslaw_dot_enforcementlaw_jurisdiction
Verify:
- physical table exists;
- PK / ID columns;
- species mapping exists;
collection_registry.coverage_statusandcoverage_scope_status.
-
Inspect read-only sample
birth_registryrows emitted for these 3 collections if present.- Do not insert test rows.
- If no safe sample exists, report
NO_SAMPLE_AVAILABLErather than mutating.
-
Classify equivalence:
EQUIVALENT_SAFE_SIBLINGPARTIAL_NEEDS_REVIEWNOT_EQUIVALENT_BLOCKEDINSUFFICIENT_EVIDENCE
-
Recommend whether validators may accept
fn_birth_registry_auto_idas a valid contract sibling, or whether migration/function design is needed.
Anti-hardcode
- Do not hardcode OIDs from prior reports as truth; resolve live.
- Do not infer equivalence from
_idsuffix. - Counts are evidence snapshots only.
Required report path
knowledge/dev/laws/dieu44-trien-khai/reports/p3d-birth-system-b3a2a-variant-function-equivalence-probe-report.md
Required final response fields
b3a2a_variant_equivalence_status=PASS|PARTIAL|BLOCKED
fn_birth_registry_auto_resolved=true|false
fn_birth_registry_auto_id_resolved=true|false
function_definitions_captured=true|false
variant_bound_table_count=<N>
sample_birth_rows_checked=<N>
equivalence_classification=EQUIVALENT_SAFE_SIBLING|PARTIAL_NEEDS_REVIEW|NOT_EQUIVALENT_BLOCKED|INSUFFICIENT_EVIDENCE
validator_whitelist_recommended=true|false|pending_gpt_review
no_mutation_performed=true
report_path=knowledge/dev/laws/dieu44-trien-khai/reports/p3d-birth-system-b3a2a-variant-function-equivalence-probe-report.md
next_recommended_action=GPT_REVIEW_B3A2A_PROBE
If any required catalog object cannot be resolved, STOP as BLOCKED and write the report with exact failing check.