KB-3DDB
Handoff S165-KB — Khôi phục + Rà soát KB
2 min read Revision 1
handoffs165-kbrestorereview
Handoff S165-KB — Khôi phục + Rà soát KB
1. TÓM TẮT
S165-KB khôi phục 2 file luật bị cắt (Đ35, Đ36), rà soát 4 file (Đ35, Đ36, Đ26, Đ28) theo 13 NT + 6 câu hỏi cốt lõi. Phát hiện và sửa 10+ vi phạm NT. Pattern mới: reference tables thay CHECK, config tables thay hardcode, PG triggers enforce tại cổng vào.
2. QUYẾT ĐỊNH KỸ THUẬT
- Reference tables thay CHECK: 8 bảng mới (4 Đ35, 3 Đ36, 1 Đ28). Thêm giá trị = INSERT, 0 deploy.
- Config tables: dot_config (Đ35), collection_config (Đ36). Thresholds/paths/schedules đọc từ PG.
- PG triggers: fn_dot_enforce_paired (B PHẢI có A), fn_template_lifecycle_guard (CẤM draft→active, checklist <8).
- Coverage 2 chiều: dot_domains × dot_operations → auto-suggest.
- Ref table change sau bootstrap: APR type='ref_table_change' → DOT execute INSERT.
3. SAI LẦM + BÀI HỌC
- Bản gốc Đ35/Đ36 §1-§8 mất vĩnh viễn (§AP-KB-DELTA). Viết lại từ council reviews + production data.
- Rà soát NT phát hiện vi phạm mà council 3 vòng không bắt.
4. DỮ LIỆU
| File | Trước | Sau | Rev |
|---|---|---|---|
| Đ35 | 6,865 | 19,174 | 8 |
| Đ36 | 6,025 | 18,118 | 7 |
| Đ26 | 12,587 | OK | 10 |
| Đ28 | 7,454 | ~10,500 | 6 |
| OR | 1,327 | CHƯA LÀM | 32 |
5. VIỆC TIẾP
- OR khôi phục/viết lại (1,327→>5,000 chars)
- Update tracker rev 14
- Đ37 GĐ2 Wave 1
6. TÀI LIỆU
| File | Path | Rev |
|---|---|---|
| Đ35 | knowledge/dev/architecture/dieu35-dot-governance-law-draft.md | 8 |
| Đ36 | knowledge/dev/architecture/dieu36-collection-protocol-law-draft.md | 7 |
| Đ28 | knowledge/dev/architecture/dieu28-display-technology-law-v2-draft.md | 6 |
| Handoff | knowledge/current-state/handoff-s165-kb-session.md | 1 |
7. PROMPT PHIÊN MỚI
search_knowledge("handoff S165-KB restore review")
search_knowledge("operating rules SSOT v7.47")
Việc: (1) OR viết lại, (2) tracker update, (3) Đ37 GĐ2