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
- Use one SQL session/transaction for:
- gates;
- delta computation;
- dry-run preview;
- insert;
- verification;
- commit or rollback.
- Do not create temp tables in one psql invocation and use them in another.
- Convert STOP gates into executable checks, not prose.
- Require exact compatible
dot_configschema:key,value,description,updated_atexist;- no unsupported schema adaptation language.
- Require unique/primary key support for
dot_config.key; STOP otherwise. - Use
ON CONFLICT (key) DO NOTHINGonly after unique key gate passes. - Use
INSERT ... RETURNING keyinto an inserted-keys temp table inside the same transaction. - Verify
fn_iu_create_plan(p_unit_kind:='law_unit')no longer returnsunresolved_vocabbefore COMMIT. - If verification fails, rollback before COMMIT.
- Species section remains SELECT-only and clearly separate.
- 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.
5. Recommended implementation structure inside prompt
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:
- DRAFT v5 prompt path.
- Patch report path.
- Top 7 fixes from v4.
- Which parts are executable candidate vs read-only candidate vs document-only.
- 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