KB-6D30

GPT Pre-Inventory — Nuxt/UI/Template Law Consolidation

17 min read Revision 1
gpt-inventorynuxtuitemplatelaw45assemblytable-modulepre-opus-verify

GPT Pre-Inventory — Nuxt/UI/Template Law Consolidation

Date: 2026-05-08
Purpose: Pre-inventory before asking Opus to verify completeness.
Status: NOT an implementation directive. No code. No law draft yet.
Trigger: User paused notification display work to consolidate Nuxt/UI/template governance before further connection.


0. User governance requirement

We must stop treating Nuxt fixes as local one-off code changes.

Current issue (tableIdMap missing event_outbox) is not merely a one-line fix. It reveals a broader Nuxt/Table Module governance gap:

new registry table → current Nuxt hardcoded map may need code edit

This violates the desired model:

schema/config/template → generated/rendered UI
not branch-specific Nuxt code

User requires three-step process going forward:

1. Write/adjust law.
2. Write design.
3. Only then adjust code/tools.

1. Candidate law placement

Option A — Fold into Điều 28 / Luật Kỹ thuật Hiển thị

Pros:

  • Điều 28 already covers display/template law and standard templates.
  • Historical source: knowledge/dev/architecture/standard-template-law.md and D38 render report indicate Điều 28 evolved from “Luật Khuôn Mẫu Chuẩn” to “Luật Kỹ Thuật Hiển Thị”.

Cons:

  • Nuxt-specific governance, cleanup, route law, and module/tooling may overload Điều 28.

Option B — Fold into Assembly/Table Module SSOT only

Pros:

  • Assembly Module SSOT and Table Module SSOT already contain many operational rules.
  • Less new-law overhead.

Cons:

  • SSOT docs are module-level, not constitutional/legal-level.
  • Nuxt cleanup, legacy deletion, and cross-template governance likely need stronger status.

Option C — Create Điều 45: Luật Nuxt / Hiển thị / Khuôn Mẫu / Assembly UI

Pros:

  • Gives one canonical place for all Nuxt/UI/template/module rules.
  • Can reference Điều 7, Điều 28, Assembly Module, Table Module, DOT, and legacy cleanup.
  • Fits the fact that Nuxt currently has scattered legacy/custom code and needs a cleanup law.

Cons:

  • Must avoid duplicating Điều 28. Điều 45 should be an implementation/operation law for UI/Nuxt, while Điều 28 remains higher-level display/template principles.

GPT preliminary recommendation

Create a new law:

Điều 45 — Luật Nuxt / UI Assembly / Khuôn Mẫu Hiển Thị

Relationship:

Điều 7 = Assembly First priority order.
Điều 28 = Display/template principle law.
Điều 45 = Nuxt/UI implementation law: templates, modules, products, route registry, cleanup, automation, smoke, code gates.

Opus should verify whether this is the best placement or whether existing law numbering already reserves Điều 45.


2. Source documents found so far

2.1 Laws / constitutional rules

  1. knowledge/dev/laws/law-07-assembly-first.md

    • PG first → Directus → Nuxt/Agency OS → external open source → new code only after failure + approval.
  2. knowledge/dev/architecture/standard-template-law.md

    • Standard Template Law; templates have lifecycle, metadata, species, config schema, instance count; metadata-driven/code-free.
  3. knowledge/dev/laws/dieu38-trien-khai/reports/p10b-2c-r2-followup-d28-2026-04-30/d28-render-raw.tsv

    • Điều 28 v2.0 “Luật Kỹ Thuật Hiển Thị” / prior “Luật Khuôn Mẫu Chuẩn”; includes Nuxt whitelist, checklist, test workflow, scanner.
  4. knowledge/dev/laws/constitution.md

    • Nuxt Web is Gate layer; Directus/PG are official storage and gateway layers.
  5. knowledge/dev/laws/dieu44-trien-khai/design/23-p3d-ui-boundary-directus-nuxt-assembly-note.md

    • PG → Directus → Nuxt existing components; no custom business logic, no direct PG from Nuxt.

