KB-383A

Handoff to Opus — P3D4C Directus DOT Read-Only Notification Exposure

8 min read Revision 1
handoffopuspack-23p3d4cdirectusdotnotification

Handoff to Opus — P3D4C Directus DOT Read-Only Notification Exposure

Date: 2026-05-08
From: GPT-5.5 Thinking / Incomex Hội đồng AI
To: Opus new session
Purpose: continue from the clean checkpoint after P3D4B PASS.
Important: use this handoff as the entry point. Do not search randomly first.


0. Current checkpoint

P3D4B has passed. The next task is P3D4C prompt drafting.

Completed

  • Pack 23 IU edit workflow: PASS.
  • P3D notification runtime in PG: PASS and ACTIVE.
  • P3D3 context + Directus exposure design: PASS.
  • P3D4 Directus/PG read-only inventory and exposure design review: PASS.
  • P3D4B DOT package review: PASS / GO.

Not yet implemented

  • Human-visible notification board in Directus/Nuxt is not implemented.
  • PG view v_iu_notification_board does not exist yet.
  • Directus read-only exposure/permission is not applied yet.
  • Nuxt display assembly is not touched.
  • Mark-read for human users is deferred.
  • Directus user → actor_ref mapping is deferred.
  • Hermes production is blocked.

1. Files to read first, in order

Read these exact files first.

  1. GPT review/directive for P3D4B PASS: knowledge/dev/laws/dieu44-trien-khai/reviews/gpt-review-23-p3d4b-execution-pass-and-p3d4c-directive-2026-05-08.md

  2. P3D4B report: knowledge/dev/laws/dieu44-trien-khai/reports/23-p3d4b-directus-dot-notification-readonly-exposure-report.md

  3. P3D4B design note: knowledge/dev/laws/dieu44-trien-khai/design/23-p3d4b-directus-dot-notification-readonly-exposure-package-review.md

  4. P3D4 report: knowledge/dev/laws/dieu44-trien-khai/reports/23-p3d4-directus-exposure-design-review-report.md

  5. P3D4 design note: knowledge/dev/laws/dieu44-trien-khai/design/23-p3d4-directus-notification-exposure-review.md

  6. P3D3 design note: knowledge/dev/laws/dieu44-trien-khai/design/23-p3d3-user-notification-board-directus-exposure-design.md

  7. Directus/Nuxt boundary note: knowledge/dev/laws/dieu44-trien-khai/design/23-p3d-ui-boundary-directus-nuxt-assembly-note.md

  8. Relevant laws if needed:

    • knowledge/dev/laws/constitution.md
    • knowledge/dev/laws/law-07-assembly-first.md
    • knowledge/dev/ssot/data-connection-law.md
    • Directus/DOT law if available
    • Điều 28/display law if available

2. What P3D4B decided

P3D4B is package review only and passed.

Key decisions:

  • recommendation=READY_FOR_IMPLEMENTATION_PROMPT
  • view_scope=HISTORY
  • payload_strategy=OMIT_RAW_PAYLOAD
  • role_strategy=NEW_ROLE_RECOMMENDED with notif_board_reader, but re-check role inventory at implementation time and reuse existing role if suitable.
  • overlap_risk=LOW
  • go_nogo_gate=GO
  • Reuse DOT conventions:
    • 3-part description contract;
    • NT12 paired DOT pattern;
    • PG-native COUNT(DISTINCT actor_ref).
  • Candidate DOT pair:
    • DOT-NOTIF-BOARD-EXPOSE
    • DOT-NOTIF-BOARD-EXPOSE-VERIFY

P3D4B did not mutate PG or Directus. It produced only a non-executable package review.


3. Your next task

Create P3D4C prompt, do not dispatch.

Prompt path:

knowledge/dev/laws/dieu44-trien-khai/prompts/23-p3d4c-pg-view-directus-dot-notification-readonly-implementation-prompt.md

Future report path:

knowledge/dev/laws/dieu44-trien-khai/reports/23-p3d4c-pg-view-directus-dot-notification-readonly-implementation-report.md

P3D4C should be an implementation prompt for later execution. The P3D4C prompt itself must not execute anything.

After drafting P3D4C prompt, stop and return for GPT/User review.


4. P3D4C prompt should cover

4.1 PG view

Create a future execution design for:

public.v_iu_notification_board

Scope:

HISTORY

Required metadata-only columns:

  • event_id
  • event_type
  • event_stream
  • canonical_address
  • unit_id
  • ref_id
  • actor_ref
  • source
  • created_at
  • read_count
  • latest_readers
  • optional safe derived fields only

