KB-5757

GPT Review — P10B-1C D32 Execute + Render Prompt v0.1

4 min read Revision 1
s188p10bp10b-1cd32execute-renderneeds-patchproduction-mutation

GPT Review — P10B-1C D32 Execute + Render Prompt v0.1

Date: 2026-04-29

Verdict

Approve with small patches. Do not dispatch v0.1 as-is.

The prompt is well structured and follows the package → execute pattern used in P10A. Because this is a production mutation, the execution prompt needs a few precision patches before dispatch.

Law / constitutional check

No conceptual conflict after the patches below.

  • Zero Trust: patch required for exact file SHAs, run-file transformation, and render parameter handling.
  • No broad migration: scope is one document only.
  • No lifecycle promotion: proposed/draft only.
  • No hardcode concern in this prompt if package SHAs are verified and run-file is derived mechanically.

Required patches

P1 — Verify SHA for all package files, not only insert SQL

T1 currently verifies candidate JSON and insert-candidate SQL only. Add SHA checks for:

  • candidate-units.json
  • insert-candidate.sql
  • render.sql
  • rollback.sql
  • verify-counts.sql

All values must match P10B-1B report before execution. If any mismatch, STOP.

P2 — Replace only the final transaction terminator

Current sed -i 's/ROLLBACK;/COMMIT;/' can replace unintended occurrences if comments/body contain ROLLBACK;.

Patch:

  • confirm original package contains exactly one transaction terminator at EOF;
  • copy original to run-file;
  • replace only the final non-comment ROLLBACK; with COMMIT; using a small script or strict tail check;
  • confirm original SHA unchanged;
  • confirm run-file ends with exactly one COMMIT; and no final ROLLBACK;.

P3 — Create run directory first and log run-file SHA

Add:

mkdir -p /tmp/p10b-1c

After creating run-file, compute SHA256 and log it. This becomes execution evidence.

P4 — Render and verify-counts may require pub_id parameter

P10A package used parameterized SQL. The prompt should inspect/render accordingly:

  • If render.sql or verify-counts.sql contains :pub_id, call psql with -v pub_id="'<PUB_ID>'".
  • If SQL is scoped by doc_code/version internally, no parameter required.
  • Do not assume.

P5 — wdiff may not be installed

wdiff is optional. If unavailable, use diff -u plus a small Python normalized-text comparison.

Add PASS definition:

  • content drift = non-whitespace textual differences after normalizing blank lines and trailing spaces;
  • if content drift exists, report exact hunks.

P6 — rollback instructions should be concrete but not executed

Deliverable should include actual pub_id, doc_code/version, and exact rollback file SHA. It must state: do not execute rollback unless separately authorized.

P7 — Upload paths should be fixed

Use a dedicated folder:

knowledge/dev/laws/dieu38-trien-khai/reports/p10b-1c-d32-execute/

Main report:

knowledge/dev/laws/dieu38-trien-khai/reports/p10b-1c-d32-execute-report-2026-04-29.md

Directive to Opus 4.6

Patch P10B-1C v0.1 → v0.2 with P1–P7.

If patched cleanly and no new scope is added:

  • mark GPT AUTHORIZED — execute immediately;
  • dispatch Agent;
  • Agent executes once, renders, uploads deliverables, and STOPs.

Status

  • P10B-1B package: PASS.
  • P10B-1C v0.1: needs small patch before dispatch.
  • Execute authorization: after v0.2 patch only.