KB-498E

Opus Review — D28 Generated Table Map Design + Đề Xuất Bước Tiếp

4 min read Revision 1
opus-reviewdieu28generated-mapdesignoption-ce42026-05-09

Opus Review — D28 Generated Table Map Design + Đề Xuất Bước Tiếp

Date: 2026-05-09 Reviewer: Opus Reviewed:

  • dieu28-trien-khai/design/d28-generated-table-map-design.md (16602 chars)
  • dieu28-trien-khai/reports/d28-generated-table-map-design-review-report.md (6145 chars) Status: ACCEPT — Agent design đạt yêu cầu prompt rev2

1. Compliance: PASS

Agent tuân thủ tất cả requirements prompt rev2:

  • VPS reverify ✅ (path corrected)
  • Schema inspect ✅
  • Row classification 21/21 ✅
  • Recommendations with rationale ✅
  • Client/server import safety verified ✅
  • No secrets ✅
  • Hard boundaries 9/9 ✅

2. Key findings summary

VPS path correction

Prompt ghi /opt/incomex/web/ — thực tế /opt/incomex/docker/nuxt-repo/web/. Tất cả prompt tương lai cần path đúng.

3 hardcoded maps confirmed on VPS (LIVE_FACT)

  • tableIdMap: 18 entries
  • collectionMap: 20 entries (18 + trigger/comment/taxonomy)
  • COLLECTION_ENTITY_MAP (relations.get.ts): 14 entries — drift 6 entries vs collectionMap

Schema: entity_type column = KHÔNG TỒN TẠI

17 columns trong table_registry, không có entity_type. Đây là data problem, design accommodates.

Row classification

  • 13 REGISTRY_ENTITY_ROUTE (id 9-21)
  • 3 NON_REGISTRY_PAGE (id 1, 5, 6)
  • 3 WORKFLOW_TAB (id 2, 3, 4)
  • 1 ADMIN_PAGE (id 7)
  • 1 INDEX_PAGE (id 8)

Data quality flags (out-of-scope, separate pack)

  • id 5 tbl_modules_list.collection='tasks' — likely sai
  • id 3 tbl_workflow_timeline — collision collection với id 2
  • relations.get.ts drift 6 entries

3. Opus đánh giá recommendations

E4 → E3 (entityType): ĐỒNG Ý

E4 (convention + overrides) là migration-safe:

  • Không cần ALTER TABLE ngay
  • Convention rules deterministic + fail-fast
  • Override dict = backfill source cho E3 sau
  • Phase 2 (entity_type column) trivial vì dict đã có

C2 build token: ĐỒNG Ý

Token NUXT_DIRECTUS_SERVICE_TOKEN đã tồn tại. Pure static output = token không leak.

Prebuild + commit: ĐỒNG Ý

PR diff visible. CI --check verify. Standard Nuxt convention.

--include-draft + publish sequence: ĐỒNG Ý

Giải chicken-egg:

  1. Dev regen --include-draft
  2. Smoke trên dev preview
  3. Publish row
  4. Production prebuild picks up automatically

Pure static import: ĐỒNG Ý

No split needed. Verified importable từ page.vue, config/.ts, server/api/.ts.

static_extras: ĐỒNG Ý

3 entries (trigger/comment/taxonomy) không có table_registry row. Script config chứa riêng + conflict detection.


4. Đề xuất bước tiếp theo

GPT cần xác nhận:

  1. Agent design ACCEPTED hay cần revision?
  2. Cho phép viết implementation prompt?
  3. Đồng ý E4→E3 strategy?
  4. Đồng ý C2 build token?
  5. Đồng ý prebuild + commit timing?

Nếu GPT approve, sequence tiếp:

Step 1: Implementation prompt (Opus soạn, GPT review)
        → Agent implement: script + generated file + swap 3 consumers + CI
Step 2: Route smoke (13 registry + 8 non-registry routes)
Step 3: --include-draft + smoke event_outbox
Step 4: Publish tbl_event_outbox → P3D Phase 1 COMPLETE
Step 5: Separate packs:
        - D28_TABLE_REGISTRY_DATA_FIX (id 5 collection)
        - D28_TABLE_REGISTRY_SCHEMA_EXTENSION (entity_type column)

Lưu ý quan trọng cho implementation prompt:

  1. Path PHẢI dùng /opt/incomex/docker/nuxt-repo/web/ (corrected)
  2. Token = NUXT_DIRECTUS_SERVICE_TOKEN (existing)
  3. Script fail-fast nếu row không match convention + không có override
  4. CI integration: nuxt-ci.yml + deploy-vps.yml
  5. Commit generated file + prebuild hook
  6. static_extras cho trigger/comment/taxonomy
  7. Smoke tất cả 21 routes sau implementation

Opus Review | D28 Generated Table Map Design | ACCEPT | 2026-05-09

Back to Knowledge Hub knowledge/dev/laws/dieu28-trien-khai/reviews/opus-review-d28-generated-table-map-design-2026-05-09.md