KB-38AF

23-P3D4C2U — Table Module Read-Only Exposure Prompt

11 min read Revision 1
p3d4c2uprompttable-moduledirectusnuxtassembly-firstdieu43readonly

23-P3D4C2U — Table Module Read-Only Exposure Prompt

Date: 2026-05-08
Status: PROMPT draft by GPT — chờ Opus/Agent thực hiện sau User approval
Scope: Design/inventory + minimal prompt proposal for exposing universal event core through existing Table Module / DirectusTable path.
Important: This is NOT a bespoke notification UI task.


0. Context

P3D4C1U PASS. Universal event core PoC is LIVE on PG production for system_issues immediate events.

Live objects:

  • event_type_registry
  • event_outbox
  • event_read
  • event_subscription
  • event_pending — seam only, currently empty
  • registry validation trigger on event_outbox
  • capture trigger on system_issues
  • fn_event_unread
  • fn_event_mark_read

P3D4C1U intentionally did not create:

  • worker
  • pg_cron
  • polling
  • fn_event_board
  • Directus mutation
  • Nuxt code
  • IU runtime changes

Critical live deviations to preserve:

event_subject_ref = text
read_status_source IN ('explicit','implicit_self')

1. Strategic correction

Do not build a notification-specific UI.

Incomex already has an Assembly/Table Module principle:

Schema / PG / Directus collection
→ Config / table_registry
→ Render / DirectusTable + Nuxt UI
→ UI appears

Therefore P3D4C2U must treat universal event viewing as adding one more table to the existing table/template registry, similar to existing registered tables such as system_issues.

Opus found that system_issues already has a table_registry entry:

Table ID: tbl_system_issues
Collection: system_issues
Page URL: /knowledge/registries/system_issue
Fields Config: [{key,label,sortable,filterable,filterOptions}...]
Settings: rows_per_page, pagination, search, default_sort, default_filter

This is the model to reuse.


2. Mandatory documents to read first

Read before doing anything:

  1. knowledge/dev/ssot/assembly-module/index.md
  2. knowledge/dev/ssot/table-module/index.md
  3. knowledge/dev/planning/table-module/_PLAN.md
  4. knowledge/dev/laws/law-07-assembly-first.md
  5. knowledge/dev/architecture/standard-template-law.md
  6. knowledge/dev/laws/dieu44-trien-khai/design/23-p3d-ui-boundary-directus-nuxt-assembly-note.md
  7. knowledge/dev/laws/dieu44-trien-khai/reports/23-p3d4c1u-universal-core-implementation-report.md
  8. knowledge/dev/laws/dieu44-trien-khai/reviews/gpt-review-23-p3d4c1u-execution-pass-and-next-directive-2026-05-08.md
  9. knowledge/dev/laws/dieu44-trien-khai/reviews/gpt-alignment-with-opus-p3d4c2u-template-table-module-approach-2026-05-08.md
  10. Điều 43 relevant docs:
    • knowledge/dev/laws/dieu43-system-context-law.md
    • knowledge/dev/laws/dieu43-migrations/03-dieu43-v1-2-extensions.sql
    • knowledge/dev/laws/dieu43-migrations/report-pre-d-prime.md
    • knowledge/current-state/templates/architecture_mmd.mmd.tmpl
    • knowledge/current-state/templates/red_zones.md.tmpl

3. Điều 43 / graphic / context-pack considerations

Điều 43 is relevant because it already proves the pattern:

  • config-driven sections;
  • generic renderer;
  • dot_config keys;
  • context-pack readonly role;
  • section_definitions instead of hardcoded renderer;
  • 8 live sections including PROJECT_MAP, DB_MAP, DOT_REGISTRY, ENTITIES_OVERVIEW, RED_ZONES, architecture_mmd, project_map_json;
  • health checks H1-H11;
  • architecture_mmd / system graphic can expose relationships between Gate, Warehouse, Brain, databases, services, DOT/context-pack, etc.

