KB-7186

P3D — Birth Inventory Prompt rev2 Patch Report

3 min read Revision 1
p3dbirth-systeminventoryrev2discovery-firstpatch-report

P3D — Birth Inventory Prompt rev2 Discovery-First Patch Report

Date: 2026-05-12 Patched: rev1 → rev2


Top 8 rev2 fixes

  1. 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.

  2. Schema discovery, not public hardcodedb_schema = DISCOVER; public is historical expectation only, not execution truth. Schema resolved via information_schema.schemata before any table query. Resolved schema used in all subsequent SQL.

  3. Table-family registry — 11 table families declared with semantic hints, required_for, on_absent behavior. Each verified via information_schema.tables before use. Absent tables → reported, not assumed.

  4. 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.

  5. PATTERN ONLY SQL — Every SQL block labelled "PATTERN ONLY — compile after resolution." Agent must log compiled SQL in report.

  6. 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.

  7. Deterministic sample — If governed collections ≤ 20 → inspect all. If > 20 → all IU/TAC families + first 10 by stable key ASC. No random selection.

  8. 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

Back to Knowledge Hub knowledge/dev/laws/dieu44-trien-khai/reports/p3d-birth-system-completion-inventory-prompt-rev2-discovery-first-patch-report.md