Handoff to Opus — P3D3 Notification Context + Directus Exposure
Handoff to Opus — P3D3 Notification Context + Directus Exposure
Date: 2026-05-08
From: GPT-5.5 Thinking / Incomex Hội đồng AI
To: Opus new session
Status: Use this as the entry point for the new Opus session.
Important: read the files listed below first. Do not search randomly.
0. Current position
We are in Pack 23 / Điều 44 IU edit workflow.
The edit workflow and PG-native notification runtime have already been implemented and verified.
Completed chain
| Pack | Meaning | Status |
|---|---|---|
| P3B | edit draft/comment schema | PASS |
| P3C1 | safe draft/comment functions | PASS |
| P3B-FU | generalized invariant after edits | PASS |
| P3C2 | apply/edit official version functions | PASS |
| P3C3 | fn_iu_save AI front-door |
PASS |
| P3C4 | policy switch to require_review + context pack |
PASS |
| P3D1 | notification tables + read/unread functions | PASS |
| P3D2 | notification triggers + board function | PASS |
Current verified operational interface
fn_iu_save(address, body, actor) -- create/edit content; new=official, existing=draft
fn_iu_comment(address, actor, comment) -- free-flow comment
fn_iu_apply_edit_draft(draft_id, actor) -- reviewer approval
Current notification interface
fn_iu_unread(actor) -- actor's unread/actionable inbox
fn_iu_mark_read(event_ids, actor) -- mark event(s) seen for that actor only
fn_iu_notification_board(actor) -- summary board with read_status_source/latest_readers
Notification runtime status
P3D2 passed. PG now automatically creates notification events for:
- non-system comments;
- drafts requiring review;
- official version applied events.
The runtime is active for limited use. Hermes production is still blocked pending review.
1. Files to read first, in order
Do not search broadly. Read these exact files first.
A. Latest P3D2 execution report
knowledge/dev/laws/dieu44-trien-khai/reports/23-p3d2-notification-triggers-report.md
Purpose: confirms P3D2 PASS, active objects, notification behavior, and next pack.
B. GPT review and directive after P3D2 PASS
knowledge/dev/laws/dieu44-trien-khai/reviews/gpt-review-23-p3d2-execution-pass-and-p3d3-directive-2026-05-08.md
Purpose: this is the latest GPT directive. It defines the next task.
C. Current Agent/AI context pack
knowledge/dev/laws/dieu44-trien-khai/context-packs/iu-agent-front-door-context.md
Purpose: this must be updated in P3D3 to include notification commands and read-state semantics.
D. Directus/Nuxt UI boundary note
knowledge/dev/laws/dieu44-trien-khai/design/23-p3d-ui-boundary-directus-nuxt-assembly-note.md
Purpose: user emphasized Assembly First: PG → Directus → Nuxt. Nuxt is read-only display assembly. No Nuxt business logic.
E. P3D notification design anchor / design note, if needed
Read if you need conceptual background:
knowledge/dev/laws/dieu44-trien-khai/design/23-p3d-notification-outbox-read-state-design-anchor.md
and/or
knowledge/dev/laws/dieu44-trien-khai/design/23-p3d-notification-outbox-design-note.md
Purpose: explains PG-native notification model, per-actor read state, event history vs actionable inbox.
2. What was just completed
P3D2 PASS verified:
phase_status=PASS;- T1–T16 all PASS;
- 4 functions + 3 triggers active;
- Pack 23 and P3D1 hashes unchanged;
- notification runtime active;
- notification board active;
- per-actor read state active;
- Hermes remains
BLOCKED_PENDING_REVIEW.
P3D2 installed / activated:
fn_iu_notif_comment()+trg_aa_iu_notif_comment;fn_iu_notif_draft()+trg_aa_iu_notif_draft;fn_iu_notif_version()+trg_aa_iu_notif_version;fn_iu_notification_board(text,text,integer).
Verified behavior:
- normal comment → notification;
- system/apply comment suppressed;
- draft created → notification;
- version applied → notification;
- birth/version_seq=1 excluded;
- applied draft hidden from actionable review inbox;
- per-actor read isolation works;
- creator implicit self-read works;
- latest readers include GPT after mark_read;
- test notification/read rows cleaned on PASS.
3. User’s latest clarification
The notification board is not only for AI/Agents.
Human users also need to monitor the workflow:
- what content/comment/review events are new;
- which information pieces need review;
- which AI/Agent has read or not read;
- how the overall process is operating.
Final target:
- a notification board visible to humans through the existing Directus → Nuxt route;
- Nuxt should only render data exposed by Directus;
- Directus should read from PG;
- PG remains the source of truth.
This is part of human + AI collaboration. It is not just an internal Hermes/agent queue.
Important: Hermes or other automated agents are later. Do not mix Hermes production into P3D3.
4. Non-negotiable Directus/Nuxt boundary
User repeated this as a hard architectural rule.
Use this path:
Postgres notification tables/functions/views
→ Directus collections/views/permissions/API
→ Nuxt existing screen/component reads from Directus
Hard boundaries:
- No Nuxt business logic.
- No Nuxt code by default.
- No direct PG access from Nuxt.
- Nuxt is only display/read assembly.
- Directus reads/exposes PG.
- PG is source of truth.
- Do not mutate Directus config in P3D3 unless specifically approved. P3D3 should be context/design only.
5. Your next task: create P3D3 prompt, do not dispatch
Create a new prompt document:
knowledge/dev/laws/dieu44-trien-khai/prompts/23-p3d3-notification-context-directus-exposure-prompt.md
Report path for later execution:
knowledge/dev/laws/dieu44-trien-khai/reports/23-p3d3-notification-context-directus-exposure-report.md
P3D3 is a documentation/context + Directus exposure design pack.
It must not implement UI code.
It must not change PG runtime.
It must not mutate Directus config unless later explicitly approved.
6. P3D3 objectives to encode in the prompt
Objective 1 — Update Agent/AI context pack
Update:
knowledge/dev/laws/dieu44-trien-khai/context-packs/iu-agent-front-door-context.md
Add notification commands:
fn_iu_unread(actor) -- check actor's unread/actionable inbox
fn_iu_mark_read(event_ids, actor) -- mark seen for actor only
fn_iu_notification_board(actor) -- summary board with read_status_source/latest_readers
Objective 2 — Document read-state semantics
The context pack must explain:
- explicit read is created by
fn_iu_mark_read; - creator has implicit self-read;
- read state is per actor, not global;
- GPT reading does not hide an event for Opus;
- Opus reading does not hide an event for GPT;
- human users also need stable actor identities;
- examples:
gpt;opus;agent:codex;user:huyen;reviewer:gpt.
Objective 3 — Document board scope
The board is currently:
actionable_current_events
Meaning:
- open draft review events appear;
- applied/stale draft events disappear from actionable review board;
- durable event history remains in
iu_notification_eventuntil a future cleanup/retention design; - board is not yet a full historical audit UI.
Objective 4 — Add Directus/Nuxt boundary
Context and design note must explicitly say:
- PG is source of truth;
- Directus exposes PG tables/views/functions;
- Nuxt only reads from Directus;
- no Nuxt business logic;
- no direct PG from Nuxt;
- no custom Nuxt work in P3D3.
Objective 5 — Create/update Directus exposure design note
Create/update:
knowledge/dev/laws/dieu44-trien-khai/design/23-p3d3-user-notification-board-directus-exposure-design.md
This design note must cover:
- purpose: shared human + AI notification board;
- board contents:
- new comments;
- new drafts requiring review;
- official update/apply events;
- actor who created the event;
- actor-specific read state;
- latest readers;
- humans should be able to see which AI/Agent read or has not read;
- Directus is the exposure layer;
- Nuxt only renders what Directus exposes;
- preferred PG exposure primitive for Directus:
- likely PG view or Directus collection backed by notification tables/functions;
- compare view vs function/API exposure;
- no implementation yet unless explicitly approved;
- human/user read state is also per actor, not global;
- Hermes consumption remains separate and blocked pending review.
7. Required report evidence for the future P3D3 execution prompt
The P3D3 prompt should require the eventual Agent report to include:
- context pack updated and readback verified;
- notification commands documented;
- implicit self-read documented;
- per-actor read state documented;
- actionable board scope documented;
- human/user board requirement documented;
- Directus/Nuxt boundary included;
- Directus exposure design note created/readback verified;
- no PG mutation;
- no Nuxt code;
- no Directus config mutation;
- no Hermes production start;
next_required_pack=P3D4_DIRECTUS_EXPOSURE_DESIGN_OR_IMPLEMENTATION_REVIEW.
8. Hard boundaries for P3D3 prompt
The P3D3 prompt must say:
- Do not change PG schema/functions/triggers.
- Do not change Pack 23 or P3D runtime.
- Do not mutate Directus configuration unless a later pack explicitly approves it.
- Do not write Nuxt code.
- Do not add Nuxt business logic.
- Do not connect Nuxt directly to PG.
- Do not start Hermes production.
- Do not implement Directus exposure yet unless explicitly approved after design review.
9. What to return after you draft P3D3 prompt
After creating the P3D3 prompt, stop.
Return a short summary to GPT/User:
- prompt path created;
- what it will update;
- what design note it will create;
- hard boundaries;
- confirm no dispatch.
Do not dispatch Agent execution.
10. Short mental model
Pack 23 + P3D2 now gives us:
AI can edit/comment/review.
PG records notifications automatically.
PG knows who has read what, per actor.
P3D3 should make this understandable and ready for human-facing exposure:
Context pack tells AI/Agent how to use it.
Design note tells future Directus/Nuxt work how to expose it without violating Assembly First.
The UI target is:
Human + AI shared notification board
shown through Directus → Nuxt assembly
with PG as source of truth.