KB-58A7

GPT Review — B3-F1c-b Function-Only Execution Prompt — APPROVED with Patches — 2026-05-13

4 min read Revision 1
p3dbirth-systemb3f1c-bexecution-promptgpt-reviewapproved2026-05-13

GPT Review — B3-F1c-b Function-Only Execution Prompt — APPROVED with Patches — 2026-05-13

Scope reviewed

Reviewed Opus draft prompt:

  • knowledge/dev/laws/dieu44-trien-khai/prompts/p3d-birth-system-b3f1c-b-full-scan-function-execution-prompt-DRAFT.md

Reviewed against approved function artifact/review:

  • knowledge/dev/laws/dieu44-trien-khai/reviews/gpt-review-b3f1c-function-revision-approved-2026-05-13.md
  • knowledge/dev/laws/dieu44-trien-khai/artifacts/p3d-birth-system-b3f1c-full-scan-function.sql.md
  • knowledge/dev/laws/dieu44-trien-khai/artifacts/p3d-birth-system-b3f1c-full-scan-rollback.sql.md

Verdict

Status: APPROVED_FOR_AGENT_B3F1C_B_FUNCTION_ONLY_EXECUTION_WITH_GPT_PATCHES

Agent may execute B3-F1c-b using prompt revision 5 or latest.

Opus draft accepted

The draft correctly keeps scope narrow:

  • install only public.fn_birth_onboarding_full_scan();
  • no scheduler binding;
  • no Directus Flow / Operation;
  • no Nuxt endpoint;
  • no DML smoke test;
  • no system_issues / system_health_checks writes by prompt;
  • no hard gate;
  • preflight dependency checks are defense-in-depth.

GPT patches applied

Patch 1 — advisory lock no numeric magic

Changed:

SELECT pg_try_advisory_xact_lock(3100001) AS lock_acquired;

to:

SELECT pg_try_advisory_xact_lock(hashtext('p3d_birth_b3f1c_b_full_scan_function_execution')) AS lock_acquired;

This avoids a magic-number advisory-lock hardcode.

Patch 2 — guarded policy JSON preflight

Replaced raw ::jsonb preflight SELECT with a guarded DO block. Malformed JSON now fails dependency_check clearly before execution rather than creating an uncontrolled install attempt.

Patch 3 — remove git commit

Removed git add -A, git commit, and git push from the prompt. B3-F1c-b is PG DDL execution plus KB report only. Repository commits require separate instruction.

Patch 4 — final fields adjusted

Replaced commit_hash=<hash> with:

git_commit_performed=false

No-hardcode assessment

Approved because:

  • the function artifact reads sibling scope from dot_config;
  • execution prompt does not embed a sibling collection list;
  • advisory lock is named via hashtext, not numeric magic;
  • public is a reviewed deployment target, not hidden schema guessing;
  • no scheduler cadence is embedded;
  • no unreviewed SQL is allowed.

Still forbidden

  • No Directus Flow creation.
  • No Directus Operation creation.
  • No Nuxt endpoint creation.
  • No scheduler binding.
  • No cadence config.
  • No CREATE EXTENSION.
  • No COMMENT ON.
  • No CREATE OR REPLACE.
  • No DML smoke test / function invocation.
  • No system_issues/system_health_checks writes by prompt.
  • No hard gate.
  • No Phase 5C2.
  • No UI cutover.
  • No git commit.

Required Agent report

Agent must write:

  • knowledge/dev/laws/dieu44-trien-khai/reports/p3d-birth-system-b3f1c-b-full-scan-function-execution-report.md

Governance status

b3f1c_b_execution_prompt_review_status=APPROVED_FOR_AGENT_EXECUTION_WITH_GPT_PATCHES
b3f1c_b_function_execution_allowed=true
b3f1c_scheduler_binding_allowed=false
b3f_complete_allowed=false
phase5c2_migration_allowed=false
next_recommended_action=AGENT_EXECUTE_B3F1C_B_FUNCTION_ONLY_WITH_REV5_OR_LATEST
Back to Knowledge Hub knowledge/dev/laws/dieu44-trien-khai/reviews/gpt-review-b3f1c-b-function-execution-prompt-approved-2026-05-13.md