KB-204B rev 2
P9 Entry Gate — Readiness Review v0.2
5 min read Revision 2
P9 Entry Gate — Production Migration Readiness Review
Loại: Readiness assessment — Điều 38 Text as Code Phase: P9 Entry Gate (pre-migration checkpoint) Trạng thái: DRAFT v0.2 — Patched 3 điểm GPT. Chờ GPT + User. Ngày: 2026-04-27 | Phiên: S182 Baseline: P8 §10.2 (12 criteria)
0. Mục tiêu
Kiểm 12 điều kiện P8 §10.2. Checkpoint đánh giá, KHÔNG migration. Không production DDL/DML.
1. Gate Checklist
| Gate | Criterion | Status | Action |
|---|---|---|---|
| G1 | P8 OFFICIAL | ✅ PASS | — |
| G2 | Đ24 facets verified | ⚠️ NEEDS DOT VERIFY | A1: read-only query |
| G3 | Đ24 entity_code format | ⚠️ NEEDS DOT VERIFY | A2: read-only KB search |
| G4 | DOT-TAC-* registered | ⚠️ NEEDS DESIGN | B2: batch registration design |
| G5 | dot-dot-register adapter | ⚠️ NEEDS VERIFY | A4: read-only code inspection |
| G6 | Migration dry-run | ⚠️ NEEDS DESIGN | B1: migration script design (blocking) |
| G7 | system_issues schema | ⚠️ NEEDS DOT VERIFY | A3: read-only pg_catalog |
| G8 | Directus roles | ⚠️ NEEDS DESIGN | B3: role creation design |
| G9 | Backup plan | ✅ PASS | P8 §8.3 |
| G10 | TRIGGER-GUARD | ✅ PASS | P8 §8.4 + C2A evidence |
| G11 | User approval | ⏳ PENDING USER | Last gate |
| G12 | Component/BOM defer | ✅ PASS | P8 §7.1 |
Score: 4 PASS / 6 NEEDS ACTION / 1 PENDING USER / 1 BLOCKING
2. Tier 1 — Read-only Verification (A1–A4)
Ràng buộc cứng
- READ-ONLY 100%. Không DDL/DML. Không dot_tools write. Không Đ24/entity_labels mutation. Không system_issues mutation. Không production table changes.
- Nếu phát hiện missing/invalid → report blocker, do NOT fix. Việc sửa = Tier 2 design riêng.
- Scope: one read-only verification prompt.
A1 — Đ24 facets existence
| Item | Detail |
|---|---|
| Query | SELECT code, name FROM taxonomy_facets WHERE code IN ('doc','topic','layer') via Directus API hoặc approved pg_catalog path |
| Output | PASS (3/3 found) / FAIL (missing facets) / BLOCKED (cannot query) |
| Evidence | Query result rows |
| If FAIL | Report which facets missing. Blocker severity: MEDIUM. Next: Tier 2 design APR to create facets. |
A2 — Đ24 entity_code format
| Item | Detail |
|---|---|
| Method | Search KB for Đ24 entity_code convention/format rules. Compare canonical_address format D38-HOWTO-S1 vs convention. |
| Output | PASS (compatible) / FAIL (format mismatch) / BLOCKED (no Đ24 format spec found) |
| Evidence | Đ24 spec text + comparison analysis |
| If FAIL | Report mismatch. Blocker severity: MEDIUM. Next: Tier 2 amend proposal. |
A3 — system_issues schema
| Item | Detail |
|---|---|
| Query | SELECT column_name, data_type FROM information_schema.columns WHERE table_schema='public' AND table_name='system_issues' ORDER BY ordinal_position |
| Check | Fields exist: source (text), severity (text), category (text), entity_code (text), summary (text), status (text), issue_signature (text) |
| Output | PASS (schema compatible) / FAIL (missing fields) / BLOCKED (table not found) |
| Evidence | Column list |
| If FAIL | Report missing fields. Blocker severity: LOW (can design adapter). Next: Tier 2 adapter design. |
A4 — dot-dot-register capability
| Item | Detail |
|---|---|
| Method | Read dot-dot-register source file on VPS. Check: (a) can register multiple DOTs in 1 run, (b) infers 11 fields, (c) handles self-registration paradox |
| Output | PASS (batch capable) / FAIL (single-file only) / BLOCKED (file not found) |
| Evidence | Code inspection summary |
| If FAIL | Report capability gap. Blocker severity: MEDIUM. Next: Tier 2 adapter design (OD-P8-07). |
3. Tier 2 — Design (after Tier 1 results)
| # | Action | Gate | Prerequisite | Deliverable |
|---|---|---|---|---|
| B1 | Migration script design | G6 | Tier 1 complete | DDL/DML script (design only) |
| B2 | DOT batch registration | G4 | A4 result | Registration prompt |
| B3 | Directus role creation | G8 | — | DOT-TAC-ROLE-ENSURE prompt |
4. Tier 3 — User Gate
| # | Action | Gate | When |
|---|---|---|---|
| C1 | User approval production DDL | G11 | After all other gates PASS |
5. Recommendation
GO WITH PREREQUISITES. Tier 1 read-only verification first. Then Tier 2 design. Then User G11. Không tự mở P9 execution.
6. Not Authorized
Production DDL/DML ❌. P9 execution ❌. DOT registration ❌. Directus collections ❌. Đ24 mutation ❌. Sandbox modification ❌. Any repair/fix during Tier 1 ❌.
P9 Entry Gate v0.2 DRAFT | S182 | 2026-04-27 | Opus 4.6 Chờ GPT + User review