KB-226E rev 2

Agent Prompt — READ-ONLY Investigation: IU/Text-as-Code Current Position Before Next Design — 2026-05-14

11 min read Revision 2
agentreadonlyinvestigationinformation-unittext-as-codephase5c2pack2bbirth-completevector-alert2026-05-14

Agent Prompt — READ-ONLY Investigation: IU/Text-as-Code Current Position Before Next Design — 2026-05-14

Mission

Investigate and confirm the exact current position of the Information Unit / “miếng thông tin” / Text-as-Code workstream before GPT authorizes any next design or execution.

This is a READ-ONLY investigation only. The goal is to verify facts from live PG/live code/KB, reconcile Opus and GPT assessments, and identify the next correct design task.

Context

Opus cross-check concluded:

birth_system_complete=true
phase5c2_resume_allowed=true
phase5c2_execution_allowed=false
bulk_migration_allowed=false
ui_cutover_allowed=false
vector_efficiency_alert=NONE
current_position=Birth System COMPLETE, Phase 5C2 resume AUTHORIZED by GPT, execution still gated pending resume plan review; Pack 2B design exists but not executed; F6/DOT-119/description-policy all done.
recommended_next_action=Draft Phase 5C2 Resume Plan from live PG evidence, read-only/design-only.

GPT accepts Opus directionally, but requires Agent live-evidence verification before designing.

Hard boundaries

Absolutely forbidden:

  • No DB writes.
  • No DDL.
  • No DML: no INSERT/UPDATE/DELETE/TRUNCATE/MERGE.
  • No function/trigger patch.
  • No function execution that mutates data.
  • No migration.
  • No TAC→IU migration.
  • No bulk migration.
  • No UI cutover.
  • No Nuxt/Directus/code changes.
  • No vector/Qdrant mutation.
  • No outbox worker or event emission creation.
  • No Claude sub-dispatch.
  • No old prompt execution.

Allowed:

  • Read KB documents.
  • Read live PG catalogs/tables via SELECT only.
  • Read live code files and git status/read-only logs.
  • Produce one KB report.

If any required check would need mutation, report BLOCKED_BY_MUTATION_BOUNDARY and stop that subcheck.

Read first — KB evidence

Birth completion / Phase 5C2 resume

  1. knowledge/dev/laws/dieu44-trien-khai/handoffs/handoff-p3d-pack1-return-to-phase5c2-after-birth-complete-2026-05-14.md
  2. knowledge/dev/laws/dieu44-trien-khai/reviews/gpt-final-review-birth-system-complete-authorize-phase5c2-resume-2026-05-14.md
  3. knowledge/dev/laws/dieu44-trien-khai/reviews/opus-final-review-birth-complete-5c2-readiness-2026-05-14.md
  4. knowledge/dev/laws/dieu44-trien-khai/design/p3d-birth-system-b2-contract-design-rev3.md
  5. knowledge/dev/laws/dieu44-trien-khai/reports/p3d-birth-post-eld-b3f-delta-verification-report.md

IU/Text-as-Code status

  1. knowledge/dev/laws/dieu44-trien-khai/ssot/p3d-iu-text-as-code-completed-state-and-remaining-work-2026-05-10.md
  2. knowledge/dev/laws/dieu44-trien-khai/handoffs/handoff-p3d-information-unit-text-as-code-resume-after-nuxt-notification-2026-05-10.md
  3. knowledge/dev/laws/dieu44-trien-khai/requirements/p3d-information-unit-text-as-code-requirements-spec.md
  4. knowledge/dev/laws/dieu44-trien-khai/reports/22-pack-closure-iu-native-create-and-gateway.md
  5. knowledge/dev/laws/dieu44-trien-khai/readme/iu-create-gateway-readme.md
  6. knowledge/dev/laws/dieu44-trien-khai/reports/23-p3b-iu-edit-draft-schema-report.md
  7. knowledge/dev/laws/dieu44-trien-khai/reports/23-p3c1-iu-edit-draft-safe-functions-report.md
  8. knowledge/dev/laws/dieu44-trien-khai/reports/23-p3c2-iu-apply-edit-functions-report.md
  9. knowledge/dev/laws/dieu44-trien-khai/reports/23-p3c3-iu-natural-save-router-report.md
  10. knowledge/dev/laws/dieu44-trien-khai/reports/23-p3c4-iu-policy-and-agent-context-report.md

