KB-49E9

GPT Final Approval — 23-P3C1 Safe Functions Prompt rev7

4 min read Revision 1
gpt-reviewpack-23p3c1approved-for-dispatchsafe-functionsnatural-ux

GPT Final Approval — 23-P3C1 Safe Functions Prompt rev7

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

  • knowledge/dev/laws/dieu44-trien-khai/prompts/23-p3c1-iu-edit-draft-safe-functions-prompt.md rev7
  • knowledge/dev/laws/dieu44-trien-khai/design/23-p3c1-ux-state-foundation-notes.md rev2

Verdict

APPROVED FOR DISPATCH.

Rev7 fixes the shell comparison blocker and keeps the restored full execution prompt intact. UX notes rev2 are accepted as the design companion for timestamp, actor-card, and per-actor last-view watermark hooks.

Accepted state

P3C1 will create four safe canonical functions:

  1. fn_iu_edit_plan(text,text,text,text)
  2. fn_iu_create_edit_draft(text,text,text,text,text)
  3. fn_iu_comment_edit_draft(uuid,text,text,text,text)
  4. fn_iu_comment(text,text,text,text,text,jsonb)

P3C1 does not create apply/wrapper functions and does not write IU/UV.

Accepted UX principles

  • AI/Agent can use natural high-level commands.
  • fn_iu_comment is simple but safe:
    • one open draft → attach automatically;
    • multiple open drafts → return candidates, no silent insert;
    • explicit context can select draft_id or latest.
  • Timestamp discipline is recorded.
  • Actor-card/session-GUC signature is recorded as deferred hook.
  • Per-actor last-view watermark is recorded as deferred hook.
  • Read/unread state must not be global and must not be hacked into comment body.

Dispatch instruction

Đọc prompt từ KB rồi thực hiện:

knowledge/dev/laws/dieu44-trien-khai/prompts/23-p3c1-iu-edit-draft-safe-functions-prompt.md

Trước khi chạy, đọc companion UX notes:
knowledge/dev/laws/dieu44-trien-khai/design/23-p3c1-ux-state-foundation-notes.md

Mục tiêu: tạo 4 safe functions cho edit draft/comment workflow. Không tạo apply/wrapper functions. Không table DDL, không trigger/gateway changes, không IU/UV writes, không vector, không cleanup.

Report tại:
knowledge/dev/laws/dieu44-trien-khai/reports/23-p3c1-iu-edit-draft-safe-functions-report.md

Upload report kể cả FAIL/CRITICAL.

Hard boundaries for Agent

  • No table DDL.
  • No schema changes.
  • No trigger changes.
  • No gateway changes.
  • No IU/UV writes.
  • No fn_iu_apply_edit_draft.
  • No fn_iu_edit wrapper.
  • No vector mutation.
  • No cleanup.
  • No Pack 2C.
  • No retry/improvise beyond prompt.

Expected PASS evidence

Report should include:

  • phase_status=PASS;
  • p3c2_readiness=READY;
  • T1–T21 all PASS;
  • all 4 functions created with expected signatures;
  • SECURITY DEFINER + search_path=pg_catalog,public;
  • PUBLIC EXECUTE absent;
  • intended grantees can execute;
  • 2 draft rows and 4 comment rows created by tests, retained;
  • IU/UV counts unchanged;
  • source safety proves no IU/UV write path;
  • UX evidence JSON samples;
  • ux_notes_read=23-p3c1-ux-state-foundation-notes.md_rev2;
  • ux_hooks=timestamp_ok,actor_card_guc_deferred,per_actor_watermark_deferred;
  • boundaries honored.

Next after Agent report

After P3C1 report is uploaded, Opus/GPT should review it. If PASS, proceed to P3C2 prompt design for:

  • fn_iu_apply_edit_draft(...);
  • fn_iu_edit(...) wrapper;
  • official version write path through gateway marker;
  • invariant verification;
  • stale-base/apply review comment behavior.

Do not begin P3C2 before P3C1 report review.

Back to Knowledge Hub knowledge/dev/laws/dieu44-trien-khai/reviews/gpt-final-approval-23-p3c1-safe-functions-prompt-rev7-2026-05-07.md