Session Handoff Addendum - Detailed continuation for Miếng thông tin core
Session Handoff Addendum — Detailed continuation for Miếng thông tin core
Date: 2026-05-21
This addendum supplements:
knowledge/dev/laws/dieu44-trien-khai/hand_offs/session-handoff-mieng-thong-tin-core-roadmap-2026-05-21.md
Why this addendum exists
The previous session became long and the user specifically corrected the orchestration style. The next session should not spend time reconstructing history or continue small readiness tasks. It should move directly to the core information-unit roadmap.
User correction to preserve
The user's main correction:
- Main objective: finish the information-unit system as quickly as possible.
- Time target is secondary.
- The assistant previously over-fragmented work into too many small readiness packages.
- The user wants larger open-goal macro tasks with enough context, live checks, clear PASS/BLOCKED conditions, forbidden boundaries, and autonomy for the agent to self-fix technical issues in scope.
- Gate only when actions involve production DB writes, CUT execution, VERIFY execution, deploy/restart, merge/push/tag, source/schema mutation.
Prompt principles to preserve:
required_prompt_shape:
- live survey before action
- clear goal
- clear PASS/BLOCKED definitions
- clear forbidden list
- internal gates before mutation
- allow Agent to self-fix technical issues within scope
new_prompt_pattern:
1: GOAL_MODE_CHECK
2: PRECHECK_LIVE_INPUT_COMPLETENESS
3: GOAL_CONTRACT_45_60_MIN
4: PASS/BLOCKED clear
5: forbidden clear
6: Agent autonomy within scope
prompt_style:
default: open_goal_macro_task
avoid: splitting into tiny steps if no production mutation is involved
Current source/runtime state from last accepted reports
Auto-cut/orchestrator path:
- Constitution cut completed earlier: 60 ICX-CONST IUs, enacted.
- Governance recording and write-VERIFY completed.
- Lifecycle draft→enacted completed.
- v0.6 orchestrator deployed side-by-side on VPS.
- Latest reported active v0.6 state after O10/O11:
- Active VPS path:
/opt/incomex/dot/iu-cutter-v0.6 - Active code reported around commit/artifact:
f111d4aafter O10. - Tests reported:
486/486 PASSafter O10/O11. execution_enabled=False.- v0.4 skeleton preserved:
/opt/incomex/dot/iu-cutter, HEADe93424bper prior reports. /var/lib/cutterexists with runtime dirs/config from O8E./opt/incomex/dot/iu-cutter-agent-sandboxexists from O11 scaffold.
- Active VPS path:
Important: the next session must live-check these values instead of trusting memory.
Most relevant KB paths
Roadmap / handoff:
knowledge/dev/laws/dieu44-trien-khai/hand_offs/session-handoff-mieng-thong-tin-core-roadmap-2026-05-21.mdknowledge/dev/laws/dieu44-trien-khai/hand_offs/session-handoff-addendum-detailed-continuation-2026-05-21.md
Roadmap file uploaded by user:
ROADMAP - Miếng thông tin.docxin the conversation upload; summary indicated the correct roadmap order:- auto-cut production
- PG-native IU relation + trigger model
- parent-child multi-level
- add/split/merge/delete
- text-as-code tooling
Codex prep docs:
knowledge/dev/laws/dieu44-trien-khai/v0.6-iu-pg-native-trigger-model-survey-design/knowledge/dev/laws/dieu44-trien-khai/v0.6-iu-pg-native-ddl-authoring-brief/knowledge/dev/laws/dieu44-trien-khai/v0.6-iu-parent-child-split-merge-brief/
Recent orchestrator reports:
knowledge/dev/laws/dieu44-trien-khai/v0.6-o8f-implement-f2-f3-gap6-deploy-proof/knowledge/dev/laws/dieu44-trien-khai/v0.6-o9-first-automated-production-run-readiness/knowledge/dev/laws/dieu44-trien-khai/v0.6-o10-automation-completion-program-bundle/knowledge/dev/laws/dieu44-trien-khai/v0.6-o11-automation-agent-sandbox-program-bundle/
Rulings:
knowledge/dev/laws/dieu44-trien-khai/reviews/dot-iu-cutter-v0.6-o10-generic-target-path-pass-gpt-ruling-2026-05-21.mdknowledge/dev/laws/dieu44-trien-khai/reviews/dot-iu-cutter-v0.6-o9-ready-for-approval-pass-next-program-bundle-gpt-ruling-2026-05-21.mdknowledge/dev/laws/dieu44-trien-khai/reviews/dot-iu-cutter-v0.6-o8f-pass-next-o9-gpt-ruling-2026-05-21.md
Agent assessment from prior session
- Claude Code: primary for core implementation, production-gated work, complex source changes.
- Codex: useful for code, tests, repo survey, technical drafting; can do non-production implementation and tests.
- Gemini CLI: usable as reviewer/critic for long documents only; no code/KB/DB authority.
- Antigravity: paused. Not reliable enough for KB/SSOT or core planning after false Directus/agent_views upload claim.
What NOT to do next
Do not continue these small branches unless user explicitly asks:
- More O8/O9/O10/O11 readiness packages.
- More Anti/Gemini review loops.
- More sandbox-only documentation.
- More approval package revisions for first automated cut, unless user is ready to provide sovereign/operator approvals.
Do not run production automated cut until these are explicitly resolved:
- SG approval for first orchestrator-managed production run.
- Authority to flip
execution_enabledfor approved run. BACKUP_GPG_FPRoperator key/provisioning.
Main next macro to run
Name:
IU_CORE_PG_NATIVE_PARENT_CHILD_STRUCTURE_OPS_AUTHORING
Effort:
xhigh
Required start host:
MacBook/dev host.
Reason:
The next task requires source repo changes, DDL/runbook files, tests, and commit. VPS is only for live read-only survey and optional non-mutating proof.
Expected Mac repo:
/Users/nmhuyen/iu-cutter-build/repo/iu-cutter
Expected VPS paths to verify:
/opt/incomex/dot/iu-cutter-v0.6/opt/incomex/dot/iu-cutter/var/lib/cutter
Full next prompt draft
Use this prompt for Claude Code/Codex:
Đây là phiên Claude Code/Codex mới. Effort: xhigh.
HOST BẮT BUỘC:
Bắt đầu trên MacBook/dev host vì macro này cần sửa source repo, viết DDL/runbook/tests và commit.
Nếu đang ở VPS/Contabo mà không truy cập được `/Users/nmhuyen/iu-cutter-build/repo/iu-cutter`, STOP với WRONG_EXECUTION_ENVIRONMENT.
VPS chỉ dùng cho live read-only survey và optional rollback-only/sandbox proof. Không production DDL execution.
MỤC TIÊU CHÍNH:
Đưa “miếng thông tin” tiến đúng roadmap: xây nền PG-native + parent-child + structure operations. Không tiếp tục chỉ đóng gói cắt tự động.
GOAL CONTRACT:
Đây là open-goal macro lớn. Không dừng sau một subtask nhỏ. Nếu một nhánh bị chặn, tiếp tục các nhánh khác trong scope. Chỉ STOP khi:
1. tất cả nhánh an toàn đã hoàn tất;
2. cần production DB mutation;
3. cần schema execution approval;
4. cần User/GPT ruling;
5. sai host/source.
Mục tiêu:
Author và test gói nền IU core gồm:
1. IU ↔ SQL object link model.
2. Inbound/outbound PG-native route model.
3. Parent-child multi-level model.
4. Add/split/merge/delete operation contract.
5. DDL migration files + rollback files, nhưng KHÔNG execute production DDL.
6. Python helpers/tests nếu an toàn.
7. Acceptance checklist cho production execution macro sau.
Cách xác nhận PASS:
IU_CORE_STRUCTURE_OPS_AUTHORING_PASS nếu:
- live survey trước khi làm PASS.
- đọc và dùng các brief Codex đã tạo:
- iu-pg-native-trigger-model-survey-design
- iu-pg-native-ddl-authoring-brief
- iu-parent-child-split-merge-brief
- source repo precheck PASS.
- author được DDL migration package cho:
- iu_sql_link
- iu_sql_event_route
- iu_outbound_route
- parent-child constraints/indexes/checks
- lineage tables/edges nếu cần
- author rollback package tương ứng.
- author tests/static validation cho DDL text/contract.
- author Python/model helpers nếu localized.
- không production DDL execution.
- không production DB write.
- reports uploaded.
BLOCKED_WITH_EXACT_GAP nếu:
- live schema mâu thuẫn với brief.
- cần kiến trúc quyết định chưa có.
- DDL không thể author an toàn.
- phải mutate production để kiểm chứng.
Đọc trước:
1. Roadmap handoff:
knowledge/dev/laws/dieu44-trien-khai/hand_offs/session-handoff-mieng-thong-tin-core-roadmap-2026-05-21.md
knowledge/dev/laws/dieu44-trien-khai/hand_offs/session-handoff-addendum-detailed-continuation-2026-05-21.md
2. Codex PG-native survey:
knowledge/dev/laws/dieu44-trien-khai/v0.6-iu-pg-native-trigger-model-survey-design/
3. Codex DDL brief:
knowledge/dev/laws/dieu44-trien-khai/v0.6-iu-pg-native-ddl-authoring-brief/
4. Codex parent-child/split-merge brief:
knowledge/dev/laws/dieu44-trien-khai/v0.6-iu-parent-child-split-merge-brief/
5. Current v0.6 code state:
knowledge/dev/laws/dieu44-trien-khai/v0.6-o10-automation-completion-program-bundle/
knowledge/dev/laws/dieu44-trien-khai/v0.6-o11-automation-agent-sandbox-program-bundle/
BRANCH 0 — PRECHECK LIVE + INPUT COMPLETENESS
- Confirm Mac repo exists and git status.
- Confirm SSH VPS works.
- Confirm KB read/upload works.
- On VPS read-only survey:
- information_unit
- unit_version
- iu_lifecycle_log
- universal_edges
- event_outbox/event_pending if present
- cutter_governance
- dot_config
- No DB write.
BRANCH 1 — ARCHITECTURE LOCK
Decide and document implementation stance:
- FACT / PROPOSAL / NEEDS_RULING.
- Use current parent_or_container_ref if viable.
- Decide whether new tables are required:
- iu_sql_link
- iu_sql_event_route
- iu_outbound_route
- iu_structure_operation
- iu_lineage_event
- Do not treat proposal as approved if uncertain.
BRANCH 2 — AUTHOR DDL MIGRATIONS
Create repo files under an appropriate path, e.g.:
sql/iu-core/
- 001_iu_sql_link.sql
- 002_iu_event_routes.sql
- 003_parent_child_constraints.sql
- 004_structure_ops_lineage.sql
- rollback files
- README/runbook
No execution on production.
BRANCH 3 — PARENT-CHILD MULTI-LEVEL
Author model for:
- containment parent
- recursive cycle check
- sibling ordering if needed
- root/top-level behavior
- reparent rules
- no hard delete default
BRANCH 4 — ADD/SPLIT/MERGE/DELETE CONTRACT
Author contracts for:
- add_piece
- split_piece
- merge_pieces
- retire/delete_piece
- supersede/replaced_by
- lineage/provenance
- idempotency
- rollback/compensation
Implementation can be DDL + Python skeleton/tests if safe.
BRANCH 5 — PG-NATIVE TRIGGER TWO-WAY MODEL
Author contract and DDL skeleton for:
- inbound SQL event -> IU/workflow
- outbound IU lifecycle/version/structure event -> SQL/workflow/vector/report
- event_outbox integration if present
- disable switch
- retry/idempotency
- fail-closed behavior
BRANCH 6 — TESTS / STATIC VALIDATION
- Add tests that parse/validate DDL files.
- Add contract tests for metadata shapes.
- Add cycle-prevention logic tests if implemented in Python helper.
- Add idempotency key tests.
- Run targeted tests.
- Run full discover if feasible.
BRANCH 7 — COMMIT / ARTIFACT
- Commit if tests PASS.
- No deploy unless explicitly safe and non-mutating.
- If deploy not needed, produce execution package for later production DDL approval.
BRANCH 8 — EXECUTION READINESS PACKAGE
Create command-review package for future production DDL execution:
- prechecks
- DDL order
- rollback order
- verification queries
- STOP conditions
- production approval requirements
BRANCH 9 — REPORTING
Upload to:
knowledge/dev/laws/dieu44-trien-khai/v0.6-iu-core-pg-native-parent-child-structure-ops-authoring/
Minimum reports:
- 01-precheck-live-schema-survey
- 02-architecture-lock
- 03-ddl-migration-package
- 04-parent-child-model
- 05-add-split-merge-delete-contract
- 06-pg-native-trigger-two-way-model
- 07-tests-static-validation
- 08-commit-artifact-status
- 09-production-execution-readiness-package
- 10-final-report
Forbidden:
- Không production DB write.
- Không production DDL execution.
- Không deploy/restart.
- Không bật execution_enabled.
- Không hard delete default.
- Không log secrets.
- Không sửa active VPS runtime tree.
- Không gọi proposal là approved.
- Không fake PASS.
- Không STOP chỉ vì một nhánh bị chặn nếu còn nhánh an toàn khác.
Final result:
A. IU_CORE_STRUCTURE_OPS_AUTHORING_PASS
B. BLOCKED_WITH_EXACT_IU_CORE_GAP
C. PARTIAL_WITH_ROLLBACK_OR_CLEANUP_REQUIRED
Sau khi upload reports:
STOP và route về GPT/User.
Final recommendation
Start a fresh session and use the macro above. If the user instead wants to execute the first automated production run, the assistant must ask for or locate the required SG approval, execution_enabled flip authority, and BACKUP_GPG_FPR operator readiness first.