Agent Prompt — dot-iu-cutter v0.1 Cut Decision Workflow Design — 2026-05-14
Agent Prompt — dot-iu-cutter v0.1 Cut Decision Workflow Design — 2026-05-14
Mission
Design dot-iu-cutter v0.1 as a semantic cut decision workflow, not merely a transaction tool.
The target user experience is still:
Cắt luật A
But the core design question is:
How does AI decide where to cut, how is that decision reviewed, and how can bad cuts later be split/merged safely?
This is DESIGN ONLY. Do not implement code. Do not mutate PG. Do not run migrations.
Critical correction to previous direction
Phase 5C2 proved the mechanical cutter can work. The harder and more important problem is the decision process:
- where to cut;
- why there;
- which section_type/unit_kind;
- what hierarchy;
- how to prove no loss/no overlap;
- how AI reviews itself without human in normal loop;
- how later split/merge corrections work.
The design must therefore prioritize Mark → Review → Cut and split/merge lifecycle before CLI implementation details.
Read first
-
Controlling operational problem statement / đề bài vận hành:
knowledge/dev/laws/dieu44-trien-khai/requirements/dot-iu-cutter-v0.1-operational-problem-statement-2026-05-14.mdThis document is controlling. The design must answer the problem statement, not merely describe a technical cutter.
-
Methodology input:
knowledge/dev/laws/dieu44-trien-khai/design/dot-iu-cutter-methodology-mark-review-cut-and-split-merge-principles-2026-05-14.md -
Final GPT Phase 5C2 review:
knowledge/dev/laws/dieu44-trien-khai/reviews/gpt-final-review-phase5c2-86-units-complete-authorize-dot-iu-cutter-design-2026-05-14.md -
86-unit completion report:
knowledge/dev/laws/dieu44-trien-khai/reports/p3d-phase5c2-86-units-completion-report.md -
DIEU-32 retry report:
knowledge/dev/laws/dieu44-trien-khai/reports/p3d-phase5c2-r2-dieu32-retry-synthesize-title-execution-report.md -
DIEU-32 root cause:
knowledge/dev/laws/dieu44-trien-khai/reports/dieu32-null-heading-body-root-cause-investigation-report.md -
R1/R2 consolidated report:
knowledge/dev/laws/dieu44-trien-khai/reports/p3d-phase5c2-r1-r2-consolidated-status-report.md -
R0 resume design:
knowledge/dev/laws/dieu44-trien-khai/design/p3d-phase5c2-resume-tac-to-information-unit-migration-plan.md -
Birth Rev3 contract:
knowledge/dev/laws/dieu44-trien-khai/design/p3d-birth-system-b2-contract-design-rev3.md -
IU create gateway README:
knowledge/dev/laws/dieu44-trien-khai/readme/iu-create-gateway-readme.md -
Pack 23 edit/save policy report:
knowledge/dev/laws/dieu44-trien-khai/reports/23-p3c4-iu-policy-and-agent-context-report.md -
Constitution:
knowledge/dev/laws/constitution.md -
P3D multidimensional principle:
knowledge/dev/laws/dieu44-trien-khai/principles/p3d-terminology-and-multidimensional-entity-db-principle-2026-05-12.md
Hard boundaries
Design only:
No implementation.
No code changes.
No PG mutation.
No migration execution.
No UI cutover.
No vector/Qdrant work.
No event_outbox implementation.
No schema/function/trigger changes unless proposed as future option with explicit review gate.
Required design structure
1. Design philosophy
State clearly:
Cutting is a semantic decision, not a mechanical operation.
Cut execution must be downstream of an approved manifest.
AI is default decision-maker; human is escalation only.
Tie this to NT14 executor perspective: write rules so an implementing agent can follow them without guessing.
2. Mark → Review → Cut workflow
Design three phases:
MARK— AI marks proposed semantic units and emits a cut manifest.REVIEW— independent AI reviews/repairs manifest, no human by default.CUT— deterministic execution from approved manifest.
Define inputs, outputs, stop conditions, and authority at each phase.
3. Cut manifest schema
Define a structured manifest schema with at least:
manifest_id
source_doc_ref
source_version_ref
source_hash
unit_index
source_start_line/source_end_line or source_span
canonical_address_proposal
title
body_span_policy
section_type
unit_kind
parent_manifest_id
hierarchy_depth
body_source_policy
semantic_role
cut_reason
confidence
review_required_flags
split_merge_notes
edge_readiness_notes
4. Semantic cutting rules
Write executor-readable rules for:
- heading boundaries;
- semantic role changes;
- actionable unit principle;
- tables/checklists/code blocks;
- large/small unit thresholds as review triggers;
- no-loss/no-overlap coverage;
- vocab-first classification;
- edge readiness.
Do not just say “AI decides semantically”; define what evidence the AI must record.
5. AI review rules
Define how reviewer validates manifest:
- coverage;
- no overlap;
- semantic cohesion;
- actionability;
- section_type correctness;
- hierarchy correctness;
- size policy;
- body policy;
- edge readiness;
- escalation.
Include status enum:
manifest_review_status=PASS|PATCHED_PASS|BLOCKED
6. Human escalation policy
Human is not default in loop. Escalate only for:
- constitutional/governance ambiguity;
- new vocab/type;
- suspected data loss/corruption;
- competing valid cuts with different legal meaning;
- split/merge changes enacted canonical meaning.
7. Split/Merge lifecycle
Must include:
- when to split;
- when to merge;
- metadata required;
- canonical address policy;
- history preservation;
- supersedes/superseded_by relations;
- rollback plan;
- how AI reviews split/merge;
- how this affects future edges and references.
8. Execution backend
Only after the above, design the backend:
- preflight gate runner;
- mapping artifact emitter;
- bounded transaction runner;
fn_iu_createonly;- profile/provenance patch;
- birth validation;
- rollback-key dual-write;
- V-1..V-10 validation;
- report.
9. Body policy from Phase 5C2
Carry forward:
SYNTHESIZE_TITLE iff section_type='heading' AND body IS NULL AND children>0
PRESERVE iff body IS NOT NULL
BLOCK iff body IS NULL AND not heading-container
10. Future edge/professional linking readiness
The manifest and resulting IU must preserve enough information for:
law unit → requirement → process → code → report
Do not implement auto-edge here, but design the metadata hooks.
11. Operator UX
Design commands after the workflow is clear, e.g.:
dot-iu-cutter mark --source kb://... --doc_code DIEU-50
dot-iu-cutter review --manifest <id>
dot-iu-cutter cut --manifest <id>
dot-iu-cutter split --unit <id>
dot-iu-cutter merge --units <ids>
dot-iu-cutter status
Also natural-language wrapper:
Cắt luật Điều 50
12. Productionization plan
Break into phases:
- v0.1 design/spec;
- v0.1 read-only mark/review manifest implementation;
- v0.1 TAC-source cut execution;
- v0.2 KB markdown segmentation mode;
- v0.3 split/merge operations;
- v0.4 MCP wrapper;
- v0.5 auto-edge integration.
Deliverables
Create:
- Design:
knowledge/dev/laws/dieu44-trien-khai/design/dot-iu-cutter-v0.1-cut-decision-workflow-design.md
- Report:
knowledge/dev/laws/dieu44-trien-khai/reports/dot-iu-cutter-v0.1-cut-decision-workflow-design-report.md
- Operator/manifest contract:
knowledge/dev/laws/dieu44-trien-khai/specs/dot-iu-cutter-v0.1-manifest-and-operator-contract.md
Required final response fields
dot_iu_cutter_design_status=PASS|PARTIAL|BLOCKED
no_mutation_performed=true|false
mark_review_cut_defined=true|false
manifest_schema_defined=true|false
semantic_cutting_rules_defined=true|false
ai_review_rules_defined=true|false
human_escalation_policy_defined=true|false
split_merge_lifecycle_defined=true|false
execution_backend_defined=true|false
phase5c2_lessons_integrated=true|false
nt14_executor_perspective_pass=true|false
anti_hardcode_scale_review_pass=true|false
implementation_authorized=false
ui_cutover_allowed=false
vector_work_allowed=false
next_recommended_action=GPT_REVIEW_CUT_DECISION_WORKFLOW_THEN_IMPLEMENT_MARK_REVIEW_MANIFEST
report_path=knowledge/dev/laws/dieu44-trien-khai/reports/dot-iu-cutter-v0.1-cut-decision-workflow-design-report.md
Notes
Do not write a beautiful philosophy-only design. Write it so the next Agent can implement mark, review, cut, split, and merge without guessing the rules.