P3D Pack 1 Phase 5 — TAC→IU Migration Design Report
P3D Pack 1 Phase 5 — TAC→IU Migration Design Report
Date: 2026-05-11 Author: Opus 4.7
Status flags
phase5_status=PASS
mode=DESIGN_AND_DRYRUN_PROMPT_ONLY
phase4d_option=OPTION_2_DEFER_SPECIES_TO_PHASE5
nesting_decision_locked=false
species_decision_locked=false
migration_allowed=false
seed_allowed=false
backfill_allowed=false
read_only_prompt_created=true
post_implementation_design_rule_included=true
next_required_action=GPT_REVIEW_PHASE5_DESIGN_AND_DRYRUN_PROMPT
Paths
| Artifact | Path |
|---|---|
| Design | ...design/p3d-pack1-phase5-tac-to-iu-migration-design.md |
| Mission prompt | ...prompts/p3d-pack1-phase5-readonly-dryrun-tac-to-iu-migration-prompt.md |
| This report | ...reports/p3d-pack1-phase5-tac-to-iu-migration-design-report.md |
Top 7 migration design decisions/questions
-
Nesting: preserve, flatten, or hybrid? THE first question. TAC has real parent→child nesting (live evidence from Phase 4B: parent column detected, most units have parent, depth up to 2). Decision drives composition → species → everything.
-
Creation pathway: fn_iu_create or direct INSERT? fn_iu_create enforces all gates + birth + invariants. Direct INSERT relies on triggers. Dry-run G8 will analyze both pathways from live function source.
-
Hash reconciliation: IU recomputes, TAC preserved as provenance. IU's fn_content_hash uses body-only sha256. TAC's hash is composite (title|body|description|content_profile). Migration must let IU compute its own hash AND store TAC's original hash as provenance reference.
-
Species: resolved AFTER nesting decision, not before. Phase 4C gave 8 PLAUSIBLE candidates (5 atom, 3 molecule). Nesting decision narrows this to correct composition range. G7 in dry-run computes options per nesting option.
-
Pilot-first strategy. One publication first, verify all gates + render fidelity, then batch. Pilot selection from dry-run G10 (structural diversity, manageable size).
-
Per-publication transactions with exact-key rollback. Each publication = one transaction. COMMIT after verification. Rollback by exact inserted keys, not pattern.
-
Sub-phasing: 5A (nesting decision) → 5B (species resolution) → 5C (pilot) → 5D (batch) → 5E (post-implementation design). Phase 5 is too large for one pack. Each sub-phase has its own GPT/User gate.
Hardcode self-check
| Item | Hardcoded? | Source |
|---|---|---|
| Row counts | No | Live queries |
| Column names | No | Introspect + detect_col |
| Species codes | No | Derive from entity_species live |
| Composition levels | No | Derive from entity_species live |
| Section types | No | Derive from source table live |
| Publication names | No | From dry-run G10 live candidates |
| Parent column name | No | detect_col pattern |
| Hash algorithm | No | From fn_content_hash source capture |
Confirmation
GPT + User review required before dispatch. No agent, no migration, no seed.