P3D — Birth Inventory Prompt rev2 Patch Report
P3D — Birth Inventory Prompt rev2 Discovery-First Patch Report
Date: 2026-05-12 Patched: rev1 → rev2
Top 8 rev2 fixes
-
Self-contained environment discovery — Removed "Same pattern as TAC→UI baseline rev3 Phase 0". Phase 0 now inlines DB container discovery, credentials discovery from compose/env, schema discovery. Zero cross-references to other prompts.
-
Schema discovery, not
publichardcode —db_schema = DISCOVER; public is historical expectation only, not execution truth. Schema resolved viainformation_schema.schematabefore any table query. Resolved schema used in all subsequent SQL. -
Table-family registry — 11 table families declared with semantic hints, required_for, on_absent behavior. Each verified via
information_schema.tablesbefore use. Absent tables → reported, not assumed. -
Concept registry — 20 concepts across 3 groups (11 birth_registry + 6 species/mapping + 3 collection_registry). Each with semantic_hint, required_for, on_unresolved. Resolution rule: 0=FIELD_ABSENT, 1=RESOLVED, >1=AMBIGUOUS_FIELD.
-
PATTERN ONLY SQL — Every SQL block labelled "PATTERN ONLY — compile after resolution." Agent must log compiled SQL in report.
-
Function bounded output — fn_birth_registry_auto, fn_iu_create, fn_iu_birth_gate_layer1: report signature, return type, write targets, checked fields, mode. No unbounded dumps.
-
Deterministic sample — If governed collections ≤ 20 → inspect all. If > 20 → all IU/TAC families + first 10 by stable key ASC. No random selection.
-
Classification counters — Final response includes
required_at_birth_supported_count,required_at_birth_unknown_count,required_hook_supported_count,required_hook_unknown_count,compiled_sql_logged,table_family_resolution_complete,concept_resolution_complete.
Confirmation
inventory_prompt_rev=2
self_contained=true
zero_cross_references=true
gpt_final_review_required=true
agent_dispatch_allowed=false
phase5c2_migration_allowed=false
rev2 Discovery-First Patch Report | 2026-05-12