KB-33BD

Copy/Paste Agent Prompt — P3D Pack1 Phase5C1 Species Mapping Backfill rev5

4 min read Revision 1
copy-pasteagentp3dpack1phase5c1rev5speciesbackfillhigh-effort2026-05-11

Copy/Paste Agent Prompt — P3D Pack 1 Phase 5C1 Species Mapping + QT-001 Backfill rev5

Date: 2026-05-11 Recommended effort: high Mode: Production write pack, tightly scoped to Phase 5C1 only

Prompt

Run the approved P3D Pack 1 Phase 5C1 species/mapping + QT-001 backfill prompt rev5.

Recommended effort: high.

This is a production write pack, but scope is narrow and GPT-approved:

  1. create species information_unit_atom / SPE-IUA;
  2. create mapping information_unit → information_unit_atom;
  3. backfill current birth_registry rows for information_unit with NULL species;
  4. write report and rollback keys.

Read first:

knowledge/dev/laws/dieu44-trien-khai/reviews/gpt-final-review-p3d-pack1-phase5c1-rev5-approved-dispatch-2026-05-11.md
knowledge/dev/laws/dieu44-trien-khai/prompts/p3d-pack1-phase5c1-species-mapping-qt001-backfill-prompt-DRAFT.md
knowledge/dev/laws/dieu44-trien-khai/reports/p3d-pack1-phase5c1-rev5-missing-concepts-patch-report.md
knowledge/dev/laws/dieu44-trien-khai/reports/p3d-pack1-phase5c1a-species-schema-parent-probe-report.md

Then execute exactly:

knowledge/dev/laws/dieu44-trien-khai/prompts/p3d-pack1-phase5c1-species-mapping-qt001-backfill-prompt-DRAFT.md

Hard boundaries:

  • No TAC migration.
  • No DIEU-35 migration.
  • No IU/UV row creation.
  • No unit_version mapping.
  • No DDL.
  • No function/trigger patch.
  • No Directus/Nuxt/Qdrant changes.
  • No nested/secondary Agent dispatch.
  • No retry with modified SQL.
  • No improvisation after failed gate.
  • If a gate fails, ROLLBACK and report.

Critical required behavior:

  • Open VPS execution log before any DB action.
  • Use ON_ERROR_STOP=1 or equivalent.
  • Introspect schema before write.
  • Resolve all concepts before use.
  • Use one transaction for all writes.
  • Acquire non-blocking advisory lock via pg_try_advisory_xact_lock.
  • If lock busy, ROLLBACK and report BLOCKED_LOCK_BUSY.
  • Repeat collision/dedupe/target checks inside transaction.
  • Capture backfill target keys before UPDATE.
  • Insert species with GPT-locked values only.
  • Insert mapping with GPT-locked values only.
  • Backfill only captured birth IDs.
  • Verify management_mode=observed, not default governed.
  • Verify remaining NULL species for information_unit = 0.
  • Persist rollback keys to VPS log and KB report.

Expected report path:

knowledge/dev/laws/dieu44-trien-khai/reports/p3d-pack1-phase5c1-species-mapping-backfill-report.md

Final response format:

phase5c1_status=PASS|PARTIAL|ROLLED_BACK|BLOCKED|BLOCKED_LOCK_BUSY
report_path=knowledge/dev/laws/dieu44-trien-khai/reports/p3d-pack1-phase5c1-species-mapping-backfill-report.md
transaction_outcome=COMMITTED|ROLLED_BACK|NOT_STARTED
schema_introspection=PASS|FAIL
concept_resolution=PASS|FAIL
fill_policy_validation=PASS|FAIL
advisory_lock_acquired=true|false
execution_log_path=<path>
rollback_reference_available=both|kb|vps_log|none
species_created=true|false
mapping_seeded=true|false
backfill_executed=true|false
precommit_target_count=<N>
backfill_affected_count=<N>
remaining_null_species=<N>
management_mode_verified=observed|governed_TRAP|NOT_CHECKED
no_iu_uv_rows_created=true
no_tac_rows_modified=true
failed_gate_id=<gate id|none>
phase5c2_unblocked=true|false
next_recommended_action=<short>

Return only the final response format plus critical blocker notes. Do not write a long essay.

Back to Knowledge Hub knowledge/dev/laws/dieu44-trien-khai/prompts/p3d-agent-copy-paste-pack1-phase5c1-species-mapping-backfill-rev5-2026-05-11.md