Must not expose:

  • IU body;
  • unit_version body;
  • raw payload jsonb;
  • sensitive content.

Rules:

  • read_count = COUNT(DISTINCT r.actor_ref) WHERE r.event_id=e.id.
  • latest_readers = top 5 by read_at DESC, actor_ref ASC.
  • no separate counter table.
  • no denormalized count column.

4.2 Directus DOT exposure

Use DOT/change package pattern.

Candidate DOT pair:

  • DOT-NOTIF-BOARD-EXPOSE
  • DOT-NOTIF-BOARD-EXPOSE-VERIFY

Must cover:

  • Directus view/collection exposure for v_iu_notification_board.
  • Read-only permission grant only.
  • No create/update/delete.
  • No manual UI clicking.
  • Role strategy:
    • prefer existing role if suitable;
    • else notif_board_reader if approved.
  • Labels/descriptions if DOT-supported.
  • Rollback path.

4.3 Preflight gates for future execution

The eventual implementation prompt should STOP unless:

  • no existing public.v_iu_notification_board exists;
  • notification tables exist;
  • relevant indexes/constraints exist;
  • P3D2 runtime active: 4 functions + 3 triggers;
  • candidate view does not expose body or raw payload;
  • role strategy confirmed at runtime;
  • Directus inventory remains read-only;
  • no Nuxt work;
  • no Hermes work.

4.4 Tests for future execution

P3D4C prompt should require tests:

  1. PG view created.
  2. View returns rows if notification events exist, or 0 rows cleanly if none.
  3. View columns exactly match approved metadata-only list.
  4. View does not expose body or raw payload.
  5. read_count matches base-table count distinct.
  6. latest_readers ordering deterministic.
  7. Directus sees/auto-registers the view or reports limited/manual DOT step.
  8. Directus permission grant read-only.
  9. No create/update/delete permission exists for target role.
  10. No PG runtime mutation except the new view.
  11. No Nuxt mutation.
  12. No Hermes mutation.
  13. Rollback plan exists.
  14. Quiet period documented: 24–48h before mark-read/human-write package.

4.5 Future execution report fields

Include at least:

  • phase_status;
  • view_created=PASS|FAIL;
  • view_name=public.v_iu_notification_board;
  • view_scope=HISTORY;
  • metadata_only=PASS|FAIL;
  • raw_payload_exposed=false;
  • body_content_exposed=false;
  • read_count_verified=PASS|FAIL;
  • latest_readers_verified=PASS|FAIL;
  • directus_view_visible=PASS|FAIL|LIMITED;
  • role_strategy=REUSE_EXISTING|CREATED_NOTIF_BOARD_READER;
  • directus_permission_read_only=PASS|FAIL;
  • no_create_update_delete_permissions=PASS|FAIL;
  • no_pg_runtime_mutation=true;
  • no_nuxt_code=true;
  • no_hermes_start=true;
  • rollback_plan=PASS;
  • quiet_period=24_48H_BEFORE_MARK_READ_PACKAGE.

5. Hard boundaries

For P3D4C prompt drafting:

  • Do not dispatch implementation.
  • Do not mutate PG during prompt drafting.
  • Do not mutate Directus during prompt drafting.
  • Do not write Nuxt code.
  • Do not start Hermes.
  • Do not expose body or raw payload.
  • Do not create/update/delete Directus permissions outside reviewed DOT package.
  • Do not involve Codex unless User explicitly approves.

For later execution, the P3D4C prompt must itself preserve:

  • no Nuxt code;
  • no Nuxt business logic;
  • no direct PG from Nuxt;
  • Directus DOT/change package only;
  • Directus UI view/inspect only;
  • no manual Directus UI configuration;
  • metadata/ref-only board;
  • mark-read deferred;
  • Directus user→actor_ref mapping deferred;
  • Hermes deferred.

6. Suggested final response after drafting prompt

After creating P3D4C prompt, respond with:

  • prompt path created;
  • main contents;
  • hard boundaries;
  • confirmation that nothing was dispatched;
  • request GPT/User final review.

Do not execute the P3D4C prompt.


7. One-line mental model

P3D4C is the reviewed construction plan for the first human-visible notification board: create one metadata-only PG view and expose it read-only through Directus DOT, with Nuxt still untouched.

Back to Knowledge Hub knowledge/dev/laws/dieu44-trien-khai/handoffs/opus-handoff-p3d4c-directus-dot-readonly-exposure-2026-05-08.md