KB-3D26

Copy/Paste Agent Prompt — P3D Pack 1 Phase 2 DDL rev3

4 min read Revision 1
copy-pasteagentp3dpack1phase2ddlrev3high-effort2026-05-11

Copy/Paste Agent Prompt — P3D Pack 1 Phase 2 DDL rev3

Date: 2026-05-11 Recommended effort: high Mode: Production DDL with strict preflight/rollback

Prompt

Execute the approved P3D Pack 1 Phase 2 DDL rev3.

Recommended effort: high.

Reason: this is production DDL on native IU tables. The change is intentionally small, but it must be executed with strict preflight, lock timeout, post-DDL verification, and rollback discipline.

Read first:

knowledge/dev/laws/dieu44-trien-khai/reviews/gpt-final-approval-p3d-pack1-phase2-ddl-prompt-rev3-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/design/p3d-pack1-design-addendum-post-inventory-2026-05-11.md
knowledge/dev/laws/dieu44-trien-khai/reports/p3d-pack1-readonly-inventory-report.md

Then execute exactly this approved prompt:

knowledge/dev/laws/dieu44-trien-khai/prompts/p3d-pack1-phase2-ddl-extend-implementation-prompt.md

Scope approved:

Add only these nullable/no-default columns.

public.information_unit:

doc_code TEXT NULL
section_type TEXT NULL
section_code TEXT NULL

public.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

Hard boundaries:

  • No data migration.
  • No TAC table modification.
  • No view creation.
  • No publication_member modification.
  • No vocab table rename or FK addition.
  • No Qdrant/vector mutation.
  • No Nuxt code.
  • No DOT-119 execution.
  • No Directus mutation/restart/schema-refresh.
  • No DEFAULT values on new columns.
  • No FK constraints on new columns.
  • No new indexes.
  • No new triggers.
  • No vector columns: do not add vector_sync_status, vector_synced_at, vector_chunk_count.
  • No updates to existing rows.
  • No direct data writes to information_unit / unit_version.

Required execution behavior:

  1. Run all preflight STOP gates from the rev3 prompt.
  2. If any STOP gate fails, do not execute DDL. Upload BLOCKED report.
  3. Run DDL only inside transaction with lock_timeout and statement_timeout.
  4. Add only the 10 approved nullable/no-default columns.
  5. Run all post-DDL verification checks.
  6. Verify row counts unchanged.
  7. Verify all new columns remain NULL on existing rows.
  8. Verify no defaults, no FK, no index, no trigger were added.
  9. Verify gateway remains enforced and gateway triggers enabled.
  10. Verify fn_iu_create_plan reachable.
  11. Roll back immediately if DDL or post-verification fails.

Expected report path:

knowledge/dev/laws/dieu44-trien-khai/reports/p3d-pack1-phase2-ddl-extend-implementation-report.md

Final response format:

pack1_phase2_status=PASS|FAIL|BLOCKED|ROLLED_BACK
report_path=knowledge/dev/laws/dieu44-trien-khai/reports/p3d-pack1-phase2-ddl-extend-implementation-report.md
columns_added=<list>
iu_cols_before=<n> iu_cols_after=<n>
uv_cols_before=<n> uv_cols_after=<n>
row_counts_unchanged=true|false
all_new_columns_null=true|false
no_defaults=true|false
no_fk_index_trigger=true|false
no_data_migration=true
no_tac_modification=true
rollback_performed=true|false

Return only the final response format plus critical blocker notes. Do not write a long essay.

Back to Knowledge Hub knowledge/dev/laws/dieu44-trien-khai/prompts/p3d-agent-copy-paste-pack1-phase2-ddl-rev3-2026-05-11.md