KB-1DE0 rev 29

Technical Slice Framework — Khung kỹ thuật sơ bộ theo lát thử cho Matrix/Stamp Refactor

60 min read Revision 29
laws-newmatrix-assemblystamp-governancetechnical-frameworkpilot-slicereuse-firstrisk-firstdraftnot-enacted2026-06-15

Technical Slice Framework — Khung kỹ thuật sơ bộ theo lát thử cho Matrix/Stamp Refactor

Vị trí: knowledge/dev/laws-new/technical-slice-framework.md Ngày: 2026-06-15 · Soạn: Claude Code (đọc read-only AgentData KB) · Track: knowledge/dev/laws-new/ Đọc cùng (SSOT track, đều DRAFT not-enacted): de-bai-cai-tien.md (rev33) · cau-hoi-khi-tai-cau-truc.md (rev82) · roadmap-cai-tien.md (rev1) · matrix-refactor-implementation-plan.md (rev5) · matrix-refactor-quick-rules.md (rev8) · matrix-stamp-governance-addendum.md (rev14) · promote-checker-v0.1-spec.md (rev11) · required-stamps.v0.1.json (rev6) Codex audit chain: HOLD → PASS_WITH_MINOR_FIXES → PASS_WITH_COSMETIC_NOTES (3 báo cáo 2026-06-15 trong reports/codex/).


0. Status / Boundary / Non-authorization

Status: DRAFT — READ-ONLY TECHNICAL FRAMEWORK. Tài liệu khung kỹ thuật mỏng để Owner/GPT thấy toàn cảnh quan hệ kỹ thuật + đường tái dùng + rủi ro + phương án lát thử trước khi khảo sát/thiết kế/pilot. Tự thân nó không ủy quyền bất cứ điều gì.

Tài liệu này KHÔNG phải, và KHÔNG cho phép:

  • Not a roadmap — roadmap kỹ thuật chi tiết nằm ở roadmap-cai-tien.md.
  • Not a gap report — không khảo sát hệ thống thực (gap report là pha sau, Owner-gated).
  • Not a detailed design — không thiết kế chi tiết bất kỳ component nào.
  • Not implementation — không sinh mã, migration, DDL, DML.
  • Not pilot approval — không mở pilot, không chọn lát thử cuối cùng.
  • Not checker approval — không phê duyệt/cho phép viết promote checker.
  • Not a source manifest system — không tạo hệ thống manifest nguồn; chỉ inline evidence.
  • Not production mutation — không chạm production / DB / CI / secrets / knowledge/dev/laws/.

Tài liệu này không trả lời toàn bộ Question Catalog. Nó chuẩn bị cho: Owner review → chọn pilot slice → source/revision preflight → scoped read-only survey.

Mutation phạm vi (mọi pass của tài liệu này): chỉ đúng một KB document — technical-slice-framework.md — được tạo/cập nhật; read-only trên mọi nguồn khác; không DB/production/CI/secrets/laws/. (Pass 1: tạo file, rev1. Pass 2: Completion Evidence Pass, rev1→rev2, thêm §16–§20. Pass 3: Codex PASS_WITH_MINOR_FIXES patch — hạ nhãn LIVE/GOVERNED→DOCUMENTARY_ONLY (§4/§13/§17), gỡ mọi schema-change direction (ALTER/cột mới/dot_role/cell_id → giả thuyết read-only Owner-gated), gỡ subagent provenance, sửa Slice B + §15 chain + §18/§19/§20; không đổi non-authorization status.)


1. Mandatory Sources Read

Tất cả đọc trực tiếp từ AgentData KB qua document-read operations (get_document_for_rewrite/get_document), không dựa vào summary/memory. Nơi không tự re-verify được full read trong main process pass này → đánh dấu provenance trung thực (read evidence từ KB document chunks / prior session record; not independently live-verified).

Source Revision / evidence Full hay truncated Ghi chú
knowledge/dev/laws/constitution.md KB rev 44 (HP v4.6.3 BAN HÀNH) FULL (19,132 ký tự) Nguyên tắc 14 tìm thấy nguyên văn — xem §2.
knowledge/dev/ssot/operating-rules.md KB rev 51 (OR v7.58) FULL (5,400) Assembly First, read-only inventory rule, AP-CLOSE, no /tmp as SSOT.
knowledge/dev/laws-new/de-bai-cai-tien.md KB rev 33 FULL (29,088) §I–§VII: governance = quan hệ; Lego Protocol; lifecycle stamp; anti-bloat.
knowledge/dev/laws-new/cau-hoi-khi-tai-cau-truc.md KB rev 82 (~365 câu, ~77 BLOCKER) FULL 145,449 ký tự — read evidence từ KB document chunks / prior session record; not independently live-verified trong pass này (DOCUMENTARY_ONLY) Pilot-slice-first; Dependency Map L0–L8/L5b; Nhóm R; Group S; CONS-001..005; Owner checkpoints; substrate row-counts ([GR] provisional).
knowledge/dev/laws-new/required-stamps.v0.1.json KB rev 6 FULL (3,111) 7 core stamp; precondition≠output; store split.
knowledge/dev/laws-new/promote-checker-v0.1-spec.md KB rev 11 FULL (6,028) Checker verdict-only; 1 candidate packet; fail-closed binding; selftest.
knowledge/dev/laws-new/matrix-stamp-governance-addendum.md KB rev 14 FULL (26,474) §2b pre/post store; §7b Atomic Promote Contract; §7c TTL/cleanup; substrate reuse map; iu_staging_* = HOLD FOR SYSTEM CHECK.
knowledge/dev/laws-new/matrix-refactor-quick-rules.md KB rev 8 FULL (6,057) Rule 1–32 + S1–S14 anti-bloat.
knowledge/dev/laws-new/matrix-refactor-implementation-plan.md KB rev 5 FULL (27,905) 4+3 model; giữ/loại; pilot 10 ngày; governance 3 mức.
knowledge/dev/laws-new/roadmap-cai-tien.md KB rev 1 FULL (15,107) Phase 0–6; HOLD-1 substrate, HOLD-2 atomic promote; Codex checkpoints.
.../reports/codex/codex-question-catalog-...-audit-2026-06-15.md KB rev 1 FULL (24,897) Status HOLD — 5 wording fixes, gate topology, missing SRC/RUN/BYPASS/CRASH risks.
.../reports/codex/codex-follow-up-...-hold-fixes-audit-2026-06-15.md KB rev 1 FULL (8,399) PASS_WITH_MINOR_FIXES.
.../reports/codex/codex-final-...-approval-review-2026-06-15.md KB rev 1 FULL (7,880) PASS_WITH_COSMETIC_NOTES — catalog đủ làm scope-control basis cho Owner gate.

Local checkout check (môi trường này): pwd=/Users/nmhuyen, không phải git repo, find … -path '*laws-new*' = 0 file. Xác nhận: ở đây laws-new chỉ tồn tại trong AgentData KB, khớp phát hiện Codex (checkout repo cũng absent laws-new). Không source nào bị BLOCKED/UNREADABLE.


2. Constitution Principle 14 / Nguyên tắc 14 Binding

2.1 Exact quote (nguyên văn, từ bảng "15 NGUYÊN TẮC NỀN TẢNG", constitution.md KB rev 44, dòng số 14)

| 14 | THỰC THI ĐƯỢC NGAY | Mọi điều khoản enacted PHẢI đủ cụ thể để agent viết mã KHÔNG CẦN HỎI LẠI: dữ liệu ở đâu, ai thực hiện, khi nào chạy, ngưỡng bao nhiêu, kiểm tra bằng gì, sai thì xử lý thế nào. Không trả lời được 6 câu = chưa ban hành. | Luật viết hay nhưng không triển khai được = luật hỏng. Council PHẢI soi góc thực thi trước khi approve. |

Con trỏ chi tiết trong Hiến pháp: → law-01-foundation-principles.md v3.3 + dieu20-thiet-ke-truoc-trien-khai.md v1.1. (Đọc đầy đủ NT14 đòi 6 câu: (1) dữ liệu ở đâu · (2) ai thực hiện · (3) khi nào chạy · (4) ngưỡng bao nhiêu · (5) kiểm tra bằng gì · (6) sai thì xử lý thế nào.)

2.2 Interpretation cho task này

NT14 ràng buộc điều khoản enacted. Khung kỹ thuật này không phải điều khoản enacted và không tuyên bố thực thi được ngay. Vai trò của NT14 ở đây là bộ lọc trung thực: với mỗi component tương lai (checker, atomic promote, stamp, scanner…), trước khi nó được coi là "sẵn sàng triển khai", nó phải trả lời đủ 6 câu. Nhiệm vụ của khung này là làm lộ ra phần CHƯA trả lời được 6 câu — tức các open question/blocker — chứ không che giấu chúng dưới ngôn ngữ "đã xong".

