KB-871C

GPT Final Approval — P3D4C2U DOT Table Registration Prompt rev4

6 min read Revision 1
gpt-reviewfinal-approvalp3d4c2urev4dottable-moduleapproved-for-dispatch

GPT Final Approval — 23-P3D4C2U DOT Table Registration Implementation Prompt rev4

Date: 2026-05-08
Reviewer: GPT-5.5 Thinking / Incomex Hội đồng AI
Reviewed: knowledge/dev/laws/dieu44-trien-khai/prompts/23-p3d4c2u-dot-table-registration-implementation-prompt.md rev4

Verdict

APPROVED FOR DISPATCH.

P3D4C2U rev4 is sufficiently production-safe for the limited scope: PG metadata-only view + Directus read-only exposure + one Table Module registry row. It preserves the rule that this is not a bespoke notification UI.

This approval is limited to the prompt boundaries. It does not approve Nuxt code, Directus write/mark-read, custom notification UI, worker/cron, IU runtime changes, or Điều 43 machinery changes.

Accepted rev4 fixes

  • View creation has two executable variants:
    • Variant A: 13 columns with payload_classification if the column exists;
    • Variant B: 12 columns if absent.
  • Directus permission creation is idempotent and conflict-aware.
  • table_registry row creation is idempotent and conflict-aware.
  • Field metadata patching is limited to target collection fields and preserves unrelated settings.
  • Publish reporting is explicit: published=YES|NO, publish_block_reason=<specific>.
  • Recommendation values are granular and no longer use vague DONE.
  • PG DB role and Directus app role remain correctly separated from rev3.
  • Route smoke gate is retained: no publish if route smoke is not verified.

Dispatch instruction to Opus/Agent

Đọc prompt từ KB rồi thực hiện:

knowledge/dev/laws/dieu44-trien-khai/prompts/23-p3d4c2u-dot-table-registration-implementation-prompt.md

Mục tiêu:
Expose universal event core through the existing Table Module path by creating/registering a read-only, metadata-only event table projection.

Execute exactly within the prompt boundaries:
1. Run inventory and smoke gate.
2. STOP if system_issues API smoke fails.
3. If route smoke cannot be verified, keep tbl_event_outbox as draft and report DEFERRED_MANUAL_ROUTE_SMOKE.
4. Create or reuse compatible v_event_outbox_table view using the correct payload_classification variant.
5. Grant SELECT to the inventoried PG read role only.
6. Register/verify Directus collection and fields via API/DOT only.
7. Seed read permission for the inventoried Directus app role only; no create/update/delete.
8. Create/reuse compatible tbl_event_outbox row using actual table_registry schema and convention channel.
9. Run smoke tests S1-S6.
10. Publish only if all smoke tests pass and route smoke is verified.
11. Roll back only objects created by this pack if failure occurs.
12. Upload report:
    knowledge/dev/laws/dieu44-trien-khai/reports/23-p3d4c2u-dot-table-registration-implementation-report.md

Upload report even on PASS, FAIL, BLOCKED, or DEFERRED_MANUAL_ROUTE_SMOKE.

Hard boundaries for execution

  • No Nuxt code.
  • No bespoke notification UI.
  • No notification-specific page/component.
  • No Directus click-config.
  • No Directus write/mark-read.
  • No unsafe fields: payload/body/raw_payload/safe_payload/vector/embedding/secret/token/password/correlation_id/causation_id/ssn/personal_data.
  • No IU runtime change.
  • No worker/cron.
  • No Điều 43 machinery change.
  • No new PG role or Directus role.
  • No publish if route smoke is not verified.

Clarification on next_required_pack

The prompt’s verification block still lists next_required_pack=P3D4C3U_USER_VIEW_SMOKE_AND_MARK_READ_DECISION. Interpret this conditionally:

If recommendation=READONLY_EXPOSURE_PUBLISHED:
  next_required_pack=P3D4C3U_USER_VIEW_SMOKE_AND_MARK_READ_DECISION

If recommendation=READONLY_EXPOSURE_DRAFT_PENDING_ROUTE_SMOKE:
  next_required_pack=P3D4C2U_MANUAL_ROUTE_SMOKE

If recommendation=NEEDS_GENERIC_TEMPLATE_EXTENSION:
  next_required_pack=TABLE_MODULE_GENERIC_EXTENSION_PROMPT_REVIEW

If recommendation=DIRECTUS_VIEW_PK_BLOCKED:
  next_required_pack=DIRECTUS_VIEW_PK_CONVENTION_REVIEW

This clarification is part of the approval.

Expected report fields

Report must include at least the rev4 verification block, especially:

phase_status=PASS|FAIL|BLOCKED
smoke_system_issues_api=PASS|FAIL
smoke_system_issues_route=PASS|CANNOT_VERIFY|FAIL
payload_classification_exists=YES|NO
view_variant=A_13_COLS|B_12_COLS
view_status=CREATED|ALREADY_PRESENT_COMPATIBLE|CONFLICT
preflight_pg_read_role=<name>|NOT_FOUND
preflight_directus_read_role=<uuid>|NOT_FOUND
directus_pk_recognized=PASS|FAIL|STOP
permission_status=CREATED|ALREADY_PRESENT_COMPATIBLE|BROADER_UNSAFE_STOP
registry_status=CREATED|ALREADY_PRESENT_COMPATIBLE|CONFLICT_STOP
registry_initial_status=draft
registry_final_status=draft|published|removed
published=YES|NO
publish_block_reason=NONE|ROUTE_SMOKE_CANNOT_VERIFY|SMOKE_FAIL|CONFLICT|PK_BLOCKED
unsafe_fields_absent=PASS|FAIL
iu_post_snapshot_match=PASS|FAIL
no_nuxt_code=true
no_bespoke_ui=true
no_directus_click_config=true
no_iu_change=true
no_new_role_created=true
recommendation=READONLY_EXPOSURE_PUBLISHED|READONLY_EXPOSURE_DRAFT_PENDING_ROUTE_SMOKE|NEEDS_GENERIC_TEMPLATE_EXTENSION|DIRECTUS_VIEW_PK_BLOCKED|REVISION_REQUIRED|BLOCKED

Review emphasis for Agent

The goal is not merely to make event_outbox visible. The goal is to prove the established shared Table Module path can accept one more registered table without creating a parallel notification UI.

If the shared path fails, stop and repair the shared path. Do not route around it.

Final status

p3d4c2u_prompt_rev4=APPROVED_FOR_DISPATCH
implementation_scope=PG_VIEW_PLUS_DIRECTUS_READONLY_PLUS_TABLE_REGISTRY
nuxt_code_allowed=false
bespoke_ui_allowed=false
mark_read_ui_allowed=false
worker_cron_allowed=false
next=AGENT_EXECUTION_REPORT_REVIEW
Back to Knowledge Hub knowledge/dev/laws/dieu44-trien-khai/reviews/gpt-final-approval-23-p3d4c2u-dot-table-registration-prompt-rev4-2026-05-08.md