Đ43 Migrations Folder — Index + Log triển khai 8 Phase
Đ43 MIGRATIONS — Folder tập trung triển khai Điều 43
Tạo: 2026-04-17 S178 Fix 9 Cập nhật: 2026-04-17 S178 Fix 11 — Phase 1 PASS + Phase 3 DONE Desktop-side Mục đích: Gom toàn bộ artifact triển khai Đ43 vào 1 folder. Chủ tịch tìm bằng mắt dễ, không rải rác nhiều nơi. Living folder — thêm/sửa file theo tiến độ 8 Phase.
📍 VỊ TRÍ
knowledge/dev/laws/dieu43-migrations/
Truy cập web: https://vps.incomexsaigoncorp.vn/knowledge/dev/laws/dieu43-migrations/
📊 PROGRESS 8 PHASE
| Phase | Nội dung | Trạng thái | Ngày |
|---|---|---|---|
| 1 | SQL Schema Migration | ✅ PASS (11/11 verify, idempotent 2 lần) | 2026-04-17 Fix 11 |
| 2 | Filesystem Init DOT (2 script .sh + 4 folder VPS) | 🟡 ĐANG LÀM | — |
| 3 | KB Folder Init (placeholder) | ✅ DONE Desktop-side | 2026-04-17 Fix 11 |
| 4 ★ | Soạn 2 DOT build + verify (NẶNG NHẤT) | ⏸️ Chờ | — |
| 5 | Register 2 DOT vào dot_tools |
⏸️ Chờ — block bởi 5 reference tables Đ35 | — |
| 6 | Cron Install DOT | ⏸️ Chờ | — |
| 7 | PG Triggers (on-law-enact + on-dot-register) | ⏸️ Chờ | — |
| 8 | First Run + Enactment (UPDATE law_v43_enacted_at) |
⏸️ Chờ | — |
📁 DANH MỤC FILE
Phase 1 — SQL Schema Migration ✅
| File | Trạng thái | Ghi chú |
|---|---|---|
00-prereq-dot-operations.sql |
✅ v1 | Tạo dot_operations + seed 18 ops Đ35 v5.1 §4.1 |
01-dieu43-block1-schema.sql |
✅ v1 | 4 bảng + 1 view + seed 2 op CONTEXT_PACK_* |
report-phase1-apply.md |
✅ v1 | 11/11 PASS, idempotent 2 lần, docker exec postgres psql -U directus |
Phase 3 — KB Folder Init ✅ (Desktop-side)
| File | Trạng thái |
|---|---|
knowledge/current-state/context-pack/README.md |
✅ v1 |
knowledge/current-state/context-pack-staging/README.md |
✅ v1 |
Phase 2 — Filesystem Init DOT 🟡 (prompt CLI sẵn sàng)
Dự kiến output trên VPS:
/opt/incomex/dot/bin/dot-dieu43-fs-init.sh(Tier B)/opt/incomex/dot/bin/dot-dieu43-fs-verify.sh(Tier A)- 4 folder:
/opt/incomex/context-pack/{current, .tmp, staging, previous}
Phase 4+ (chưa đụng)
(Xem phụ lục Đ43 §3.4-3.8)
🔗 TÀI LIỆU THAM CHIẾU
- Luật chính:
knowledge/dev/laws/dieu43-system-context-law.mdv1.1 FINAL - Phụ lục 8 Phase:
knowledge/dev/laws/dieu43-phu-luc-ban-do-he-thong.md - Hiến pháp:
knowledge/dev/laws/constitution.mdv4.6.1 - Đ33 PG Law:
knowledge/dev/laws/dieu33-postgresql-law.mdv2.0 - Đ35 DOT Governance:
knowledge/dev/laws/dieu35-dot-governance-law.mdv5.1 FINAL - Đ41 VPS-as-SSOT:
knowledge/dev/laws/dieu41-luat-van-hanh-ma-vps-v1.0.md
⚠️ GHI CHÚ QUAN TRỌNG
-
VPS = SSOT mã (Đ41). CLI fetch file từ KB về
/tmp/trên VPS, chạy thẳng trên VPS. CẤMscpvề local, CẤMgit clone/pullrepo VPS. -
Idempotent bắt buộc. Mọi file
.sql+.shchạy lại không lỗi. Đã verify Phase 1 chạy 2 lần vẫn PASS. -
★ PG User thật trên VPS là
directus, KHÔNG phảipostgres(Fix 11 phát hiện). Mọi prompt psql phải dùngdocker exec postgres psql -U directus -d <dbname>. RolepostgresKHÔNG tồn tại trong container. Đã ghi memory #26. -
★ Phase 5 dependency:
dot-dot-registercần các FK reference tables Đ35 v5.1 §4.1:dot_tiers,dot_trigger_types,dot_coverage_statuses,dot_domains,dot_coverage_required,dot_config. File00-prereq-*.sqlPhase 1 CHỈ tạodot_operations. Khi chạm Phase 5, Desktop sẽ soạn file prereq bổ sung HOẶC quyết chạy Đ35 v5.1 BLOCK 1 đầy đủ (mission riêng). -
Phases tuần tự, không gộp. Mỗi Phase: 1 prompt CLI → báo cáo → Desktop duyệt → Phase tiếp.
-
★ Prompt CLI theo nguyên tắc "MỤC TIÊU MỞ" (OR, Huyên chốt Fix 11): chỉ ghi mục tiêu + tiêu chí đo + ràng buộc luật. KHÔNG chi tiết từng lệnh shell. Agent có ngữ cảnh sát hơn Desktop → tự quyết cách làm. Đã ghi memory #25.
📊 LOG TRIỂN KHAI
| Ngày | Phase | Hành động | Kết quả |
|---|---|---|---|
| 2026-04-17 Fix 9 | — | Tạo folder + upload 01-dieu43-block1-schema.sql rev 1 |
✅ |
| 2026-04-17 Fix 9 | — | Tạo README folder | ✅ |
| 2026-04-17 Fix 11 | 1 | Upload 00-prereq-dot-operations.sql rev 1 |
✅ |
| 2026-04-17 Fix 11 | 1 | Soạn + gửi prompt CLI Phase 1 APPLY | ✅ |
| 2026-04-17 Fix 11 | 1 | CLI chạy Phase 1: 11/11 PASS, idempotent 2 lần. Sửa -U postgres → -U directus tại chỗ |
✅ |
| 2026-04-17 Fix 11 | 3 | Desktop upload 2 placeholder KB (context-pack + context-pack-staging) | ✅ |
| 2026-04-17 Fix 11 | 2 | Soạn prompt CLI Phase 2 theo nguyên tắc MỤC TIÊU MỞ | 🟡 |
Folder dieu43-migrations | S178 Fix 11 | Chủ tịch Huyên chốt 2026-04-17 tập trung 1 chỗ