F6 / DOT-119 / IU birth trigger / Pack 2B

  1. knowledge/dev/laws/dieu44-trien-khai/reports/iu-birth-trigger-install-18c-report.md
  2. knowledge/dev/laws/dieu44-trien-khai/design/19-iu0-pack2b-pilot-crud-and-birth-fire-execution-pack.md
  3. Search KB for newer docs containing: F6, DOT-119, Pack 2B, birth path, trg_birth_information_unit, description_policy, QT-003R.

TAC→IU / Phase 5C2 references

  1. knowledge/dev/laws/dieu44-trien-khai/prompts/p3d-pack1-phase5c2-dieu35-hybrid-pilot-migration-prompt-DRAFT.md
  2. knowledge/dev/laws/dieu44-trien-khai/reports/p3d-pack1-phase5c2-rev4-self-contained-operational-prompt-patch-report.md
  3. knowledge/dev/laws/dieu44-trien-khai/design/p3d-phase5c2-impact-addendum-after-multidimensional-design.md
  4. knowledge/dev/laws/dieu44-trien-khai/design/p3d-pack1-phase5-tac-to-iu-migration-design.md
  5. knowledge/dev/laws/dieu44-trien-khai/reviews/opus-review-tac-ui-baseline-pass-5c2-prerequisite-satisfied-2026-05-12.md

Vector/search safety

  1. knowledge/dev/laws/dieu44-trien-khai/design/p3d-vector-search-unified-contract-ssot.md
  2. knowledge/dev/laws/dieu44-trien-khai/reports/p3d-vector-search-reliability-hardening-implementation-report.md
  3. knowledge/dev/laws/dieu44-trien-khai/reports/20a-20b-p0-search-vector-hygiene-inspection-report.md
  4. knowledge/current-state/reports/qdrant-full-audit

Live PG / code verification requirements

Use read-only SELECT/catalog queries only.

A. Birth completion live spot-check

Verify current presence/shape of:

  • birth_registry columns: canonical_address, owner, jsonb_profile; confirm jsonb_profile NOT NULL invariant by count.
  • fn_birth_onboarding_full_scan_hc(jsonb) exists and returns boolean; do not execute it.
  • system_health_checks row DOT-BIRTH-ONBOARD-FULLSCAN-HC exists and active.
  • Birth triggers on birth_registry remain as expected.

B. IU core live spot-check

Verify current presence/shape of:

  • information_unit table.
  • unit_version table.
  • current row counts for both.
  • fn_iu_create, fn_iu_create_plan, fn_iu_verify_invariants existence/signature; do not execute mutating functions.
  • Gateway guard triggers/functions blocking direct writes.
  • Pack 23 functions: fn_iu_apply_edit_draft, fn_iu_edit, fn_iu_save existence/signature; do not execute mutating functions.
  • unit_edit_draft, unit_edit_comment tables if present.

C. IU birth trigger / F6 / Pack 2B precondition spot-check

Verify:

  • Trigger trg_birth_information_unit exists on information_unit.
  • birth_registry count where collection_name='information_unit'.
  • Whether unit_version has any independent birth trigger; expected historically: no independent birth for subordinate unit_version unless newer design changed it.
  • Whether Pack 2B has already executed by checking for pilot canonical addresses / pilot IU rows referenced in Pack 2B reports. Do not create or delete rows.
  • collection_registry.description_policy exists and has 0 NULL values, or report exact NULL count and blockers. Pattern only:
    SELECT count(*) FROM collection_registry WHERE description_policy IS NULL;
    
  • DOT-119 / birth-trigger setup script version on disk is the expected safe v2 line, and cannot overwrite fn_birth_registry_auto v2. Read-only file check only. Historical expected md5 from 18c: 5883bce405b86ab436e885cf16fd22de; if path differs, discover/report. Suggested checks:
    md5sum /opt/incomex/dot/scripts/dot-birth-trigger-setup.sh 2>/dev/null || truemd5sum /opt/incomex/dot/bin/dot-birth-trigger-setup 2>/dev/null || truegrep -R "CREATE OR REPLACE FUNCTION fn_birth_registry_auto" /opt/incomex/dot -n 2>/dev/null | head -20 || true
    
  • identity_profile placement: confirm birth_registry does NOT have identity_profile, while information_unit has identity_profile JSONB or report if current schema differs.

