KB-3B90

GPT Review — 23-P3D4C0X Execution PASS and P3D4C0Y Directive

9 min read Revision 1
gpt-reviewp3d4c0xpassp3d4c0ydirectiveuniversal-eventnotificationphase2-poc

GPT Review — 23-P3D4C0X Execution PASS and P3D4C0Y Directive

Date: 2026-05-08
Reviewer: GPT-5.5 Thinking / Incomex Hội đồng AI
Reviewed:

  • knowledge/dev/laws/dieu44-trien-khai/design/23-p3d4c0x-universal-event-outbox-notification-architecture.md
  • knowledge/dev/laws/dieu44-trien-khai/reports/23-p3d4c0x-universal-event-outbox-notification-architecture-review-report.md
  • knowledge/dev/laws/dieu44-trien-khai/reviews/opus-review-23-p3d4c0x-execution-pass-2026-05-08.md

Verdict

P3D4C0X PASS confirmed.

Opus review is accepted. Agent output is accepted. No supplemental P3D4C0X work is required.

The architecture direction is now correctly generalized: this is not an IU notification feature. It is the universal PG-to-outside signal/notification substrate for Incomex, with IU as first existing consumer/compatibility domain.

Accepted recommendation

Approve UNIVERSAL_WITH_IU_COMPAT (Option C).

Accepted interpretation:

  • Existing P3D1/P3D2 IU runtime remains ACTIVE and untouched.
  • fn_iu_unread, fn_iu_mark_read, fn_iu_notification_board remain stable front-door APIs.
  • Universal event_outbox, event_read, event_subscription, routing/projection and worker design should serve new domains first.
  • IU converges later through compatibility views/functions after universal core is proven.
  • No breaking changes and no migration of current IU runtime in the next pack.

Answers to 8 open questions

  1. Approve Option C?
    YES — UNIVERSAL_WITH_IU_COMPAT is approved as the working strategy.

  2. Approve C-i in Phase 2 PoC before C-ii?
    YES. Phase 2 should validate universal core with a low-risk domain and IU compatibility view/projection before any IU migration.

  3. Stream taxonomy 7 streams accepted?
    Accepted for PoC: comment, review, update, birth, task, alert, health.
    P3D4C0Y should test whether task and review overlap in practice, but do not change now.

  4. Inclusion criteria 3-question rubric enough?
    YES, with one hardening: P3D4C0Y must add an event_type_registry or equivalent registry/config design so allowed event types are explicit and not free-form. This prevents activity-log creep.

  5. Law ownership — defer Đ45 until after Phase 2 PoC?
    YES. Do not create/amend law now. P3D4C0Y should record candidate jurisdiction and propose whether Đ45 or an appendix is needed after PoC evidence.

  6. P3D4C1 fate?
    Generalize / absorb into universal roadmap. Do not proceed with IU-specific P3D4C1. Do not cancel its lessons. Treat it as design material to be reused in P3D4C0Y/P3D4C1U. The old P3D4C1 remains paused.

  7. LISTEN/NOTIFY Phase 2 or Phase 3?
    Defer implementation to Phase 3. P3D4C0Y may keep LISTEN/NOTIFY as a seam/evaluation note only. Phase 2 PoC should rely on PG tables, functions, views, pg_cron, Directus projection, and agent SQL polling.

  8. Đ43 red_zones feed universal alerts — Đ43 review/amend or additive?
    Additive-only if using existing Đ43 pg_query source mode and no section/schema change. If P3D4C0Y proposes a new Đ43 section or changes context-pack contract, require separate Đ43 review/amend.

Strategic constraints carried forward

The universal design must preserve:

PG hot path = O(1) append only.
Derived processing = deferred worker.
Durable event = PG source of truth.
Routing/read-state = PG functions/views/tables.
Directus = DOT/read projection only.
Nuxt = display assembly only, no business logic, no PG direct.

No trigger/function on the AI write path may perform COUNT, JOIN, rollup, batch detection, latest_readers, vector work, or derived processing.

Directive to Opus — create P3D4C0Y prompt, do not dispatch

Create prompt:

knowledge/dev/laws/dieu44-trien-khai/prompts/23-p3d4c0y-universal-phase2-poc-scope-plan-prompt.md

Future design note:

knowledge/dev/laws/dieu44-trien-khai/design/23-p3d4c0y-universal-phase2-poc-scope-plan.md

Future report:

knowledge/dev/laws/dieu44-trien-khai/reports/23-p3d4c0y-universal-phase2-poc-scope-plan-report.md

P3D4C0Y is scope/design review only. Do not implement.

P3D4C0Y scope

The P3D4C0Y prompt should produce a practical Phase 2 PoC plan for universal PG-to-outside signal architecture.

