KB-3926

110000x · 05 — Điều 37 KB Source Resolution

6 min read Revision 1
iu-core110000xdieu-37kb-sourceresolutionlaw-unitmanifest-pieces

110000x · 05 — Điều 37 KB Source Resolution

Goal: Demonstrate that operator's short MARK alias automatically resolves the Điều 37 source from KB path without asking user for the link.

1. Resolution chain (agent-side)

When the operator types:

MARK file knowledge/dev/laws/dieu37-governance-organization-law.md theo quy trình operational-cut-workflow, lưu vào No-Vector Staging Zone

The agent executes:

Step 1. Parse short form:
  source_ref      = knowledge/dev/laws/dieu37-governance-organization-law.md
  workflow_ref    = operational-cut-workflow
  destination_ref = No-Vector Staging Zone

Step 2. Fetch source text:
  result = mcp__claude_ai_Incomex_KB__get_document_for_rewrite(
    document_id = source_ref
  )
  source_text = result.content

Step 3. Author piece list from source_text per 80000x cut_manifest schema
  (the agent's MARK responsibility; consult v0.6-iu-core-operational-cut-workflow…/02-agent-mark-instructions.md).

Step 4. Call SQL alias:
  fn_iu_op_mark_file(
    p_source_text  := source_text,
    p_source_ref   := source_ref,
    p_pieces       := pieces_jsonb,
    p_actor        := 'operator-<name>',
    p_source_kind  := 'user'
  )

Step 5. Return short summary (sid + manifest_digest) to operator.

2. Verified resolution (this macro)

Live resolution executed during 110000x Phase A:

mcp__claude_ai_Incomex_KB__get_document_for_rewrite(
  "knowledge/dev/laws/dieu37-governance-organization-law.md"
)
  → revision 5, content_length 20482
  → title: "Điều 37 — Luật Tổ chức Bộ máy Quản trị v3.3 BAN HÀNH (KHÔI PHỤC ĐẦY ĐỦ)"
  → tags: [law, dieu-37, governance, v3.3, enacted, restored-s165]
  → md5(content) = (computed at MARK time, deterministic from source_text)
  → octet_length(content) ≈ 20,482 bytes

Operator was not asked for the link.

Top-level structure (sections per source headings):

{
  "manifest_version": "v0.6",
  "source_id": "knowledge/dev/laws/dieu37-governance-organization-law.md",
  "source_hash": "<md5 of content>",
  "source_bytes": 20482,
  "manifest_digest": "<32-hex deterministic>",
  "pieces": [
    {"local_piece_id":"p1","parent_local_id":null,
     "unit_kind":"law_unit","section_type":"heading","section_code":"title",
     "piece_role":"title","canonical_address":"DIEU-37-v3.3#title",
     "source_position":1,"sort_order":1,
     "content_text":"# ĐIỀU 37 — LUẬT TỔ CHỨC BỘ MÁY QUẢN TRỊ v3.3"},

    {"local_piece_id":"p2","parent_local_id":"p1",
     "unit_kind":"law_unit","section_type":"heading","section_code":"muc-tieu",
     "piece_role":"intro","canonical_address":"DIEU-37-v3.3#muc-tieu",
     "source_position":2,"sort_order":2,
     "content_text":"## MỤC TIÊU\n…"},

    {"local_piece_id":"p3","parent_local_id":"p1",
     "unit_kind":"law_unit","section_type":"paragraph","section_code":"nv",
     "piece_role":"body","canonical_address":"DIEU-37-v3.3#nv",
     "source_position":3,"sort_order":3,
     "content_text":"## 5 NHIỆM VỤ CHÍNH\n…"},

    {"local_piece_id":"p4","parent_local_id":"p1",
     "unit_kind":"law_unit","section_type":"definition","section_code":"par1",
     "piece_role":"body","canonical_address":"DIEU-37-v3.3#par1",
     "source_position":4,"sort_order":4,
     "content_text":"## §1. GIẢI THÍCH TỪ NGỮ\n…"},

    {"local_piece_id":"p5","parent_local_id":"p1",
     "unit_kind":"law_unit","section_type":"principle","section_code":"par2",
     "piece_role":"body","canonical_address":"DIEU-37-v3.3#par2",
     "source_position":5,"sort_order":5,
     "content_text":"## §2. TUYÊN BỐ CỐT LÕI\n…"},

    // §3 phạm vi, §4 nguyên tắc, §5 schema, §6 DOT, §7 ma trận,
    // §8 catalog, §9 quan hệ, §10 seed, §11 nợ kỹ thuật, §12 triggers, changelog
    // → 13 pieces total recommended (1 title + 12 sections)
  ]
}

Vocab compliance (from feedback memory):

  • unit_kind = law_unit (Điều 37 is a real law, not a design doc).
  • section_type{appendix,article,changelog,checklist,definition,governance_process,heading,instruction_block,paragraph,principle,process,section,technical_spec}. Use heading for top headings, paragraph / definition / principle / process for body sections, changelog for the changelog section.
  • piece_role{title,intro,body,step,clause,appendix,reference}. Use title only for the root piece; intro for §MỤC TIÊU; body for §1-§12; appendix for §11+ supplementary; reference for cross-link sections.
  • canonical_address pattern: DIEU-37-v3.3#<section_code>.
  • parent_local_id builds the Axis C tree: all body sections point to p1 (root); subsections can further nest.

4. Why this matters for "Agent mới"

A fresh agent reading START-HERE (Phase J) sees:

"Source KB test đầu tiên: knowledge/dev/laws/dieu37-governance-organization-law.md"

…and the short cheatsheet. The agent is expected to:

  1. Read the source via KB MCP.
  2. Author the piece list using 80000x doctrine (referenced from operational-cut-workflow).
  3. Call the alias.

No 110000x macro, no 100000x re-author, no schema deep-dive — just KB read + manifest authoring + alias call.

5. Bounded-proof recommendation

Because Điều 37 source is ~20KB and would split into 12–15 IU pieces (a real durable cut), the first test by a new agent should be:

  • Run in BEGIN/ROLLBACK to validate end-to-end without permanent state mutation.
  • After successful rollback proof, the operator may approve a durable cut by removing the ROLLBACK wrap.
  • Composer gate must be opened (UPDATE dot_config SET value='true' WHERE key='iu_core.composer_enabled') before the alias call, and closed (SET value='false') immediately after.

This bounded approach mirrors the 100000x proof FIXTURE pattern and keeps the first real-source cut auditable.

Back to Knowledge Hub knowledge/dev/laws/dieu44-trien-khai/v0.6-iu-core-110000x-operator-alias-surface-d30-d31-protection/05-dieu37-kb-source-resolution.md