KB-61B1

P3D Birth — B3-A1b dot_domain_rules Species Mapping Seed Report

6 min read Revision 1
p3d-birthb3-a1bspecies-mappingdot_domain_rulesgovernance_infraseedreport

title: P3D Birth — B3-A1b dot_domain_rules Species Mapping Seed Report mainline: P3D_BIRTH_SYSTEM_COMPLETION_PACK phase: B3-A1b status: PASS date: 2026-05-12 host: 38.242.240.89 db: postgres (container=postgres, db=directus)

B3-A1b — dot_domain_rules → governance_infra Species Mapping Seed

1. Input — Approved Mapping

collection_name species_code is_primary
dot_domain_rules governance_infra true

Approved-mapping count: 1.

2. Hard Boundaries Honored

  • INSERT-only into public.species_collection_map — yes (exactly one row).
  • Only the approved pair inserted — yes.
  • No entity_species INSERT — confirmed.
  • No other species_collection_map INSERT — confirmed.
  • No UPDATE / DELETE — confirmed.
  • No trigger creation — confirmed.
  • No function creation or patch — confirmed.
  • No DDL — confirmed.
  • No migration — confirmed.
  • No Phase 5C2 — confirmed.
  • No UI cutover — confirmed.
  • B3-A birth triggers not installed in this session — confirmed.

3. Preflight Gate Results (live PG re-query, no historical counts)

All gates executed inside the single transaction after pg_advisory_xact_lock(hashtext('p3d_birth_b3a1b_dot_domain_rules_species_seed')).

# Gate Result Evidence
1 Advisory lock acquired PASS pg_advisory_xact_lock(...) returned void without error
2 public.collection_registry exists PASS gate2_tbl_collection_registry=true
3 public.species_collection_map exists PASS gate3_tbl_species_collection_map=true
4 public.entity_species exists PASS gate4_tbl_entity_species=true
5 public.birth_registry exists PASS gate5_tbl_birth_registry=true
6 collection_registry contains dot_domain_rules (exactly 1 row) PASS gate6_dot_domain_rules_in_registry=1
7 dot_domain_rules has coverage_status='BIRTH_REQUIRED' AND coverage_scope_status='IN_SCOPE' PASS gate7_dot_domain_rules_status_ok=1
8 entity_species.species_code='governance_infra' exists PASS gate8_governance_infra_species=1
9 No conflicting prior mapping for dot_domain_rules → other species PASS gate9_conflicting_count=0
10 Exact mapping pre-state MISSING → INSERT path pre_exact_pair_count=0
11 birth_registry side-effect counted before/after PASS (evidence-based) pre_br_total=212828; post_br_total=212829
12 Post-insert verification — exact pair exists PASS post_exact_pair_count=1, final_exact_pair=1
13 Rollback key captured PASS species_collection_map.id = 169
14 Exact rollback SQL prepared PASS see §6

4. Outcome

  • Mapping already existed? No (pre_exact_pair_count=0).
  • Inserted exactly one row? Yes.
  • Inserted row:
id species_code collection_name is_primary
169 governance_infra dot_domain_rules true

inserted_count=1, already_exists_count=0, blocked_count=0.

5. Compiled SQL (logged)

BEGIN;
SELECT pg_advisory_xact_lock(hashtext('p3d_birth_b3a1b_dot_domain_rules_species_seed'));

-- gates 2–9 + pre snapshot (read-only)

INSERT INTO public.species_collection_map (species_code, collection_name, is_primary)
VALUES ('governance_infra', 'dot_domain_rules', true)
RETURNING id;
-- → 169

-- post snapshot
COMMIT;

transaction_committed=true.

6. Exact Rollback SQL (scoped by captured id only)

BEGIN;
SELECT pg_advisory_xact_lock(hashtext('p3d_birth_b3a1b_dot_domain_rules_species_seed_rollback'));
DELETE FROM public.species_collection_map
 WHERE id = 169
   AND species_code = 'governance_infra'
   AND collection_name = 'dot_domain_rules';
COMMIT;

rollback_keys_captured=true.

7. auto_birth_rows_emitted — Evidence

A pre-existing trigger fires on INSERT into species_collection_map:

Triggers:
    birth_trigger_species_collection_map AFTER INSERT ON species_collection_map
      FOR EACH ROW EXECUTE FUNCTION fn_birth_registry_auto()

This trigger is pre-existing (not created by this session). Its side-effect is allowed per scope.

Side-effect counts:

Counter Before After Δ
birth_registry total rows 212828 212829 +1
birth_registry rows where collection='dot_domain_rules' 0 0 0

The new birth_registry row records the species_collection_map row itself, not a dot_domain_rules entity:

id=224719
entity_code=species_collection_map::169
collection_name=species_collection_map
species_code=governance_infra
dot_origin=PG:trg_birth_species_collection_map
born_at=2026-05-12 10:24:17.621693+00
status=born

auto_birth_rows_emitted = 1 (from the pre-existing trigger; no dot_domain_rules entity births occurred — that is the job of B3-A birth installation in a separate phase).

8. Disabled User Trigger (informational)

Disabled user triggers:
    trg_count_species_collection_map AFTER INSERT OR DELETE ON species_collection_map
      FOR EACH STATEMENT EXECUTE FUNCTION update_record_count()

Disabled — did not fire. No action taken on it in this session.

9. Scope Confirmations

  • no_entity_species_insert=true
  • no_trigger_created=true
  • no_ddl=true
  • no_function_patch=true
  • no_5c2_migration=true

10. Final Recommendation

b3a1b_dot_species_seed_status=PASS. species_collection_map now covers the 8th and final pending dot_domain_rules mapping. Hand back to GPT for review, then re-run B3-A readiness gate; species mapping gap that downgraded B3-A to PARTIAL should now clear.

next_recommended_action=GPT_REVIEW_THEN_RERUN_B3A_READINESS

Back to Knowledge Hub knowledge/dev/laws/dieu44-trien-khai/reports/p3d-birth-b3a1b-dot-domain-rules-species-mapping-seed-report.md