KB-43EF

IU-0 — Information Unit Minimum Standard: Index & Core Schema

10 min read Revision 1
iu-0full-draftmodular-v2indexumcprofilecapabilitys191

IU-0 — Information Unit Minimum Standard & Packaging Plan

Trạng thái: FULL DRAFT MODULAR v2 — chờ GPT/User polish review Phiên: S191 (2026-05-03) Authority: Đ44 v0.1.2 controlled DRAFT (chưa enacted) — logical proposal cross-cutting Baseline: OUTLINE-E.1 rev 1 (6 rounds A→E.1, uploaded 2026-05-02) Track A: DONE (orphan 0, ghost bug 0, trigger persist, backup cron) Schema sketch: NON-NORMATIVE EXAMPLE. Không DDL/code/P44-6.


§0. Tóm tắt

  1. IU-0 chốt chuẩn chung Incomex cho information_unit — mọi đối tượng thông tin dùng cùng schema, không hệ thứ hai, không schema riêng TAC/Đ38.
  2. Kế thừa nguyên P38-XC (UMC 10 elements, 10 capabilities, DOT Contract Matrix) và P44-3 (Profile Registry 11 fields), KHÔNG re-design.
  3. Packaging 9 layer + IU-PG CRUD Performance Contract: hot path = PG local only, cold path = async outbox 120s delay.
  4. Track A Legacy Vector đã ổn định. Vector assumptions dựa VRC evidence thật (17 findings). IU vector = hệ song song, không mutate legacy.
  5. Slice-based editing giải quyết vấn đề thực tế: tài liệu dài tốn token, Agent sửa từng slice không rewrite toàn bộ.
  6. Pilot dogfooding 3–5 docs validate trước khi mở rộng.

Phụ thuộc

Tài liệu Vai trò
P38-XC final UMC 10 elements + 10 capabilities + DOT Contract Matrix
P44-3 Profile Registry 11 logical fields + required/optional + versioning
P44-4A Relation Edge Edge conformance design
P44-5A Update Mechanism DOT contract matrix realize
VRC Report rev 1 Vector reality evidence (17 findings)
Track A Completion Legacy vector stabilized (GPT confirmed)
P11A/C/D/E TAC infrastructure + checker proof

Module map — 3 files

File Sections Nội dung Sửa khi
07-iu0-index-and-core.md (file này) §0–§4 Index, authority, guardrails, quyết định, UMC, Profile/Capability Schema cốt lõi hoặc capability set
07b-iu0-packaging-crud-vector.md §5, §5.A, §6 Packaging 9 layer, CRUD hot path, outbox, vector, duplicate, freshness Packaging, CRUD contract, hoặc vector
07c-iu0-protection-slice-pilot-open.md §7–§13 Protection, slice editing, MUP, pilot, OPEN/TD, risk, review Protection, editing, pilot, hoặc OPEN status

Cross-reference: → xem 07b §N hoặc → xem 07c §N. Mỗi bảng/concept chỉ đầy đủ ở 1 nơi.


10 Guardrails (áp dụng toàn bộ IU-0)

# Guardrail
GR-1 KHÔNG re-design UMC, Capability, Profile, Edge, DOT — kế thừa nguyên.
GR-2 KHÔNG DDL, code, migration script.
GR-3 KHÔNG mở P44-6.
GR-4 KHÔNG sửa tài liệu đã upload.
GR-5 KHÔNG mutate legacy vector collection production_documents.
GR-6 KHÔNG tạo object family mới chỉ vì subtype.
GR-7 KHÔNG claim production-ready.
GR-8 KHÔNG hardcode threshold, schedule, vocab.
GR-9 KHÔNG chốt Qdrant implementation — defer APR.
GR-10 KHÔNG suy đoán vector behavior — chỉ dùng VRC evidence.

5 Quyết định đã chốt (không thay đổi)

  1. Legacy KB vector giữ nguyên 100%. Track A DONE.
  2. IU vector = hệ song song, không mutate production_documents.
  3. Duplicate KB + IU = collection separation + freshness dedup.
  4. Vector projection = async delayed outbox 120s. PG CRUD hot path = local only.
  5. Track A completion = tiền đề đã thỏa cho §6 vector design.

§1. Mục đích, phạm vi

§1.1 Vấn đề thực tế

Tài liệu thiết kế Incomex ngày càng dài (P38-XC ~30K chars, P44-3 ~25K chars, P11D-A ~37K chars). Khi Agent sửa: tốn token context (30–50% window), rủi ro drift phần không liên quan, không track "sửa đoạn nào", vector cắt theo ký tự (4000/400) không biết ranh giới logic.

§1.2 Giải pháp IU-0

Chia tài liệu thành information unit có schema chuẩn. Agent sửa từng miếng. Vector embed theo phạm vi miếng. Mỗi miếng tự biết mình là ai, thuộc ai, có lệch không.

§1.3 IU-0 lấp 6 gap

Gap Giải quyết tại
Schema chuẩn chung §2 + §3 (file này)
Đóng gói miếng đầy đủ → xem 07b §5
Vector contract an toàn → xem 07b §6
Bảo vệ nội dung enacted → xem 07c §7
Sửa từng miếng → xem 07c §8
Dùng thử trước mở rộng → xem 07c §10

§1.4 User định hướng S190+

  • Schema miếng thông tin = chuẩn chung, không riêng TAC.
  • Tránh tuyệt đối 2 hệ thống schema.
  • CRUD PG phải nhanh, vector chỉ phục vụ search lâu dài.

Insight từ User: "Vector chỉ phục vụ search lâu dài. Ngay tại thời điểm edit, nội dung đã có sẵn trong context của AI/Agent."

