KB-440F

GPT Review — 23-P3C1 rev5 + UX State/Signature Directive

6 min read Revision 1
gpt-reviewpack-23p3c1rev5rev6-requiredux-statetimestampsignatureread-receiptpg-native

GPT Review — 23-P3C1 rev5 + UX State/Signature Directive

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 rev5
New User requirements: timestamp discipline, auto signature/card, read/unread review state, PG First/Native/Driven.

Verdict

P3C1 rev5 is technically near-dispatch, but do NOT dispatch yet. Rev6/addendum required.

The four rev5 fixes are accepted. However, the User introduced important design requirements that affect the comment/edit UX foundation. These should be recorded before executing P3C1 so the first canonical comment functions do not lock in an awkward interface.

Accepted rev5 fixes

  1. T19 now verifies intended grantees can execute.
  2. T21 source safety is broadened to all IU/UV INSERT/UPDATE/DELETE paths.
  3. Gate 8 uses psql variable for TEST_ADDR_A when selecting TEST_ADDR_B.
  4. Report upload instruction is explicit.

New design requirements to preserve

R1 — Timestamp discipline

Every action on an information unit must leave a timestamp trace:

  • draft created: unit_edit_draft.created_at;
  • comment created: unit_edit_comment.created_at;
  • apply/review: P3C2 must set applied_at and insert an apply/system comment with timestamp;
  • stale/withdrawn/future actions must timestamp their action.

Default ordering for comments must be newest-first for reviewer inbox flows:

ORDER BY created_at DESC

Old comments remain available below / for audit.

R2 — Automatic signature / actor card

The long-term interface should not force AI/Agent to manually write “GPT commented” or “Opus commented” every time.

PG-native approach:

  • use existing author_ref, created_by, applied_by fields as the signature storage;
  • P3C1 may keep explicit p_author for now, but functions should be designed to later resolve actor from a session-level GUC such as app.iu_actor or app.actor_ref;
  • if actor is not provided and no GUC exists, return invalid_input with guidance rather than guessing;
  • do not create a heavy identity system in P3C1.

Future direction:

  • Agent runner/session can set one card once per run/session:
    • SELECT set_config('app.iu_actor','gpt', false);
    • or an equivalent runner-controlled identity marker.
  • comment/edit functions can use COALESCE(p_author, current_setting('app.iu_actor', true)) when signatures are revised.

This follows PG First and avoids requiring every Agent to remember manual signature text.

R3 — Read/unread or reviewed/unreviewed state for reviewer

The system needs an “inbox” model so the reviewer only reviews new/unseen comments/drafts instead of rereading everything every run.

Important: current P3B schema does not include a read-receipt table. Do not hack this into comment text or metadata as a permanent solution.

PG-native minimal future model:

  • create a small receipt/state table later, likely:
    • unit_edit_review_receipt
    • fields: id, draft_id, comment_id NULL, reviewer_ref, seen_at, decision, metadata jsonb, created_at
  • or one table per review state if runtime inspection suggests a better existing primitive.

Use this as a future Pack/P3D/P3E hook, not a P3C1 blocker, unless User decides it must be implemented before apply.

Reviewer workflow principle:

  • newest unreviewed comments first;
  • reviewed comments remain audit/history;
  • reviewer can mark seen/considered by function later;
  • do not require reprocessing old comments on every review.

R4 — PG First / Native / Driven

Prefer:

  • columns already present (created_at, author_ref, created_by, applied_at, stale_at);
  • SQL defaults (now());
  • indexes and ORDER BY for inbox views;
  • small receipt table later rather than extra complex functions;
  • session GUC for actor card rather than prompting AI to sign every comment manually.

Avoid:

  • overbuilding an external workflow engine;
  • hiding read/unread state inside comment body;
  • requiring Agents to remember process details;
  • adding many functions before a simple table/index/SQL pattern can solve the problem.

Required rev6 patch

Patch P3C1 prompt to add a short section before final approval:

§0.1 UX State Foundation Notes

It should state:

  1. P3C1 uses existing created_at defaults for timestamp trace. Comment and draft queries must sort newest-first where relevant.
  2. P3C1 functions currently accept explicit p_actor/p_author, but future revision should support session actor card via GUC. Do not ask Agents to manually sign text bodies.
  3. Read/unread review state is not implemented in P3C1. It is a required future design hook, likely via a small PG receipt table, not metadata hacks.
  4. P3C1 must not create extra schema/functions for receipts now. Record as P3C2/P3D design requirement.

Also add to report requirements:

  • confirm timestamp columns used: draft/comment created_at;
  • confirm comment candidate/order behavior newest-first;
  • record that auto-signature and read-receipt are deferred hooks, not ignored.

Do not rewrite SQL bodies unless needed.

Directive to Opus

Patch P3C1 prompt to rev6 with the UX State Foundation Notes above.

Path:

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

Do not dispatch after patch. Return for GPT/User final review.

Hard boundaries remain

  • No dispatch.
  • No table DDL.
  • No schema changes.
  • No trigger changes.
  • No gateway changes.
  • No IU/UV writes.
  • No vector mutation.
  • No cleanup.
  • No Pack 2C.

Summary

Rev5 is technically close. The new User requirements are architectural UX-state hooks: timestamp discipline, automatic signature, and read/unread review state. They do not require new runtime work in P3C1, but they must be explicitly captured before dispatch so the system keeps moving toward “no one needs to remember the process” without forcing a later redesign.

Back to Knowledge Hub knowledge/dev/laws/dieu44-trien-khai/reviews/gpt-review-23-p3c1-rev5-and-ux-state-directive-2026-05-07.md