08 — Next step: CUT approval and execution
08 — Next step: CUT approval and execution
The Điều 39 cut_request 146f1520-aaa2-4bda-af2c-06a8f76cd36a is now at status='marked' with a valid cut_manifest_piece_schema_v1 manifest:
- staging record
9fa4685e-d35a-45d4-aee7-aa2836785ca5 - manifest_digest
aded6af91fb9643fb2ea99ff024a1ede - 16/16 pieces complete on all required fields
- VERIFY_MARK preview verdict =
approved(axis A/B/C all PASS)
Operator approval (required to advance)
SELECT public.fn_cut_verify_mark(
p_cut_request_id := '146f1520-aaa2-4bda-af2c-06a8f76cd36a'::uuid,
p_approve := true,
p_approval_doc_id := '<KB path or ticket reference>',
p_approver := '<approver identity, e.g. nmhuyen>',
p_actor := '<operator identity>'
);
This will:
- Call
fn_iu_op_verify_mark(p_approve=true, …)→fn_iu_verify_mark(p_apply=true, …)which setsiu_staging_record.lifecycle_status='approved'and records the approval doc id. - Transition
cut_request.status: marked → mark_verified. - Emit signal
cut.verify_markwith verdict=approved.
CUT execution
Once at mark_verified, call:
SELECT public.fn_cut_apply(
p_cut_request_id := '146f1520-aaa2-4bda-af2c-06a8f76cd36a'::uuid,
p_actor := '<operator>'
);
This advances cut_request.status: mark_verified → cut_in_progress → cut_done, creates cut_run_id, and emits 16 IUs anchored to knowledge/dev/laws/dieu39-knowledge-graph-law.md under canonical addresses DIEU-39-v2.3#….
CUT verification
SELECT public.fn_cut_verify_cut(
p_cut_request_id := '146f1520-aaa2-4bda-af2c-06a8f76cd36a'::uuid,
p_actor := '<operator>'
);
Expected: axis_a/b/c_ok=true, no_vector_ok=true, pieces_count=16, verdict='verified'.
Completion
SELECT public.fn_cut_request_transition(
'146f1520-aaa2-4bda-af2c-06a8f76cd36a'::uuid,
'completed',
'<operator>',
'{}'::jsonb
);
Then completed → cleanup_scheduled after 15-day TTL window (CF-1 from runtime-hardening pack — cleanup executor still pending).
What's intentionally NOT done in this pack
- CUT not run (strict non-goal).
- mark_verified transition not applied (requires operator-supplied
approval_doc_idandapprover— caller decision, not the fix author's). - Orphaned staging record
3d9d0388-…left atlifecycle_status=rejectedfor audit; cleanup executor (CF-2 in [[project-iu-cut-operational-pipeline-copy-mark-verify-cut-pass-2026-05-26]]) will reap.
Caller guidance for future MARK invocations
Every future caller of fn_cut_mark_staged_file MUST emit pieces matching cut_manifest_piece_schema_v1 (see 03-cut-manifest-piece-schema-v1.md):
[
{
"local_piece_id": "P1",
"source_position": 1,
"piece_role": "section_body",
"section_type": "section",
"content_text": "...",
"canonical_address": "...",
"parent_local_id": null
},
...
]
If the caller produces invalid pieces, MARK raises an indexed error (piece[N].<field> is required (cut_manifest_piece_schema_v1)) and the cut_request stays at copied (or mark_rejected) — no silent advance to marked.