KB-7D14

IU-0 Pack 1 CP2 DDL Execution Report

3 min read Revision 1
iu0pack1checkpointddldieu44

CP2 — DDL Execution Report

Step 1 Vocab: PASS

INSERT 0 3. Verify SELECT trả 3 rows:

                key                 |       value
------------------------------------+--------------------
 vocab.unit_kind.design_doc_section | design_doc_section
 vocab.section_type.section         | section
 vocab.publication_type.design_doc  | design_doc

Step 2 information_unit: PASS

Table created với 15 cột đúng spec. Indexes:

  • information_unit_pkey (id)
  • idx_iu_canonical (canonical_address)
  • idx_iu_unit_kind
  • idx_iu_parent (partial WHERE NOT NULL)
  • idx_iu_lifecycle
  • idx_iu_identity_profile (GIN)
  • information_unit_canonical_address_key UNIQUE

Trigger trg_iu_updated_at (BEFORE UPDATE) created.

Step 3 unit_version + FK: PASS

Table created với 9 cột. Indexes: pkey, idx_uv_content_hash, idx_uv_unit_id, uq_unit_version_seq UNIQUE(unit_id, version_seq). FK unit_version.unit_id → information_unit(id).

fk_iu_version_anchor: condeferrable=t, condeferred=t

Step 4 Birth gate L1: PASS

Function fn_iu_birth_gate_layer1 + trigger trg_iu_birth_gate_layer1 (BEFORE INSERT) created. Sửa config_keykey ở 3 chỗ SELECT vocab.

Step 5 Birth gate L2: PASS

Function fn_iu_birth_gate_layer2 + CONSTRAINT TRIGGER trg_iu_birth_gate_layer2 created. Verify pg_trigger: tgdeferrable=t, tginitdeferred=t ✓

Full trigger list trên information_unit

            tgname             | tgdeferrable | tginitdeferred
-------------------------------+--------------+----------------
 RI_ConstraintTrigger_a_186686 | f            | f
 RI_ConstraintTrigger_a_186687 | f            | f
 RI_ConstraintTrigger_c_186697 | t            | t
 RI_ConstraintTrigger_c_186698 | t            | t
 trg_iu_birth_gate_layer1      | f            | f
 trg_iu_birth_gate_layer2      | t            | t
 trg_iu_updated_at             | f            | f

4 RI_ConstraintTrigger là internal triggers do FK fk_iu_version_anchor (DEFERRABLE) tạo — bình thường.

Lỗi/warning không mong đợi

Có 1 warning lặp lại — không gây fail nhưng cần ghi nhận:

WARNING:  [TRIGGER-GUARD] DDL detected: CREATE TRIGGER on <name> on public.information_unit

Xuất hiện 3 lần, mỗi lần CREATE TRIGGER trên information_unit (trg_iu_updated_at, trg_iu_birth_gate_layer1, trg_iu_birth_gate_layer2). Đây là cảnh báo audit từ một event trigger sẵn có trên DB (TRIGGER-GUARD), KHÔNG block CREATE — tất cả triggers vẫn được tạo thành công. Cần Opus xác nhận có cần đăng ký các triggers mới với hệ thống audit này không (có thể là yêu cầu governance registration tách biệt — không thuộc Pack 1 scope).

Overall: PASS

DỪNG. Chờ Opus phê duyệt CP3 (smoke tests T1–T14).