KB-76F5

Điều 32 Foundation Report — approval_requests + DOT scanners

5 min read Revision 1
reportdieu32approvalscannerfoundation

Điều 32 Foundation — Báo cáo triển khai

Ngày: 2026-03-28 | Session: S142-b | OR: v6.2


Phase 1: Collection approval_requests

  • PG table: OK. 18 fields, 3 indexes, auto-code trigger (APR-NNNN). Constraints: priority IN (critical/high/normal/low), status IN (pending/approved/applied/rejected/expired).
  • Directus register: OK. 18 fields visible. Public read/create/update permissions set.
  • Khai sinh:
    • meta_catalog: CAT-025 (Yeu cau Phe duyet, compound, governed)
    • collection_registry: COL-139 (governed, primary, policy)
    • entity_species: SPE-APP (approval_request, governed)
    • species_collection_map: approval_request → approval_requests (primary)
  • Lưu ý: API qua MCP OK. API qua public proxy trả 404 — cần kiểm tra nginx routing.

Phase 2: DOT Scanners

DOT-115: dot-orphan-scanner

  • File: /opt/incomex/dot/bin/dot-orphan-scanner (v1.0.0)
  • Registered: DOT-115 trong dot_tools
  • Logic: Quét PG tables + DOT bin files → check 3 giấy tờ (collection_registry, meta_catalog, species_map) → ghi approval_requests
  • Flags: --dry-run, --scope=collections|dot_tools|all

DOT-116: dot-misclass-scanner

  • File: /opt/incomex/dot/bin/dot-misclass-scanner (v1.0.0)
  • Registered: DOT-116 trong dot_tools
  • Logic: Phase 1 rules — junction naming, directus internal, unclassified migration
  • Flags: --dry-run

Phase 3: Quét lần đầu

Tổng: 143 pending

Loại Count Chi tiết
birth_orphan (collection) 111 Collections thiếu meta_catalog (phần lớn), một số thiếu collection_registry + species_map
birth_orphan (dot_tool) 31 DOT bin files chưa đăng ký trong dot_tools table
reclassify 1 workflow_categories: junction table đang observed, nên excluded

Phân bổ priority

Priority Count
high 1 (taxonomy_facets — governed nhưng thiếu meta_catalog)
normal 141
low 1 (reclassify)

Top findings

  1. APR-0099 (HIGH): taxonomy_facets thiếu meta_catalog — governed collection không có trong danh mục
  2. APR-0006: birth_registry thiếu collection_registry + species_map — hạ tầng giám sát tự nó chưa khai sinh
  3. APR-0053/0054/0055: law_catalog, measurement_log, measurement_registry — 3 tables mới (Điều 32 infra?) thiếu cả 3 giấy tờ
  4. APR-0090: pivot_definitions thiếu collection_registry + species_map — collection quan trọng (Điều 26)
  5. 31 DOT tools chưa đăng ký — bao gồm tools quan trọng: dot-birth-backfill, dot-collection-register, dot-species-register, dot-inspect-pen

Observations

  • 111/138 collections thiếu meta_catalog → meta_catalog chỉ có ~27 entries cho 138 collections
  • Phần lớn thiếu meta_catalog ONLY (collection_registry + species đã có) → batch khai sinh meta_catalog là ưu tiên
  • 136/139 collections có migration_state=unclassified (Rule 3 của misclass scanner) — chưa ghi approval vì quá nhiều
  • DOT tools trên VPS: 147 files, 116 registered (114 cũ + 2 mới) → 31 unregistered

Hệ thống sau quét

Metric Giá trị
PG tables (public) 138
Collections hợp pháp (đủ 3 giấy tờ) ~27 / 138
DOT tools registered 116 / 147
Pending approval 143 items
approval_requests collection LIVE, khai sinh đầy đủ

User giám sát


Issues phát hiện

  1. DOT tools không chạy trên VPS — environment.sh hardcode localhost:8055, Directus trong Docker không map port. dot-birth-backfill, dot-collection-register chỉ chạy khi export DIRECTUS_ADMIN_TOKEN. Cloud mode cần SSH key không có trên VPS.
  2. Nginx routing cho approval_requests — public API trả 404. Cần kiểm tra nginx config cho collection mới.
  3. 136 unclassified collections — quá nhiều để tạo từng approval_request. Cần batch review workflow.

S142-b | Điều 32 Foundation DONE | 143 pending | DOT-115 + DOT-116 LIVE