Agent must inspect whether the event table/projection can later feed or align with Điều 43 context-pack sections without duplicating Đ43 machinery.

Important principle:

P3D4C2U must not create a second context-map/graphic/relationship system.
If relationship/context data is needed, use or align with Điều 43 outputs.

For this pack, Điều 43 is a source of current-state/context/relationship evidence and a config-driven model to imitate, not something to modify unless explicitly approved.


4. Task for Opus/Agent

Perform a read-only inventory and design review, then write a recommendation. Do not implement unless this prompt is later explicitly approved as an implementation prompt. Current task is to prepare the next safe step.

4.1 Inventory existing Table Module path

Verify live/KB state of:

  • registries/table_registry/ entries count and structure;
  • tbl_system_issues entry;
  • field config shape;
  • default sort/filter/search/pagination settings;
  • how DirectusTable consumes table_registry;
  • whether a generic route/page already renders tables by registry entry;
  • whether adding one table requires only a registry/config declaration.

4.2 Inventory Directus exposure path

Verify:

  • whether event_outbox is already discoverable by Directus as a collection/table;
  • whether a PG view is needed for safe display, e.g. v_event_outbox_table;
  • what permissions/roles are needed for read-only access;
  • whether Directus exposes raw table fields that should be hidden;
  • whether DOT already has conventions for read-only collection exposure and verify pair.

4.3 Inventory live event schema

Inspect live PG schema read-only:

  • event_outbox
  • event_read
  • event_subscription
  • event_type_registry
  • event_pending
  • fn_event_unread
  • fn_event_mark_read

Confirm:

event_subject_ref type = text
read_status_source values = explicit | implicit_self
worker_created = false
pg_cron_used = false
event_pending empty for immediate PoC

4.4 Determine display source

Choose one:

Option Meaning
RAW_EVENT_OUTBOX DirectusTable can safely render event_outbox directly with field config hiding unsafe fields
PG_VIEW_PROJECTION Need metadata-only PG view, e.g. v_event_outbox_table, before Directus/table_registry
FUNCTION_BACKED_NOT_ALLOWED_NOW Function access needed but not suitable for Table Module now; defer
BLOCKED Existing assembly/table path cannot display safely without generic module extension

Preferred: PG_VIEW_PROJECTION if raw table has unsafe/noisy columns or needs read-status join later.

4.5 Draft table_registry declaration

If viable, draft a table_registry-style config, similar to tbl_system_issues, for universal event table/projection.

Candidate:

table_id: tbl_event_outbox
collection: event_outbox or v_event_outbox_table
page_url: /knowledge/registries/event_outbox or existing generic route convention
module: DirectusTable
status: active/proposed

Candidate visible fields must be metadata/ref-only, such as:

  • occurred_at / created_at
  • event_domain
  • event_type
  • event_stream
  • delivery_lane
  • severity
  • event_subject_table
  • event_subject_ref
  • canonical_address
  • actor_ref
  • source_system
  • payload_classification

Do not expose:

  • raw body
  • raw payload if unsafe
  • vector / embedding
  • secret / token / password
  • unrestricted JSON fields unless allowlisted

4.6 Directus/DOT plan

Draft the minimal DOT-driven plan for:

  • expose read-only collection/view;
  • create/read-only role/permission if needed;
  • register table config if table_registry lives in Directus or KB registry path;
  • verify Directus can read the collection with intended fields;
  • rollback path.

No click-config in Directus UI.

4.7 Nuxt plan

Determine whether Nuxt needs any code.

Allowed outcomes:

Outcome Meaning
NO_NUXT_CODE existing generic table route/module can render table_registry entry
REGISTRY_DECLARATION_ONLY only table_registry/config declaration needed
GENERIC_TEMPLATE_EXTENSION_REQUIRED existing template insufficient; propose reusable Table Module extension
BLOCKED cannot proceed safely

Forbidden:

  • notification-specific page;
  • notification-specific component;
  • business logic in Nuxt;
  • Nuxt direct PG.

