IU Core Production DDL — 11 Final report
IU Core Production DDL — 11 Final report
Date: 2026-05-21 Macro:
v0.6-iu-core-production-ddl-and-runtime-prep-open-goalResult:IU_CORE_PRODUCTION_DDL_APPLIED_AND_RUNTIME_PREP_PASS
1. Final status
IU_CORE_PRODUCTION_DDL_APPLIED_AND_RUNTIME_PREP_PASS. All 6 production-DDL
gates passed; the prompt's narrow approval was in force; DDL 001..005 was
applied to the production directus database and verified; residual H3 was
closed with a real defect found and fixed; the next runtime layer was
authored and validated; tests pass; changes committed.
2. What changed
- Production
directusDB: iu-core substrate created — 7 tables, 2 views, 7 functions, 30 indexes; 0 triggers, 0 rows. Existing IU data unchanged. Master gate remains closed (substrate inert). - Repo: H3 fix to
fn_iu_emit_eventin005; newsql/iu-core/runtime/package (4 SQL + 3 rollback + README); README updated; +11 tests.
3. Repo path / branch / HEAD / commit
/Users/nmhuyen/iu-cutter-build/repo/iu-cutter, branchmain.- HEAD
4ce2667→4601d83(parent4ce2667, 11 files, +603/-16). - No push, no merge, no tag.
4. Production approval + gate result
The prompt granted a narrow production-DDL approval (apply 001..005 only, if all gates pass). 6/6 gates PASS: host, target identity, sha-verified backup, greenfield drift check, package integrity, rollback boundary.
5. Backup result
pg_dump -Fc of directus →
/root/backups/iu-core-prod-ddl/directus-pre-iucore-20260521T103010Z.dump
on vmi3080463, 74,400,952 bytes, sha256
4c18e317c46007991a39be10769f28dbdd599ea497010b52d15f84a71022289d
(container/host copies identical), pg_restore -l TOC 2873 objects.
6. DDL apply result
001..005 applied via psql -v ON_ERROR_STOP=1 (no -1), each file
self-transacted, exit code checked per file. All 5 OK, 0 errors.
7. Verification result
7 tables / 2 views / 7 functions / 30 indexes / 0 triggers / 0 rows;
information_unit=158, unit_version=165 unchanged;
fn_iu_core_routes_enabled()=false; v_iu_tree=158 rows depth≥0;
v_iu_sql_link_resolved=0 rows. Matches SSOT report-10 expected counts.
8. H3 result
CLOSED. Gate-OPEN emit path exercised on production via two rolled-back
transactions. Found 2 real defects in fn_iu_emit_event (event_stream
'workflow' and payload_classification 'safe', both rejected by
event_outbox's CHECKs and the trg_event_outbox_type_validate registry
trigger). Fixed: the helper now sources event_stream/delivery_lane from
event_type_registry and uses 'safe_metadata'; the fix was proven
end-to-end against live event_outbox. D3 (uuid→text) cleared as a
non-defect. Production carries the pre-fix body — harmless while the gate
is closed; the runtime macro re-runs idempotent 005 to reconcile.
9. Runtime-prep package result
sql/iu-core/runtime/ authored — event-type seed, route seed (inert),
trigger attach, read-only verification, 3 rollback files, activation +
disable runbook. 020/030 sandbox-proven and reverted clean; 040 ran
clean on production; 010 covered by the H3 probe. Key finding flagged:
unit_version already has a parallel version_applied path
(trg_aa_iu_notif_version → iu_notification_event).
10. Tests
python3 -m unittest tests.test_iu_core_ddl → 50 OK (was 39).
python3 -m unittest discover -s tests → 536 OK (was 525, +11),
zero regressions.
11. KB reports (7)
knowledge/dev/laws/dieu44-trien-khai/v0.6-iu-core-production-ddl-and-runtime-prep-open-goal/
01 precheck · 02 survey-gates-backup · 03 ddl-apply-verification ·
04 h3-closure · 05 runtime-prep-package ·
10 next-runtime-activation-approval-package · 11 final-report.
12. Exact next macro
v0.6-iu-core-runtime-activation — under a separate sovereign gate,
re-run idempotent 005 (H3 reconcile), then apply runtime/010 + 020,
rule on the parallel-path decision, apply 030; route-enable and the
master-gate flip remain further separate gated macros. See report 10.
Forbidden actions — none taken
No production seed, no route enable, no trigger attach on production, no
deploy/restart, no execution_enabled flip, no live runtime-tree mutation,
no secret logged, no push/merge/tag, no GPT handoff as task input, no fake
PASS. All H3 probes and 040 verification were BEGIN … ROLLBACK —
production committed nothing beyond the approved DDL 001..005.
Route
STOP. Route to GPT/User for runtime-activation approval.