KB-3261

GPT Review — P3D Pack 1 Design Addendum + Phase 2 DDL Prompt rev1

6 min read Revision 1
gpt-reviewp3dpack1phase2ddlprompt-review2026-05-11

GPT Review — P3D Pack 1 Design Addendum + Phase 2 DDL Prompt rev1

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

  • knowledge/dev/laws/dieu44-trien-khai/design/p3d-pack1-design-addendum-post-inventory-2026-05-11.md
  • knowledge/dev/laws/dieu44-trien-khai/prompts/p3d-pack1-phase2-ddl-extend-implementation-prompt.md
  • knowledge/dev/laws/dieu44-trien-khai/reports/p3d-pack1-design-addendum-and-phase2-prompt-report.md
  • knowledge/dev/laws/dieu44-trien-khai/reports/p3d-pack1-readonly-inventory-report.md

Verdict

Design addendum: ACCEPTED AS DIRECTIONALLY CORRECT.

Phase 2 DDL prompt rev1: NOT APPROVED FOR DISPATCH.

Reason: this is the first DDL step on native IU schema. Under the rule “if not certainly right, it is wrong”, the prompt must be hardened before any execution.

Accepted

  1. EVOLVE remains the correct working hypothesis.
  2. Inventory-based mapping is useful and substantially correct.
  3. Phase 2 should not migrate data yet.
  4. TAC-rich fields must not be silently dropped.
  5. Hash semantics must be investigated before any migration.
  6. Publication membership must remain a separate association family.
  7. Vocab reconciliation is real and must be handled deliberately.

Blocking issues in Phase 2 prompt rev1

1. DDL is too early without a stricter read-only preflight

The prompt includes a preflight, but it is not enough for DDL approval. It must first verify:

  • current columns and types for all proposed new columns;
  • existing triggers affected by ALTER TABLE;
  • defaults/backfill behavior;
  • function bodies/signatures that may assume current column lists;
  • Directus/schema-cache implications;
  • whether any birth/gateway guards are table-column sensitive;
  • exact current table sizes and lock risk.

2. updated_at TIMESTAMPTZ DEFAULT now() may mutate existing rows / rewrite behavior

Adding a volatile/default timestamp column can backfill or alter existing-row semantics. The prompt says “existing data unaffected”, but this is not certainly true. If updated_at is added, it should be nullable first, then handled by a later trigger/backfill design if needed.

3. Vector columns on unit_version need stricter justification

The system principle is that vector is projection, not source of truth. Sync metadata may be acceptable, but vector_sync_status, vector_synced_at, vector_chunk_count should not be added blindly to native unit_version until the IU vector contract decides whether sync state belongs on UV, a separate vector table, or both.

4. Vocab/FK reconciliation is deferred but DDL adds text columns with defaults

Adding review_state TEXT DEFAULT 'unreviewed' and provenance TEXT DEFAULT 'PROV-AI' before vocab decision may be acceptable as nullable text, but defaults on existing rows are not essential and can create misleading data for pilot rows. Prefer nullable/no-default in Phase 2, with migration/backfill later.

5. Hash investigation is included but not actionable enough

The prompt checks md5 and perhaps mentions SHA-256 in design, but the implementation prompt itself does not require a conclusive hash rule finding or source-code/trigger inspection. Since both TAC and IU mismatch md5 100%, this must become a dedicated read-only preflight finding before any data migration, and Phase 2 report must record it clearly.

6. Directus refresh wording is unsafe/ambiguous

“Trigger Directus schema refresh” is not defined and could become mutation/restart behavior. Phase 2 should only verify whether Directus sees columns if there is a safe known mechanism, otherwise record directus_refresh=deferred.

7. Rollback DROP COLUMN is not always harmless

Rollback is simple only if no data has been written to new columns and no dependencies created. Prompt must verify no dependencies and avoid adding FK/index/trigger/default constraints in Phase 2.

Required correction

Create Phase 2 prompt rev2 with a stricter structure:

  1. Read-only preflight section with STOP gates.
  2. DDL section only after gates pass.
  3. DDL limited to nullable/no-default, non-constrained columns that are clearly needed.
  4. No vector columns unless justified by an explicit UV sync-metadata decision; otherwise defer vector_* to IU vector contract pack.
  5. No Directus refresh mutation.
  6. No default values except where proven safe and necessary.
  7. No FK/index/trigger creation in Phase 2.
  8. Full post-DDL checks and rollback.

Likely safe after preflight:

information_unit:

  • doc_code TEXT NULL
  • section_type TEXT NULL
  • section_code TEXT NULL

unit_version:

  • title TEXT NULL
  • description TEXT NULL
  • review_state TEXT NULL
  • provenance TEXT NULL
  • editor TEXT NULL
  • enacted_at TIMESTAMPTZ NULL
  • updated_at TIMESTAMPTZ NULL

Potentially defer:

  • vector_sync_status
  • vector_synced_at
  • vector_chunk_count

Reason: vector sync should be settled in IU vector contract / vector projection design, not silently embedded now.

Next action for Opus

Opus should not do more broad design. Instead, revise the Phase 2 prompt to rev2 with production safety gates and either:

  • a conservative DDL-only safe set; or
  • an explicit STOP requiring agent read-only preflight if any proposed column remains uncertain.

Status

pack1_design_addendum=ACCEPTED_DIRECTIONALLY
phase2_prompt_rev1=NOT_APPROVED_FOR_DISPATCH
implementation_allowed=false
next_action=OPUS_PATCH_PHASE2_PROMPT_REV2_WITH_STRICT_PREFLIGHT_AND_SAFE_DDL
Back to Knowledge Hub knowledge/dev/laws/dieu44-trien-khai/reviews/gpt-review-p3d-pack1-design-addendum-and-phase2-ddl-prompt-rev1-2026-05-11.md