2.2 SSOT / module docs

  1. knowledge/dev/ssot/assembly-module/index.md

    • System is assembly engine, not web app.
    • Nuxt UI layer, wrappers, page config.
    • DirectusTable Step 3; migrate custom tables/popups later.
    • Pain lesson: custom table failure.
  2. knowledge/dev/ssot/table-module/index.md

    • Every UI table = one table_registry record.
    • No registry row = no UI table.
    • Registry Wiring Rule.
    • Selftest tools verify data layer.
  3. knowledge/dev/planning/table-module/_PLAN.md

    • New table should be collection + fields config, no new code.
    • Pagination/sort/search/filter/responsive from shared module.
  4. knowledge/dev/planning/assembly-roadmap.md

    • Only roadmap for UI construction.
    • DirectusTable, Registry 3-layer UI, Section-Based layer.
    • “Thích code thay vì lắp ráp = sai.”
  5. knowledge/dev/ssot/custom-code-registry.md

    • All custom files must be registered for review during upgrade/cleanup.

2.3 Reports / implementation history

  1. knowledge/current-state/reports/assembly-step1-inventory.md

    • Nuxt UI component inventory; available components.
  2. knowledge/current-state/reports/assembly-step3-deploy-report.md

    • DirectusTable UTable wrapper; replaced custom DirectusDataTable.
  3. knowledge/current-state/reports/table-module-complete-report.md

    • Table Module complete report; DirectusTable + migrated pages; net code reduction.
  4. knowledge/current-state/reports/registry-engine-report

    • Registry engine; table_registry entries created before code page; SharedDirectusTable usage.
  5. knowledge/current-state/reports/s117-registries-polish-report

    • Registry UI polish; routes and detail pages; relationship layers.
  6. knowledge/current-state/reports/s146-m2-registries-display-fix-report

    • Registry display fix; v_registry_counts stale data; triggers disabled; important lesson on stale/duplicated UI data.
  7. knowledge/current-state/reports/s146-m3-gemini-nuxt-investigation.md

    • Found Nuxt hardcoded phantom rows / duplicate aggregation in registries.
    • Evidence of legacy/rác Nuxt logic.
  8. knowledge/dev/laws/dieu38-trien-khai/reports/p10d-2a-evidence-quick-check-2026-04-30.md

    • No-code path verification; found hardcoded categories/sections in Nuxt.
  9. knowledge/dev/reports/gpt-decision-s191-p10d-inventory-complete-next-precheck-2026-04-30.md

    • Reuse existing components; no new server routes/components; preserve no direct PG from Nuxt.
  10. knowledge/dev/laws/dieu44-trien-khai/todos/td-p3d-phase1-notification-display-remaining-before-nuxt-law-pause-2026-05-08.md

    • Current notification checkpoint; tableIdMap blocker; pause for Nuxt law.

2.4 Current P3D evidence

  1. knowledge/dev/laws/dieu44-trien-khai/reports/23-p3d4c2u-option-d-base-table-field-allowlist-implementation-report.md

    • event_outbox permission/table_registry layer PASS in scope; S9 blocked by hardcoded tableIdMap.
  2. knowledge/dev/laws/dieu44-trien-khai/reviews/opus-review-23-p3d4c2u-option-d-draft-pending-2026-05-08.md

    • Opus confirms S9 blocker and Table Module gap.
  3. registries/table_registry/tbl_event_outbox

    • Draft product currently waiting for shared Nuxt/Table Module route resolution.

3. Known templates/khuôn identified so far

This is preliminary; Opus must verify against live repo, Directus, and KB.

3.1 Table Module / DirectusTable

  • Template/wrapper: DirectusTable / SharedDirectusTable.
  • Uses Nuxt UI UTable.
  • Config source: table_registry.fields.
  • Fetch behavior: readItems(collection, { fields }).
  • Products: all rows in table_registry that render through generic registry route.

3.2 Registry 3-layer UI

  • Registry index/detail routes under /knowledge/registries/....
  • Products include registry tables, pages/routes, modules, agents, DOT tools, meta catalog, system issues, etc.
  • Known gap: tableIdMap hardcoded in web/pages/knowledge/registries/[entityType]/index.vue.

3.3 DirectusTimeline / timeline template

  • Mentioned in Assembly Module roadmap as future wrapper around UTimeline.
  • Need verify whether implemented or still planned.

3.4 DirectusForm / form template

  • Mentioned as wrapper category in Assembly pattern.
  • Need verify existence/status.

