P44-3 — Profile Registry Design
P44-3 — Profile Registry Design
Trạng thái: P44-3A polish — uploaded | Phiên: S190 (2026-05-01) Authority: Đ44 v0.1.2 controlled DRAFT (chưa enacted) — §3.2 G6, §4.3 Family Profile rule, §9.1, §9.4 Path:
knowledge/dev/laws/dieu44-trien-khai/design/03-profile-registry-design.mdPhụ thuộc: P44-0 README rev 1, P44-1 Family Registry rev 1, P44-2 SCMR rev 1 Nguồn nền: L3 Metadata Governance (4 nhóm core + 4 loại fill + 3 tầng kiểm) Polish: GPT-5.5 review 6 điểm — (1) reinterpret P44-1 F5 cardinality 0..n không patch tên; (2) Q1 không block upload; (3)profile_rolenotepublicationdomain-specific; (4) required/optional enforcement mềm wording; (5)required_g_setlà logical contract need không patch P44-1; (6) Sketch §6 cảnh báo mạnh không là spec. Review: GPT-5.5 PASS sau P44-3A polish.
§0. Tóm tắt 5 dòng cốt lõi
- Profile Registry là logical capability bắt buộc — mọi family có profile (G6 trong Đ44 §3.2) phải đăng ký qua Profile Registry. Không có entry = profile không hợp pháp.
- 11 field logic tối thiểu cho 1 Profile entry:
profile_id,profile_code,family_code,profile_role,schema_version,schema_definition,required_fields_set,optional_fields_set,g_groups_covered,status, timestamps. Per-profile entry (1 family có thể đăng ký nhiều profile — interpret cardinality 0..n cho P44-1 F5 capability binding). - Required vs Optional: required → birth gate (block là khuyến nghị cho production, không luật cứng); optional → DOT enrichment INFO không block. Phân loại = config data per family qua APR.
- Profile schema có version + lifecycle: semver bump (major = breaking, minor = thêm optional, patch = clarify); status
proposed → active → deprecated → retired. - Resolve OPEN P44-2-ε "G required theo family aggregate": logical contract need cho interface Family Registry ↔ Profile Registry —
required_g_setlà amendment candidate cho P44-1, không patch ngay.
§1. Mục đích + ranh giới
1.1 Profile Registry để làm gì
| Vai trò | Diễn giải |
|---|---|
| Sổ đăng ký mọi profile schema | Mọi family có profile (G6 trong Đ44 §3.2) phải có entry. L3 §3.2: "Profile schema = config, không code." Profile Registry là nơi lưu config đó. |
Anchor cho schema_profile_binding (P44-1 F5) |
P44-1 F5 binding tới Profile Registry. Profile Registry là target của binding. Không có Profile Registry = F5 binding rỗng. |
| Cấm Agent tự sáng tác profile field | L3 §3.2: "Agent không tự sáng tác profile field. Phải nằm trong config đã đăng ký. Free-form = cấm." Profile Registry là cơ chế enforce. |
| Phân loại required/optional | L3 §5.2 — Profile Registry chứa required_fields_set + optional_fields_set, là input cho birth gate (required) và DOT enrichment (optional). |
| Resolve OPEN P44-2-ε | P44-2 để mở "G required theo family aggregate". Profile Registry kết hợp với Family Registry chốt định nghĩa qua g_groups_covered + logical contract need required_g_set (amendment candidate cho P44-1, không patch). |
| Profile evolution có version + audit trail | Profile schema thay đổi qua thời gian. Profile Registry lưu version + lifecycle để audit + migration có căn cứ. |
| Cầu nối thực tế quay về Miếng thông tin | Sau P44-3 PASS, đủ móng để propose P38-X — Information Unit Profile/Schema (3 profiles: identity / content / publication) với tư cách 1 family conform Đ44. |
1.2 Ranh giới P44-3
P44-3 LÀM:
- Định nghĩa logical contract khung Profile Registry (11 field).
- Định nghĩa phân loại required/optional + cơ chế enforce qua birth gate / DOT enrichment.
- Định nghĩa profile schema version + lifecycle (4 status).
- Resolve OPEN P44-2-ε bằng "logical contract need" (không patch P44-1).
- Reinterpret P44-1 F5 cardinality 0..n (không sửa wording P44-1).
- Sketch non-binding 3 profiles cho
information_unit— cảnh báo mạnh không là spec. - Cầu nối rõ ràng tới P38-X.
- Meta-conformance hypothetical cho Profile Registry tự nó.
- Liệt kê amendment candidate cho P44-1 (không patch).
P44-3 KHÔNG LÀM (cố tình):
- ❌ KHÔNG patch P44-1 — F5 cardinality +
required_g_setlà amendment candidate, không sửa P44-1 rev 1. - ❌ KHÔNG chốt field list cuối cho
information_unitprofiles — đó là deliverable của P38-X. - ❌ KHÔNG thiết kế Family Registry / SCMR (đã làm P44-1/P44-2).
- ❌ KHÔNG thiết kế Relation Edge (P44-4).
- ❌ KHÔNG thiết kế Update Mechanism / DOT cụ thể (P44-5).
- ❌ KHÔNG DDL, code, migration, mutate production.
- ❌ KHÔNG chốt tên bảng vật lý Profile Registry.
- ❌ KHÔNG chốt storage format (defer APR).
- ❌ KHÔNG xử lý profile populate cho TAC (P38-X scope).
Phép thử nhanh: nếu thấy đang viết schema chi tiết cho
information_unitprofile (vd "title field type string max 200"), thiết kế DOT cụ thể, viết DDL, hoặc patch trực tiếp P44-1 — lỗi sa đà, báo lại.
§2. Logical contract khung Profile Registry
2.1 11 field logic tối thiểu cho 1 Profile entry
Quyết định kiến trúc: Per-profile entry — 1 family có thể đăng ký nhiều profile (vd
information_unitđăng ký 3: identity / content / publication). Match L3 pattern "core + profile per object family".
| # | Logical field | Cardinality | Kiểu logical | Ràng buộc | Tham chiếu |
|---|---|---|---|---|---|
| P1 | profile_id |
1..1 | identifier (logical, abstract) | PK, unique, immutable | L3 §3.2 |
| P2 | profile_code |
1..1 | identifier (snake_case, ≤ 64 chars) | unique, format {family_code}_{role}_v{n} |
L3 vocab pattern |
| P3 | family_code |
1..1 | FK reference | FK → Family Registry (P44-1 F1) | P44-1, Đ44 §4.3 |
| P4 | profile_role |
1..1 | enum logical (extensible vocab) | not null, vocab default {identity, content, publication, custom} — xem §2.2 P4 note | L3 §3 + Đ44 §3.2 G6 |
| P5 | schema_version |
1..1 | semver string (major.minor.patch) | not null, immutable per entry | new (P44-3) |
| P6 | schema_definition |
1..1 | structured logical schema definition | thoả invariant INV-P3 | L3 §3.2 |
| P7 | required_fields_set |
0..* | logical set of field names | subset của fields trong P6 | L3 §5.2 |
| P8 | optional_fields_set |
0..* | logical set of field names | subset của fields trong P6, không overlap với P7 | L3 §5.2 |
| P9 | g_groups_covered |
0..* | logical set của G ∈ {G1..G12} | each G phải hợp lệ Đ44 §3.2 | OPEN P44-2-ε resolve |
| P10 | status |
1..1 | enum {proposed, active, deprecated, retired} | not null, default proposed |
L3 lifecycle pattern |
| P11 | created_at, created_by, updated_at, updated_by |
1..1 each | timestamp + user FK | NT11 (PG tự suy ra) | G12 Đ44 |
2.2 Field-by-field rationale
P1 — profile_id
Identifier logical. Storage scheme defer APR/P44-5. Logical contract: ổn định, immutable, unique.
P2 — profile_code
Format đề xuất: {family_code}_{role}_v{major} (vd information_unit_identity_v1).
- Snake_case, ≤ 64 chars — match L3 vocab + safe encoding.
- Mutable per major version: bump major version → tạo profile_code mới (
v1→v2). Pattern immutable identifier per version.
P3 — family_code
FK chính sang Family Registry. Mọi profile phải thuộc 1 family.
Lưu ý cardinality (xem §2.3): 1 family có thể có nhiều profile entries — phía Profile Registry, một family map tới N entries (cardinality 0..n từ family side). Đây là interpret rộng cho P44-1 F5
schema_profile_binding, không patch P44-1.
P4 — profile_role
Enum logical extensible. Default vocab có 4 giá trị:
identity— profile mô tả các thuộc tính nhận diện object (vd title, owner, classification).content— profile mô tả nội dung object (vd body, hash, derived properties).publication— profile mô tả khía cạnh xuất bản/phân phối (vd authority, enacted_at, jurisdiction).custom— bất kỳ role nào khác do family declare.
⚠️ Note quan trọng:
publicationlà domain-specific (Đ38 text-as-code), KHÔNG universal cho mọi family. Family nhưdot_checker,vector_projection,specieskhông có khái niệm "publication". Family ngoài text-as-code mở role mới qua APR + amendprofile_rolevocab. 4 default trên không phải là mandatory cho mọi family.
profile_role không cấm 1 family có nhiều entry cùng role (vd information_unit_identity_v1 và information_unit_identity_v2 cùng role identity, khác version). Vocab có thể mở rộng qua APR + amend vocab.
P5 — schema_version
Semver string major.minor.patch:
- Major bump = breaking change (đổi required field, đổi kiểu field, xoá field cũ).
- Minor bump = backward-compatible (thêm optional field, thêm vocab value).
- Patch bump = clarify wording, không đổi schema thực.
Quy tắc: 1 entry = 1 version. Bump major → tạo entry mới (với
profile_codemới). Bump minor/patch → tạo entry mới với cùngprofile_codenhưngschema_versionkhác (xem INV-P5).
Defer chi tiết migration cho §4 + APR.
P6 — schema_definition
Cốt lõi của Profile Registry. Mô tả logical structure của profile schema:
- Field names + logical type (logical, không physical type).
- Constraints logical (vd "required cardinality 1..1", "format vocab ref").
- Mọi field phải justify "PG không tự biết" (NT11 + L3 §3.2) — không khai field PG có thể derive.
Storage format (JSONB / table riêng / mixed / khác) defer P44-5 / APR. P44-3 chỉ yêu cầu "structured logical schema definition".
Cấm Agent tự sáng tác (L3 §3.2): mọi field phải nằm trong
schema_definitionđã đăng ký. Free-form fields = cấm. Validation logic enforce (xem §3 + §4).
P7 — required_fields_set
Subset của field trong schema_definition đánh dấu required. Birth gate (Đ44 §9.4 + L3 §7.1) sẽ kiểm khi missing.
Enforcement mode: block / warn / escalate — do profile/family khai qua APR per profile. Block là default khuyến nghị cho family production mới, không phải luật cứng cho mọi controlled-draft case. Family khai khi đăng ký qua APR. Xem §3.2.
P8 — optional_fields_set
Subset của field trong schema_definition đánh dấu optional. DOT enrichment (Đ44 §9.1 + L3 §7.4) nhắc INFO khi missing, không block.
Constraint logical (INV-P4): mọi field trong schema_definition phải nằm ở đúng 1 trong: required_fields_set HOẶC optional_fields_set. Không được vắng cả 2.
P9 — g_groups_covered ⚡ — kết nối OPEN P44-2-ε
Logical set các G ∈ {G1..G12} mà profile này contribute. Liên kết Profile Registry → Đ44 §3.2 + SCMR.
Ví dụ logical:
information_unit_content_v1:g_groups_covered = {G6}.information_unit_identity_v1:g_groups_covered = {G1, G2}.dot_checker_metadata_v1:g_groups_covered = {G6, G11}.
Liên kết với SCMR: SCMR entry per-physical-table có g_mapping[G].fields = [...]. Profile contribute vào set field cho G được cover. Family aggregate conformance = union of g_groups_covered + SCMR g_mapping. Resolve chi tiết ở §5.
P10 — status
Lifecycle ≥ 2 state (thoả OQC-2). Default proposed. Transition:
proposed → activesau APR cấp medium.active → deprecatedkhi có version mới (quasupersedesedge).deprecated → retiredsau grace period (defer chốt sau).
P11 — Audit timestamps
NT11 + Đ44 G12 — PG tự suy ra. Agent KHÔNG khai.
2.3 Reinterpret P44-1 F5 cardinality — không patch tên
Khi soạn P44-3 §2.1 (per-profile entry), tôi quan sát: P44-1 F5 schema_profile_binding có wording cardinality 0..1 (1 family bind 1 profile schema). Nhưng pilot TAC cho information_unit cần 3 profile (identity/content/publication).
Cách giải (theo GPT review):
2.3.1 Reinterpret rộng, không patch P44-1 wording
schema_profile_binding là logical binding capability, không nhất thiết scalar field. Có thể hiểu:
- "Family có binding tới profile schema" — capability, không rep storage.
- Cardinality thực của binding ở tầng Profile Registry là 0..n (1 family map tới N profile entries).
- Field name P44-1 F5 giữ nguyên (singular
schema_profile_binding) — đại diện capability, không scalar.
→ Không patch P44-1 rev 1. P44-3 đứng trên reinterpret này để thiết kế Profile Registry per-profile entry.
2.3.2 Amendment candidate cho P44-1 (ghi nhận, chưa decide)
Để traceability + nếu sau này User muốn rõ ràng hơn:
Amendment candidate AC-44-1-A: Có thể amend P44-1 F5 wording để rõ cardinality 0..n và đổi tên thành
schema_profile_bindings(plural) hoặc giữ singular nhưng note rõ "capability binding cardinality 0..n" trong rationale F5. Status: candidate, chờ User chốt sau khi thấy P44-3 hoạt động trong thực tế. Không patch ngay.
2.4 Logical invariants
| ID | Invariant | Kiểm bằng |
|---|---|---|
| INV-P1 | profile_id unique |
DB constraint |
| INV-P2 | profile_code unique cho cùng major version, format {family_code}_{role}_v{major} |
Validation logic |
| INV-P3 | Mọi field name trong required_fields_set hoặc optional_fields_set phải tồn tại trong schema_definition |
Validation logic |
| INV-P4 | Mọi field trong schema_definition phải nằm ở đúng 1 trong: required_fields_set HOẶC optional_fields_set |
Validation logic |
| INV-P5 | 1 profile_code (ổn định qua minor/patch) chỉ có 1 entry với status = active tại 1 thời điểm. Có thể có nhiều entries deprecated. |
Lifecycle audit |
| INV-P6 | family_code phải tồn tại trong Family Registry |
FK |
| INV-P7 | Mọi G trong g_groups_covered phải ∈ {G1..G12} |
Validation logic |
| INV-P8 | Profile status = active ⇒ phải có ≥ 1 SCMR entry (thuộc family này) cover physical hoá fields |
DOT audit |
§3. Required vs Optional + cơ chế enforce
3.1 Phân loại
Theo L3 §5.2 + Đ44 §4.3:
| Loại | Định nghĩa | Birth path | DOT |
|---|---|---|---|
| Required profile field | Field bắt buộc, không thể thiếu khi tạo object thuộc family này | Enforcement mode khai qua APR (block/warn/escalate) — block là default khuyến nghị | — |
| Optional profile field | Field nên có nhưng không thiết yếu — enrichment | Không block | DOT daily nhắc INFO |
Phân loại = config data per family — chốt khi family đăng ký profile qua APR. Không phải doctrine cứng trong P44-3.
3.2 Required → Birth Gate (Đ44 §9.4 + L3 §7.1)
Hành vi logical
Khi INSERT object thuộc family F:
- Quét
required_fields_settrong các profile entries cóstatus = activecủa familyF. - Với mỗi field required, kiểm có giá trị hợp lệ trong INSERT payload.
- Missing → enforcement mode áp dụng — do family/profile khai qua APR.
Enforcement mode — không cứng default block
Block là default khuyến nghị cho family production mới, không phải luật cứng cho mọi controlled-draft case. Family khai enforcement mode qua APR per profile:
| Mode | Khi nên dùng |
|---|---|
| block | Production family với data quan trọng (vd information_unit text-as-code) — default khuyến nghị |
| warn | Pilot/migration phase, family đang ramp up, hoặc field mới thêm còn populate dở |
| escalate | Field critical nhưng có legacy data thiếu — log + escalate cho human review |
→ Family chọn mode phù hợp với maturity + nature. Không 1-size-fits-all.
Tích hợp với Đ44 §9.4 birth gate
Đ44 §9.4 yêu cầu birth gate kiểm 5 điều — mục 5 ("Required profile fields đầy đủ") = required_fields_set + enforcement mode từ Profile Registry.
Reuse Fix 27-28 pattern
L3 §10: "Reuse pattern proven, không copy nguyên trạng. Birth gate, config-driven, checksum, self-healing = lấy nguyên lý."
P44-3 KHÔNG thiết kế trigger/function chi tiết — đó là P44-5 + APR. Chỉ chốt logical contract.
3.3 Optional → DOT Enrichment (Đ44 §9.1 + L3 §7.4)
Hành vi logical
Định kỳ (DOT daily nhắc, schedule defer P44-5):
- Quét object thuộc family
Fcóstatusngoàidraft. - Kiểm
optional_fields_setcó giá trị không. - Missing optional → log INFO, không block.
Pattern
Đây là Optional Enrichment trong Đ44 §9.1 — tầng kiểm thứ 4. P44-3 chốt logical input; cơ chế DOT cụ thể defer P44-5.
3.4 Phân loại = config data per family (L3 §5.2)
L3 §5.2: "Phân loại required/optional cho từng profile field = config data, xác định khi đăng ký profile."
P44-3 KHÔNG chốt field nào required, field nào optional cho family cụ thể. Đó là config data per family — chốt:
- Khi family đăng ký profile qua APR (Đ32 cấp medium).
- Bằng entry trong Profile Registry với
required_fields_set+optional_fields_set+ enforcement mode đã khai.
§4. Profile schema versioning + evolution
4.1 Vì sao profile cần version
Profile schema phát triển theo thời gian: thêm field mới, sửa cách kiểm, đổi vocab. Không có version = không audit được, không migration được.
L3 không quy định version chi tiết. P44-3 thiết kế thêm pattern — phần mới của P44-3.
4.2 Lifecycle profile schema
proposed
│ APR cấp medium PASS
▼
active ───────────► deprecated ───────────► retired
│ (khi version mới active, (sau grace period, không
│ edge supersedes link) còn object dùng version cũ)
│
└─► (audit) → có thể quay lại proposed nếu cần re-design
| Transition | Trigger | Authority |
|---|---|---|
proposed → active |
APR cấp medium PASS | Đ32 |
active → deprecated |
Version mới của cùng profile_code (sau bump major) đạt active, edge supersedes link |
Đ32 + Đ44 §5.3.A |
deprecated → retired |
Grace period kết thúc + verify không còn object đang dùng | DOT audit + Đ32 |
proposed → (rút lui) |
APR REJECT hoặc đề xuất rút lui | Đ32 |
4.3 Bump version rules
| Thay đổi schema | Bump | Hệ quả |
|---|---|---|
| Thêm optional field | Minor (1.0.0 → 1.1.0) | Backward-compatible, entry mới với cùng profile_code |
| Thêm required field mới | Major (1.x.x → 2.0.0) | Breaking — cần migration cho data hiện hữu, entry mới với profile_code mới (v1 → v2) |
| Đổi kiểu field | Major | Breaking |
| Xoá field | Major | Breaking — migration plan + grace period |
| Đổi vocab value (vd thêm value mới vào enum) | Minor | Backward-compatible |
| Clarify wording, đổi description | Patch | Không đổi schema thực |
4.4 Migration — defer detail
Khi bump major version, data hiện hữu cần migration:
- P44-3 KHÔNG thiết kế migration script — defer APR design phase.
- P44-3 chỉ chốt invariant logical: bump major ⇒ phải có migration plan trong APR documentation.
OPEN P44-3-β: migration policy detail (grace period mặc định, fallback strategy, rollback) — defer P44-5 + APR.
§5. Resolve OPEN P44-2-ε — "G required theo family aggregate"
5.1 Phát biểu lại vấn đề
P44-2 §2.3 nói: "Required G được xét theo role của table + aggregate qua tất cả entries thuộc family."
Nhưng chưa chốt rõ:
- Family ở đâu khai required G của mình?
- Aggregate xét logic thế nào?
5.2 Resolution — logical contract need
5.2.1 required_g_set là logical contract need (amendment candidate cho P44-1)
Để resolve OPEN P44-2-ε, cần một logical contract giữa Family Registry ↔ Profile Registry:
Family declares its required G set somewhere.
Có 2 option logical:
- Option 1: Family Registry có thêm field
required_g_set(set các G family này required). - Option 2: Suy ra
required_g_settừ aggregateg_groups_coveredcủa các profile entries thuộc family + Đ44 §3.2 universal required (G1/G2/G3/G12).
Option 2 không cần thêm field vào Family Registry. Option 1 explicit hơn.
Amendment candidate AC-44-1-B: Thêm logical field
required_g_setcho Family Registry entry (Option 1) hoặc giữ nguyên P44-1 (Option 2 — suy ra từ profile entries). Status: candidate, chờ User chốt. Không patch P44-1 trong P44-3. P44-3 hoạt động được với cả 2 option.
5.2.2 Default required_g_set (Đ44 §3.2)
Mặc định mọi family required: G1, G2, G3, G12 (4 universal theo Đ44 §3.2 cardinality 1..1).
Family content-bearing có thể required thêm G6 (Content/Profile). Family khác có thể loại trừ một số G (vd relation_edge không có G3 lifecycle riêng).
OPEN P44-3-γ: cơ chế loại trừ G universal required — Đ44 §3.2 hiện cardinality 1..1 cứng cho G1/G2/G3/G12. Family có thể loại trừ không? Đ44 amend candidate, defer post-enacted.
5.2.3 Aggregate logic (resolve P44-2-ε)
Family F conformant cho G Gi nếu:
- Profile contribution: ∃ ít nhất 1 profile entry P thuộc family F với
Gi ∈ P.g_groups_coveredAND profile có required fields cho Gi đầy đủ. - HOẶC SCMR contribution: ∃ ít nhất 1 SCMR entry S thuộc family F với
Gi ∈ S.g_mappingANDgap_classification[Gi] ∈ {A, B, C}. - HOẶC mark N/A hợp lệ: ∃ rationale rõ trong family registration cho Gi N/A.
Family F fully conformant nếu thoả điều kiện trên cho mọi Gi ∈ required G set.
5.2.4 Ví dụ TAC family
Family information_unit đề xuất required: {G1, G2, G3, G6, G11, G12}.
Aggregate qua 4 SCMR entries (P44-2 §4) + 3 profile entries (P44-3 §6 sketch):
| Gi | Profile contribute | SCMR contribute (status) | Aggregate |
|---|---|---|---|
| G1 | identity_profile | LU/UV/Pub/Member: A | ✅ |
| G2 | identity_profile | LU/Pub/Member: A; UV inherit | ✅ |
| G3 | content_profile (lifecycle field) | LU/UV/Pub: A | ✅ (Member N/A hợp lệ) |
| G6 | content_profile | LU/UV/Pub: B (populate empty) | ⚠️ B aggregate |
| G11 | (none) | LU/UV/Pub/Member: D (drift checker thiếu) | ⚠️ D aggregate |
| G12 | (audit fields) | LU/UV/Pub/Member: B | ⚠️ B aggregate |
→ Family information_unit partial conformant. Match nhận xét P44-2 §4.2.
§6. Sketch non-binding cho information_unit profiles
⚠️⚠️⚠️ NON-BINDING SKETCH — KHÔNG PHẢI SPEC
Section §6 này là minh hoạ logical concept, KHÔNG chốt field list cuối, KHÔNG chốt enforcement mode, KHÔNG chốt format.
Không field nào trong §6 được coi là requirement cho đến khi P38-X PASS.
P38-X (deliverable thuộc Đ38, sau P44-3) sẽ chốt cuối qua APR. Cấm trích từ §6 như spec.
6.1 information_unit_identity_v1 — LU-level (sketch)
| Field logical (sketch) | Required/Optional (sketch) | Note |
|---|---|---|
title |
Required (sketch) | Tiêu đề unit, agent khai |
owner |
Required (sketch) | Owner khai khi tạo |
primary_section_type_ref |
Required (sketch) | FK section_type vocab |
aliases |
Optional (sketch) | List tên gọi khác |
summary_text |
Optional (sketch) | Tóm tắt ngắn cho display |
g_groups_covered (sketch): {G1, G2}.
6.2 information_unit_content_v1 — UV-level (sketch)
| Field logical (sketch) | Required/Optional (sketch) | Note |
|---|---|---|
body_hash_check |
Required (sketch) | Verify content_hash match body — derived/checked |
lifecycle_anchor_ref |
Required (sketch) | FK lifecycle_status vocab |
word_count_derived |
Optional (sketch) | PG derived (NT11) |
key_entities |
Optional (sketch) | Entity extraction (Đ39 KG) |
topics |
Optional (sketch) | Topic labels (LSL-01 Label layer) |
claim_extractions |
Optional (sketch) | Numeric claim extractions (Addendum §2.3) |
g_groups_covered (sketch): {G3, G6}.
6.3 information_unit_publication_v1 — Pub-level (sketch)
| Field logical (sketch) | Required/Optional (sketch) | Note |
|---|---|---|
publication_authority_ref |
Required (sketch) | FK normative_registry hoặc owner_agency |
publication_status_ref |
Required (sketch) | FK lifecycle_status |
enacted_at_or_proposed_at |
Required (sketch) | Timestamp khi enact / propose |
doc_chair |
Optional (sketch) | Người chủ trì xuất bản |
council_score |
Optional (sketch) | Score nếu có council review |
kb_anchor_ref |
Optional (sketch) | KB path link |
jurisdiction |
Optional (sketch) | Phạm vi áp dụng |
g_groups_covered (sketch): {G3, G4, G6}.
6.4 tac_publication_member — không có profile riêng
Member là relation row, không có content body. Theo P44-2 §4.1 Entry 4: G6 N/A. Member không cần profile entry riêng.
6.5 Cần ghi rõ cho P38-X
P38-X (sau P44-3 PASS) sẽ:
- Đăng ký 3 profile chính thức trong Profile Registry với field list cuối + enforcement mode + format.
- Chốt mapping field → physical column trong tac_logical_unit / tac_unit_version / tac_publication.
- Update P11A roadmap để populate
identity_profile,content_profile,publication_profileJSONB columns hiện đang{}.
→ P38-X = đầu vào của TAC profile populate pilot (P11A Top 3 Next Proofs §5 Proof 1).
§7. Cầu nối quay về Miếng thông tin
7.1 P44-3 PASS = đủ móng
Sau P44-3 PASS:
| Móng có | Cung cấp gì cho P38-X |
|---|---|
| P44-1 Family Registry | family_code information_unit, owner_law NRM-LAW-38, owner_agency TBD/unassigned, maturity M2 provisional |
| P44-2 SCMR | 4 SCMR entries cho 4 TAC tables (LU/UV/Pub/Member) với gap mapping rõ (G6 = B nhất quán) |
| P44-3 Profile Registry | Logical contract Profile Registry; required vs optional pattern; version + lifecycle; aggregate logic resolve OPEN P44-2-ε |
→ P38-X có đầy đủ móng để thiết kế:
- 3 profile entries cho
information_unit(identity / content / publication) với field list cuối + enforcement mode. - Migration plan cho TAC profile JSONB populate (gap B → A).
7.2 P38-X position trong roadmap
[P44-0 Folder] → [P44-1 Family Registry] → [P44-2 SCMR] → [P44-3 Profile Registry]
│
├─► [P38-X: Information Unit Profile/Schema]
│ (deliverable thuộc Đ38, không thuộc Đ44 folder)
│
└─► (P44-4 Edge + P44-5 Mechanism)
P38-X không thuộc folder dieu44-trien-khai/. Path đề xuất: knowledge/dev/laws/dieu38-trien-khai/p38-x-information-unit-profile-schema.md.
P38-X có thể bắt đầu sau P44-3 PASS, song song với P44-4 + P44-5.
7.3 Khác biệt P44-3 vs P38-X
| Tiêu chí | P44-3 | P38-X |
|---|---|---|
| Authority | Đ44 (cross-cutting schema law) | Đ38 (text-as-code chuyên môn) |
| Scope | Logical contract Profile Registry chung | Field list cuối cho information_unit family |
| Field list | Sketch non-binding minh hoạ (§6) | Chốt cuối qua APR |
| Output | Logical capability framework | Concrete proposal cho 1 family |
7.4 Sau P38-X
P38-X PASS → APR cấp medium → Profile Registry seed entries information_unit_identity_v1 + information_unit_content_v1 + information_unit_publication_v1 (sau Đ44 ENACTED).
Lúc đó các profile JSONB columns trong P11A bắt đầu populate, gap B → A.
§8. Meta-conformance hypothetical cho Profile Registry
8.1 Profile Registry tự nó có phải object-family không?
Có. Khi physical hoá thành 1 logical entity, Profile Registry là 1 family với family_code = 'profile_schema' (hoặc tên tương tự, chốt qua APR).
8.2 OQC check (Đ44 §2.2)
| OQC | Profile Registry thoả? | Lý do |
|---|---|---|
| OQC-1 Persistent Identity | ✅ | profile_id ổn định + immutable per version |
| OQC-2 Lifecycle ≥ 2 state | ✅ | P10 status 4 state |
| OQC-3 Governance Subject | ✅ | Đ44 quản (NRM-LAW-44), APR cấp medium duyệt amend |
| OQC-4 Has Relations | ✅ | FK → Family Registry; supersedes edge giữa version; governed_by edge tới Đ44 |
→ 4/4 OQC.
8.3 G1–G12 hypothetical mapping
⚠️ Hypothetical — full check khi physical hoá qua APR.
| G | Profile Registry có | Status |
|---|---|---|
| G1 Identity | P1 profile_id |
A |
| G2 Type & Family | self-reference: family_code = 'profile_schema' |
A |
| G3 Lifecycle | P10 status (4 state) + P5 schema_version |
A |
| G4 Owner & Authority | owner = Đ44 (Architecture Council) | A |
| G5 Source & Provenance | — | N/A |
| G6 Content/Profile | P6 schema_definition + P7/P8 + P9 g_groups_covered |
A (self-referential — Profile Registry chính nó có profile mô tả profile schema!) |
| G7 Relation | P3 → Family Registry; supersedes edges; governed_by edge |
A |
| G8 Usage | reverse: family bind tới profile entries | C |
| G9 BOM | — | N/A |
| G10 Vector Projection | — | N/A |
| G11 Checker/DOT | DOT cặp Profile Conformance Audit (đề xuất P44-5) | OPEN |
| G12 Timestamps & Audit | P11 | A |
Recursive note: Profile Registry chứa profile mô tả schema của chính Profile Registry (self-referential meta-profile). Pattern hợp lệ, đẹp về mặt design (consistent dogfooding).
Tổng: 7 A + 1 C + 1 OPEN + 3 N/A = 12 cells.
8.4 Bootstrap
Tương tự P44-1 / P44-2:
- Entry Profile Registry đầu tiên:
(profile_code = 'profile_schema_meta_v1', family_code = 'profile_schema', ...)— self-referential. - Insert qua init seed khi physical hoá. Defer APR.
§9. OPEN / Technical Debt + Amendment candidates
9.1 OPEN items P44-3
| ID | Item | Ảnh hưởng | Resolve khi |
|---|---|---|---|
| OPEN P44-3-β | Migration policy detail (grace period, fallback, rollback) khi bump major | Mỗi profile bump major chưa biết migration thế nào | P44-5 + APR |
| OPEN P44-3-γ | Cơ chế family loại trừ G universal required (Đ44 §3.2 cardinality 1..1) | Family như relation_edge có thể không có G3 lifecycle riêng |
Đ44 amend candidate, defer post-enacted |
| OPEN P44-3-δ | Default grace period cho deprecated → retired |
Lifecycle profile chưa định lượng | P44-5 + pilot |
9.2 Amendment candidates cho P44-1 (KHÔNG patch trong P44-3)
| ID | Candidate | Ảnh hưởng | Decide khi |
|---|---|---|---|
| AC-44-1-A | P44-1 F5 wording — clarify cardinality 0..n hoặc đổi tên thành schema_profile_bindings (plural) |
Hiện reinterpret rộng wording, hoạt động được | User chốt sau khi thấy P44-3 hoạt động |
| AC-44-1-B | Thêm logical field required_g_set cho Family Registry entry |
P44-3 hoạt động được với cả 2 option (Option 1 thêm field, Option 2 suy ra từ profile aggregate) | User chốt khi cần explicit |
Quan trọng: candidates này KHÔNG patch P44-1 rev 1. Chỉ ghi nhận để traceability + xử lý sau.
9.3 Technical Debt P44-3
| ID | Item | Ảnh hưởng | Resolve khi |
|---|---|---|---|
| TD P44-3-1 | Field list cuối cho information_unit profiles — sketch §6 chỉ minh hoạ |
P38-X cần làm | Sau P44-3 PASS, propose P38-X |
| TD P44-3-2 | Profile populate cho TAC JSONB (3 columns hiện {}) |
Gap B nhất quán cho G6 | P38-X + LSL-01 procedure + Đ39 extraction |
| TD P44-3-3 | Vocab profile_role extensibility — hiện đề xuất 4 default, có thể cần thêm cho family ngoài text-as-code |
Family vector_projection, dot_checker, ... có role nào? |
Per-family đăng ký + APR |
| TD P44-3-4 | Recursive meta-profile (Profile Registry chứa profile của chính nó) | G6 self-referential pattern cần thiết kế cẩn thận | P44-5 + APR design |
§10. Pre-conditions PASS + cầu nối tiếp
10.1 Để P44-3 PASS
| # | Pre-condition | Đã đạt? |
|---|---|---|
| 1 | 11 logical field tối thiểu định nghĩa rõ | ✅ (§2.1, §2.2) |
| 2 | Reinterpret P44-1 F5 cardinality 0..n + ghi amendment candidate (không patch) | ✅ (§2.3) |
| 3 | 8 logical invariants | ✅ (§2.4) |
| 4 | Required vs Optional + cơ chế enforce + wording mềm "block khuyến nghị" | ✅ (§3) |
| 5 | Profile schema versioning + lifecycle | ✅ (§4) |
| 6 | Resolve OPEN P44-2-ε bằng logical contract need (không patch P44-1) | ✅ (§5) |
| 7 | Sketch non-binding 3 profiles cho information_unit + cảnh báo mạnh |
✅ (§6) |
| 8 | Cầu nối P38-X rõ ràng | ✅ (§7) |
| 9 | Meta-conformance hypothetical (4/4 OQC + G1-G12) | ✅ (§8) |
| 10 | OPEN/TD/Amendment candidates ghi rõ ràng | ✅ (§9) |
| 11 | Không DDL, không code, không physical Profile Registry table name | ✅ |
| 12 | Không patch P44-1 rev 1 | ✅ |
| 13 | Không sa đà sang Edge / Mechanism / DOT cụ thể / migration script | ✅ (kiểm §1.2 ranh giới) |
| 14 | Không chốt field list cuối cho information_unit (§6 NON-BINDING SKETCH) |
✅ |
10.2 Cần User/GPT chốt (không block upload)
| # | Quyết định | Đề xuất Opus |
|---|---|---|
| Q1 | AC-44-1-A — P44-1 F5 wording amend | Defer User chốt sau khi thấy P44-3 hoạt động |
| Q2 | AC-44-1-B — required_g_set Option 1 (field) hay Option 2 (suy ra) |
Defer User chốt khi cần explicit |
| Q3 | Vocab profile_role default 4 + extensible (TD P44-3-3) |
PASS đề xuất |
| Q4 | OPEN P44-3-γ family loại trừ G universal required | Defer Đ44 amend |
| Q5 | OPEN P44-3-β migration policy default | Defer P44-5 + APR |
| Q6 | Path upload | knowledge/dev/laws/dieu44-trien-khai/design/03-profile-registry-design.md |
→ Không có quyết định nào block upload. P44-3 đứng được trên reinterpret rộng + amendment candidates.
10.3 Cầu nối tiếp
P44-3 PASS → có thể bắt đầu (User chọn thứ tự):
- P38-X — Information Unit Profile/Schema (thuộc Đ38, ngoài folder Đ44) — cầu nối thực tế quay về Miếng thông tin.
- P44-4 — Relation Edge Conformance Design (Đ44 folder) — resolve OPEN P44-2-δ + TD-44-2 + TD-44-3.
- P44-5 — Update Mechanism / Living DB Design (Đ44 folder) — tổng hợp DOT cặp + cơ chế update.
GPT đề xuất: P38-X trước sau P44-3A, vì đây là mục tiêu quay lại schema chuẩn cho Miếng thông tin.
§11. AP-CLOSE
11.1 Đã làm trong P44-3 (P44-3A polish)
- Định nghĩa logical contract khung Profile Registry: 11 field (P1-P11) + 8 invariant (INV-P1..8), không tên bảng vật lý, không DDL.
- Reinterpret P44-1 F5 cardinality 0..n (capability binding), giữ tên field singular — không patch P44-1.
- Required vs Optional phân loại + enforcement mode mềm (block là khuyến nghị production, không luật cứng) — birth gate (Đ44 §9.4) + DOT enrichment (Đ44 §9.1).
- Profile schema versioning (semver) + lifecycle (4 status) + bump rules.
- Resolve OPEN P44-2-ε bằng logical contract need (
required_g_setlà amendment candidate AC-44-1-B, không patch P44-1). - Sketch non-binding 3 profiles cho
information_unitvới cảnh báo mạnh "không là spec". - Cầu nối rõ tới P38-X.
- Meta-conformance hypothetical: 4/4 OQC + G1-G12 (7 A + 1 C + 1 OPEN + 3 N/A).
- Liệt kê 3 OPEN + 4 TD + 2 amendment candidates cho P44-1.
profile_rolevocab note:publicationdomain-specific, không universal.
11.2 Chưa làm (cố tình)
- ❌ Không patch P44-1 rev 1 (F5 cardinality,
required_g_set) — chỉ ghi amendment candidates. - ❌ Không chốt field list cuối cho
information_unitprofiles (P38-X scope). - ❌ Không thiết kế Family Registry / SCMR / Edge / Mechanism.
- ❌ Không DDL, code, mutate production, physical Profile Registry table name.
- ❌ Không tạo decision log.
- ❌ Không sang P44-4 / P44-5 / P38-X.
11.3 P44-3 KHÔNG CHỐT (kỷ luật scope — ghi rõ)
| # | Không chốt | Defer đến |
|---|---|---|
| (i) | Storage format cho schema_definition, required_fields_set, optional_fields_set, g_groups_covered |
P44-5 / APR |
| (ii) | Field list cuối cho information_unit 3 profiles |
P38-X |
| (iii) | Migration script khi bump major version + grace period detail | P44-5 / APR |
| (iv) | DOT cặp tên cụ thể cho Profile Conformance Audit + birth gate trigger code | P44-5 |
| (v) | Patch P44-1 F5 wording / thêm required_g_set cho Family Registry |
User chốt sau (AC-44-1-A, AC-44-1-B) |
11.4 Sau khi upload
- Upload P44-3A vào
knowledge/dev/laws/dieu44-trien-khai/design/03-profile-registry-design.md. ← đã upload - Không tạo decision log nào.
- Không sửa P44-1 rev 1.
- Dừng P44-3.
- Hỏi User chọn bước tiếp:
- P38-X (cầu nối Miếng thông tin, thuộc Đ38) — GPT nghiêng cách này.
- P44-4 (Edge Conformance, thuộc Đ44 folder).
- P44-5 (Update Mechanism, thuộc Đ44 folder).
P44-3 — P44-3A polish | S190 (2026-05-01) | Soạn: Opus 4.7 | Polish: 6 sửa theo GPT review (1) reinterpret F5 cardinality 0..n không patch tên, (2) Q1 không block, (3) profile_role note publication domain-specific, (4) enforcement mềm "block khuyến nghị", (5) required_g_set logical contract need không patch P44-1, (6) §6 cảnh báo mạnh không là spec | Authority: Đ44 v0.1.2 controlled DRAFT (chưa cưỡng chế) | Phụ thuộc: P44-0 README rev 1, P44-1 rev 1, P44-2 rev 1 | Trạng thái: uploaded