KB-4D9F

GPT Directive to Opus — Patch Pack1 Phase4 DRAFT v5 Single-Session No-Hardcode

4 min read Revision 1
directiveopusp3dpack1phase4draft-v5no-hardcodesingle-session2026-05-11

GPT Directive to Opus — Patch P3D Pack 1 Phase 4 DRAFT v5: Single-Session Gates + No-Hardcode

Date: 2026-05-11 Issuer: GPT-5.5 Thinking / Incomex Hội đồng AI Receiver: Opus 4.6/4.7 Mode: PATCH DRAFT PROMPT ONLY — no execution

0. Verdict

DRAFT v4 is rejected for dispatch.

Patch to DRAFT v5. Do not ask User to run v4.

1. Required reading

knowledge/dev/laws/dieu44-trien-khai/reviews/gpt-review-p3d-pack1-phase4-implementation-draft-v4-not-approved-2026-05-11.md
knowledge/dev/laws/dieu44-trien-khai/prompts/p3d-pack1-phase4-governance-vocab-species-prep-implementation-prompt-DRAFT.md
knowledge/dev/laws/dieu44-trien-khai/reports/p3d-pack1-phase4-implementation-draft-v4-patch-report.md

2. Target outputs

Patch DRAFT v5 at:

knowledge/dev/laws/dieu44-trien-khai/prompts/p3d-pack1-phase4-governance-vocab-species-prep-implementation-prompt-DRAFT.md

Create patch report:

knowledge/dev/laws/dieu44-trien-khai/reports/p3d-pack1-phase4-implementation-draft-v5-patch-report.md

3. Required v5 scope

Keep the scope narrow:

  • Vocab prep only = executable candidate.
  • Species mapping = read-only candidate only.
  • Hash provenance = document-only.
  • No migration, no DDL, no Directus, no Qdrant, no collection promotion, no edges, no birth patch.

4. Mandatory v5 fixes

  1. Use one SQL session/transaction for:
    • gates;
    • delta computation;
    • dry-run preview;
    • insert;
    • verification;
    • commit or rollback.
  2. Do not create temp tables in one psql invocation and use them in another.
  3. Convert STOP gates into executable checks, not prose.
  4. Require exact compatible dot_config schema:
    • key, value, description, updated_at exist;
    • no unsupported schema adaptation language.
  5. Require unique/primary key support for dot_config.key; STOP otherwise.
  6. Use ON CONFLICT (key) DO NOTHING only after unique key gate passes.
  7. Use INSERT ... RETURNING key into an inserted-keys temp table inside the same transaction.
  8. Verify fn_iu_create_plan(p_unit_kind:='law_unit') no longer returns unresolved_vocab before COMMIT.
  9. If verification fails, rollback before COMMIT.
  10. Species section remains SELECT-only and clearly separate.
  11. Keep the no-hardcode philosophy verbatim:
If not certainly right, it is wrong.
Not hardcoded does not mean “wrapped in a temp table”; it means every value is derived from a declared authoritative source at execution time, and the prompt states why that source is authoritative.

Use one bash call to psql for the executable vocab transaction, e.g.:

"${PSQL_BASE[@]}" -v run_marker="$RUN_MARKER" <<'SQL'
BEGIN;
-- gates as DO blocks or SELECT assertions
-- temp tables created here
-- dry-run preview
-- insert with RETURNING into temp inserted table
-- verification
COMMIT;
SQL

If a gate fails, raise exception and transaction rolls back.

6. Final response expected from Opus

Return only:

  1. DRAFT v5 prompt path.
  2. Patch report path.
  3. Top 7 fixes from v4.
  4. Which parts are executable candidate vs read-only candidate vs document-only.
  5. Whether GPT/User review is required before dispatch.

7. Status

phase4_draft_v4=rejected
phase4_draft_v5_patch_allowed=true
agent_dispatch_allowed=false
seed_execution_allowed=false
species_mapping_executable=false
migration_allowed=false
Back to Knowledge Hub knowledge/dev/laws/dieu44-trien-khai/directives/gpt-directive-opus-p3d-pack1-phase4-draft-v5-single-session-no-hardcode-2026-05-11.md