KB-31DA

P3D — B3-A2a Variant Function Equivalence Probe — Agent Prompt

4 min read Revision 1
p3dbirth-systemb3a2avariant-functionequivalence-probepromptreadonly

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 _id suffix.
  • 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

  1. Resolve both functions live from pg_proc:

    • public.fn_birth_registry_auto
    • public.fn_birth_registry_auto_id Capture OIDs, argument signatures, return type, language, volatility, owner.
  2. Use pg_get_functiondef() to capture both function definitions.

  3. Compare semantics, not just names:

    • How entity_code / entity id is derived.
    • How species_code is resolved.
    • How composition_level is resolved.
    • How collection_name is resolved.
    • How birth_registry INSERT is built.
    • Differences in guards, status, origin, owner, timestamps, exception handling.
  4. List all enabled non-internal triggers bound to either function, with:

    • table
    • trigger name
    • timing
    • event
    • row/statement
    • enabled state
    • tgfoid
  5. For the 3 variant-only tables:

    • governance_relations
    • law_dot_enforcement
    • law_jurisdiction

    Verify:

    • physical table exists;
    • PK / ID columns;
    • species mapping exists;
    • collection_registry.coverage_status and coverage_scope_status.
  6. Inspect read-only sample birth_registry rows emitted for these 3 collections if present.

    • Do not insert test rows.
    • If no safe sample exists, report NO_SAMPLE_AVAILABLE rather than mutating.
  7. Classify equivalence:

    • EQUIVALENT_SAFE_SIBLING
    • PARTIAL_NEEDS_REVIEW
    • NOT_EQUIVALENT_BLOCKED
    • INSUFFICIENT_EVIDENCE
  8. Recommend whether validators may accept fn_birth_registry_auto_id as 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 _id suffix.
  • 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.

Back to Knowledge Hub knowledge/dev/laws/dieu44-trien-khai/prompts/p3d-birth-system-b3a2a-variant-function-equivalence-probe-prompt.md