P3D Phase 5C2-R2 — DIEU-32 Pilot Migration Execution Report (BLOCKED_BEFORE_BEGIN — 4 NULL bodies in TAC source)
P3D Phase 5C2-R2 — DIEU-32 Pilot Migration Execution Report
Date (UTC): 2026-05-14T14:09:00Z Author: Claude Opus 4.7 (1M, xhigh) Authorization: Same overlay as R1 retry (
CONDITIONAL_R2_AUTHORIZED=YES). Triggered conditionally after DIEU-28 PASS. Outcome: BLOCKED_BEFORE_BEGIN — preflight detected 4 source rows withtac_unit_version.body IS NULL. Per hard boundary §"No automatic content repair" and stop condition §"Missing vocab/owner/body > 0", transaction was NOT opened. No PG mutation.
0. Hard boundaries — all honored
| Boundary | Honored |
|---|---|
No BEGIN issued; no fn_iu_create invocation |
✅ |
| No DDL / DML at all | ✅ |
| No content repair attempted on source | ✅ |
| No automatic skip of NULL-body rows (would have required partial-publication migration which is out of spec) | ✅ |
1. Stage A — Preflight (FAIL on body_null_count)
doc_code=DIEU-32
publication_id=6e08315c-7c70-470a-8a6a-32d7e2ae1b94
publication_version=v1.1
publication_lifecycle=proposed
publication_type=law
member_count=23
render_order: min=0 max=22 distinct=23 count=23 contiguous=true
owner_null_count=0
body_null_count=4 ← HARD GATE FAIL
collision_count=0
section_types_distinct=8
section_types_missing_vocab=<none>
pre_iu_count=75 / pre_uv_count=82 / pre_br_iu=75
pre_tac counts: pub=3 lu=86 uv=86 pm=86
HARD_GATES_FAILED = ['body_null=4'] → orchestrator returned BLOCKED_BEFORE_BEGIN; no psql transaction opened.
2. Identified NULL-body rows
Read-only join into TAC source identifies the 4 rows blocking migration:
| canonical_address | section_type | observation |
|---|---|---|
D38-DIEU32-ROOT |
heading |
source tac_unit_version.body IS NULL |
D38-DIEU32-S2 |
heading |
source tac_unit_version.body IS NULL |
D38-DIEU32-S3 |
heading |
source tac_unit_version.body IS NULL |
D38-DIEU32-S4 |
heading |
source tac_unit_version.body IS NULL |
All four are section_type='heading'. This pattern is not random — it likely reflects an upstream TAC ingest convention where heading-only rows have no body. This is a TAC source data-quality / authoring-convention question, not a migration defect.
3. Why no partial migration was attempted
fn_iu_create raises EXCEPTION 'body required' when p_body IS NULL (verified earlier in source inspection of the function). Three options exist for next attempt; none of them is in scope for this run:
- Upstream fix at TAC — populate
tac_unit_version.bodywith the heading text itself (or a normalized empty-string convention) and rerun the orchestrator. Lowest risk. - Patch design § Stage A — allow heading-section_type rows to migrate with a synthesized minimal body (e.g. the title). Requires GPT/Opus design review; loses byte-level preservation (V-3b would no longer be cleanly satisfiable).
- Patch
fn_iu_create— accept NULL body forunit_kind='law_unit' AND section_type='heading'. Requires fn change; not allowed by hard boundary §"No trigger/function changes".
Recommendation: Option 1 (upstream fix). Defer DIEU-32 migration until source rows have non-null bodies.
4. State
No mutation occurred. Pre/post counts identical: information_unit=75, unit_version=82, birth_registry[information_unit]=75, tac_* unchanged. The 4 NULL-body source rows remain as found; no automatic repair was attempted.
5. Required final response fields (DIEU-32)
r2_dieu32_status=BLOCKED_BEFORE_BEGIN
source_count_live=23
body_null_count=4
collision_count=0
owner_null_count=0
missing_vocab_count=0
created_iu_count=0
created_uv_count=0
created_birth_count=0
tac_source_untouched=true
pre_existing_iu_untouched=true
v3_patched_semantics_used=not_reached
rollback_keys_report_path=<none — transaction not opened>
execution_report_path=knowledge/dev/laws/dieu44-trien-khai/reports/p3d-phase5c2-r2-dieu32-pilot-migration-execution-report.md
recommendation=UPSTREAM_FIX_TAC_NULL_BODIES_THEN_RETRY
P3D Phase 5C2-R2 | DIEU-32 | 2026-05-14T14:09:00Z | BLOCKED_BEFORE_BEGIN | source data-quality issue (4 NULL bodies, all section_type=heading)