Agent Prompt — READ-ONLY Investigation: IU/Text-as-Code Current Position Before Next Design — 2026-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
knowledge/dev/laws/dieu44-trien-khai/handoffs/handoff-p3d-pack1-return-to-phase5c2-after-birth-complete-2026-05-14.mdknowledge/dev/laws/dieu44-trien-khai/reviews/gpt-final-review-birth-system-complete-authorize-phase5c2-resume-2026-05-14.mdknowledge/dev/laws/dieu44-trien-khai/reviews/opus-final-review-birth-complete-5c2-readiness-2026-05-14.mdknowledge/dev/laws/dieu44-trien-khai/design/p3d-birth-system-b2-contract-design-rev3.mdknowledge/dev/laws/dieu44-trien-khai/reports/p3d-birth-post-eld-b3f-delta-verification-report.md
IU/Text-as-Code status
knowledge/dev/laws/dieu44-trien-khai/ssot/p3d-iu-text-as-code-completed-state-and-remaining-work-2026-05-10.mdknowledge/dev/laws/dieu44-trien-khai/handoffs/handoff-p3d-information-unit-text-as-code-resume-after-nuxt-notification-2026-05-10.mdknowledge/dev/laws/dieu44-trien-khai/requirements/p3d-information-unit-text-as-code-requirements-spec.mdknowledge/dev/laws/dieu44-trien-khai/reports/22-pack-closure-iu-native-create-and-gateway.mdknowledge/dev/laws/dieu44-trien-khai/readme/iu-create-gateway-readme.mdknowledge/dev/laws/dieu44-trien-khai/reports/23-p3b-iu-edit-draft-schema-report.mdknowledge/dev/laws/dieu44-trien-khai/reports/23-p3c1-iu-edit-draft-safe-functions-report.mdknowledge/dev/laws/dieu44-trien-khai/reports/23-p3c2-iu-apply-edit-functions-report.mdknowledge/dev/laws/dieu44-trien-khai/reports/23-p3c3-iu-natural-save-router-report.mdknowledge/dev/laws/dieu44-trien-khai/reports/23-p3c4-iu-policy-and-agent-context-report.md
F6 / DOT-119 / IU birth trigger / Pack 2B
knowledge/dev/laws/dieu44-trien-khai/reports/iu-birth-trigger-install-18c-report.mdknowledge/dev/laws/dieu44-trien-khai/design/19-iu0-pack2b-pilot-crud-and-birth-fire-execution-pack.md- 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
knowledge/dev/laws/dieu44-trien-khai/prompts/p3d-pack1-phase5c2-dieu35-hybrid-pilot-migration-prompt-DRAFT.mdknowledge/dev/laws/dieu44-trien-khai/reports/p3d-pack1-phase5c2-rev4-self-contained-operational-prompt-patch-report.mdknowledge/dev/laws/dieu44-trien-khai/design/p3d-phase5c2-impact-addendum-after-multidimensional-design.mdknowledge/dev/laws/dieu44-trien-khai/design/p3d-pack1-phase5-tac-to-iu-migration-design.mdknowledge/dev/laws/dieu44-trien-khai/reviews/opus-review-tac-ui-baseline-pass-5c2-prerequisite-satisfied-2026-05-12.md
Vector/search safety
knowledge/dev/laws/dieu44-trien-khai/design/p3d-vector-search-unified-contract-ssot.mdknowledge/dev/laws/dieu44-trien-khai/reports/p3d-vector-search-reliability-hardening-implementation-report.mdknowledge/dev/laws/dieu44-trien-khai/reports/20a-20b-p0-search-vector-hygiene-inspection-report.mdknowledge/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_registrycolumns:canonical_address,owner,jsonb_profile; confirmjsonb_profileNOT NULL invariant by count.fn_birth_onboarding_full_scan_hc(jsonb)exists and returns boolean; do not execute it.system_health_checksrowDOT-BIRTH-ONBOARD-FULLSCAN-HCexists and active.- Birth triggers on
birth_registryremain as expected.
B. IU core live spot-check
Verify current presence/shape of:
information_unittable.unit_versiontable.- current row counts for both.
fn_iu_create,fn_iu_create_plan,fn_iu_verify_invariantsexistence/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_saveexistence/signature; do not execute mutating functions. unit_edit_draft,unit_edit_commenttables if present.
C. IU birth trigger / F6 / Pack 2B precondition spot-check
Verify:
- Trigger
trg_birth_information_unitexists oninformation_unit. birth_registrycount wherecollection_name='information_unit'.- Whether
unit_versionhas 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_policyexists 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_autov2. 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_profileplacement: confirmbirth_registrydoes NOT haveidentity_profile, whileinformation_unithasidentity_profileJSONB 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-35exists and current live member count/order can be read.information_unit/unit_versioncurrent rows and whether prior TAC migration rows exist.fn_iu_createis 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:
- Is Opus correct that the old handoff is stale and Birth System is complete?
- Is Opus correct that F6/DOT-119/IU birth trigger work is already done?
- Is Opus correct that Pack 2B design exists but execution has not run?
- Is Opus correct that the next recommended work should be Phase 5C2 resume plan from live PG evidence?
- Should Pack 2B revalidation run in parallel as design-only, or wait until Phase 5C2 resume plan is reviewed?
- What is the safest one next design task after this investigation?
- 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.