2.3 Khung này obey NT14 thế nào

  • Mọi component được mô tả ở mức quan hệ + ranh giới, kèm cờ rõ ràng "6 câu chưa đủ → chưa enact" (ví dụ checker: "kiểm tra bằng gì" có spec nhưng "dữ liệu ở đâu" = iu_staging_* vẫn HOLD-1; "ai thực hiện/khi nào chạy" của atomic promote = HOLD-2).
  • Substrate được phân loại DOCUMENTARY_ONLY/DESIGN-ONLY/ABSENT/UNKNOWN/CONFLICT (§4) đúng theo "dữ liệu ở đâu" — nhãn tài liệu reported "LIVE/GOVERNED" được hạ về DOCUMENTARY_ONLY cho tới Phase-1 read-only verification; không coi design-only là live.
  • Risk register (§10–§11) chính là danh mục "sai thì xử lý thế nào / kiểm tra bằng gì" còn thiếu → chuyển thành gate, không thành lời hứa.

2.4 Forbidden vì NT14

  • Cấm trình bày bất kỳ component nào là "enacted / executable / ready" khi chưa trả lời đủ 6 câu.
  • Cấm để khung này bị đọc nhầm thành spec ban hành; mọi điều thực thi vẫn phải qua Council/lane Canonical (§32) và đủ 6 câu NT14.
  • Cấm "cứ làm đi" trên phần chưa chắc (cộng hưởng NT9 + OR luật gốc #1).

(Principle 14 found exactly: yes. Source: constitution.md KB rev 44, bảng 15 Nguyên tắc, hàng 14.)


3. Source Authority Snapshot

Câu hỏi Trả lời theo bằng chứng hiện có Hệ quả
Nguồn nào authoritative cho laws-new/* lúc này? AgentData KB là nơi duy nhất chứa đủ 8+ file laws-new (đọc được full); local checkout (cả môi trường này lẫn repo Codex) absent. KB = SoT thực tế hiện tại cho track. Phải pin revision trước survey.
File nào chỉ tồn tại trong KB? Toàn bộ laws-new/* (de-bai, catalog, plan, quick-rules, addendum, roadmap, required-stamps, checker-spec, + 3 codex report). Agent/Codex/Claude phải đọc cùng một revision (Group S: SRC-006).
Nguồn nào phải sync trước khảo sát chi tiết? KB → checkout (SRC-003) và KB → runtime config (required-stamps.v0.1.json → checker runtime, SRC-009/010). Chưa có quy trình sync được xác nhận → drift risk (IMPL-RISK-1).
Bằng chứng nguồn cần ở mức nào (không tạo manifest system)? Inline evidence: ghi path + KB revision (+ hash nếu cần) ngay trong report/survey. Đủ. KHÔNG dựng hệ thống manifest mới trừ khi Owner duyệt (Group S anti-bloat, Codex confirmed).
KB vs checkout vs runtime nếu lệch? Chưa có rule enacted; cần Owner/CONS-004 chốt authority order. Owner decision (§14).

Pin revisions đã quan sát (để freeze baseline ở §14): constitution rev44 · OR rev51 · de-bai rev33 · catalog rev82 · required-stamps rev6 · checker-spec rev11 · addendum rev14 · quick-rules rev8 · plan rev5 · roadmap rev1.

Không tạo manifest system. Bản pin trên là inline evidence — đủ cho preflight; nếu Owner muốn hệ thống ghi nguồn chính thức thì đó là quyết định riêng (Mức 3).


4. Current Substrate Inventory

Phân loại theo bằng chứng tài liệu (KB governed files + [GR] provisional gap-report row-counts được catalog rev82 trích + Codex checkout-ref-counts + addendum HOLD flags). Chưa có truy vấn DB trực tiếp trong task này (truy vấn live = một phần Phase 1 survey, Owner-gated — cố ý không làm). Vì vậy cột Status dùng DOCUMENTARY_ONLY cho mọi asset được báo cáo "LIVE/GOVERNED": đó là giả thuyết tài liệu, chưa Owner-verified, cần Phase 1 read-only substrate check xác nhận — không asset nào được trình bày là live-proven. Row-counts ([GR]) là số tài liệu, không phải bằng chứng live.

Asset Status Evidence read (nguồn) Reuse potential Risk if assumed wrong
birth_registry DOCUMENTARY_ONLY — reported LIVE/GOVERNED; Phase-1 verification required Đ0-G v1.0 (S157); addendum: 162 birth trigger (báo cáo), cột inspect_pen/stamp/gate+certified; [GR] ~1,212,803 rows, 22 cột (documentary); Codex ref 4 Post-promote stamp ledger = cột inspect_* (cơ chế cột đã ban hành sẵn ở Đ0-G — không đề xuất thay đổi schema trong khung này); BIRTH/SPECIES/COLLECTION/GOV stamp Nếu coi 8-field birth là "đủ governance" → dồn tải khai sinh (chính lỗi đề bài muốn tránh).
collection_registry DOCUMENTARY_ONLY — reported LIVE/GOVERNED; Phase-1 verification required HC-REG; [GR] ~168 rows (documentary); plan §4.5; Codex ref 6 SSOT Kho/collection → chiều "Kho" của cell_id (mô hình thuộc tính khái niệm, không registry mới) Coi sandbox_tac đã registered ở đây = sai (COL-014: chưa).
meta_catalog DOCUMENTARY_ONLY — reported LIVE/GOVERNED; Phase-1 verification required Cột layer (báo cáo); [GR] ~169 rows (documentary); Codex ref 23 (cao nhất) Nguồn "Tầng" cho cell_id; gắn cell_id như thuộc tính = giả thuyết khả thi read-only (mọi hiện thực hóa cột/metadata cần thiết kế chi tiết + Owner gate) Dùng làm per-candidate stamp store = xung đột grain (addendum cấm).
dot_tools DOCUMENTARY_ONLY — reported LIVE/GOVERNED; Phase-1 verification required Đ35 v5.2 BAN HÀNH (báo cáo), paired-DOT; [GR] ~309 rows (documentary); báo cáo chưa có cột dot_role/cell_id (chưa live-verified); Codex ref 8 Mọi DOT lắp/kiểm/promote đăng ký ở đây; việc gắn dot_role/cell_id chỉ là giả thuyết khả thi read-only cần khảo sát sau — mọi thay đổi schema/metadata nằm ngoài khung này và cần thiết kế chi tiết + Owner gate (REUSE-013) Giả định scanner One-Roof dot_governance_coverage_scan… đã có = sai (addendum: CHƯA tồn tại).
universal_edges DOCUMENTARY_ONLY — reported LIVE/GOVERNED; Phase-1 verification required [GR] ~2,199 rows (documentary); integer-keyed (IU-edges uuid riêng); Codex ref 2 RELATION_STAMP, Object Card, quan hệ (graph riêng — KHÔNG phải chiều ma trận) Gộp 2 store cạnh = vi phạm "no hidden second graph SoT".
system_issues DOCUMENTARY_ONLY — reported LIVE/GOVERNED; Phase-1 verification required fn_log_issue (báo cáo); [GR] ~224,102 rows (documentary); Codex ref 8 Log lỗi/cảnh báo cho scanner/quarantine Cấm làm stamp ledger chính (chỉ log lỗi — addendum §2b).
event_outbox DOCUMENTARY_ONLY — reported LIVE/GOVERNED; Phase-1 verification required register-before-emit (báo cáo), event_type_registry 40 types; [GR] ~215,526 rows (documentary); Codex checkout ref 0 Provenance/audit cho Atomic Promote Contract bước 8 Cấm làm source chính của pre-promote stamp. Codex local ref 0 ⇒ runtime-only theo báo cáo, không ở checkout → drift-aware.
registry_changelog DOCUMENTARY_ONLY — reported LIVE/GOVERNED (per [GR]); Phase-1 verification required [GR] ~81,341 rows (documentary); Codex checkout ref 0 Provenance ledger Cấm làm candidate ledger; nhãn "live" chỉ dựa [GR] provisional → cần Phase-1 verify.
iu_staging_record UNKNOWN → likely-LIVE (CONFLICT bằng chứng) addendum/roadmap: HOLD FOR SYSTEM CHECK (chưa verify schema/lifecycle); [GR] rev82: live, 26 cột, PK uuid; Codex checkout ref 0 Ứng viên #1 cho pre-promote staging + candidate packet store (KHÔNG tạo bảng mới) Rủi ro cao nhất: nếu bind checker vào mà schema/lifecycle/TTL không đủ → cả lane sụp. Phải Phase 1 verify (HOLD-1).
iu_staging_payload UNKNOWN → likely-LIVE (CONFLICT) addendum: HOLD FOR SYSTEM CHECK; [GR]: live, 11 cột, CASCADE, cap 10MiB, có blob_ref; Codex ref 0 Lưu payload candidate packet (jsonb) thay vì bảng mới blob_ref → rủi ro orphan/cleanup (RISK-GC). Chưa verify bind theo candidate_id.
governance_candidate_state DESIGN-ONLY (BUILD NO-GO) SB-10; addendum §8 "design-only, BUILD NO-GO"; [GR]: tồn tại nhưng 0 rows / 0 writer; Codex ref 0 Lớp candidacy group-grain (PROMOTE_STAMP) — bổ sung, không thay per-object Cấm coi là live. Nếu khung phụ thuộc nó = giả định sai (group-grain chưa có writer).
sandbox_tac DESIGN-ONLY plan: "sandbox_tac đang tồn tại" nhưng STG-013: "design Đ38, chưa deploy; live = iu_staging"; COL-014: chưa registered; Codex ref 0 Kho tạm mẫu (Đ38) — chỉ tham chiếu CONFLICT giữa plan ("tồn tại") và catalog ("chưa deploy"). Mặc định DESIGN-ONLY, không coi là kho tạm sống.
fn_birth_register / fn_birth_gate DOCUMENTARY_ONLY (gated) — reported LIVE/GOVERNED; Phase-1 verification required plan §4.4/§4.6 (báo cáo): fn_birth_register dry_run default true; fn_birth_gate còn mode=warning + kill-switch app.bypass_birth_gate Đường khai sinh canonical tại promote (BIRTH-013 birth-fold) birth_gate=warning ⇒ "đếm được, chưa chặn được"; bypass kill-switch = bề mặt BYPASS (RISK-BYPASS).
governance_audit_log DOCUMENTARY_ONLY — reported live nhưng ~rỗng; Phase-1 verification required [GR]: ~1 row (documentary) Audit ownership (Đ37) Gần rỗng → không phải ledger Đ32; đừng coi là audit đầy đủ.
normative_registry DOCUMENTARY_ONLY — reported LIVE/GOVERNED; Phase-1 verification required [GR] ~47 rows (documentary) SSOT luật/NRM (ngoài scope lát v0.1; ghi nhận.)
canonical_fields ABSENT (không phải bảng) [GR]: "KHÔNG là bảng"; Codex ref 0 Quick-rule 19 liệt kê nó như "sổ cũ" → không tồn tại dạng bảng; đừng tham chiếu như registry.

Tổng kết phân loại: nhóm được báo cáo LIVE/GOVERNED (birth/collection/meta/dot/edges/issues/outbox/changelog) hiện là DOCUMENTARY_ONLYgiả thuyết tài liệu gợi ý phần lớn nhu cầu có thể tái dùng, nhưng tất cả vẫn cần Phase-1 read-only verification trước khi coi là live (không asset nào live-proven trong task này). Hai mắt xích quyết định lane đều chưa chắc: iu_staging_* (UNKNOWN→cần verify, HOLD-1) và atomic promote transaction (chưa tồn tại, HOLD-2). DESIGN-ONLY (governance_candidate_state, sandbox_tac) không được dùng như live.


5. Reuse-First Technical Map

Concern Existing substrate to reuse Minimal wrapper/metadata/config path What must NOT be created by default New creation allowed only if…
Birth / minimal identity birth_registry (8-field căn cước), fn_birth_register, trigger chain Khai sinh canonical tại promote (BIRTH-013); object kho tạm dùng workspace_id/candidate_id Birth-registry mới; nhồi governance vào khai sinh P0 Birth core bất biến cần thêm field nền tảng + Owner Mức 3.
Governance as information/state governance_role, universal_edges, governance_audit_log, One-Roof Governance = mảnh thông tin/edge/state trên sổ hiện có; DOT bổ sung + stamp xác nhận từng mảnh Governance system song song; registry/workflow cho mỗi governance fact; DOT-per-fact Vùng canonical/kernel/high-risk cần (GOV-016/017) + Owner.
Registries / pivots birth_registry, collection_registry, meta_catalog, dot_tools, universal_edges, normative_registry cell_id như mô hình thuộc tính khái niệm trên sổ hiện có; gắn dot_role/cell_id cho dot_tools = giả thuyết khả thi read-only cần khảo sát sau (KHÔNG thay đổi schema/metadata trong khung hay Phase-1; mọi thay đổi = thiết kế chi tiết tương lai + Owner-gated) Registry mới nếu sổ cũ biểu diễn được (quick-rule 19) Sổ cũ chứng minh không gánh được + Owner Mức 3.
Staging / candidate / temp iu_staging_record + iu_staging_payload (UNKNOWN→verify), fn_iu_staging_create/cleanup Candidate packet = view/projection trên staging metadata hiện có; pre-promote stamp ở đây Persisted packet store/ledger mới; dùng system_issues/meta_catalog làm store Phase 1 chứng minh staging substrate không đủ → JSON staging tối thiểu sandbox-local (chưa tạo bảng).
Matrix cell / cell_id meta_catalog.layer, collection_registry, species taxonomy (Đ29) cell_id (tầng×loài×kho×miền) = mô hình thuộc tính khái niệm (hiện thực hóa thành cột/metadata = giả thuyết read-only, Owner-gated); UNKNOWN/PENDING chỉ ở kho tạm Chiều thứ 5; "7 chiều phẳng"; ontology/domain tree lớn CELL-003/004/007 + CONS-003 (6-vs-7 tầng) Owner-resolved.
IO Contract tests/contracts/* (Đ30/31), dot_agent_api_contract (pattern) 1 record io_contract.v0.1 5 trường (nhận/trả/schema_min/fail/rollback) Module Contract First; gói 5 artifact; contract registry Vùng Mức 3 thật sự cần compatibility/semver (CONS-002 Owner-resolved).
Required stamps required-stamps.v0.1.json (config metadata) Checker đọc file, không hardcode; 7 core stamp ≤ trần 8–10 Stamp-per-piece; thêm core stamp bắt buộc; stamp ledger mới Metadata không gánh được history/evidence/expiry phức tạp + Mức 3 (CONS-001).
DOT / check / verdict dot_tools (309), Đ35 paired-DOT, mô hình PEN/STAMP/GATE DOT generic + config validate nhiều piece; wrapper quanh DOT cũ (REUSE-013) DOT-per-piece; DOT-capability/governance system (DOT-CAP) DOT đích cụ thể thiếu năng lực + chỉ khai contract tối thiểu của DOT đó (DOT-CAP-001).
Atomic promote boundary (chưa có transaction); FIX7 rollback-proof pattern; event_outbox register-before-emit Atomic Promote Contract v0.1 (addendum §7b) chạy sau checker, all-or-nothing Coi PROMOTE_OK là mutation; gộp checker+mutation HOLD-2: cần transaction thật + rehearsal staging trước pilot (AP-* blockers).
Scanner / report / heartbeat Đ23 inverse-check, truy vấn birth_registry (certified=false), system_issues Scanner chỉ liệt kê (read-only báo cáo); heartbeat/freshness tối thiểu Scanner auto-fix; full-system backfill; macro governance L7: scanner phạm vi pilot slice trước; coverage rộng DEFER.
Runtime / config / source delivery AgentData MCP, Postgres, Directus, Qdrant; required-stamps.v0.1.json Read-only healthcheck preflight; fail-closed nếu config không load/parse/pin được Config-delivery subsystem mới; manifest system RISK-RUN/SRC chứng minh đường giao config hiện có không đủ + Owner.

6. Thin Whole-System Relationship Map

Bản đồ nông (không deep-design). Mũi tên = phụ thuộc/luồng; ⛔ = Owner gate; ⟳ = HOLD chưa gỡ.

6.1 Trục nguồn → substrate → lát:

Source authority (AgentData KB, pin revision)  ⛔SRC/CONS
   → Substrate inventory (§4: birth_registry · collection_registry · meta_catalog ·
                          dot_tools · universal_edges · iu_staging_* ⟳HOLD-1)
      → Selected pilot slice (Owner chọn ⛔)  →  Dependency closure (§9 template)

6.2 Vòng đời một mảnh trong lát (workspace → canonical):

workspace/candidate (TEMP_ID_STAMP, iu_staging_* ⟳)
  → cell/context (CELL_STAMP: tầng×loài×kho×miền; UNKNOWN→chỉ kho tạm)
  → IO/check (IO_STAMP · VALIDATION_STAMP · ROLLBACK_STAMP)
  → candidate packet (view/projection, bind candidate_id+packet_hash)
  → promote checker  ──verdict-only──>  PROMOTE_OK / PROMOTE_BLOCKED / ESCALATE_L3
  → [⛔ Owner + selftest]  Atomic Promote Contract (transaction, sau PROMOTE_OK) ⟳HOLD-2
        → BIRTH_STAMP + PROMOTE_STAMP (post-promote store) + consume staging + audit(event_outbox)
        → canonical (kho chính)   |  fail bất kỳ bước → ROLLBACK toàn bộ
  → delete/rehearsal boundary: kho tạm xóa được (TTL + fail-safe); rehearsal chỉ staging/dry-run

6.3 Phụ thuộc ngang (birth/governance/registries/staging/DOT/stamp/runtime):

  • Khai sinh ↔ promote: BIRTH_STAMP đóng tại promote (không trong kho tạm).
  • Stamp config ↔ checker: required-stamps.v0.1.json (metadata) lái checker (không hardcode).
  • DOT ↔ stamp: mỗi DOT đóng một dấu; DOT cũ bất biến. Mọi thay đổi cấu trúc lưu dấu = thiết kế chi tiết tương lai + Owner-gated — không thực hiện trong khung này hay Phase-1.
  • Registries ↔ cell: cell_id (tọa độ ô) là mô hình thuộc tính khái niệm; việc hiện thực hóa nó thành cột/metadata trên meta_catalog/collection_registry/dot_toolsgiả thuyết khả thi read-only — mọi thay đổi schema cần thiết kế chi tiết + Owner gate, không thực hiện ở đây.
  • Runtime ↔ tất cả: checker/atomic-promote cần config load được + runtime alive (RISK-RUN/SRC).

6.4 Vị trí các cơ quan tương lai:

  • Checker sẽ ngồi ở cổng promote (L5) — verdict-only, đọc 1 packet; không scan toàn hệ.
  • Scanner/heartbeat quan sát ở L7 — chỉ liệt kê thiếu dấu/orphan/promote-blocked + freshness; không sửa.
  • Owner decision gates ⛔ tại: chọn slice · duyệt new-artifact exception · cho phép viết checker · mở rehearsal · mở pilot · mọi thứ chạm canonical/production (lane Canonical/Đ32).

7. Pilot-Slice Method

  1. Hẹp. Một lát = một đường workflow thật, tối thiểu số ô/loài/kho; không khảo sát toàn hệ.
  2. Đủ đại diện. Phải chạm đủ chuỗi: workspace → candidate → cell/context → IO/check → stamp/verdict → delete/rehearsal boundary. Không chọn lát "dễ nhưng không đại diện" chỉ để PASS (Codex: false-confidence risk).
  3. Chạm đường thật. Ưu tiên lát bắt đầu từ staging/candidate, tránh canonical write ở v0.1.
  4. Proof boundary giới hạn. Lát thành công chỉ chứng minh đúng proof boundary của nó, không suy ra toàn hệ (§2e catalog: cấm extrapolate local PASS → whole system).
  5. Ngoài lát = TODO/DEFER. Mọi câu hỏi ngoài dependency closure của lát giữ TODO/DEFER, không block lát.
  6. Stop/abort budget. Lát có ngân sách: số bề mặt chạm, số artifact mới tối đa (mặc định 0 registry/table/DOT mới), thời lượng, trigger rollback (PILOT-018 + BUDGET-001).
  7. No lane before checker. Chưa có checker fail-closed chạy block-mode + selftest PASS thì chưa tuyên bố lane (quick-rule 32). "A paper lane is no lane."

8. Candidate Pilot Slice Options

KHÔNG chọn lát cuối cùng. Đây là các phương án để Owner chọn. Không phương án nào cần production mutation hay full backfill. Lát tốt nhất nên bắt đầu từ staging/candidate và tránh canonical write.

Slice A — Information-unit workspace→candidate→checker-verdict→delete loop (trong iu_staging, không promote write)

Tiêu chí Nội dung
Why useful Đúng "viên gạch nguyên tử" (Đ38 TAC/mảnh thông tin); chứng minh trọn vòng kho tạm + verdict + xóa, tận dụng staging hiện có.
Reuse assets iu_staging_record/payload (⟳verify), fn_iu_staging_create/cleanup, fn_iu_cut_from_manifest (~70% reusable), required-stamps.v0.1.json, checker-spec.
Direct dependencies HOLD-1 (iu_staging_* schema/lifecycle/TTL/bind candidate_id); packet_hash (STG-015); CELL_STAMP cho 1 cell; cleanup fail-safe (STG-012).
Risks iu_staging_* chưa verify; blob_ref orphan (RISK-GC); cell UNKNOWN (RISK-CELL).
What it proves workspace→candidate→IO/VALIDATION/ROLLBACK stamp→checker PROMOTE_OK/BLOCKED→delete chạy thật trong staging; "sai thì xóa được".
What it does NOT prove Atomic promote/canonical write (HOLD-2); toàn hệ; representativeness ngoài species information_unit.
Recommendation Ứng viên mạnh nhất cho v0.1 (staging-first, no canonical write). Owner quyết.

Slice B — Read-only feasibility candidate for DOT-role/cell mapping (KHÔNG thêm cột, KHÔNG patch dot_tools)

Tiêu chí Nội dung
Why useful Khảo sát read-only feasibility cho đường gắn tọa độ ô + CELL/IO stamp bằng reuse — đánh giá khả thi, KHÔNG thực hiện thay đổi schema/metadata.
Reuse assets dot_tools (309), meta_catalog.layer, collection_registry, required-stamps.v0.1.json.
Direct dependencies CELL-003/004/007 + CONS-003 (6-vs-7 tầng). Bất kỳ cột/metadata mới dot_role/cell_id = thiết kế chi tiết tương lai + Owner-gated, KHÔNG thực hiện ở Phase-1.
Risks Dễ bị đọc nhầm thành "metadata patch được phép" → DOT-CAP system; CONFLICT loài/tầng chưa chốt. Vì vậy giữ read-only feasibility nghiêm ngặt.
What it proves Chỉ documentary feasibility của cell_id-as-attribute + CELL_STAMP/IO_STAMP path reuse — không đóng cột, không chứng minh live.
What it does NOT prove Promote/checker verdict end-to-end; delete-fast; runtime liveness; không chứng minh schema/metadata change là an toàn.
Ràng buộc bắt buộc của Slice B (1) Phase-1 không thêm cột; (2) Phase-1 không patch dot_tools; (3) mọi thay đổi schema/metadata là thiết kế chi tiết tương lai và Owner-gated; (4) Slice B chưa an toàn để làm lát implementation.
Recommendation Chỉ là ứng viên khảo sát khả thi read-only nếu Owner muốn xét reuse-first trước; nhẹ hơn A và chứng minh ít hơn. Owner quyết.

Slice C — Read-only missing-stamp scanner/report (trên birth_registry + system_issues)

Tiêu chí Nội dung
Why useful Chứng minh nguyên tắc "scanner chỉ liệt kê, không sửa" (L7) với rủi ro thấp nhất; không chạm promote.
Reuse assets Truy vấn birth_registry (certified=false/inspect_* IS NULL), Đ23 inverse-check, system_issues/fn_log_issue.
Direct dependencies Read-only DB access (RISK-RUN preflight); index/full-scan trên bảng lớn (RISK-IDX — birth_registry ~1.2M rows).
Risks Full-table-scan trên bảng lớn; scanner phình thành coverage toàn hệ.
What it proves Detector/heartbeat tối thiểu phạm vi hẹp; bảng cảnh báo đỏ không vỡ hệ.
What it does NOT prove Bất kỳ phần promote/checker/atomic-promote nào; delete-fast.
Recommendation Lát "an toàn nhất / chứng minh ít nhất". Tốt làm đệm L7 song song A. Owner quyết.

Slice D — Single display-layer cell mapping (Đ28 template, read-only)

Tiêu chí Nội dung
Why useful Map một object tầng "vật liệu/thành phẩm" phía UI vào ô ma trận để đo độ phủ 4 chiều (read-only).
Reuse assets meta_catalog, UI constitution-new-index.html (Object Card), Đ28 template.
Direct dependencies cell_id resolution (CELL-*); không staging/promote.
Risks Ít đại diện cho vòng promote; chủ yếu chứng minh hiển thị.
What it proves cell_id-mapping + Object Card đọc từ edges hiện có.
What it does NOT prove Vòng kho tạm/promote/checker.
Recommendation Tùy chọn bổ sung; không đủ đại diện để làm lát chính. Owner quyết.

Loại trừ: không phương án nào được phép yêu cầu production mutation, canonical write rộng, hay full-system backfill.


9. Dependency Closure Template

Template để dùng cho scoped survey kế tiếp. KHÔNG điền lát cuối ở đây trừ khi Owner đã chọn.

Selected pilot slice:        < tên lát + cell_id(tầng×loài×kho×miền) >
Direct dependencies:         < substrate/asset/DOT/stamp/config lát chạm trực tiếp >
Cross-cutting gates:         < SRC-* (source/pin) · CONS-* (mâu thuẫn) · RISK-RUN · OWNER checkpoints >
Applicable BLOCKER questions:< chỉ các BLOCKER thuộc lát + direct deps (Catalog rev82) >
DEFER outside slice:         < nhóm/câu ngoài lát → TODO/DEFER, không block >
Proof boundary:              < lát chứng minh CHÍNH XÁC điều gì >
Does not prove:              < lát KHÔNG chứng minh điều gì (đặc biệt HOLD-1/HOLD-2/toàn hệ) >
Owner decisions needed:      < quyết định Owner cần trước khi survey/checker/pilot lát này >

Quy tắc closure (để không under-scope): liệt kê substrate trực tiếp + một cấp phụ thuộc, ghi rõ điều loại trừ; nghi ngờ thiếu → mở rộng closure, không thu hẹp giả tạo (Codex: "direct dependencies under-scoped" risk).


10. Risk Register — Implementation Risks

Risk Trigger Impact Evidence needed Mitigation as question/gate Owner decision needed?
IMPL-1 Source drift KB↔checkout↔runtime Agent/Codex đọc revision khác Owner-approved; config KB≠runtime Khảo sát/triển khai trên bản sai → drift tức thì Pin revision/hash 3 nơi (SRC-001..006, 009/010) Group S preflight trước mọi survey; inline evidence (chốt authority order, CONS-004).
IMPL-2 Wrong authority order laws-new vs Constitution/quick-rules/addendum mâu thuẫn Quyết định dựa nguồn sai CONS-004 authority order; pin Constitution rev44 baseline CONS-004 freeze trước technical survey .
IMPL-3 Accidental new registry/table/DOT/worker/index "Dễ tạo mới hơn" hợp lý hóa duplicate Phình hệ; debt dài hạn; hai SoT REUSE-001..015 + §2c 5-proof; lifecycle-cost compare Create-new blocking rule; new artifact = Owner exception (mọi exception).
IMPL-4 Canonical write bypass Đường ghi canonical không qua checker/atomic-promote; app.bypass_birth_gate Promote không an toàn; vỡ fail-closed RISK-BYPASS-001/002/004; role matrix Block pilot nếu bypass không kiểm soát .
IMPL-5 Pilot too easy / not representative Chọn lát dễ để PASS False confidence; suy sai toàn hệ §2e proof boundary + does-not-prove; representativeness check Pilot-slice method §7.2; ghi closure §9 (duyệt lát).
IMPL-6 Dependency closure under-scoped "Direct dependencies" bỏ sót phụ thuộc Khảo sát thiếu; blocker lọt §9 template + exclusion list Closure rule; Codex checkpoint sau survey Không (review-gated).
IMPL-7 Old draft contradiction unresolved CONS-001 (pre-promote store), CONS-002 (IO fields), CONS-003 (6-vs-7 tầng) cell_id/IO/stamp kết luận sai CONS-001..005 verdict + Owner freeze CONS blockers trước survey (freeze invariants).
IMPL-8 Reuse assumed live but design-only Coi governance_candidate_state/sandbox_tac là live; coi iu_staging_* đã verify Bind vào thứ không tồn tại/0-writer → lane sụp §4 classification; Phase 1 substrate check (HOLD-1) Read-only survey trước, không giả định từ prose (sau survey).
IMPL-9 Catalog → checklist monster Dùng ~365 câu làm khảo sát toàn hệ Tái tạo "một khối khó sửa" mới §2e pilot-slice-first; L0 scope = slice + direct deps Chỉ áp BLOCKER của lát (chọn slice trước).
IMPL-10 Module Contract First regression dưới tên IO Contract IO Contract phình thành gói 5 artifact/contract registry Quay lại hướng module nặng đã loại CONS-002 freeze 5-field boundary IO Contract = 1 record 5 trường (CONS-002).

11. Risk Register — Operational Risks

Risk When it matters Failure mode Minimal read-only evidence Gate before survey/checker/pilot
OP-1 Runtime liveness unavailable (RISK-RUN-001/004) Checker/atomic-promote chạy khi MCP/PG/Qdrant/Directus down Verdict không sinh / treo Read-only healthcheck preflight các runtime BLOCKER trước survey/pilot.
OP-2 Config load/parse/version stale (RISK-RUN-005, SRC-010) required-stamps.v0.1.json không load/parse/pin được Checker dùng config rỗng/cũ → verdict sai Thử load+parse+version-pin; fail-closed path BLOCKER nếu checker/promote dùng runtime config.
OP-3 Stale verdict / config drift (RISK-STL-001/005/006/007) required-stamps đổi sau PROMOTE_OK; stamp thiếu version/hash PROMOTE_OK cũ vẫn được dùng → promote sai rule_version/config_hash trên stamp; TTL cho PROMOTE_OK BLOCKER (đặt sớm L3/L5).
OP-4 Bypass / write permission (RISK-BYPASS-001/002/004) Role/flag ghi canonical/consumed không qua checker Double-promote / canonical-without-checker Role matrix staging vs canonical; audit mọi write path BLOCKER trước pilot.
OP-5 Crash / retry / outbox consistency (RISK-CRASH-001..004) Crash giữa birth/consume/audit; retry canonical-without-audit / consumed-without-canonical / double-promote Commit-boundary analysis; read-only partial-state detector BLOCKER trước pilot promote.
OP-6 JSONB full scan / missing index (RISK-IDX-001..004) Truy vấn jsonb staging/birth_registry (~1.2M rows) Full-table-scan; chậm; lock lan EXPLAIN plan; index coverage; cấm full-scan bảng lớn BLOCKER cho đường truy vấn thật của lát.
OP-7 Long transaction / deadlock (RISK-AP-001/002/004/005) Atomic promote txn quá dài; FOR UPDATE lock Deadlock; lock-range rộng Tách read-only pre-check khỏi commit txn; EXPLAIN/lock rehearsal BLOCKER trước rehearsal (đặt sớm L5/L6).
OP-8 blob_ref / external garbage (RISK-GC-001..006) Xóa candidate có iu_staging_payload.blob_ref Orphan blob/cache/vector blob_ref points where; cleanup DB-only hay emit event REQUIRED → BLOCKER trước delete-fast nếu có blob thật.
OP-9 Scanner / heartbeat silent failure (L7) Scanner/scheduler/cleanup dừng âm thầm trong pilot Hệ tưởng "đủ phủ" nhưng detector chết Freshness/heartbeat measurement của scanner/scheduler/config BLOCKER (minimal scoped) trước pilot; coverage rộng DEFER.
OP-10 Retention / backpressure / cardinality (RISK-CAP-001..003) Packets/verdicts/issues/outbox tăng đột biến Phình; backpressure; cardinality nổ Retention/cardinality thresholds; scanner batch limit REQUIRED trước pilot.
OP-11 Clock / TTL skew (RISK-TIME-001..003) So expires_at/TTL giữa runtime và DB Packet hết hạn sai; promote stale Clock/source định nghĩa TTL; skew handling BLOCKER (TTL clock source).
OP-12 UNKNOWN/PENDING cell context (RISK-CELL-001..004) IO_CHECK/VALIDATE chạy khi cell UNKNOWN; CELL_STAMP sau IO IO/validation vô nghĩa; stamp sai thứ tự CELL_STAMP trước IO/VALIDATION; IO bind resolved cell_id BLOCKER (đặt L2/L3, trước IO/validation).

12. Anti-Bloat / No-New-System Controls

Hard controls (đồng bộ quick-rules 18–23/S1–S14, de-bai §IV/§VI, Codex anti-bloat audit):

  1. Không tạo registry/table/ledger/workflow/DOT/index/worker mới trừ khi đã chứng minh reuse insufficiency (5-proof §2c) Owner duyệt exception (named owner + retirement/merge path + lifecycle cost).
  2. No DOT-per-piece default — DOT generic + config validate nhiều piece; wrapper quanh DOT cũ trước.
  3. No stamp-per-piece default — 7 core stamp ≤ trần 8–10; thêm dấu bắt buộc = thay đổi Mức 3.
  4. No source manifest system by default — source map = inline evidence record; manifest system chỉ khi Owner duyệt.
  5. No full scanner/backfill in v0.1 — scanner phạm vi pilot slice + direct deps trước; coverage rộng DEFER.
  6. No auto-fix scanner — scanner chỉ liệt kê (read-only báo cáo); không tự sửa.
  7. No full-system survey before first slice — chọn lát hẹp trước; ngoài lát TODO/DEFER.
  8. No detailed design in this framework — chỉ quan hệ + ranh giới; thiết kế chi tiết là pha sau.
  9. No Module Contract First regression under IO Contract name — IO Contract = 1 record 5 trường (CONS-002 freeze).
  10. No monster-system expansion — không dựng governance macro hiểu toàn hệ; không Integration Bus/federated registry; candidate packet = projection, không persisted store mặc định.

13. What This Framework Proves / Does Not Prove

This framework proves (một giả thuyết/bản đồ substrate dạng tài liệu (documentary) dựa trên nguồn KB governed + báo cáo trước — không phải live DB proof):

  • Những nguồn nào đã đọc và revision nào (§1) — và rằng AgentData KB là SoT thực tế cho laws-new (§3).
  • Một bản đồ substrate dạng giả thuyết tài liệu (documentary hypothesis) dựa trên nguồn KB governed + báo cáo trước (§4), phân loại DOCUMENTARY_ONLY/DESIGN-ONLY/ABSENT/UNKNOWN/CONFLICT — không phải live DB state.
  • Các đường tái dùng reuse-first ứng viên (§5) và quan hệ nông toàn hệ (§6).
  • Các rủi ro cần kiểm soát, tách implementation (§10) vs operational (§11).
  • Các phương án lát thử (§8) kèm proof boundary + does-not-prove.

This framework does NOT prove:

  • Live DB state / live row counts / live schema / live permissions / live runtime config / operational readiness — chưa truy vấn DB; mọi "live" là documentary, cần Phase-1 read-only verify (row-counts [GR] là số tài liệu, không phải bằng chứng live).
  • Checker correctness (chưa viết; selftest chưa chạy).
  • Atomic promote safety (HOLD-2: chưa có transaction thật + rehearsal).
  • Pilot readiness (chưa chọn/đủ điều kiện lát).
  • Production safety (mọi cổng production vẫn khóa; không chạm).
  • Source sync completeness (KB→checkout→runtime sync chưa xác nhận).
  • Exact detailed design cho mỗi component (cố ý không thiết kế).

14. Owner Decisions Required Before Next Stage

  1. Approve Question Catalog làm scope-control basis (Codex final = PASS_WITH_COSMETIC_NOTES; sẵn cho Owner gate).
  2. Choose pilot slice trong các phương án §8 (mặc định khuyến nghị Slice A; Owner quyết).
  3. Approve blocker set + DEFER set cho lát đã chọn (chỉ BLOCKER của lát + direct deps + cross-cutting gates).
  4. Freeze source authority/revision/hash baseline (pin §3; chốt KB-vs-checkout-vs-runtime authority — SRC/CONS-004).
  5. Freeze CONS invariants hoặc đánh dấu unresolved — CONS-001 (pre-promote stamp store), CONS-002 (IO Contract 5-field), CONS-003 (6-vs-7 tầng), CONS-004 (authority order), CONS-005 (freeze decision).
  6. Authorize scoped read-only survey (Phase 1 substrate check / HOLD-1: verify iu_staging_record/iu_staging_payload schema/lifecycle/TTL/bind candidate_id — chỉ đọc, không tạo bảng).
  7. Confirm no implementation/pilot/checker yetANSWERED + Mức 3 và Codex PASS không phải quyền chuyển pha; chỉ Owner mở pha.

Owner accepts framework → Owner chooses candidate (§8) → Owner approves blocker/DEFER set → freeze source/revision baseline (§3) → freeze hoặc explicitly flag CONS invariants (CONS-001..005) → authorize scoped read-only Phase-1 survey (HOLD-1).

No detailed design, no schema change, no implementation, no checker, no pilot, no rehearsal trước khi có kết quả Phase-1 survey và Owner gate sau đó. Sau survey read-only của lát đã chọn → Codex Checkpoint 1 → Owner quyết bước tiếp (mặc định HOLD với mọi thứ chạm canonical/production).


16. Completion Contract / Thế nào là hoàn thành

Lớp control, không phải lớp architecture mới. Mục đích: làm khung tự kiểm chứng để reviewer/Codex audit bằng chứng đã hoàn chỉnh, không phải đi tìm proof cơ bản còn thiếu.

A. Framework-level completion

Khung này hoàn thành chỉ khi nó chứng minh đủ 11 điều:

  1. mandatory sources đã đọc và pin revision (§1);
  2. Principle 14 trích nguyên văn và áp dụng trung thực (§2);
  3. source authority / KB-vs-checkout-vs-runtime drift được nhận diện (§3);
  4. substrate inventory phân loại mà không overclaim live (§4 — nhãn reported "LIVE/GOVERNED" được hạ về DOCUMENTARY_ONLY; không asset nào live-proven);
  5. reuse-first map tồn tại cho mọi concern lớn (§5);
  6. whole-system relationship map mỏng, không detailed design (§6);
  7. candidate slices chỉ là ứng viên, KHÔNG selected (§8);
  8. dependency closure template tồn tại (§9);
  9. implementation riskoperational risk tách bạch (§10 vs §11);
  10. anti-bloat controls cấm hệ thống mới by default (§12);
  11. Owner decisions liệt kê trước mọi pha kế (§14).

Thiếu bất kỳ điều nào trong 11 → khung chưa framework-level complete → report PARTIAL/BLOCKED, không PASS.

B. Section-level completion (tiêu chí từng section)

Section Hoàn thành chỉ khi…
§1 Sources mỗi nguồn có path + KB revision + full/truncated; nguồn không đọc được = NOT_FOUND/UNREADABLE (không bịa).
§2 Principle 14 exact quote + interpretation + how-obeys + forbidden; nếu không tìm thấy NT14 → BLOCKED.
§3 Source authority trả lời: nguồn nào authoritative · file nào KB-only · phải sync gì · inline-evidence-not-manifest · pin revisions.
§4 Substrate inventory mỗi asset có: classification · evidence source · reuse potential · risk-if-assumed-wrong; nhãn reported "LIVE/GOVERNED" phải hạ về DOCUMENTARY_ONLY (không asset live-proven).
§5 Reuse-first map mỗi concern có: substrate tái dùng · đường wrapper/metadata/config · cái KHÔNG được tạo · điều kiện new.
§6 Relationship map nông (bullets/bảng), có ⛔ Owner-gate + ⟳ HOLD; không deep design.
§7 Pilot-slice method narrow · representative · chạm workflow thật · proof-boundary-only · outside=DEFER · no-lane-before-checker.
§8 Candidate slices 2–4 phương án, mỗi phương án có proof boundary + does-not-prove + "Owner quyết"; không chọn cuối.
§9 Dep-closure template là template rỗng (không điền lát cuối) + closure rule chống under-scope.
§10/§11 Risk registers impl-risk có trigger/impact/evidence/gate/owner; op-risk có when/failure-mode/min-evidence/gate; đủ danh mục bắt buộc.
§12 Anti-bloat cấm mặc định registry/table/DOT/index/worker/manifest/auto-fix/backfill/monster.
§13 Proves/Not tách rõ "proves" vs "does NOT prove" (đặc biệt live/checker/atomic/pilot/production).
§14 Owner decisions liệt kê ≥7 quyết định Owner trước pha kế; ANSWERED/Codex-PASS ≠ authorization.
§15 Next step chỉ Owner review → chọn slice → preflight → scoped read-only survey; không khuyến nghị implementation.

C. Next-phase completion

Khung này KHÔNG đủ để bắt đầu implementation.
Khung này CHỈ complete cho mục đích: Owner review + chuẩn bị chọn pilot slice.
Pha kế DUY NHẤT được mở: scoped read-only substrate survey — SAU khi Owner quyết.
Mọi thứ xa hơn (checker/rehearsal/pilot/canonical/production) vẫn HOLD.

17. Completion Evidence Matrix / Chứng minh hoàn thành bằng gì

Status vocab: PROVEN (verified bằng hành động trong session/artifact của chính doc) · DOCUMENTARY_ONLY (chỉ KB/prose/[GR] provisional, chưa verify live) · UNKNOWN (chưa xác định) · CONFLICT (nguồn nói khác nhau) · BLOCKED (chưa tồn tại/chặn) · DEFER (cố ý hoãn). Quy tắc cứng: KHÔNG mark PROVEN cho live runtime fact trừ khi đã verify live. Chỉ có KB/prose → DOCUMENTARY_ONLY. Codex/[GR] nói "live" nhưng addendum nói HOLD → CONFLICT/UNKNOWN, không PROVEN. Task này không truy vấn DB → không asset substrate nào được PROVEN live. Mọi nhãn §4 reported "LIVE/GOVERNED" đã được hạ về DOCUMENTARY_ONLY (downgraded); row-counts/[GR] không phải bằng chứng live. dot_role/cell_id cho dot_tools = giả thuyết khả thi read-only, không phải metadata patch được ủy quyền.

Claim / Area What would prove it Evidence currently present Evidence still missing Status Blocks next phase?
Mandatory sources read Path+revision đọc full trong session §1: 13 nguồn, revision pinned, đọc full PROVEN No
Principle 14 quote Trích nguyên văn từ constitution §2.1 verbatim, constitution rev44 hàng 14 PROVEN No (nếu missing → BLOCKED)
Source authority snapshot §3 trả lời 5 câu authority §3 đủ; pin 10 revisions Authority order KB-vs-checkout-vs-runtime chưa Owner-chốt (CONS-004) PROVEN (snapshot) / authority order UNKNOWN Yes (SRC/CONS-004 trước survey)
KB vs checkout status Tìm file ở checkout This env: find=0 + not git repo (verified-absent here); Codex: repo absent Có quy trình sync KB→checkout? (SRC-003) DOCUMENTARY_ONLY (repo) / verified-absent here Yes (SRC trước survey)
Runtime/config delivery Chứng minh required-stamps tới runtime Chỉ biết file ở KB rev6 Đường giao KB→runtime; load/parse/version-pin; fail-closed (SRC-009/010, RISK-RUN-005) UNKNOWN Yes (BLOCKER nếu checker dùng runtime config)
Substrate inventory DB introspection live §4 phân loại 16 asset; [GR] row-counts + Codex ref-counts Live verification (Phase-1 survey) DOCUMENTARY_ONLY Partial (cần verify trước design)
iu_staging_record Verify schema/lifecycle/TTL/bind live addendum: HOLD; [GR]: live 26 cột PK uuid; Codex checkout ref 0 Phase-1 live check (HOLD-1) CONFLICT / UNKNOWN Yes (HOLD-1)
iu_staging_payload Verify schema/blob_ref/bind live addendum: HOLD; [GR]: live 11 cột, blob_ref, 10MiB; Codex ref 0 Phase-1 live check + blob_ref behavior CONFLICT / UNKNOWN Yes (HOLD-1)
governance_candidate_state Verify rows + writer live [GR]: tồn tại nhưng 0 rows/0 writer; addendum: design-only BUILD NO-GO — (đã đủ để KHÔNG dùng) DOCUMENTARY_ONLY → design-only Must-not-use (treat absent)
sandbox_tac Verify deployed + registered plan: "đang tồn tại"; catalog STG-013/COL-014: chưa deploy/chưa registered Owner/CONS resolution của mâu thuẫn CONFLICT → design-only Must-not-use as live
required-stamps.v0.1.json Read file + delivery §1: read rev6 (config metadata) Runtime delivery (xem dòng config delivery) DOCUMENTARY_ONLY Partial (config drift gate)
Promote checker spec Read spec + selftest chạy §1: read rev11 (verdict-only) Checker chưa viết; selftest chưa chạy DOCUMENTARY_ONLY Yes (no-lane-before-checker)
Atomic promote Transaction thật + rehearsal addendum §7b design; chưa có transaction HOLD-2: transaction + staging rehearsal BLOCKED Yes (HOLD-2)
Candidate slice A (iu_staging loop) Là ứng viên, không selected §8 liệt kê + recommended; feasibility phụ thuộc HOLD-1 Owner chọn; iu_staging verify claim PROVEN / feasibility UNKNOWN Owner-gated
Candidate slice B (DOT-role/cell mapping, read-only feasibility) Ứng viên, không selected §8 liệt kê (read-only feasibility) CONS-003 (6-vs-7 tầng); dot_role/cell_id = giả thuyết khả thi read-only, KHÔNG phải metadata patch được ủy quyền claim PROVEN (là candidate) / feasibility DOCUMENTARY_ONLY Owner-gated
Candidate slice C (scanner read-only) Ứng viên, không selected §8 liệt kê RISK-IDX (full-scan birth_registry ~1.2M) claim PROVEN / feasibility DOCUMENTARY_ONLY Owner-gated
Candidate slice D (display cell) Ứng viên, không selected §8 liệt kê; đánh dấu "không đủ đại diện làm lát chính" cell_id resolution claim PROVEN / feasibility DOCUMENTARY_ONLY Owner-gated
Implementation risk coverage Đủ danh mục bắt buộc §10 IMPL-1..10 (source drift, authority, new-artifact, bypass, slice-too-easy, under-scope, CONS, design-as-live, monster, MCF-regression) PROVEN No
Operational risk coverage Đủ danh mục bắt buộc §11 OP-1..12 (runtime/config/stale/bypass/crash/index/txn/blob/scanner/retention/time/cell) PROVEN No
Anti-bloat controls 10 control cấm new by default §12 #1..#10 PROVEN No
Owner decision list ≥7 quyết định trước pha kế §14: 7 quyết định PROVEN Yes (mọi transition Owner-gated)

Tổng quan ma trận: 21 hàng. PROVEN = các claim về chính tài liệu (sources/quote/maps/risk/anti-bloat/owner-list) và "candidate-not-selected". Không asset substrate nào PROVEN live. Mọi mắt xích quyết định lane (iu_staging_*, atomic promote, config delivery) = CONFLICT/UNKNOWN/BLOCKED → đều block pha kế cho tới Phase-1 read-only survey + Owner decision.


18. Negative / Hostile Self-Review

Tự cố phá khung bằng giả định xấu (tư duy Codex adversarial). Nếu giả định xấu vẫn dẫn tới PASS/triển khai → khung fail-open và phải sửa. Dưới đây mỗi giả định + hành vi an toàn kỳ vọng + nơi khung enforce (hay phải sửa).

Bad assumption / hostile input Expected safe behavior If framework currently fails, what must be fixed?
1. KB và checkout bất đồng → cứ dùng bản tiện tay OWNER DECISION REQUIRED + SRC/CONS-004 freeze trước survey Khung enforce ở §3 + §10 IMPL-1/2 + §17 (authority order UNKNOWN). Không cần sửa.
2. iu_staging_* là live (vì [GR] nói vậy) PHASE-1 READ-ONLY SURVEY REQUIRED; mark CONFLICT/UNKNOWN, không bind §4 + §17 mark CONFLICT/UNKNOWN; HOLD-1. Không cần sửa.
3. sandbox_tac tồn tại (vì plan nói) DEFER / treat design-only; không coi là kho tạm sống §4 CONFLICT→design-only; §17. Không cần sửa.
4. governance_candidate_state dùng được (vì bảng tồn tại) DO NOT USE (0 writer/0 row, BUILD NO-GO); treat absent §4 DESIGN-ONLY + §17 must-not-use. Không cần sửa.
5. required-stamps config KB = runtime config UNKNOWN → fail-closed; phải chứng minh delivery (SRC-009/010) §11 OP-2 + §17 "Runtime/config delivery"=UNKNOWN (BLOCKER). Không cần sửa.
6. Một role có thể bypass canonical gate (app.bypass_birth_gate) BLOCKED pilot tới khi bypass kiểm soát + audit (RISK-BYPASS) §11 OP-4 + §4 (fn_birth_gate kill-switch). Không cần sửa.
7. Slice A pass → cả hệ ổn PROOF-BOUNDARY-ONLY; cấm extrapolate local PASS → whole system §7.4 + §8 (does-not-prove) + §13. Không cần sửa.
8. Scanner full-scan birth_registry (~1.2M) STOP / RISK-IDX gate; cấm full-scan bảng lớn, scope=pilot slice §11 OP-6 + §12 #5. Không cần sửa.
9. blob_ref cleanup là DB-only nên an toàn DEFER / RISK-GC gate: kiểm blob_ref points where + orphan risk trước delete-fast §11 OP-8. Không cần sửa.
10. Codex/GPT/Claude PASS = quyền mở pilot OWNER DECISION REQUIRED; PASS = answer-quality, không phải phase authorization §14.7 + §2.4 + §17 (Owner-gated). Không cần sửa.
11. Source manifest phải được tạo DO NOT IMPLEMENT; manifest = inline evidence, không hệ thống mới §3 + §12 #4. Không cần sửa.
12. cell UNKNOWN/PENDING vẫn promote được PROMOTE_BLOCKED; UNKNOWN chỉ ở kho tạm, CELL_STAMP chưa đóng §11 OP-12 + §5 (Matrix cell). Không cần sửa.
13. Documentary substrate counts hoặc nhãn LIVE/GOVERNED là đủ bằng chứng live REJECT / downgrade về DOCUMENTARY_ONLY; yêu cầu scoped read-only Phase-1 verification; KHÔNG design/implement từ documentary counts/labels Khung TỪNG fail điểm này (nhãn LIVE/GOVERNED ở §4) → ĐÃ SỬA pass này: hạ nhãn §4/§13/§17 về DOCUMENTARY_ONLY; row-counts đánh dấu documentary; không design/implement từ documentary alone.

Kết luận hostile review: mọi giả định xấu ở trên đều bị khung downgrade/reject an toàn (STOP / BLOCKED / DEFER / OWNER DECISION / PHASE-1 SURVEY / DO NOT IMPLEMENT). Không giả định xấu nào dẫn tới PASS-để-triển-khai → khung không fail-open. 13 ca: 12 ca "không cần sửa"; ca 13 (documentary-counts/LIVE-labels = live proof) khung TỪNG fail và đã được sửa pass này — hạ mọi nhãn reported LIVE/GOVERNED về DOCUMENTARY_ONLY (§4/§13/§17), nên giờ cũng bị reject an toàn.


19. Stop Conditions / Nếu không hoàn thành thì dừng ở đâu

STOP trước Owner review nếu:

  • mandatory sources chưa đọc; hoặc
  • Principle 14 không tìm thấy; hoặc
  • khung authorize implementation (bất kỳ ngôn ngữ "must build/deploy/run live"); hoặc
  • khung coi design-only là live.

STOP trước pilot-slice selection nếu:

  • Owner chưa chấp nhận Question Catalog / khung làm scope basis;
  • source authority baseline chưa pin;
  • CONS invariants chưa freeze hoặc chưa được đánh dấu unresolved.

STOP trước Phase-1 read-only survey nếu:

  • selected slice chưa được Owner chọn;
  • blocker/DEFER set chưa được duyệt;
  • direct dependency closure chưa được ghi (§9);
  • runtime/config/source preflight chưa được định nghĩa (RISK-RUN/SRC).

STOP trước detailed design nếu:

  • Phase-1 read-only survey chưa chuyển các substrate claim liên quan từ DOCUMENTARY_ONLY/UNKNOWN/CONFLICT thành verified evidence (đặc biệt iu_staging_*);
  • applicable BLOCKER questions còn TODO/CONFLICT;
  • reuse-first path chưa được chứng minh.

STOP trước implementation nếu:

  • detailed slice design chưa được audit;
  • checker/rehearsal/pilot gates chưa được Owner-authorize;
  • bất kỳ đường ghi canonical/production nào dính líu mà chưa có phê duyệt rõ ràng.

STOP trước MỌI schema change (ALTER / cột mới / metadata mới — gồm dot_role/cell_id trên dot_tools) nếu:

  • Owner chưa authorize detailed design + implementation cho thay đổi đó; mọi schema/metadata change là future Owner-gated design, không nằm trong khung này hay Phase-1 read-only survey.

Mặc định ở mọi tầng: HOLD. Nghi ngờ → dừng + ghi blocker + chờ Owner, không workaround ngoài scope (OR §8).


20. Final Self-Check Before Reporting

20.1 Macro completion-pass checklist (10 câu — bất kỳ "no" → PARTIAL/BLOCKED, không PASS)

# Câu hỏi Kết quả
1 Đọc actual governed files? Yes — re-read framework (full, via slice) + constitution rev44 (re-check NT14) + catalog/de-bai/codex-final đã trong session.
2 Tránh dựa local prose? Yes — reconstruct từ AgentData KB; local checkout xác nhận absent.
3 Phân biệt documentary vs live evidence? Yes — §17 vocab tách PROVEN vs DOCUMENTARY_ONLY/UNKNOWN/CONFLICT.
4 Tránh mark UNKNOWN thành PROVEN? Yes — không asset substrate nào PROVEN live; iu_staging_*=CONFLICT/UNKNOWN.
5 Tránh chọn pilot slice cuối? Yes — §8 chỉ candidate; §17 "candidate-not-selected"=PROVEN.
6 Tránh ngôn ngữ implementation? Yes — không "must build/deploy/run live"; §0/§13/§19 cấm.
7 Tránh tạo subsystem mới? Yes — chỉ update 1 KB doc; §12 cấm; no manifest system.
8 Giữ Owner authority? Yes — §14.7 + §2.4: ANSWERED/Codex-PASS ≠ authorization.
9 Định nghĩa completion + evidence cho mọi major claim? Yes — §16 (contract A/B/C) + §17 (21-row matrix).
10 Nhận diện phần còn unproven? Yes — §17 CONFLICT/UNKNOWN/BLOCKED rows; HOLD-1/HOLD-2.

20.2 Original framework self-check (preserved + strengthened từ §16 cũ)

Self-check Kết quả
All mandatory sources read? Yes — 13 governed docs/reports + Constitution incl. NT14 (§1).
Principle 14 quoted exactly? Yes — nguyên văn constitution.md rev44, bảng 15 NT, hàng 14 (§2.1); re-checked pass này.
No implementation? Yes — không mã/migration/DDL/DML.
No mutation? Yes — chỉ tạo/cập nhật đúng KB doc này; không DB/production/laws/.
No new artifact except this document? Yes — completion-evidence pass cập nhật in-place, không file mới.
No pilot selected as final? Yes — §8 chỉ là phương án; Owner chọn.
No full-system detailed design? Yes — chỉ quan hệ nông + ranh giới + control layer.
No new registry/table/DOT/index/worker proposed as default? Yes — §12 cấm; mọi new = Owner exception.
Risks separated into implementation and operational? Yes — §10 (IMPL-1..10) / §11 (OP-1..12).
Candidate slices include proof boundary and does-not-prove? Yes — §8 mỗi lát có "What it proves / does not prove".
Section 11 includes runtime/config/bypass/crash/scanner/retention/time? Yes — OP-1..OP-12.
Section 12 forbids monster-system expansion? Yes — control #10.
Completion contract + evidence matrix + hostile review + stop conditions present? Yes — §16/§17/§18/§19 (pass này).
Hostile self-review fail-open? No (an toàn) — §18: 13/13 giả định xấu bị reject/downgrade an toàn (ca 13 documentary-live đã sửa pass này); không ca nào dẫn tới PASS-triển-khai.

20.3 Engineering PASS vs Authority PASS

  • Engineering PASS (khung tự kiểm chứng đầy đủ): đạt — completion contract, evidence matrix, hostile review, stop conditions có mặt và nhất quán.
  • Authority PASS (được phép chuyển pha): KHÔNG — chỉ Owner mở pha. Tài liệu này, kể cả khi Codex audit PASS sau đó, không tự ủy quyền survey/checker/pilot/implementation.

20.4 Codex PASS_WITH_MINOR_FIXES patch self-check (pass này)

# Kiểm tra Kết quả
1 Không asset nào bị gán nhãn live-proven? Yes — mọi nhãn reported LIVE/GOVERNED ở §4 hạ về DOCUMENTARY_ONLY; row-counts đánh dấu documentary; §17 không substrate nào PROVEN live.
2 Không còn schema-change direction (ALTER / ADD COLUMN / thêm cột / patch metadata như next step)? Yes — mọi dot_role/cell_id thành giả thuyết khả thi read-only; "ALTER ADD COLUMN" gỡ; Slice B cấm thêm cột/patch dot_tools; §19 thêm STOP-before-schema-change.
3 Không còn subagent/background provenance claim? Yes — §1 dùng document-read operations; provenance không-tự-verify đánh dấu "KB chunks / prior session record; not independently live-verified".
4 Phase-1 vẫn read-only, không thay đổi schema? Yes — §15/§19 + Slice B + §4 ràng buộc Phase-1 read-only; schema change = future Owner-gated.
5 Engineering PASS ≠ Authority PASS giữ nguyên? Yes — §20.3 + §2.4 + §14: chỉ Owner mở pha.

Technical Slice Framework v0.1 | 2026-06-15 | DRAFT — READ-ONLY, NOT-ENACTED, NON-AUTHORIZING | +Completion Evidence Pass (§16–§20: completion contract · evidence matrix · hostile self-review · stop conditions · final self-check) | +Codex PASS_WITH_MINOR_FIXES patch pass (nhãn LIVE/GOVERNED→DOCUMENTARY_ONLY §4/§13/§17; gỡ schema-change directions → read-only feasibility Owner-gated; gỡ subagent provenance; Slice B = read-only feasibility; §15 6-step chain; §18 row 13; §19 STOP-before-schema-change; §20.4 patch self-check). "Khung mỏng + tự kiểm chứng để Owner thấy toàn cảnh, đường tái dùng, phụ thuộc chéo, lát thử ứng viên, gate rủi ro VÀ bằng chứng hoàn thành — KHÔNG mở đường triển khai. Documentary ≠ live proof. Engineering PASS ≠ Authority PASS."