P3D Pack 1 Phase 4B — Legal Alignment Addendum
P3D Pack 1 Phase 4B — Legal Alignment Addendum
Date: 2026-05-11 Author: Opus 4.7 Status: Addendum to Phase 4B design — law-first, discovery-second Trigger: GPT review rejected Phase 4B for insufficient old-law compliance
A. Law inventory read
| Law / Procedure | Version | Key content for Phase 4B |
|---|---|---|
| Điều 0-B | v3.1 S111 | 6 lớp cấu tạo. "Entity này chứa gì bên trong?" determines composition_level. atom = không chứa entity khác. |
| Điều 0-G | v1.0 S157 | Birth registry: mọi entity → auto INSERT birth_registry. species_code auto-lookup từ species_collection_map JOIN entity_species. NULL species = audit flag. |
| Điều 29 | v2.0 S160 | ONE classification system. Mọi collection: species + birth + đếm. "Thiếu BẤT KỲ thuộc tính nào = KHÔNG TIN CẬY." |
| QT-001 | v3.1 S193 | Backfill: entity đã tồn tại chưa có birth record. 5 bước: check mapping → count gap → backfill → verify → inspect. |
| QT-003R | v3.1 S193 | Retroactive registration: table đã tạo, 0 rows, chưa registry. Đã áp dụng cho IU/UV → COL-176/COL-177. |
| QT-005 | v3.0 S160 | Thăng cấp observed→governed: tạo species riêng → map → backfill QT-001 → update governance_role → verify. |
| Species Taxonomy | v1.2 S157 | 21 species (doc time, 40 live). Species = meta-entity ngoài 6 lớp. Tree 3 tầng (depth 0/1/2). |
| Phase 3 report | 2026-05-11 | IU: 0 species_collection_map, 12 birth_registry NULL species, 0 labels, 0 edges, observed/pilot. |
| Phase 4 report | 2026-05-11 | 14 vocab keys committed. Planner resolves law_unit=plan_ok. Vocab gate OPEN. |
B. Compliance matrix
| # | Requirement | Source law | Current IU state | Status | Phase 4B action |
|---|---|---|---|---|---|
| 1 | Every collection has species mapping | Điều 29 §II | species_collection_map: 0 rows for IU/UV | ❌ MISSING | Discovery must list all 40 species + options; seed after GPT decision |
| 2 | Every collection has birth trigger | Điều 29 §II | trg_birth_information_unit active |
✅ PRESENT | Discovery confirms |
| 3 | Every collection has governance_role | Điều 29 §II | observed (COL-176) |
⚠️ PRESENT but NOT governed | Decision: promote via QT-005 or keep observed |
| 4 | Every collection has purpose description | Điều 29 §II | description_policy=structured_exempt |
⚠️ EXISTS but exempt tier | Review adequacy |
| 5 | Birth auto-fills species from mapping | Điều 0-G §2.2 | NULL (no mapping exists) | ❌ GAP | Create species_collection_map entry → future births auto-fill |
| 6 | Birth auto-fills composition from species | Điều 0-G §2.2 | NULL | ❌ GAP | Composition decision required before mapping |
| 7 | Existing entities without birth → QT-001 backfill | QT-001 | 12 rows with NULL species | ❌ NOT BACKFILLED | After species mapping, run QT-001-aligned backfill (not ad-hoc UPDATE) |
| 8 | Composition determined by containment analysis | Điều 0-B §II | Not analyzed yet | ❓ UNKNOWN | Discovery must answer: does IU contain other entities? |
| 9 | One classification system, no parallel | Điều 29 §I | IU outside species universe | ❌ VIOLATION | IU must JOIN existing system |
| 10 | Promotion observed→governed follows QT-005 | QT-005 | Not applied | ⚠️ IF promoting | Follow QT-005: species → map → backfill → update role → verify |
| 11 | Species gom for non-governed collections | Điều 29 §III | IU is observed → could use gom species | ❓ DEPENDS | If kept observed: gom species (e.g., SPE-GOV). If promoted: dedicated species. |
| 12 | Retroactive registration done | QT-003R | COL-176/COL-177 created (precedent) | ✅ DONE | No action needed |
Summary: 4 missing, 3 present-but-incomplete, 2 unknown (need discovery), 2 conditional, 1 done.
C. Old-law constraints on IU birth/migration
From the laws, these constraints are NON-NEGOTIABLE for Phase 4B:
- Điều 29: IU MUST have species mapping before it's considered trustworthy. "Thiếu BẤT KỲ thuộc tính nào = KHÔNG TIN CẬY."
- Điều 0-G:
fn_birth_registry_autoreadsspecies_collection_map. No mapping → NULL species → audit flag. This is working-as-designed (not a bug), but means IU births are flagged. - Điều 0-B: Composition level MUST be determined by "thứ này chứa gì bên trong?" — not by assumption. Must prove via containment evidence.
- QT-001: Backfill of 12 existing birth_registry rows requires the 5-step procedure, not ad-hoc SQL.
- QT-005: If promoting IU from observed→governed, must follow the promotion procedure: species creation → mapping → backfill → role update → verify.
- Điều 29 §I: "Hai hệ thống hành chính song song = vi phạm Assembly First + Điều 28." IU cannot have its own classification scheme outside the species universe.
D. What current IU violates or lacks
| Violation / Lack | Severity | Law |
|---|---|---|
| No species_collection_map entry | HIGH — invisible to species-based counting/monitoring | Điều 29, Điều 0-G |
| birth_registry species_code=NULL for all 12 rows | HIGH — birth records incomplete | Điều 0-G |
| birth_registry composition_level=NULL for all 12 rows | HIGH — can't classify by lớp cấu tạo | Điều 0-B, Điều 0-G |
| governance_role=observed, not governed | MEDIUM — reduced inspection, adequate for pilot phase | Điều 29 §VI |
| entity_labels: 0 entries | LOW — DOT enrichment, post-birth concern | Not a birth/registry law requirement |
| universal_edges: 0 entries | LOW — DOT enrichment, post-birth concern | Not a birth/registry law requirement |
E. What must be metadata-driven, not code-driven
Per Điều 0-G: "KHÔNG SỬA CODE. Thay đổi = thay đổi metadata." Per Điều 29: "Thêm species mới → KHÔNG SỬA QUERY."
Phase 4B executable actions (after design approval) must be METADATA operations only:
- INSERT into
species_collection_map(metadata) - INSERT into
entity_speciesIF new species needed (metadata) - UPDATE
birth_registryper QT-001 procedure (metadata backfill) - UPDATE
collection_registry.species_code(metadata) - Optionally UPDATE
collection_registry.governance_roleper QT-005 (metadata)
NO function patches. NO trigger patches. NO birth gate changes. NO new queries to maintain.
F. Species decision: law + live registry, not local guess
Phase 4B design v1 recommended "new species E1." This was premature. Per Điều 29:
- If IU stays observed: must use a species-gom (e.g., SPE-GOV for governance infrastructure). Điều 29 §III explicitly defines gom species for non-governed collections.
- If IU promoted to governed: must create dedicated species (QT-005 §BƯỚC 1: "tạo species riêng").
- The decision between gom vs dedicated depends on governance_role promotion decision.
- The exact species_code depends on live entity_species catalog (40 rows — are there existing species that fit? does a governance-infrastructure species already exist?).
Phase 4B discovery must answer:
- What species currently exist in entity_species? (all 40)
- Is there an existing species suitable for IU? (e.g., SPE-GOV if IU stays observed)
- If promoting to governed, what naming convention do other governed collection species follow?
- What tree depth/parent should a new IU species have?
Decision LOCKED = false. Cannot lock until discovery results are reviewed.
G. Composition decision: Điều 0-B criteria + live containment evidence
Phase 4B design v1 recommended "atom F1." This was hypothesis, not conclusion. Per Điều 0-B:
"Câu hỏi duy nhất: Entity này chứa gì bên trong?"
Must answer for IU law_unit:
- Does an IU law_unit contain OTHER entities (with IDs)? If yes → molecule or higher. If no → atom.
- Is parent_or_container_ref a structural containment (IU contains other IU)? Or just a document-tree reference?
- Does the TAC hierarchy (logical_unit parent→child) mean IU law_units CONTAIN each other? Or are they siblings within a publication?
- Are sections (article, paragraph, heading) separate entities or sub-atomic field values?
Discovery evidence needed:
tac_logical_unitparent/child structure: how many have parent_ref? How deep is nesting?information_unit.parent_or_container_ref: schema exists but 12 rows NULL. Is this containment?- Does the IU birth gate or planner treat parent as structural containment?
Decision LOCKED = false. Cannot lock until containment evidence from discovery is reviewed.
H. Birth registry backfill: QT-001 aligned, not ad-hoc
Phase 4B design v1 described backfill as "simple UPDATE SET species_code=..., composition_level=...". This violates QT-001.
QT-001 requires 5 steps:
- Check: species_collection_map exists? birth trigger exists? ✅ already exist for IU.
- Count: source (information_unit) vs birth_registry. Gap = rows with NULL species (currently 12).
- Execute:
dot-birth-backfill --collection=information_unit(or equivalent per QT-001 BƯỚC 3). If dot tool unavailable, fallback to governed SQL that follows QT-001 semantics (UPDATE birth_registry SET species_code, composition_level WHERE collection_name='information_unit' AND species_code IS NULL). - Verify: count again. All 12 rows should now have species.
- Inspect: if governed, run dot-inspect-pen.
The executable prompt for Phase 4C must implement these 5 steps explicitly, not just "UPDATE 12 rows."
I. Revised Phase 4B recommendation
Original Phase 4B: "design + discovery → GPT decides options E/F/G/H."
Revised Phase 4B (law-aligned):
- Discovery first — read-only prompt gathers ALL evidence from live PG.
- Evidence informs decisions — species, composition, governance_role decisions are made by GPT/User based on evidence + old-law requirements.
- No decision locked before discovery — species and composition are hypotheses.
- Phase 4C — executable alignment prompt, follows QT-001/QT-005 procedures explicitly.
- Phase 5 — TAC→IU migration design (only after 4B + 4C done).
Changed from v1:
- Removed all "recommended" labels on species/composition options. Now "hypothesis pending discovery."
- Added compliance matrix as gating requirement.
- Birth backfill redesigned per QT-001.
- Species decision tied to governance_role decision (per Điều 29 §III vs QT-005).
J. Updated migration gates
vocab_gate = OPEN (14 keys, planner plan_ok)
species_mapping_gate = BLOCKED (no species_collection_map for IU)
composition_decision_gate = BLOCKED (not proven via Điều 0-B containment)
governance_promotion_gate = OPEN_QUESTION (observed sufficient for migration? or must promote first?)
birth_backfill_gate = BLOCKED (12 rows NULL, QT-001 not yet executed)
legal_compliance_gate = BLOCKED (compliance matrix items #1,5,6,7,8 unresolved)
label_gate = DEFERRED (DOT enrichment, post-migration)
edge_gate = DEFERRED (DOT enrichment, post-migration)
migration_allowed = false (until species + composition + compliance gates resolved)
Legal Alignment Addendum | Compliance matrix with Điều 0-B, 0-G, 29, QT-001/003R/005 | No decisions locked | 2026-05-11