dot-iu-cutter v0.5 WS-2 — Source Family + Grammar Profile + Authority Semantics (D2/D3/D4)
dot-iu-cutter v0.5 WS-2 — Source Family Registry + Grammar Profile + Authority Semantics (D2 / D3 / D4)
Phase: design-only (WS-2) · 2026-05-18 · Self-contained.
Concrete hóa, KHÔNG redesign. Reference: v0.5 canonicalization/address-grammar design (
...v0.5-constitution-hardtest-design/dot-iu-cutter-v0.5-canonicalization-and-address-grammar-design-2026-05-17.md) §2grammar_profilemodel, §4 address; v0.5 source-document ingestion design (...source-document-ingestion-pipeline-design-2026-05-17.md) §2source_document; WS-1 binding-authority-clarification-note §4. Pseudo-schema YAML only, no executable SQL/table/migration (QG2/QG4).
0. Ba trục độc lập — tránh nhầm lẫn (quan trọng)
| Trục | Câu hỏi | Nguồn | Giá trị |
|---|---|---|---|
source_family (D2 — MỚI concrete hóa từ WS-1 G4) |
Đây là loại văn bản gì? | WS-1 G4 | constitution / law / process / code / report / lesson... |
source_authority_class (đã có ở ingestion §2 — reference) |
Nguồn đáng tin cấp nào? | ingestion design | authoritative / draft / mirror |
authority_semantics (D4 — WS-1 §4) |
Trong assembly nó đóng vai gì? | WS-1 binding-authority §4 | normative / evidence / implementation |
Ba trục KHÔNG thay thế nhau. D2 cung cấp source_family; D4 map source_family → authority_semantics default + override. source_authority_class (ingestion) giữ nguyên, không redesign.
1. D2 — source_family_registry (concrete)
source_family_registry: # MỚI: concrete hóa WS-1 G4; chưa tạo bảng
source_family: text PK # resolve qua registry — KHÔNG enum hardcode (v0.4 P3)
display_vi: text
display_en: text
authority_semantics_default: text # -> D4: normative_authority|evidence_authority|implementation_authority
grammar_profile_ref: text # FK -> grammar_profile (D3 / canon §2)
version_policy: text # immutable_snapshot | living_document | external_pinned
status_policy: text # enacted_only | all | draft_flagged
default_parser_profile_ref: text # advisory -> parser_profile registry (ingestion §2)
lifecycle: text # proposed | active | deprecated
registered_by / registered_at
Seed ≥9 families (QG5) — authority_semantics_default justify ngắn:
| source_family | authority_semantics_default | version_policy | status_policy | ghi chú |
|---|---|---|---|---|
| internal_incomex_constitution | normative_authority | living_document | enacted_only | Hiến pháp Kiến trúc nội bộ; ✅/📋 markers |
| internal_incomex_law | normative_authority | living_document | enacted_only | Điều 0..44 |
| internal_process | normative_authority | living_document | all | quy trình prescriptive |
| external_government_law | normative_authority | external_pinned | enacted_only | luật nhà nước |
| sql_entity | implementation_authority | external_pinned | all | đang chạy thật |
| code_artifact | implementation_authority | external_pinned | all | code đang chạy |
| report | evidence_authority | immutable_snapshot | all | chứng minh đã làm |
| lesson | evidence_authority | immutable_snapshot | all | bài học rút ra |
| architecture_note | normative_authority | living_document | draft_flagged | kiến trúc định hướng; hay mixed → override D4 |
Thêm family mới = thêm row lifecycle=proposed, sovereign approve → active. Runtime resolve qua registry, KHÔNG literal (chống hardcode, v0.4 P3 / v0.5 §6).
2. D3 — grammar_profile (concrete, ≥2 profile — QG6)
Model grammar_profile giữ nguyên canon §2 (reference, không redesign): grammar_profile_ref PK, level_definitions[] (level, matcher_kind, matcher_ref, numbering_scheme, is_leaf_candidate), status_marker_rules, address_template_ref. Profiles are data (canon §2). Dưới đây concrete hóa 2 profile row:
Profile A — incomex-architecture-constitution-v4 (internal law)
grammar_profile_ref: incomex-architecture-constitution-v4
level_definitions:
- level: NGUYEN_TAC # 15 Nguyên tắc Nền tảng
matcher_kind: heading-rule
matcher_ref: mc.icx.nguyen_tac
numbering_scheme: arabic
is_leaf_candidate: true
- level: KIEN_TRUC_SECTION # Kiến trúc Hạ tầng A/B/C
matcher_kind: heading-rule
matcher_ref: mc.icx.kien_truc
numbering_scheme: letter
is_leaf_candidate: true
- level: DIEU # Mục lục Luật Điều 0..44
matcher_kind: structural
matcher_ref: mc.icx.dieu
numbering_scheme: arabic
is_leaf_candidate: true
status_marker_rules:
- marker: "✅" => enacted
- marker: "📋" => controlled_draft # eligible_for_cut phụ thuộc enacted_only_policy
address_template_ref: at.icx.const.v4
Profile B — vn-national-law (external government law)
grammar_profile_ref: vn-national-law
level_definitions:
- level: CHUONG
matcher_kind: heading-rule
matcher_ref: mc.vn.chuong
numbering_scheme: roman
is_leaf_candidate: false
- level: DIEU
matcher_kind: structural
matcher_ref: mc.vn.dieu
numbering_scheme: arabic
is_leaf_candidate: false
- level: KHOAN
matcher_kind: structural
matcher_ref: mc.vn.khoan
numbering_scheme: arabic
is_leaf_candidate: true
- level: DIEM
matcher_kind: structural
matcher_ref: mc.vn.diem
numbering_scheme: letter
is_leaf_candidate: true
- level: DOAN
matcher_kind: structural
matcher_ref: mc.vn.doan
numbering_scheme: none
is_leaf_candidate: true
status_marker_rules: [] # luật nhà nước không dùng ✅/📋 inline
address_template_ref: at.vn.law
Parser tự detect: canon pipeline C1_grammar_detect chọn grammar_profile_ref qua registry rule trên doc signals; fail-closed → review queue, không silent default (canon §3 C1/C8). matcher_kind/matcher_ref là config row, KHÔNG regex inline (chống hardcode). Đăng ký profile mới = thêm grammar_profile row + matcher config rows + address_template, sovereign approve. KHÔNG redesign model canon §2.
3. D4 — authority_semantics mapping (default + override)
Reference WS-1 binding-authority §4 (default từ source_family + unit/span override) — concrete hóa storage shape (logical), không redesign rule.
Default mapping
source_family_registry.authority_semantics_default (bảng §1) = nguồn default. Lookup: IU → source_family → default role.
Override storage (logical pseudo-schema)
authority_override: # logical only — chưa tạo bảng
override_id: text PK
scope: text # unit | span
iu_id: text # khi scope=unit -> IU identity
span_ref: text # khi scope=span -> source_span.span_id (ingestion §2)
authority_role: text # normative_authority|evidence_authority|implementation_authority
reason: text
set_by: text
set_at: timestamptz
provenance: jsonb # who/when/why/source (auditable)
- unit-level override: dùng ngay khi 1 IU sai role mặc định.
- span-level override: khái niệm định nghĩa nay (gắn
source_span.span_idtừ ingestion §2); cơ chế chi tiết defer sang khi có pilot mixed-authority thật (không over-design). - Assembly output bắt buộc gán mỗi unit đúng 1 trong:
normative_authority | evidence_authority | implementation_authoritycho ngữ cảnh assembly đó (WS-1 §4 — binding).
Ví dụ mixed-authority (override bắt buộc)
- Luật + phụ lục giải thích: thân luật = normative; span phụ lục giải thích = evidence.
- Report nhúng trích yêu cầu chính thức: thân report = evidence; span trích requirement = normative.
- Code file có cả implementation + ghi chú compliance: code = implementation; span ghi chú compliance = normative (hoặc evidence nếu là attestation).
4. WS-2 dependency note — governed_by / derived_from (theo GPT cleanup review §3)
Edge-minimization (WS-1) dựa constrains→governed_by, lesson_from→derived_from. Cả hai là P44-4A candidate edges chờ ban hành v1.0 (P44-4A §3.2). GPT ruling: dependency_not_blocker_for_WS1_authority, track_under_P44_candidate_activation_or_WS2_dependency_note, caution: nếu không kích hoạt, các resolution liên quan phải revisit trước WS-3 execution. → Ghi nhận tại đây làm WS-2 dependency; KHÔNG tự kích hoạt candidate edge, KHÔNG APR (forbidden §5).
5. Ví dụ nôm na (QG3)
Thư viện nhiều loại sách: source_family = phân loại kệ (sách luật / biên bản / sổ tay quy trình / nhật ký bài học). grammar_profile = cách đánh mục lục cho từng loại (sách luật có Chương→Điều→Khoản; hiến pháp nội bộ có Nguyên tắc→Điều). Thủ thư mới không tự bịa cách đánh số — tra bảng quy tắc. authority_semantics = "quyển này nói luật (ra lệnh), quyển kia là biên bản (chứng minh), quyển nọ là máy đang chạy". Một quyển luật có phần phụ lục giải thích thì dán nhãn riêng cho phần phụ lục (override) để không nhầm phụ lục là điều luật.
6. Statements
- D2 ≥9 families (QG5); D3 ≥2 concrete profiles internal law + external gov law (QG6). Concrete hóa, không redesign (QG1).
- Pseudo-schema YAML, no executable SQL/table/migration/code/dry-run/Directus/vector/edge/APR/commit (QG2/QG4).
- No repo/VPS access in this session. code_changed: false; commit_made: false.
- Self-advance PROHIBITED — STOP sau khi đủ 4 file WS-2 → GPT/User review.