KB-75CE rev 4

START HERE — IU Core Cutting Operator (Agent mới đọc trước)

8 min read Revision 4
start-hereiu-coreoperatoragent-mớimarkcutno-vector-staging-zoneonboardingdieu-37short-commands110000x

START HERE — IU Core Cutting Operator

Bạn là Agent mới. Đọc trang này TRƯỚC khi làm bất cứ thao tác MARK / CUT nào.

Bạn chỉ cần đọc 2 file: trang này (START HERE) và 01-short-command-cheatsheet.md. Sau đó bạn có thể nhận lệnh ngắn từ operator và thực thi đúng.

1. Latest valid pipeline (chỉ dùng cái này)

Macro Trạng thái Vai trò
100000x PASS (2026-05-26) Live pipeline: MARK → VERIFY-MARK → APPROVE → CUT → VERIFY-CUT → CLEANUP. 5 functions live: fn_iu_mark_create_manifest, fn_iu_verify_mark, fn_iu_cut_from_manifest, fn_iu_verify_cut_result, fn_iu_staging_cleanup.
110000x AUTHORED (PARTIAL_WITH_EXACT_GAP) Alias surface + tests authored. KB report + onboarding pack uploaded. Apply channel out-of-scope.
110500x PASS (2026-05-26) mig 042R APPLIED durably: 5 fn_iu_op_* wrappers + 5 dot_iu_operator_* DOT entries live (502→507 fns, 36→41 DOT). Điều 37 short alias proof PASS (BEGIN/ROLLBACK; 16 IU pieces created + verify_cut verdict=verified + no_vector_ok=true). Điều 30 regression PASS T1-T7 + Điều 31 refusals PASS R1/R2/R3/R6/R7/R8/R9.
90000x / 91000x PARTIAL — CHỈ LÀM LỊCH SỬ KHÔNG dùng làm nguồn vận hành. Schema/signature trong các báo cáo này đã lỗi thời, được sửa ở 100000x.
80000x doctrine (docs-only) Operational workflow MARK → REVIEW → CUT → VERIFY. Đọc khi cần biết cut_manifest schema (M1-M16) hoặc 12-step Agent MARK procedure.

Quy tắc cứng: không trích 90000x hay 91000x làm tham chiếu cho thao tác hiện tại. Chỉ trích 100000x (pipeline) + 110500x (alias APPLIED). 110000x chỉ là author-mode đặc tả mig 042R đã được áp dụng ở 110500x.

2. Năm lệnh ngắn (toàn bộ giao diện operator)

MARK file <source_ref> theo quy trình operational-cut-workflow, lưu vào No-Vector Staging Zone
VERIFY MARK staging_id <id>
CUT staging_id <id>, output IU corpus, verify reconstruct + Axis A/B/C
VERIFY CUT run_id <id>
CLEANUP STAGING dry-run older_than 15d

Chi tiết từng lệnh: xem 01-short-command-cheatsheet.md.

3. Source KB test đầu tiên

knowledge/dev/laws/dieu37-governance-organization-law.md

Bạn được phép đọc trực tiếp file này từ KB (qua mcp__claude_ai_Incomex_KB__get_document_for_rewrite). KHÔNG hỏi operator xin link.

4. SAFETY RULES (không được vi phạm)

# Rule Vì sao
1 MARK pending data chỉ lưu vào No-Vector Staging Zone (iu_core.iu_staging_record + iu_core.iu_staging_payload). KHÔNG lưu KB. KB là context, không phải runtime staging. Pending MARK chưa được duyệt — nếu upload thành KB nó sẽ bị vector hóa, vi phạm "no-vector-on-staging".
2 Chỉ upload final report vào KB (sau khi macro hoàn tất + verify). Tách "rác đang xử lý" khỏi "trí thức đã duyệt".
3 KHÔNG vector hóa staging payload. 4-layer structural guarantee (vector_excluded=true CHECK + no FK + sidecar + structural absence). Vi phạm = phá rule cốt lõi.
4 KHÔNG CUT nếu chưa VERIFY-MARK + approved manifest. G3 (not_approved) sẽ refuse, nhưng nếu agent cố ý bypass bằng cách gọi fn_iu_cut_from_manifest trực tiếp với hash bất kỳ thì G6 (source_changed) hoặc G5 (digest_changed) cũng sẽ refuse — nhưng vẫn tạo audit refused gây nhiễu. Đừng cố.
5 KHÔNG bỏ qua VERIFY-CUT. VERIFY-CUT là nơi axis A/B/C + no-vector được kiểm tra. Skip nó = không biết cut có valid không.
6 KHÔNG động production_documents. Bảng không tồn tại trong DB directus; nếu xuất hiện trong câu SQL của bạn = bug.
7 KHÔNG động Qdrant. Aliases không gọi Qdrant. Mọi thao tác tự gọi Qdrant từ trong macro này = vi phạm.
8 KHÔNG deploy Nuxt. Out of scope toàn diện.
9 KHÔNG enable iu_core.retention_enabled global. Chỉ dry-run cleanup (fn_iu_op_cleanup_dry_run). Apply cleanup là việc operator gọi fn_iu_staging_cleanup(true, ...) thủ công.
10 KHÔNG dùng prompt dài. Toàn bộ vận hành chỉ qua 5 lệnh ngắn ở §2. Nếu bạn thấy mình đang viết "macro" >100 dòng để cut 1 file → bạn làm sai.

