KB-6966

GPT Review — 23-P3D4C1U Prompt rev3

4 min read Revision 1
gpt-reviewp3d4c1urev4-requireduniversal-eventimplementationschema-consistency

GPT Review — 23-P3D4C1U Prompt rev3

Date: 2026-05-08
Reviewer: GPT-5.5 Thinking / Incomex Hội đồng AI
Reviewed: knowledge/dev/laws/dieu44-trien-khai/prompts/23-p3d4c1u-universal-core-implementation-prompt.md rev3

Verdict

REV4 REQUIRED — very narrow patch. Do not dispatch rev3.

Rev3 successfully fixes the major rev2 blockers: PK/FK choice is explicit, fn_event_mark_read is added, event_read status source is explicit, pg_cron quoting is safe, cron privilege order is fixed, red_zone_violation is inactive/deferred, NULL correlation_id is piece-level, test cleanup is safer, and reports are required even on FAIL/BLOCKED.

However one remaining schema-consistency issue must be patched before production dispatch.

Accepted fixes from rev3

  • Canonical PK is now event_outbox.id and event_read.event_id REFERENCES event_outbox(id).
  • fn_event_mark_read(p_event_ids uuid[], p_actor text) is included and handles implicit_self → explicit_read.
  • event_read.read_status_source requires explicit_read|implicit_self.
  • pg_cron schedule uses safe $do$ / $cmd$ dollar quoting.
  • cron schema privilege is checked only after extension installation.
  • red_zone_violation is seeded inactive and capture remains deferred.
  • Test cleanup has FK-safety fallback: ARCHIVED_NOT_DELETED.
  • NULL correlation means piece-level emission, never suppression.
  • Report is mandatory on FAIL/BLOCKED.
  • IU runtime remains protected.

Remaining blocker

P1 — event_outbox subject column names are not locked, but tests/cleanup assume entity_ref

Rev3 says event_outbox uses the P3D4C0Y §B.1 envelope, but P3D4C0Y used:

event_subject_table
event_subject_ref

Rev3 Step 8 cleanup says:

DELETE FROM event_pending/event_outbox/event_read WHERE entity_ref IN (test IDs)

That will fail if event_outbox uses event_subject_ref rather than entity_ref.

Patch rev4 to explicitly lock subject column names for event_outbox and use them consistently in worker, access functions, tests and rollback.

Preferred:

event_outbox.event_subject_table text NOT NULL
event_outbox.event_subject_ref uuid NULL

Then update cleanup/test/rollback language to:

event_pending.entity_ref IN (test IDs)
event_outbox.event_subject_ref IN (test IDs)
event_read via event_id from matching event_outbox rows

If Opus instead chooses entity_table/entity_ref for event_outbox, then revise the whole envelope and report fields consistently. Do not mix both naming systems.

Minor patch while editing

Update next pack label to the finalized universal branch label:

next_required_pack=P3D4C2U_DIRECTUS_DOT_READONLY_EXPOSURE_PROMPT_REVIEW|REVISION_REQUIRED|BLOCKED

instead of the shorter P3D4C2U_DIRECTUS_UNIVERSAL_BOARD_EXPOSURE.

Directive to Opus

Patch the prompt to rev4 at:

knowledge/dev/laws/dieu44-trien-khai/prompts/23-p3d4c1u-universal-core-implementation-prompt.md

Only patch the subject-column consistency and next-pack label unless Opus finds a directly related issue. Do not broaden the redesign. Do not dispatch after patch; return for GPT/User final review.

Hard boundaries unchanged

  • No PG mutation during prompt patch.
  • No Directus mutation.
  • No Nuxt code.
  • No Hermes/Codex dispatch.
  • No external scheduler/tool/service.
  • No change to existing iu_notification_* runtime.
  • No old IU-specific P3D4C1 resume.
  • No body/raw payload/vector/secret/personal data exposure.
  • No activity-log creep.

Summary

P3D4C1U rev3 is close to final. One naming inconsistency remains between universal envelope (event_subject_ref) and test cleanup (entity_ref). Rev4 should lock this before production approval.

Back to Knowledge Hub knowledge/dev/laws/dieu44-trien-khai/reviews/gpt-review-23-p3d4c1u-prompt-rev3-2026-05-08.md