KB-1011

23-P0 — IU Schema Return: History Reconciliation Report

7 min read Revision 1
pack-23p0reconciliationhistoryiu-schemafn-iu-editresume-point

23-P0 — IU Schema Return: History Reconciliation Report

Date: 2026-05-06 Author: Opus (Claude) Purpose: Định vị resume point sau Pack 22 COMPLETE, trước khi hoàn thiện miếng thông tin Status: READ-ONLY analysis — không runtime, không DDL/DML


Dòng thời gian tóm tắt

Thời điểm Sự kiện Output
S189-S190 (May 1-2) P38-XC final + Đ44 v0.1.2 controlled DRAFT Schema design hoàn chỉnh trên giấy
S191 (May 3) IU-0 full draft modular v2 (07/07b/07c) 3 files, PASS
S191 (May 3-4) Pilot Round 1: G-Pilot-1→5 2/2 writable slices PASS, 77-95% token savings
S191 (May 4) Minimal Implementation Planning Pack (09) Logical schema + 3 packs đề xuất
S191 (May 4-5) Vướng DOT-119 / birth trigger Roadmap pause → fix DOT-119 first
S191+ (May 5) DOT-119 redesign + 18c birth trigger install trg_birth_information_unit installed
Pack 22 (May 6) fn_iu_create + Gateway enforced Creation path hoàn chỉnh

Trả lời 7 câu hỏi

1. Roadmap cũ nào đã bị Pack 22 supersede?

Roadmap cũ Status Lý do
DOT-119 metadata-driven redesign (18a) SUPERSEDED cho IU fn_iu_create xử lý creation, birth trigger đã hoạt động
DOT-119 repair execution (18b) SUPERSEDED cho IU Tương tự
18c trg_birth_information_unit DONE (đã install trước Pack 22) Birth trigger đã fire, Pack 22 dùng nó
Pack 2B pilot CRUD prerequisite PARTIALLY SUPERSEDED fn_iu_create thay thế creation path, nhưng CRUD edit/delete chưa có
09 Pack 1 (Vocab + Schema + Birth gate) LARGELY DONE Tables tồn tại, vocab seeded, birth gate active, fn_iu_create live
Track 0 (orphan/ghost) Vẫn relevant Tách biệt, không bị Pack 22 ảnh hưởng
Track A (Legacy vector) Vẫn relevant Tách biệt, confirmed DONE (orphan 0, ghost bug 0)

2. IU-0 schema/design còn câu hỏi mở nào?

Đã giải quyết bởi Pack 22:

  • IU-0-β Implementation pattern → RESOLVED: single table information_unit + unit_version
  • IU-0-γ unit_kind extensions → PARTIALLY: design_doc_section seeded vào dot_config
  • IU-0-η MUP threshold → RESOLVED: fn_iu_create enforces 15 elements

Còn mở:

  • IU-0-δ Slice boundary final — chưa test với IU records thật
  • IU-0-ε Vector granularity — defer (vector chưa động)
  • IU-0-ζ Concurrency editing — defer
  • IU-0-θ Profile templates — chưa test
  • IU-0-κ IU Qdrant collection — defer
  • IU-0-λ Shared vs separate outbox — defer
  • P44-6 (Implementation Phase) — chưa chính thức mở, nhưng Pack 22 đã tạo functions trên production

Câu hỏi mới phát sinh từ Pack 22:

  • CRITICAL: Gateway blocks edit workflow. trg_aa_iu/uv_gateway_write_guard chặn INSERT OR UPDATE. Edit slice = INSERT new unit_version + UPDATE anchors → BỊ CHẶN nếu không qua canonical function. Cần fn_iu_edit hoặc tương đương.

3. Pilot result nào vẫn còn valid sau Pack 22?

Tất cả pilot results vẫn valid:

  • G-Pilot-1→5: PASS, evidence không bị invalidate
  • H1-H4: Token savings 77-95%, MUP feasible, CRUD hot path design verified, boundary OK
  • 9 slice metadata: canonical addresses, boundaries, MUP checklist — vẫn đúng
  • Kết luận "không cần thêm pilot vi mô" — vẫn đúng

4. Minimum schema nào cần để miếng thông tin dùng được ngay?

