KB-4613

GPT Review — 23-P3D4B Prompt rev1

7 min read Revision 1
gpt-reviewpack-23p3d4brev2-requireddirectusdotdieu43

GPT Review — 23-P3D4B Prompt rev1

Date: 2026-05-08
Reviewer: GPT-5.5 Thinking / Incomex Hội đồng AI
Reviewed: knowledge/dev/laws/dieu44-trien-khai/prompts/23-p3d4b-directus-dot-notification-readonly-exposure-prompt.md rev1

Verdict

Rev1 is directionally correct, but do not dispatch yet. Rev2 required.

Opus correctly bounded the Điều 43 inventory to avoid rabbit holes, and the overall staged recommendation is aligned with P3D4. However, the prompt still risks drifting into an implementation mindset and has several unclear or unsafe details for a DOT package review.

Accepted rev1 points

  • P3D4B is package review only, not implementation.
  • Điều 43/DOT overlap inventory is mandatory and bounded.
  • Candidate package is metadata/ref-only.
  • Mark-read, Directus user→actor_ref mapping, Nuxt display, and Hermes are deferred.
  • No body content exposure.
  • No Nuxt code.
  • No Codex dispatch.
  • No PG/Directus mutation.

Required rev2 fixes

P1 — Rename next_required_pack to avoid implying same-pack implementation

Rev1 says:

next_required_pack=P3D4B_IMPLEMENTATION (nếu READY)

This can be read as implementing in the same pack. Change to:

next_required_pack=P3D4C_PG_VIEW_AND_DIRECTUS_DOT_IMPLEMENTATION_PROMPT_REVIEW

if READY_FOR_IMPLEMENTATION_PROMPT, or:

P3D4B_DIEU43_ALIGNMENT_REVIEW

if NEEDS_DIEU43_ALIGNMENT, or DEFERRED.

P2 — Candidate PG view SQL must be explicitly non-executable sketch

Step 2A asks for a view design and rollback. Add explicit wording:

Do not provide a runnable CREATE VIEW script in P3D4B unless clearly fenced as NON-EXECUTABLE SKETCH. P3D4B must not be copy-paste executable for PG mutation.

Reason: P3D4B is review only. The implementation prompt later will contain executable SQL.

P3 — Candidate DOT package must be non-executable and format-aligned

Rev1 asks for a DOT package outline. Add:

Do not create an actual DOT package file intended for execution/application. Produce a candidate outline only, aligned to existing Điều 43/DOT conventions if found.

If existing DOT template is found, the note may include a non-executable skeleton showing sections/fields, but not an apply-ready payload.

P4 — Directus role target must not invent a new role by default

Rev1 says target role e.g. notif_board_reader or existing role. This can lead to unnecessary role creation.

Patch:

  • Prefer existing roles/permissions model discovered from Directus/DOT inventory.
  • If a new role is recommended, it must be justified and deferred to implementation review.
  • Report role_strategy=REUSE_EXISTING|NEW_ROLE_RECOMMENDED|UNKNOWN.

P5 — Candidate view should include actionable/current scope decision

P3D3/P3D4 distinguished actionable current board vs durable history. Candidate view design must decide one of:

  • v_iu_notification_board_current — filters actionable/current events;
  • v_iu_notification_event_history — full metadata history;
  • or a staged pair, with rationale.

GPT preference for Phase 1 human monitoring: history/read-state overview view first may be safer than actionable-only, because humans want oversight. If actionable filtering is included, document exact rule for applied/stale drafts.

P6 — latest_readers/read_count must avoid double-counting and be deterministic

Add requirements:

  • read_count = count distinct actor_ref from iu_notification_read for event_id;
  • latest_readers ordered by read_at DESC, actor_ref ASC as tie-breaker;
  • top 5;
  • no separate counter table;
  • no stored denormalized count in P3D4B.

P7 — Payload exposure must be constrained

Rev1 says payload metadata keys only, but payload is jsonb and may later contain unwanted details. Add:

  • list allowed payload keys, or recommend excluding payload entirely in Phase 1;
  • if included, only include safe refs such as draft_id, comment_id, version_id, actor_ref;
  • do not expose arbitrary payload jsonb unless separate review.

GPT preference: Phase 1 view should expose typed columns from event table and omit raw payload, or include payload_ref_summary sanitized.

P8 — Điều 43 inventory should include MCP/tooling sources if available

User specifically mentioned tools of Điều 43 and many DOTs. Add to search/read scope:

  • list available Directus/DOT tools if there is a tools index;
  • search KB for Directus MCP, DOT registry, DOT template, dot_apply, relationship_count, rollup, schema blocker;
  • record whether inventory was KB-only or included available tool registries.

P9 — Add “do not solve schema blockers here” boundary

Điều 43 may be blocked by schema. P3D4B must not try to repair Điều 43 schema.

Add hard boundary:

Do not fix Điều 43 schema blockers in P3D4B. Only document blockers and decide whether notification exposure can proceed without conflict.

P10 — Report should include inventory depth and blocked-parts summary

Add report fields:

dieu43_inventory_depth=KB_ONLY|KB_AND_TOOLING|LIMITED
reusable_dot_template=FOUND|NOT_FOUND|UNCLEAR
reusable_counting_pattern=FOUND|NOT_FOUND|UNCLEAR
dieu43_blockers_summary=<short text>
role_strategy=REUSE_EXISTING|NEW_ROLE_RECOMMENDED|UNKNOWN
view_scope=HISTORY|ACTIONABLE|PAIR|UNDECIDED
payload_strategy=OMIT_RAW_PAYLOAD|SANITIZED_REFS|UNDECIDED

P11 — Hard boundary: no Directus item-level permission changes in P3D4B

Rev1 says no Directus mutation, but add specific:

Do not grant/read/update Directus item permissions in P3D4B. P3D4B only describes the future permission grant.

P12 — Add final “go/no-go” gate for implementation prompt

The design note recommendation should include explicit go/no-go conditions for drafting P3D4C:

  • Go only if overlap_risk LOW or accepted MEDIUM with mitigations;
  • Go only if DOT convention/template is identified or fallback convention is approved;
  • Go only if view_scope and payload_strategy are decided;
  • No-go if Điều 43 overlap cannot be assessed.

Directive to Opus

Patch P3D4B prompt rev1 to rev2 with P1–P12.

Path:

knowledge/dev/laws/dieu44-trien-khai/prompts/23-p3d4b-directus-dot-notification-readonly-exposure-prompt.md

Do not dispatch after patch. Return for GPT/User review.

Hard boundaries remain

  • No dispatch.
  • No PG mutation.
  • No Directus mutation.
  • No Directus permission change.
  • No executable DOT package.
  • No executable CREATE VIEW script.
  • No Nuxt code.
  • No Hermes production.
  • No Codex dispatch without user approval.
  • No body content.
  • No Điều 43 schema repair.
  • No duplicate DOT/counting convention.

Summary

Rev1 is good as a starting design prompt. Rev2 should further prevent accidental implementation, clarify view/payload/role strategies, deepen but bound Điều 43/DOT inventory, and add explicit go/no-go conditions before any implementation prompt is drafted.