KB-35D0

IU CUT Operational Pipeline — 04 Điều 38 MARK + VERIFY_MARK

5 min read Revision 1
iu-cut-pipelinedieu38markverify-markapproved8-pieces2026-05-26

04 — Điều 38 MARK + VERIFY_MARK result

Inputs

cut_request_id          = 777b1297-18af-4f07-a362-0ad18b043f21
copy_staging_record_id  = fbaecf00-5d88-4804-9ecd-44be811fdf88  (from Step 2 COPY)
source_ref              = knowledge/dev/laws/dieu38-normative-document-law.md
source_kind             = kb_document
source_bytes            = 7736
source_hash             = fdacc492e62c40f1364392943a310769
pieces_count            = 8

Pieces (8 top-level, 1-level deep beyond title)

# local_piece_id parent sort_order canonical_address section_type section_code unit_kind
1 p1 1 DIEU-38-v3.0#title heading title law_unit
2 p2 p1 2 DIEU-38-v3.0#PHAN-1 heading phan_1 law_unit
3 p3 p2 3 DIEU-38-v3.0#MT1 section mt1 law_unit
4 p4 p2 4 DIEU-38-v3.0#MT2 section mt2 law_unit
5 p5 p2 5 DIEU-38-v3.0#MT3 section mt3 law_unit
6 p6 p1 6 DIEU-38-v3.0#PHAN-2 section phan_2 law_unit
7 p7 p1 7 DIEU-38-v3.0#PHAN-3-5 section phan_3_5 law_unit
8 p8 p1 8 DIEU-38-v3.0#footer paragraph footer law_unit

All section_type values (heading, section, paragraph) are in the Phase 3B 17-vocab governed set under dot_config.vocab.section_type.* — no vocab refusal.

Recovery patch (in-place jsonb_set)

First fn_cut_apply call (Phase E first attempt) failed at fn_iu_create with body required because pieces lacked content_text. Per [[feedback-mark-pieces-live-in-iu-staging-payload-cut-manifest-not-in-iu-staging-record-metadata]], the fix is jsonb_set on iu_staging_payload.payload_json->'pieces'[i] (NOT on iu_staging_record.metadata->'pieces'). One UPDATE transaction patched all 8 pieces with content_text. Post-patch: pieces_count=8, p0/p7 content_text non-null.

The manifest_digest stored in cut_request.manifest_digest = eb68d77912ecb04c8b677e4f441632b1 was computed at MARK time before the patch; the patch broke the digest = md5(source_hash || bytes || pieces::text) reconstruction. Per Phase 3B feedback ("G5/G6 don't recompute digest from pieces on the fly"), this does not block CUT; G5 (digest format) + G6 (source_bytes hash) still pass. The break is recorded here as a known consequence of mid-flight piece repair.

MARK call (Step 3)

SELECT public.fn_cut_mark_staged_file(
  p_cut_request_id := '777b1297-...',
  p_pieces         := <8-element jsonb array>,
  p_actor          := 'claude_opus_4_7',
  p_mark_report_md := '# MARK report — Điều 38 v3.0 DRAFT (Phase D pilot)...'
);
→ {
  "status":                     "marked",
  "manifest_staging_record_id": "ea5dbce0-636f-4cfa-8ea7-7852f0c1e2da",
  "manifest_digest":            "eb68d77912ecb04c8b677e4f441632b1",
  "pieces_count":               8,
  "alias_result.lifecycle_status": "pending_review",
  "alias_result.source_hash":      "fdacc492e62c40f1364392943a310769",
  "alias_result.source_bytes":     7736
}

State transitions: copied → mark_in_progress → marked. Signal job fd2bbd28-a0a2-408e-a5a3-202bd44b6913 queued (cut.mark).

Important: fn_cut_mark_staged_file reads the source text from the source_copy payload server-side (no source bytes pass through Agent). The Agent supplies only the pieces array.

VERIFY_MARK call (Step 4)

SELECT public.fn_cut_verify_mark(
  p_cut_request_id  := '777b1297-...',
  p_approve         := true,
  p_approval_doc_id := 'knowledge/dev/laws/dieu44-trien-khai/v0.6-iu-cut-operational-pipeline-copy-mark-verify-cut/04-dieu38-mark-verify-result.md',
  p_approver        := 'claude_opus_4_7',
  p_actor           := 'claude_opus_4_7'
);
→ {
  "status":         "mark_verified",
  "verdict":        "approved",
  "alias_result.inner_result": { "ok": true, "verdict": "approved", "axis_a_ok": true, "axis_b_ok": true, "axis_c_ok": true }
}

Three-axis verification: A (source-order reconstruction), B (professional content axis), C (parent-child-grandchild) all PASS.

State transition: marked → mark_verified. Signal job ba104944-8e7f-41cd-a52e-b1dad8c35cba queued (cut.verify_mark).

End-of-Phase-D state

Field Value
status mark_verified
mark_verdict approved
mark_verified_at 2026-05-26 16:38:46
manifest_staging_record_id ea5dbce0-636f-4cfa-8ea7-7852f0c1e2da
manifest_digest eb68d77912ecb04c8b677e4f441632b1
Back to Knowledge Hub knowledge/dev/laws/dieu44-trien-khai/v0.6-iu-cut-operational-pipeline-copy-mark-verify-cut/04-dieu38-mark-verify-result.md