D. TAC→IU / Phase 5C2 live spot-check

Verify live state, read-only:

  • TAC source tables exist: tac_publication, tac_logical_unit, tac_unit_version, tac_publication_member.
  • DIEU-35 exists and current live member count/order can be read.
  • information_unit / unit_version current rows and whether prior TAC migration rows exist.
  • fn_iu_create is the canonical writer path and whether Phase 5C2 rev4 assumptions still match current live schema at a high level.
  • TAC→UI source preservation: do not inspect UI code unless needed; KB evidence may be sufficient. If inspecting code, read-only only.

E. Vector/search safety spot-check

Do not mutate Qdrant. Do not reindex.

Classify whether there is any current evidence of vector inefficiency or unreliability requiring immediate user notification.

Use KB evidence and, only if safe/read-only, inspect code/config for:

  • whether IU vector collection exists yet;
  • whether legacy vector remains separate;
  • whether hardening/path-title boost exists;
  • whether there are current ALERT-level reports after hardening.

Required analysis

Answer these questions:

  1. Is Opus correct that the old handoff is stale and Birth System is complete?
  2. Is Opus correct that F6/DOT-119/IU birth trigger work is already done?
  3. Is Opus correct that Pack 2B design exists but execution has not run?
  4. Is Opus correct that the next recommended work should be Phase 5C2 resume plan from live PG evidence?
  5. Should Pack 2B revalidation run in parallel as design-only, or wait until Phase 5C2 resume plan is reviewed?
  6. What is the safest one next design task after this investigation?
  7. Is there any vector/search ALERT that requires immediate user notification?

Report output path

Create exactly one report:

knowledge/dev/laws/dieu44-trien-khai/reports/agent-readonly-investigation-iu-current-position-before-next-design-2026-05-14.md

Required final response fields

readonly_investigation_status=PASS|PARTIAL|BLOCKED
no_mutation_performed=true|false
birth_system_complete_live_confirmed=true|false|unknown
phase5c2_resume_allowed_confirmed=true|false|unknown
phase5c2_execution_allowed=false
bulk_migration_allowed=false
ui_cutover_allowed=false
f6_dot119_iu_birth_trigger_done_confirmed=true|false|unknown
pack2b_design_exists=true|false|unknown
pack2b_execution_done=true|false|unknown
iu_core_tables_live=true|false|unknown
iu_core_functions_live=true|false|unknown
iu_gateway_enforced=true|false|unknown
pack23_edit_save_functions_live=true|false|unknown
tac_dieu35_live_verified=true|false|unknown
rev4_revalidation_required=true
vector_efficiency_alert=NONE|WATCH|ALERT
must_notify_user_now=true|false
recommended_next_design_task=<one clear task>
parallel_design_tracks_allowed=yes|no|unknown
conflicts_or_stale_assumptions=<list>
report_path=knowledge/dev/laws/dieu44-trien-khai/reports/agent-readonly-investigation-iu-current-position-before-next-design-2026-05-14.md
next_recommended_action=GPT_REVIEW_READONLY_INVESTIGATION_THEN_DISPATCH_DESIGN

Notes

Be strict. If evidence conflicts, mark PARTIAL and list the conflict. Historical counts are not gates unless live-verified. If a function may mutate, do not execute it. If not certainly right, report UNKNOWN and recommend a safe read-only verification path.

Back to Knowledge Hub knowledge/dev/laws/dieu44-trien-khai/prompts/agent-readonly-investigation-iu-current-position-before-next-design-2026-05-14.md