5. Output documents

Create design note:

knowledge/dev/laws/dieu44-trien-khai/design/23-p3d4c2u-table-module-readonly-exposure-design.md

Create report:

knowledge/dev/laws/dieu44-trien-khai/reports/23-p3d4c2u-table-module-readonly-exposure-report.md

Upload report even on FAIL/BLOCKED/NEEDS_MORE_INVENTORY.


6. Required report fields

phase_status=PASS|FAIL|BLOCKED|NEEDS_MORE_INVENTORY
assembly_module_read=PASS|FAIL
table_module_read=PASS|FAIL
dieu7_read=PASS|FAIL
dieu28_read=PASS|FAIL
dieu43_reviewed=PASS|FAIL
dieu43_graphic_relevance=USED_AS_CONTEXT|NOT_RELEVANT|NEEDS_MORE_INVENTORY
table_registry_entries_count=<number>
system_issues_registry_found=PASS|FAIL
directus_table_available=PASS|FAIL|UNCLEAR
generic_table_route_available=PASS|FAIL|UNCLEAR
event_schema_inventory=PASS|FAIL
event_subject_ref_type=text
read_status_source_values=explicit,implicit_self
display_source=RAW_EVENT_OUTBOX|PG_VIEW_PROJECTION|FUNCTION_BACKED_NOT_ALLOWED_NOW|BLOCKED
pg_projection_needed=YES|NO
pg_projection_name=<candidate_or_none>
unsafe_fields_hidden=PASS|FAIL
table_registry_declaration_drafted=PASS|FAIL
directus_dot_plan_drafted=PASS|FAIL
readonly_only=true
mark_read_ui=DEFERRED
nuxt_path=NO_NUXT_CODE|REGISTRY_DECLARATION_ONLY|GENERIC_TEMPLATE_EXTENSION_REQUIRED|BLOCKED
bespoke_notification_ui=false
nuxt_business_logic=false
nuxt_direct_pg=false
body_payload_vector_secret_exposed=false
worker_cron_added=false
iu_runtime_changed=false
recommendation=PROCEED_TO_DOT_TABLE_REGISTRATION_PROMPT|NEEDS_GENERIC_TEMPLATE_EXTENSION|BLOCKED|REVISION_REQUIRED
next_required_pack=<based_on_recommendation>

7. Hard boundaries

  • No bespoke notification UI.
  • No notification-specific Nuxt page/component.
  • No Nuxt business logic.
  • No Nuxt direct PG.
  • No Directus click-config mutation.
  • No Directus write/mark-read in this pack.
  • No UI outside Table Module / Assembly Module path.
  • No body/raw payload/vector/secret exposure.
  • No IU runtime change.
  • No worker/cron.
  • No Điều 43 machinery duplication.
  • No modification to Điều 43 context-pack builder/verify unless a separate review explicitly approves.

8. Expected recommendation logic

If existing Table Module path is sufficient:

recommendation=PROCEED_TO_DOT_TABLE_REGISTRATION_PROMPT
next_required_pack=P3D4C2U_DOT_TABLE_REGISTRATION_IMPLEMENTATION_PROMPT_REVIEW

If existing Table Module path is not sufficient but only a generic module gap exists:

recommendation=NEEDS_GENERIC_TEMPLATE_EXTENSION
next_required_pack=TABLE_MODULE_GENERIC_EXTENSION_PROMPT_REVIEW

If Directus/registry/route inventory is insufficient:

recommendation=NEEDS_MORE_INVENTORY

If the proposed approach requires bespoke UI:

recommendation=BLOCKED

9. Review emphasis

The strongest output is not a new UI design. The strongest output is proof that universal events can be exposed by adding a table/projection declaration to the existing table module path.

Think: “add one more book to the existing shelf,” not “build a new shelf.”

Back to Knowledge Hub knowledge/dev/laws/dieu44-trien-khai/prompts/23-p3d4c2u-table-module-readonly-exposure-prompt.md