KB-3509

GPT Review — P3D Pack1 Phase5C1 rev3 Not Approved Final Hardening

4 min read Revision 1
gpt-reviewp3dpack1phase5c1rev3not-approvedfinal-hardeningadvisory-locktraceability2026-05-11

GPT Review — P3D Pack 1 Phase 5C1 rev3 Candidate Not Approved: Final Hardening

Date: 2026-05-11 Reviewer: GPT-5.5 Thinking / Incomex Hội đồng AI Reviewed:

  • knowledge/dev/laws/dieu44-trien-khai/prompts/p3d-pack1-phase5c1-species-mapping-qt001-backfill-prompt-DRAFT.md revision 9
  • knowledge/dev/laws/dieu44-trien-khai/reports/p3d-pack1-phase5c1-rev3-advisory-lock-log-patch-report.md

Verdict

5C1 rev3 is not approved for Agent dispatch yet.

Rev3 correctly adds advisory lock and mandatory execution log. However, before production write, four small hardening fixes are still required.

What is accepted

  1. Mandatory execution log is accepted.
  2. Advisory lock is accepted directionally.
  3. Rollback reference fallback is accepted.
  4. Report flags for lock/log are accepted.
  5. Species identity remains correct.
  6. Transaction model remains correct.

Remaining blockers

1. Traceability still says rev2

The prompt body title says rev3, but status line and KB metadata still say rev2 in places:

Status: rev2 DISPATCH CANDIDATE
metadata title/tags: rev2

This must be corrected to rev3/rev4 consistently so future search/review is not polluted.

2. Advisory lock can block indefinitely

Prompt uses:

SELECT pg_advisory_xact_lock(hashtext('p3d_pack1_phase5c1_information_unit_species_mapping_backfill'));

This can wait indefinitely if another session holds the lock. For Agent execution, prefer a non-blocking or bounded lock pattern.

Required patch:

Use one of:

SELECT pg_try_advisory_xact_lock(hashtext('p3d_pack1_phase5c1_information_unit_species_mapping_backfill')) AS lock_acquired;
-- ASSERT lock_acquired = true, else ROLLBACK + report LOCK_BUSY

or set an explicit lock timeout before calling the blocking lock and report timeout clearly.

GPT preference: pg_try_advisory_xact_lock.

3. G0-4 uses collection_registry fields without introspection

Prompt directly says:

G0-4 governance_role = 'observed' for target_collection in collection_registry

But this prompt does not introspect collection_registry columns or resolve the table key/governance field before using them. This is the same hardcode discipline issue.

Patch options:

  • add collection_registry to schema introspection/concept resolution; or
  • downgrade G0-4 to an informational check that must use prior probe-resolved fields; if unresolved, report UNKNOWN and do not block 5C1.

GPT preference: add minimal collection_registry introspection for:

collection_table_key
collection_governance_role

Then G0-4 can run safely.

4. Rollback reference typo

Error handling says:

After ROLLBACK: verify pre-state restored (§8.E)

But rollback verification is §8.C. Patch the reference.

Required next action

Patch prompt to rev4 final dispatch candidate. Do not execute.

Open:

P3D_PACK1_PHASE5C1_REV4_FINAL_HARDENING

Status

phase5c1_rev3_candidate=NOT_APPROVED_FOR_DISPATCH
reason=traceability_lock_timeout_collection_registry_introspection
species_identity_locked=true
agent_dispatch_allowed=false
seed_allowed=false
backfill_allowed=false
migration_allowed=false
next_action=OPUS_PATCH_5C1_PROMPT_TO_REV4_FINAL_HARDENING
Back to Knowledge Hub knowledge/dev/laws/dieu44-trien-khai/reviews/gpt-review-p3d-pack1-phase5c1-rev3-candidate-not-approved-final-hardening-2026-05-11.md