3.5 Section-Based / Layer 3 UI

  • Mentioned in Assembly Roadmap.
  • Likely used by registry/detail sections.
  • Need verify actual templates/products.

3.6 Matrix template / DirectusMatrix

  • knowledge/current-state/reports/s157c-matrix-report.md mentions DirectusMatrix and species page.
  • Need verify whether this should be a sanctioned template/khuôn or legacy/custom item.

3.7 DocsTreeView / laws tree pattern

  • Mentioned in S191/P10D decision as reusable component path for /knowledge/laws.
  • Need verify as template or product-specific component.

3.8 Workflow supervisor / workflow UI

  • Custom Code Registry mentions workflow supervisor pages and partials.
  • Need classify: template, product, legacy, or cleanup candidate.

3.9 Insert marks / proposals / modals within table module

  • Table Module complete report mentions UTooltip, UPopover, UBadge, UCheckbox, UPagination, UModal, UInput.
  • Need distinguish core table template features vs separate templates.

4. Known products cast from templates/khuôn

4.1 table_registry products found in KB prefix

KB currently lists 14 synced table_registry docs:

  1. tbl_checkpoint_instances — Checkpoint Instances
  2. tbl_event_outbox — Hộp thư sự kiện — draft
  3. tbl_meta_catalog — Danh mục hệ thống
  4. tbl_proposals_list — Danh sách đề xuất bảng
  5. tbl_registry_agents — Agents
  6. tbl_registry_changelog — Nhật ký thay đổi
  7. tbl_registry_collections — Collections
  8. tbl_registry_dot_tools — DOT Tools
  9. tbl_registry_entity_dependencies — Entity Dependencies
  10. tbl_registry_modules — Modules
  11. tbl_registry_ui_pages — Pages/Routes
  12. tbl_system_issues — Vấn đề hệ thống
  13. tbl_table_registry — Danh sách bảng UI
  14. tbl_workflow_list — Danh sách quy trình

Important discrepancy:

P3D4C2U Agent report says live Directus table_registry has 20 rows.
KB prefix list currently shows 14 synced docs.

Opus/Agent must verify live Directus and reconcile missing KB sync docs before final law/design.

4.2 Known registry route products

  • /knowledge/registries/system_issue works and renders.
  • /knowledge/registries/event_outbox returns 200 but DirectusTable does not mount due missing hardcoded map.
  • Generic convention /knowledge/registries/{singular} used by many entries; Agent previously found 13/20 rows use this convention.

Preliminary list:

  1. DirectusTable.vue / SharedDirectusTable
  2. useDirectusTable.ts
  3. table_registry Directus collection
  4. ui_pages Directus collection / tbl_registry_ui_pages
  5. meta_catalog / tbl_meta_catalog
  6. Directus REST API / SDK readItems
  7. DOT tools / Directus schema tools:
    • dot-schema-snapshot
    • dot-schema-diff
    • other DOT/API patterns
  8. Custom Code Registry
  9. Assembly selftest tools for Table Module data layer
  10. Route smoke mechanism (currently inadequate for some cases)
  11. Nuxt middleware/session/auth path:
    • Public prefixes
    • Directus anon/public role access
  12. Directus permission field allowlist
  13. Field metadata translation patching
  14. Table Module registry route and tableId mapping

Need Opus verify exact tool names, paths, and which are active vs historical.


6. Known legacy/rác/candidate cleanup areas

Preliminary list for Opus verification:

  1. Hardcoded tableIdMap in web/pages/knowledge/registries/[entityType]/index.vue.
  2. Old registry hardcodes / phantom rows found in S146 Gemini Nuxt investigation.
  3. Hardcoded categories/sections in /knowledge/laws found in P10D quick check.
  4. Legacy/custom DirectusDataTable replaced by DirectusTable — verify no residual usage.
  5. Workflow supervisor custom pages/partials — classify and register/keep/migrate/retire.
  6. Registry counts / v_registry_counts stale-table history — ensure no duplicated count logic remains in Nuxt.
  7. Any server APIs added for UI that duplicate Directus/PG capabilities.
  8. Any direct PG access from Nuxt — should be forbidden.
  9. Any Nuxt pages calculating business logic instead of consuming PG/Directus projections.

