GPT Pre-Inventory — Nuxt/UI/Template Law Consolidation
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.mdand 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
-
knowledge/dev/laws/law-07-assembly-first.md- PG first → Directus → Nuxt/Agency OS → external open source → new code only after failure + approval.
-
knowledge/dev/architecture/standard-template-law.md- Standard Template Law; templates have lifecycle, metadata, species, config schema, instance count; metadata-driven/code-free.
-
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.
-
knowledge/dev/laws/constitution.md- Nuxt Web is Gate layer; Directus/PG are official storage and gateway layers.
-
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
-
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.
-
knowledge/dev/ssot/table-module/index.md- Every UI table = one
table_registryrecord. - No registry row = no UI table.
- Registry Wiring Rule.
- Selftest tools verify data layer.
- Every UI table = one
-
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.
-
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.”
-
knowledge/dev/ssot/custom-code-registry.md- All custom files must be registered for review during upgrade/cleanup.
2.3 Reports / implementation history
-
knowledge/current-state/reports/assembly-step1-inventory.md- Nuxt UI component inventory; available components.
-
knowledge/current-state/reports/assembly-step3-deploy-report.md- DirectusTable UTable wrapper; replaced custom DirectusDataTable.
-
knowledge/current-state/reports/table-module-complete-report.md- Table Module complete report; DirectusTable + migrated pages; net code reduction.
-
knowledge/current-state/reports/registry-engine-report- Registry engine; table_registry entries created before code page; SharedDirectusTable usage.
-
knowledge/current-state/reports/s117-registries-polish-report- Registry UI polish; routes and detail pages; relationship layers.
-
knowledge/current-state/reports/s146-m2-registries-display-fix-report- Registry display fix;
v_registry_countsstale data; triggers disabled; important lesson on stale/duplicated UI data.
- Registry display fix;
-
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.
-
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.
-
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.
-
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
-
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.
-
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.
-
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_registrythat 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:
tableIdMaphardcoded inweb/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.mdmentions 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:
tbl_checkpoint_instances— Checkpoint Instancestbl_event_outbox— Hộp thư sự kiện — drafttbl_meta_catalog— Danh mục hệ thốngtbl_proposals_list— Danh sách đề xuất bảngtbl_registry_agents— Agentstbl_registry_changelog— Nhật ký thay đổitbl_registry_collections— Collectionstbl_registry_dot_tools— DOT Toolstbl_registry_entity_dependencies— Entity Dependenciestbl_registry_modules— Modulestbl_registry_ui_pages— Pages/Routestbl_system_issues— Vấn đề hệ thốngtbl_table_registry— Danh sách bảng UItbl_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_issueworks and renders./knowledge/registries/event_outboxreturns 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.
5. Known tools related to Nuxt/UI/template governance
Preliminary list:
DirectusTable.vue/SharedDirectusTableuseDirectusTable.tstable_registryDirectus collectionui_pagesDirectus collection /tbl_registry_ui_pagesmeta_catalog/tbl_meta_catalog- Directus REST API / SDK
readItems - DOT tools / Directus schema tools:
dot-schema-snapshotdot-schema-diff- other DOT/API patterns
- Custom Code Registry
- Assembly selftest tools for Table Module data layer
- Route smoke mechanism (currently inadequate for some cases)
- Nuxt middleware/session/auth path:
- Public prefixes
- Directus anon/public role access
- Directus permission field allowlist
- Field metadata translation patching
- 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:
- Hardcoded
tableIdMapinweb/pages/knowledge/registries/[entityType]/index.vue. - Old registry hardcodes / phantom rows found in S146 Gemini Nuxt investigation.
- Hardcoded categories/sections in
/knowledge/lawsfound in P10D quick check. - Legacy/custom
DirectusDataTablereplaced by DirectusTable — verify no residual usage. - Workflow supervisor custom pages/partials — classify and register/keep/migrate/retire.
- Registry counts /
v_registry_countsstale-table history — ensure no duplicated count logic remains in Nuxt. - Any server APIs added for UI that duplicate Directus/PG capabilities.
- Any direct PG access from Nuxt — should be forbidden.
- 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:
- Jurisdiction and relationship to Điều 7, Điều 28, DOT, PG, Directus.
- No bespoke UI / no local workaround principle.
- Template/khuôn lifecycle:
- draft → active → deprecated → retired.
- Template registry requirements:
- every template has ID, owner, config schema, products list, verification tests.
- Product-from-template registry:
- every UI product must point to template/khuôn and config source.
- Table Module law subset:
- every UI table requires
table_registryrecord; - route resolution must be registry/config-driven, not hardcoded.
- every UI table requires
- Directus permission and field allowlist law.
- Nuxt code permission gate:
- code only when PG/Directus/template path insufficient;
- must update Custom Code Registry.
- Legacy cleanup taxonomy:
- keep / migrate / quarantine / delete.
- Automation-first verification:
- route smoke;
- component mount smoke;
- field leak smoke;
- no manual smoke as final state.
- DOT/API-only mutation rule:
- no click UI.
- Rollback and report requirements.
- Security boundaries:
- no secrets/raw payload/vector exposure.
- Compatibility with Điều 43 context/graphic outputs.
- 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_outboxafter 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.