Đã có:

  • information_unit table ✅
  • unit_version table ✅
  • fn_iu_create (canonical create) ✅
  • fn_iu_create_plan (dry-run) ✅
  • Gateway guard (block direct writes) ✅
  • Birth trigger ✅
  • Vocab: design_doc_section, section seeded ✅
  • 5 helper functions ✅

Còn thiếu (minimum):

  1. fn_iu_edit — canonical edit path: INSERT new version + UPDATE anchors + verify invariants + set marker. Không có thì không sửa được slice.
  2. Vocab production status — 3 values vẫn proposed_pilot trong pilot metadata (nhưng đã seeded trong dot_config bởi Pack 22 P1 helpers)
  3. Real IU data — convert ít nhất 1-2 design docs thành IU records qua fn_iu_create
  4. Read path — SELECT không bị gateway chặn (gateway chỉ chặn INSERT/UPDATE). Read OK ngay.

Có thể defer:

  • Soft delete (fn_iu_delete) — cần nhưng không urgently
  • Profile update — cần nhưng sau edit
  • Outbox / vector — defer xa
  • P10D render layer — cần nhưng sau data

5. Nên patch doc nào tiếp: 07, 07-index/core, 09, hay tạo Pack 23 mới?

Tạo Pack 23 mới. Lý do:

  • 09 giả định sequential P44-6 opening → Pack 22 đã bypass quy trình đó
  • Landscape thay đổi lớn: tables tồn tại, fn_iu_create live, gateway enforced
  • 09 Pack 1 (Vocab + Schema) → done. 09 Pack 2 (CRUD) → partially done (create only)
  • Patch 09 sẽ phải rewrite phần lớn → tạo mới gọn hơn

Pack 23 scope đề xuất: CRUD Completion + First IU Data

  • fn_iu_edit (canonical edit path)
  • Convert 1-2 pilot docs → IU records
  • Smoke test full cycle: create → read → edit → verify

6. Resume nhánh nào trước: P10D render layer, schema law patch, hay minimal CRUD pilot?

CRUD pilot trước (fn_iu_edit). Lý do:

  1. fn_iu_edit là blocker #1 — không có thì không sửa slice, tức miếng thông tin chỉ đọc
  2. P10D render layer cần data hiển thị — tạo IU data trước render
  3. Schema law patch (Đ44 enact) — quan trọng nhưng không block CRUD pilot
  4. Thứ tự đúng: fn_iu_edit → real IU data → P10D render

7. Prompt tiếp theo nên giao Agent làm gì?

Thiết kế fn_iu_edit (Pack 23 P1). Cụ thể:

  • fn_iu_edit nhận canonical_address + new body + actor → INSERT new unit_version + UPDATE anchors + verify invariants
  • Phải set canonical_writer marker (tương tự fn_iu_create) để qua gateway
  • Complete-or-nothing: invariant fail = rollback
  • fn_iu_edit_plan (dry-run) tương tự fn_iu_create_plan
  • Idempotent considerations: edit cùng body = no-op? hay vẫn tạo version mới?

Phát hiện quan trọng

Gateway blocks edit — cần giải quyết ngay

fn_iu_create sets app.canonical_writer marker trước INSERT. Gateway guard cho phép. Nhưng không có function nào set marker cho edit operations (INSERT new UV + UPDATE IU anchors).

Nếu Agent cố edit slice bằng direct SQL:

INSERT INTO unit_version(...) VALUES(...);  -- BLOCKED by gateway
UPDATE information_unit SET version_anchor_ref = ...;  -- BLOCKED by gateway

→ Edit bị chặn. Đây là behavior đúng (gateway hoạt động) nhưng thiếu canonical edit path.

Fix: Tạo fn_iu_edit tương tự fn_iu_create — set marker → write → verify → return.


Đề xuất Pack 23 scope

Phase Deliverable Effort
P0 Design fn_iu_edit + fn_iu_edit_plan Low
P1 Implement fn_iu_edit Medium (tương tự P2)
P2 Convert 2 pilot docs → real IU records qua fn_iu_create Low
P3 Smoke test full cycle: create → read → edit → re-read → verify Low

Sau Pack 23: miếng thông tin dùng được (create + read + edit). P10D render layer và soft delete có thể chạy song song hoặc tiếp theo.


23-P0 Reconciliation | 2026-05-06 | READ-ONLY | Chờ GPT/User review

Back to Knowledge Hub knowledge/dev/laws/dieu44-trien-khai/reports/23-p0-iu-schema-return-history-reconciliation-report.md