P3D Pack 1 Phase 5B — Design + Execution Prompt DRAFT Report
P3D Pack 1 Phase 5B — Design + Execution Prompt DRAFT Report
Date: 2026-05-11 Author: Opus 4.7 Mode: DESIGN + EXECUTION-PROMPT-DRAFT ONLY Audience: GPT (review/decision) + User (final approval before any Agent dispatch)
1. Status flags
phase5b_status = PASS
mode = DESIGN_AND_EXECUTION_PROMPT_DRAFT_ONLY
phase5a_dryrun = PASS_ACCEPTED
recommended_nesting = D3_HYBRID
recommended_d3_sub_implementation = D3a_PRIMARY_IDENTITY_PROFILE_JSON (Opus proposal — see open question #1)
recommended_d3b_universal_edges = DEFER_TO_PHASE5E
recommended_pilot = DIEU_35
recommended_species_option = E2A_SINGLE_NEW_SPECIES_information_unit_atom (Opus proposal — see open question #3)
recommended_composition_level = atom
recommended_governance_role_change = DEFER_promotion_QT005_step6_post_pilot
recommended_uv_mapping_seed = NO_subordinate_no_birth_rows
recommended_existing_12_iu_backfill = YES_same_species_as_pilot
migration_allowed = false
seed_allowed = false
backfill_allowed = false
execution_prompt_dispatch_allowed = false
execution_prompt_status = DRAFT_NOT_DISPATCH_READY
placeholders_pending_in_prompt = 7 (see §10 of DRAFT prompt)
post_implementation_design_rule_included = true
requires_GPT_User_review = true
agent_dispatch_allowed = false_until_GPT_USER_APPROVES_prompt_rev1
2. Artifact paths
| Artifact | Path |
|---|---|
| Phase 5B design | knowledge/dev/laws/dieu44-trien-khai/design/p3d-pack1-phase5b-hybrid-nesting-species-pilot-migration-design.md |
| Phase 5C execution prompt — DRAFT | knowledge/dev/laws/dieu44-trien-khai/prompts/p3d-pack1-phase5b-hybrid-pilot-migration-implementation-prompt-DRAFT.md |
| This report | knowledge/dev/laws/dieu44-trien-khai/reports/p3d-pack1-phase5b-design-and-draft-prompt-report.md |
3. What this session produced
Two artifacts. Design covers sections A–N (executive summary; accepted evidence from Phase 5A; D3 rationale; D3 sub-implementation analysis with Opus recommendation; species/composition consequences; QT-005 procedural steps; QT-001 backfill plan for 12 existing IU rows; pilot rationale for DIEU-35; pilot migration algorithm with preflight + per-row + assertions; safety gates; rollback model; post-implementation design requirement; 8 open questions / pushback points; phase boundaries 5B/5C/5D/5E).
Execution prompt DRAFT covers SCOPE BLOCK, GATE-0, PF-1..5 preflight, 4 STEPs (species seed, backfill, pilot migration, render fidelity), ROLLBACK model (in-transaction + post-COMMIT + backfill + species), legal binding (Điều 0-B/0-G/29 + QT-001/005), report requirements, 7 explicitly unresolved placeholders requiring GPT/User decision before the DRAFT becomes dispatch-ready, no-hardcode discipline, and safety summary.
4. Top 7 design choices / questions for GPT/User
These are the decisions that block Phase 5C dispatch. Opus has a default position on each (in parens) but does not lock without GPT/User confirmation.
-
D3 sub-implementation — D3a JSON in identity_profile vs D3b universal_edges vs D3c parent_or_container_ref-as-pointer-only. Opus default: D3a primary (identity_profile JSON keys: tac_parent_anchor, tac_parent_canonical_address, publication_anchor, publication_render_order, tac_sort_order); D3b deferred to Phase 5E; D3c rejected as it visually collapses into D1. Design §D.
-
Composition level = atom: confirm Điều 0-B interpretation that UV (versions) does not count as "contained entity". Opus default: atom. UV/subordinates are convention-treated as sub-atomic parts of the entity, not contained entities. If GPT reads Điều 0-B strictly (UV = contained entity), composition becomes molecule and §F.1 needs revision. Design §M.2.
-
Species option: E.2.A single new species (
information_unit_atom) covering all unit_kinds; or E.2.B per-unit_kind species; or E.2.C reuse gom (SPE-GOV). Opus default: E.2.A. Single mapping covers existing 12 + future 86 + any future unit_kind. Discriminator-based split can be added later without rework. Design §E.2. -
Species naming + entity_species fields: code, display_name (Vietnamese), prefix, depth in taxonomy tree, parent species, kg_metadata. Opus proposal: species_code='information_unit_atom', entity prefix='SPE-IUA', display_name TBD (Vietnamese), depth=1 under an infrastructure root. All exact values are GPT/User decisions. Design §F.1 + Prompt §10 placeholder #1.
-
governance_role: keep
observedfor pilot vs promote togovernedvia QT-005 before pilot. Opus default: keep observed. Promotion adds Điều 29 governed-tier obligations (inspections, label coverage) that the pilot doesn't yet satisfy. Promotion is reversible and can happen at Phase 5E or later. Design §E.3. -
Backfill scope for existing 12 IU rows: backfill with same species as pilot (atomic uniformity) vs assign separate species vs leave NULL. Opus default: backfill with same species. Mixed dataset (12 NULL + 36 mapped after pilot) violates Điều 29. Design §G.
-
render_order storage carrier: identity_profile.publication_render_order (Opus default for pilot) vs build IU publication_member table now (Phase 5B) vs defer to Phase 5D/5E. Opus default: identity_profile carrier for pilot and full batch; IU publication_member table designed as a separate pack after migration is complete. Design §M.7 + Prompt §10 placeholder #7.
(Bonus open questions in design §M.4, M.6, M.8 cover UV mapping seed, universal_edges readiness, etc. They are second-order to the 7 above.)
5. Confirmation: GPT/User review required before any Agent dispatch
✔ No DB write performed in this session.
✔ No Agent dispatched.
✔ No migration, seed, or backfill executed.
✔ No DDL.
✔ No function or trigger patch.
✔ No Directus/Nuxt/Qdrant changes.
✔ Execution prompt is marked DRAFT throughout.
✔ Execution prompt has 7 explicit placeholders requiring GPT/User resolution before rev1.
✔ No hardcoded row counts as gates.
✔ No hardcoded species/composition decision in executable form.
✔ Semantic field registry discipline carried forward from Phase 5A.
Required gates before Agent dispatch:
(a) GPT review of Phase 5B design — accept / amend / reject D3a primary, atom composition,
species option E.2.A, DIEU-35 pilot, governance_role defer, backfill scope, render_order carrier.
(b) User approval after GPT review.
(c) Opus produces prompt rev1 with §10 placeholders resolved per (a) and (b).
(d) GPT final review of prompt rev1.
(e) User GO.
(f) Agent dispatch (Phase 5C single dispatch — species seed + backfill + DIEU-35 pilot + verification).
agent_dispatch_allowed = false until all 6 gates close.
6. Phase boundaries summary
| Phase | Scope | Allowed actions | Status |
|---|---|---|---|
| 5A dry-run | Evidence gathering (TAC counts, nesting, hash, species landscape, birth gate readiness) | Read-only | PASS_ACCEPTED |
| 5B | THIS pack: design + prompt DRAFT + report | Design only, no Agent dispatch, no DB write | PASS (this report) |
| 5C | DIEU-35 pilot (species seed + 12-row backfill + 36-row migration + verification + render fidelity) | Single Agent dispatch with GPT-approved executable prompt rev1; per-publication COMMIT | BLOCKED until 5B accepted |
| 5D | Full batch (DIEU-28 + DIEU-32 = 50 more units) | Reuse 5C algorithm; per-publication COMMITs | BLOCKED until 5C accepted |
| 5E | Post-implementation design + optional universal_edges enrichment (D3b) + optional IU publication_member table | Documentation + follow-on design packs | BLOCKED until 5D accepted |
7. Two-round review summary (per house OR rule "2 vòng rà soát")
Round 1 — OR scan (CP/CQ/NT):
- §FIX_GỐC: design proposes new species + mapping seed as gốc-fix for IU species gap. Not a patch.
- §ASSEMBLY_FIRST: PG-first (species + mapping in metadata; identity_profile JSON in existing column). No Directus/Nuxt change in Phase 5B/5C.
- §0-AU: no hardcode. Semantic field registry resolution + SCOPE BLOCK only.
- §0-AF: report requirements include live evidence capture; production-style verification preserved.
- §FN_TỰ_ĐỘNG: species auto-assignment via fn_birth_registry_auto reading mapping. Migration writes 36 rows that auto-trigger species fill.
- NT-13 PG-FIRST: yes. Step 1 = PG metadata. Step 3 = PG transaction.
- NT-14 "Thực thi được ngay": prompt is structured for executable, but explicitly DRAFT with 7 placeholders pending GPT decision. After resolution, rev1 is dispatch-ready.
Round 2 — Deep rethink (root-cause check):
- Why D3 vs D1: GPT recommends; Opus second-checked and adds "exit ramp preservation" rationale (D3 → D1 is harder than D1 → D3, so start at D3).
- Why new species (E.2.A) vs gom: gom (SPE-GOV) is semantically wrong (IU ≠ governance infrastructure). New species cost is low (1 row in entity_species + 1 row in species_collection_map). Risk of premature species creation mitigated by E.2.A's universal-mapping design.
- Why atom under D3: literal Điều 0-B reading. Open question M.2 (UV-as-contained) raised as a real pushback.
- Why DIEU-35 first: highest diversity_count exposes vocab/section_type gaps early.
- Why backfill 12 existing now: avoid mixed dataset; Điều 29 violation if delayed.
- Why DEFER governance_role promotion: pilot validates migration mechanics; promotion adds governed-tier obligations not yet satisfied.
- Why DRAFT not rev1: 7 placeholders require GPT/User decisions that Opus does not lock alone.
No contradictions found between this design and previously accepted Phase 4 / Phase 5A artifacts.
8. Limits of this session
- Opus did not read all 19 prior phase reports; relied on Phase 5A accepted evidence + Phase 4B addendum + Phase 4D memo per GPT handoff §7 reading list.
- The 7 placeholders in the DRAFT prompt (§10) are deliberate; Opus does not have authority to lock them. They require GPT/User direction.
- Some column names in §5 of the DRAFT prompt are shown as
<resolved field map column>rather than literal because semantic registry rules apply. Prompt rev1 will materialize them per the registry resolution table from Phase 5A G2 (already proven 31/31 concepts). - Render fidelity test (§6 of DRAFT) reconstructs tree from JSON; if GPT chooses D3b primary instead, the fidelity test will reconstruct from
universal_edgesinstead. Adjustment is mechanical.
9. Recommended GPT workflow for review
1. Read Phase 5B design (~6,000 words) — focus on §D (D3 sub-options), §E (species), §M (open questions).
2. Read Phase 5C execution prompt DRAFT — focus on §10 (7 placeholders).
3. Decide each of the 7 top design choices (§4 of this report).
4. Either:
(a) Direct Opus to amend Phase 5B design + produce prompt rev1, OR
(b) Accept design as-is + direct Opus to produce prompt rev1 with §10 resolved per GPT direction.
5. After prompt rev1, GPT final review.
6. User GO.
7. Single Agent dispatch for Phase 5C.
Phase 5B Report | Design + DRAFT prompt complete | 7 placeholders pending GPT/User | No Agent dispatch | 2026-05-11