It should cover:

  1. PoC domain choice.
    Prefer system_issues / Đ22 health issue lifecycle if inventory confirms it is simple and low-risk. Otherwise choose the simplest low-risk domain with existing lifecycle rows. Do not use IU as the first universal PoC because IU runtime is already active and should not be disturbed.

  2. Universal core schema design, not execution.
    Draft candidate DDL for:

    • event_outbox;
    • event_read;
    • event_subscription;
    • event_type_registry or equivalent allowed-event registry;
    • worker log/config only if needed;
    • domain pending table pattern, if the PoC domain needs debounce.
  3. IU compatibility C-i plan.
    Keep current IU runtime untouched. Design v_event_unified or equivalent read projection that can union existing iu_notification_event with future universal event_outbox without changing fn_iu_* APIs.

  4. Routing model.
    Design subscription defaults for humans, AI agents, roles/agencies and system services. Keep Phase 2 minimal: enough for PoC + agent inbox + Directus read projection.

  5. Exposure plan.
    Design PG views/functions for Directus/Agent consumption. No Directus mutation yet. Nuxt remains deferred/display-only.

  6. Event inclusion registry.
    Define how event types are registered, mapped to stream/severity/domain, and validated so this cannot become a general activity log.

  7. Đ43 alignment.
    Confirm no duplicate context-pack/DOT machinery. If using existing Đ43 pg_query mode for red_zones/recent alerts is enough, mark additive. If not, mark NEEDS_D43_REVIEW.

  8. P3D4C1 reuse decision.
    Map old P3D4C1 lessons into universal design: birth hook O(1), pg_cron worker, debounce/grouping, rollback/test patterns. Do not continue IU-specific P3D4C1.

  9. Test and rollback plan.
    Define tests for PoC parity, routing, read-state, activity-log boundary, no body/vector/secret payload, no direct Directus/Nuxt mutation, no IU breakage.

  10. Next implementation pack proposal.
    Based on P3D4C0Y result, recommend one next prompt:

  • P3D4C1U_UNIVERSAL_CORE_IMPLEMENTATION_PROMPT_REVIEW; or
  • P3D4C1U_REV2_REQUIRED; or
  • NEEDS_D43_ALIGNMENT; or
  • NEEDS_LAW_APPENDIX_BEFORE_IMPLEMENTATION.

Required report fields for future P3D4C0Y

phase_status=PASS|FAIL|NEEDS_MORE_INVENTORY
poc_domain_selected=<domain>
poc_domain_justification=<short>
universal_core_schema_drafted=PASS|FAIL
event_type_registry_defined=PASS|FAIL
iu_compat_c_i_plan=PASS|FAIL
v_event_unified_strategy=PASS|FAIL
routing_minimal_phase2_defined=PASS|FAIL
exposure_projection_plan=PASS|FAIL
directus_mutation_required=false
nuxt_code_required=false
d43_alignment=ADDITIVE_ONLY|NEEDS_D43_REVIEW|BLOCKED
p3d4c1_status=PAUSED_ABSORBED_INTO_UNIVERSAL|PAUSED_PENDING_DECISION
activity_log_boundary_enforced=PASS|FAIL
payload_safety_rules=PASS|FAIL
hot_path_contract=O1_APPEND_ONLY
worker_strategy=PG_CRON_ONLY|NO_WORKER_NEEDED_FOR_POC
listen_notify_status=DEFERRED_PHASE3
rollback_plan=PASS|FAIL
no_pg_mutation=true
no_directus_mutation=true
no_nuxt_code=true
no_iu_runtime_change=true
recommendation=P3D4C1U_UNIVERSAL_CORE_IMPLEMENTATION_PROMPT_REVIEW|REVISION_REQUIRED|NEEDS_D43_ALIGNMENT|NEEDS_LAW_APPENDIX

Hard boundaries for Opus/Agent

  • Do not implement.
  • Do not mutate PG.
  • Do not mutate Directus.
  • Do not write Nuxt code.
  • Do not start Hermes.
  • Do not dispatch Codex.
  • Do not create runtime tables/functions/triggers.
  • Do not touch existing iu_notification_* runtime.
  • Do not resume old IU-specific P3D4C1.
  • Do not add external scheduler/tool/service.
  • Do not include body/raw payload/vector/secret in any proposed projection.
  • Do not solve routing/grouping in Directus or Nuxt.

Next after Opus returns P3D4C0Y prompt

GPT/User review the P3D4C0Y prompt. If approved, then dispatch design/scope plan. Implementation still comes later as a separate prompt review.

Back to Knowledge Hub knowledge/dev/laws/dieu44-trien-khai/reviews/gpt-review-23-p3d4c0x-execution-pass-and-p3d4c0y-directive-2026-05-08.md