7. Proposed structure for the new law

If creating Điều 45, propose:

ĐIỀU 45 — LUẬT NUXT / UI ASSEMBLY / KHUÔN MẪU HIỂN THỊ

Candidate sections:

  1. Jurisdiction and relationship to Điều 7, Điều 28, DOT, PG, Directus.
  2. No bespoke UI / no local workaround principle.
  3. Template/khuôn lifecycle:
    • draft → active → deprecated → retired.
  4. Template registry requirements:
    • every template has ID, owner, config schema, products list, verification tests.
  5. Product-from-template registry:
    • every UI product must point to template/khuôn and config source.
  6. Table Module law subset:
    • every UI table requires table_registry record;
    • route resolution must be registry/config-driven, not hardcoded.
  7. Directus permission and field allowlist law.
  8. Nuxt code permission gate:
    • code only when PG/Directus/template path insufficient;
    • must update Custom Code Registry.
  9. Legacy cleanup taxonomy:
    • keep / migrate / quarantine / delete.
  10. Automation-first verification:
  • route smoke;
  • component mount smoke;
  • field leak smoke;
  • no manual smoke as final state.
  1. DOT/API-only mutation rule:
  • no click UI.
  1. Rollback and report requirements.
  2. Security boundaries:
  • no secrets/raw payload/vector exposure.
  1. Compatibility with Điều 43 context/graphic outputs.
  2. Upgrade/maintenance rules for Agency OS/Nuxt UI.

8. Proposed three-step plan

Step 1 — Law consolidation

Output:

  • either amendment to Điều 28; or
  • new Điều 45 law draft.

Must include:

  • all principles;
  • template registry model;
  • product registry model;
  • legacy cleanup policy;
  • no-code/new-code gate;
  • automation-first tests.

Step 2 — Design / inventory

Output:

  • Nuxt/UI template inventory;
  • current products inventory;
  • legacy/rác inventory;
  • Table Module routing redesign;
  • tool gap list;
  • migration plan;
  • smoke/verify plan.

Step 3 — Code/tooling changes

Only after law + design approval:

  • fix hardcoded tableIdMap by shared mechanism;
  • add/repair automated route smoke;
  • update Custom Code Registry;
  • publish tbl_event_outbox after machine smoke PASS;
  • cleanup/deprecate old Nuxt artifacts.

9. Request for Opus verification — not implementation

Ask Opus to verify this pre-inventory before drafting any law.

Proposed verification ask:

Opus, please verify the Nuxt/UI/template law consolidation inventory.
Do not implement. Do not draft final law yet.

1. Confirm whether Điều 45 should be a new law or whether content belongs inside Điều 28.
2. Verify all source documents listed above and add missing ones.
3. Verify all existing templates/khuôn and their statuses.
4. Verify all products cast from each template, especially live table_registry rows.
5. Reconcile live Directus table_registry count (20) vs KB synced docs (14).
6. Verify tools/components/code paths: DirectusTable, useDirectusTable, registry route, tableIdMap, custom code registry, DOT tools.
7. Identify legacy/rác Nuxt areas that must be migrated/deleted/quarantined.
8. Propose law structure and three-step plan: law → design → code/tooling.
9. Return a verification report, not implementation.

Suggested report path:

knowledge/dev/laws/dieu44-trien-khai/reports/nuxt-ui-template-law-consolidation-inventory-verification-report.md

Suggested design/inventory path if Opus confirms:

knowledge/dev/laws/dieu44-trien-khai/design/nuxt-ui-template-law-consolidation-inventory.md


10. Current GPT stance

Preliminary recommendation:

Create Điều 45 as the Nuxt/UI Assembly implementation law,
while referencing Điều 7 and Điều 28 as superior/general laws.

Reason:

  • Điều 28 is broad display/template law.
  • Nuxt has enough operational, tooling, cleanup, and route-specific complexity to need a dedicated law.
  • Current issue is not a one-off notification issue; it is a cross-system Nuxt/Table Module governance issue.

But this is not final until Opus verifies law numbering, existing law coverage, and live system inventory.

Back to Knowledge Hub knowledge/dev/laws/dieu44-trien-khai/reviews/gpt-preinventory-nuxt-ui-template-law-consolidation-2026-05-08.md