§1.5 Guardrails

→ Xem 10 guardrails GR-1..10 ở đầu file này.


§2. Quyết định chiến lược: một information_unit duy nhất

§2.1 Nguyên tắc

information_unit là universal information substrate cho mọi đối tượng thông tin Incomex. Không hệ schema thứ hai.

Nôm na: thay vì mỗi loại tài liệu lưu kiểu riêng, tất cả đều là information_unit với cùng bộ field cốt lõi (UMC). Khác biệt nằm ở unit_kind + profile extension, không phải schema riêng. Giống mọi công dân đều có CCCD cùng format — nghề khác nhau thêm chứng chỉ hành nghề bên cạnh, không đòi CCCD riêng.

§2.2 unit_kind — vocab extensible

Vocab mở rộng (P38-XC §5.3), KHÔNG enum cứng. Seed controlled-draft:

Seed value Use case
law_unit Văn bản pháp lý (TAC pipeline đã có)
sop_step Bước SOP / quy trình
workflow_step Bước business workflow (Đ34)
knowledge_atom Sự kiện / định nghĩa KB
claim Mệnh đề verify
decision Quyết định kèm rationale
task_instruction Mô tả công việc
rule Validation / business rule
custom Fallback tạm — DOT nhắc chuẩn hoá

Mở rộng qua APR cấp medium. Dogfooding candidates (OPEN IU-0-γ): design_doc_section mới; proof_note merge knowledge_atom + tag; review_comment merge claim + category.

§2.3 Anti-patterns

# Anti-pattern Vì sao sai
AP-1 Tạo schema riêng 1 use case Phân mảnh, không cross-query
AP-2 Đẻ family mới khi chỉ cần subtype Vi phạm Đ44 NS-1
AP-3 Bypass UMC fields Phá contract, birth gate bể
AP-4 Agent tự sáng tác profile field Vi phạm P44-3 INV-P3

§3. Universal Minimum Core — kế thừa P38-XC

Kế thừa nguyên P38-XC §5.2. Section này giải thích, không thêm/bớt element.

§3.1 UMC là gì

10 elements bắt buộc mọi information_unit instance, bất kể use case. Mọi implementation pattern phải bảo toàn. Nôm na: 10 ô bắt buộc trên mọi mẫu đơn.

§3.2 10 UMC elements

# Element Mục đích Fill Immutable?
U1 unit_id Identity duy nhất System auto (UUID)
U2 canonical_address Địa chỉ ổn định, format per unit_kind System/Agent ✅ (sau birth)
U3 unit_kind Phân loại — vocab extensible Agent manual Không
U4 lifecycle_status Trạng thái vòng đời System (default draft) Không
U5 content_anchor_ref Tham chiếu nội dung Agent/System Không
U6 version_anchor_ref Tham chiếu version System auto Không
U7 owner_ref Ai tạo unit Agent manual Không
U8 timestamps + audit created/updated at/by System auto created_at ✅
U9 parent_or_container_ref Container trực tiếp Agent/System Không
U10 conformance_status Conformance, default open System → DOT Tier 4 Không

§3.3 UMC invariants

Invariant Diễn giải
Completeness Mọi unit đủ 10 elements tại birth.
Immutability U1 + U2 immutable sau birth. Sửa nội dung = version mới.
Independence UMC độc lập TAC. TAC là implementation cho law_unit.
Pattern-invariant Dù single table, per-kind, hay hybrid — UMC bảo toàn.
Migration UMC major change cần migration plan + grace period.

§3.4 canonical_address per unit_kind

unit_kind Format example
law_unit Đ44.§3.2
sop_step SOP-DEPLOY.05
design_doc_section P38-XC.§5.2

Non-law format: OPEN P38-X-14, chốt APR per use case.

§3.5 UMC mapping TAC

8/10 có cột physical. Còn 2: U3 unit_kind (chưa có cột — mọi row đồng nhất law_unit; lưu ý section_typeunit_kind), U10 conformance_status (P44-5 tạo).


§4. Profile và capability extension — kế thừa P44-3

Kế thừa nguyên P44-3. Section này giải thích cơ chế.

§4.1 Profile Registry

Quy tắc Diễn giải
Đăng ký bắt buộc Field không trong registry → cấm Agent ghi.
Per-profile entry 1 family đăng ký nhiều profile (identity, content, publication).
Required/Optional Mỗi field 1 trong 2 (INV-P4). Required → birth gate. Optional → DOT INFO.
Versioning Semver. Major = breaking, cần migration.

§4.2 10 capabilities, 4 nhóm

Nhóm Capabilities Tier Birth gate?
Universal Core identity, content, publication, governance 0 Block
Relation Core relation, composition 1 DOT warn
Domain Extension semantic, workflow 2–3 Không log
System Intelligence checker, execution_readiness 4–5 Degrade gracefully

§4.3 3 Tier-0 profiles

Profile Level Required Optional
identity_v1 LU title, owner_lookup_ref, primary_section_type_ref composition_role, aliases, summary_text, description
content_v1 UV (core columns) word_count, key_entities, topics, claim_extractions, granularity_level
publication_v1 Pub publication_authority_ref, publication_type_ref kb_anchor_ref, doc_chair, council_score, jurisdiction, description

Birth gate = 15 elements strict: 10 UMC + 3 identity Required + 2 publication Required.

§4.4 5 cấu trúc lưu trữ

Core columns, Profile JSONB, Edge (universal_edges), DOT state, Derived check (không lưu). Chi tiết: P38-XC §3.3.


IU-0 Index & Core | S191 (2026-05-03) | Kế thừa: P38-XC + P44-3 | Track A: DONE | Modules: 07/07b/07c