5. Vận hành 1 file (workflow chuẩn)

Operator:  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

Agent:
  1. fetch  = mcp__claude_ai_Incomex_KB__get_document_for_rewrite("knowledge/dev/laws/dieu37-governance-organization-law.md")
  2. source_text = fetch.content
  3. pieces  = author per 80000x cut_manifest schema (12-step Agent MARK)
  4. result  = psql -c "SELECT fn_iu_op_mark_file(p_source_text:='...', p_source_ref:='knowledge/dev/laws/dieu37-governance-organization-law.md', p_pieces:='[...]'::jsonb, p_actor:='operator', p_source_kind:='user');"
  5. report back: sid, manifest_digest, lifecycle

Operator:  VERIFY MARK staging_id <sid>

Agent:
  result = psql -c "SELECT fn_iu_op_verify_mark('<sid>'::uuid, true, '<approval_doc_id>', '<approver>', 'operator');"
  report back: verdict (must = 'approved')

Operator:  CUT staging_id <sid>, output IU corpus, verify reconstruct + Axis A/B/C

Agent:
  1. psql -c "UPDATE dot_config SET value='true' WHERE key='iu_core.composer_enabled';"
  2. result_cut = psql -c "SELECT fn_iu_op_cut('<sid>'::uuid, true, 'operator', true);"
  3. rid = result_cut->>'run_id'
  4. result_verify = psql -c "SELECT fn_iu_op_verify_cut('<rid>'::uuid, 'operator');"
  5. psql -c "UPDATE dot_config SET value='false' WHERE key='iu_core.composer_enabled';"
  6. report back: applied, pieces_created_count, verify-cut verdict, axes A/B/C ok

Operator:  VERIFY CUT run_id <rid>     -- idempotent re-check (optional)

Đó là toàn bộ. Không có bước thứ 7.

6. Khi bị refusal

refusal_code Nguyên nhân Sửa
not_found sid hoặc rid sai Kiểm tra lại id
wrong_kind staging row không phải mark_manifest Chỉ MARK rows được CUT
not_approved chưa chạy VERIFY MARK với apply=true Chạy VERIFY MARK staging_id <id> trước
incomplete_approval thiếu approval_doc_id / approved_by Chạy lại verify-mark với đầy đủ
digest_changed manifest đã bị sửa sau MARK Bug nghiêm trọng — báo operator, không cố cut
source_changed source_hash không khớp manifest đã staged Source đã đổi từ lúc MARK → MARK lại
composer_gate_closed dot_config.iu_core.composer_enabled = false Truyền p_open_composer:=true cho alias hoặc UPDATE thủ công

7. Tài liệu phụ (đọc khi cần)

  • 01-short-command-cheatsheet.md — bảng tóm tắt 5 lệnh
  • 02-current-live-status.md — trạng thái DB hiện tại (số lượng IU, gates, mig đã apply)
  • 03-safety-rules.md — 10 rule §4 ở dạng tự đứng (tham chiếu nhanh)
  • 04-new-agent-test-plan.md — bài kiểm tra cho Agent mới (operator chấm)
  • knowledge/dev/laws/dieu44-trien-khai/v0.6-iu-core-operational-cut-workflow-mark-review-cut-verify/ — 80000x doctrine (cut_manifest schema, 12-step MARK)
  • knowledge/dev/laws/dieu44-trien-khai/v0.6-iu-core-100000x-reauthor-apply-cut-verify-full-proof/ — pipeline live PASS (tham chiếu kỹ thuật)
  • knowledge/dev/laws/dieu44-trien-khai/v0.6-iu-core-110000x-operator-alias-surface-d30-d31-protection/ — alias surface + tests (author-mode design)
  • knowledge/dev/laws/dieu44-trien-khai/v0.6-iu-core-110500x-apply-operator-alias-d30-d31-test/APPLIED + LIVE-PROVEN (mig 042R durable, Điều 37 proof PASS, D30/D31 PASS)

8. Một câu kết

Bạn nhận lệnh ngắn từ operator. Bạn gọi alias fn_iu_op_* qua psql. Bạn báo cáo kết quả ngắn. Hết. Không macro dài, không upload pending vào KB, không vector hóa staging, không bypass G1-G7, không động production_documents / Qdrant / Nuxt.