KB-111E

Điều 38 v3.0 SQL Hóa Văn Bản (Text-as-Code) — Amendment DRAFT (non-enacting): preserve 3 MT/Text-as-Code/IU-Smart-Brick/LSL-01, block DOT-100% auto-output-regen + auto-rewrite + auto-SQL + auto-schema before checker+Owner — 2026-06-17

24 min read Revision 1
laws-newnewlawsamendmentdraftnon-enactingdieu38text-as-codesql-hoa-van-bandot-100auto-output-regenauto-rewritescanner-list-onlyinformation-unitlsl-01render-at-promoteowner-gatecons-002cons-003cellread-onlynon-authorizing2026-06-17workstream-b2

Điều 38 v3.0 — Luật SQL Hóa Văn Bản (Text as Code) — Amendment DRAFT

DRAFT · NON-ENACTING · READ-ONLY · NON-AUTHORIZING. 2026-06-17, rev1. Law Revision Workstream B2. This is a draft amendment, not an enacted law. It is not adopted, not in force, and does not change laws/dieu38-normative-document-law.md. It is review material for GPT → Codex → Owner. Codex/GPT PASS ≠ Owner authorization. Engineering PASS / DOT-scan PASS ≠ authority PASS. Target law: Điều 38 — Luật SQL Hóa Văn Bản v3.0 (S168) (knowledge/dev/laws/dieu38-normative-document-law.md, rev2). The target is itself a DRAFT — chờ Huyền duyệt (rewritten from v2.3; MT approved in principle, GP still being detailed). This amendment preserves the 3 MT goals / direction and reframes only its unsafe rollout mechanisms; it does not enact or adopt Điều 38 v3.0. Companions (read together): Điều 38 — Phụ lục 01 (Objectives) dieu38-appendix-01-objectives.md (BAN HÀNH, KEEP+NOTE) and its compatibility note; LSL-01 Information-Unit-First v0.3 (Council PASS) dieu38-trien-khai/LSL-01-information-unit-first.md. Catalog disposition: Law Merge catalog record #6 = AMEND ("Keep 3 MT goals; constrain 'DOT 100%' / auto-output-regen to scanner+checker+render-at-promote") → LAW_READING_INDEX.md §3.3 = READ_NEW_AMENDED_VERSION_PENDING. This document is that pending amended version, in draft form only. Model: F0→F5/FX. The scanner is list-only (FX/D11); any text/output/status/schema mutation flows through checker (F4) + Owner / Mức 3 / Điều 32; output is rendered at promote from approved data, never auto-published.


0. Boundary & non-authorization (read first)

  • This draft preserves Điều 38 v3.0's 3 MT goals (data-ize non-SQL content / manage with PG; auto-generate output documents; manage the whole lifecycle) and the Text → Code → Workflow → Knowledge direction. It preserves the Information Unit / Smart Brick / relationship-intelligent direction and the LSL-01 Information-Unit-first principles where compatible. It only reframes the unsafe rollout mechanisms: "DOT 100%" read as auto-everything, auto-regeneration of output documents, auto-fix, auto-rewrite of legal text, and auto-creation of SQL output / schema / registry from a scanner.
  • It does not enact, adopt, or put any clause in force. It does not edit, move, or delete laws/dieu38-normative-document-law.md, the Phụ lục 01, or any enacted law. It does not patch the Constitution.
  • It performs no technical design, no Phase-1, no live DB/runtime query, no implementation. It materializes nothing: no schema/table/registry/index, no cell_id / dot_role / canonical_fields, no SSOT Catalog / Component Registry as a live system.
  • It does not resolve CONS-002/003/004/005, CELL-003/004/007, HOLD-1, HOLD-2, RISK-BYPASS/GC/CAP; it does not change the authority order or the v0.1-stable / FIX7 V3 baseline.
  • Default disposition until the Owner acts: HOLD.

1. Preserved goals (what stays — DO NOT weaken)

Điều 38 v3.0's three objectives and the Text-as-Code direction are kept. The amendment changes what "100%/auto" means and how an output/text/status/schema mutation is authorized — never the goal of structuring text as data, generating output, or managing lifecycle.

Preserved from v3.0 (and companions) Clause Status under this draft
MT1 — Data-ize non-SQL content, manage with PG (each segment = data with metadata/status/relations, queryable/indexable/triggerable) MT1 KEEP
MT1 DOT/AI split: DOT understands the "phần cứng" (numbers/status/deadlines/binding); AI understands the "phần mềm" (semantics/logic) — "AI rà soát và suggest, con người duyệt" MT1 (2)(3) KEEP — strengthen (AI proposes, human approves)
MT2 — Auto-generate output documents from PG data + registered templates (Carbone/docxtemplater → PDF/DOCX) MT2, §E KEEP the goal; reframe to render-at-promote under approval (see §3 A3)
MT3 — Infrastructure for the whole lifecycle (draft → duyệt → ban hành → hết hiệu lực) MT3 KEEP
A3 — Integrity protection (REJECT edit-enacted → force new version; SHA256 tamper-detect; 2 VB same article_number both enacted → REJECT; enact-without-approval → REJECT trigger checks APR) §A3 KEEP — strengthen (these reject, they enforce; they do not auto-mutate — fully aligned with the new model)
Semantic Annotation as the main output (each VB ships a DOT-readable "translation"; DOT compares VB ↔ PG, no AI, no token) Ghi chú S169 KEEP as the detect/compare (list-only) mechanism
Text → Code → Workflow → Knowledge value chain; "Luật là pilot — không phải đích"; design once, serve all document types Phụ lục 01 KEEP
Information-Unit / Smart Brick = the addressable, versionable unit is the SSOT subject; file/vector = projection (LSL-01 NT15 §5) Phụ lục 01 MT1; LSL-01 §5–§9 KEEP — align (unit-centric; PG unit_version = authoritative; vector/file = projection)
Reuse-first decision (reuse → config → variant → new) and relationship-intelligence (pushes toward Đ39) Phụ lục 01 MT0C; LSL-01 §8.4, §17 KEEP (reuse-first; Đ39 stays runtime-EMPTY)
"Text as Code ≠ text sinh code tự do" (GR1); enacted publications not auto-re-segmented; structural change → change-set + APR (Đ32) Phụ lục 01 GR1; LSL-01 §10.3 KEEP — strengthen (see §3 A4)

The law's own boundaries already point the right way: Phụ lục 01 states "Text as Code ≠ text sinh code tự do" (GR1), and LSL-01 §10.3 requires every structural change to an enacted publication to pass change-set + APR (Đ32) and §10.2 makes law/policy/constitution propose-only (need approval). This amendment makes the v3.0 draft's "DOT 100% / auto" language consistent with those boundaries.


2. Unsafe rollout mechanisms identified (verbatim, with clause)

These are the behaviors that mutate text / output / status / schema directly from a scanner or trigger without a checker + Owner gate — i.e. read "DOT 100% / auto" as auto-everything. They are the reason Điều 38 v3.0 is AMEND.

# Mechanism Clause Why unsafe under F0→F5/FX
U1 "DOT tự động 100%" read as auto-everything: "DOT tự so sánh chính xác, phát hiện chênh lệch, tự động 100%" MT1 (2) "100%" is the automatable comparison/detection; read as 100% auto-application of fixes/outputs it becomes auto-mutation from a scanner.
U2 MT3 vision — auto-fix + auto-regeneration: "DOT phát hiện chênh lệch → Agent sửa hoặc cảnh báo → Văn bản đầu ra tự sinh đúng theo chính sách mới. Con người chỉ duyệt." MT3 Agent auto-fixes and output auto-regenerates from a policy change, with humans only rubber-stamping after the fact — no checker/Owner gate before the mutation.
U3 Auto-generate / auto-render output as an unguarded act: "tất cả được sinh từ PG data + biểu mẫu… render PDF/DOCX" MT2, §E Rendering is fine; auto-publishing generated legal/contract output without a promote/approval gate is not.
U4 B2.1 auto-retire superseded: "PG trigger tự kiểm… UPDATE status = 'retired' cho predecessor… result = 'auto_retired'" §B2.1 A PG trigger auto-mutates the lifecycle status of an enacted normative document — a high-stakes governance act — from a trigger, not a gated decision.
U5 C — auto-reclassify/relabel by collection: "vào chuồng nào → tự động dán nhãn… Thay đổi phân loại → DOT phát hiện → cập nhật" §C "cập nhật" read as auto-reclassify is a classification mutation from a scanner (couples to Điều 36 U2/U3).
U6 "Text as Code" misread as auto text-to-code / auto-rewrite of legal text MT1, value chain Reading Text-as-Code as LLM auto-rewriting/regenerating legal text contradicts GR1 and LSL-01 §10.3 (enacted text immutable; change via change-set + Đ32).
U7 Auto-create SQL output / schema / table / registry (Đ38 "mới deploy schema vỏ"; binding/publication/unit tables) MT1, A1/A2; Phụ lục 01 V12 Creating tables/registries/binding schema automatically is the Điều 33 auto-DDL path; must run the design chain.

3. Amendment logic (clause-by-clause reframe)

Single principle: the mechanical/"hard" part of a document may be detected, compared, listed, and proposed automatically (DOT 100% = 100% automatable detection, no AI); a text rewrite, output regeneration, status change, classification change, or schema change may not run from a scanner/trigger. Every such mutation flows through the checker (F4) + Owner / Mức 3 / Điều 32; output is rendered at promote from approved data. This mirrors the Điều 22 draft (no auto-fix; proposal-only) and the Điều 33 draft (no auto-DDL / schema-auto-change), and aligns with LSL-01 §10.2/§10.3 (law/policy = propose-only; structural change = change-set + Đ32).

A1 — "DOT 100%" scoped to detect/compare/list, never auto-mutate (reframe U1). Clarify MT1: the "phần cứng" (hard part) — numbers, status, deadlines, binding — is 100% automatable to compare and detect (no AI, no token; this is the Semantic-Annotation list-only mechanism). "DOT tự động 100%" means 100% of the detection/comparison is automatable, not 100% automatic application of a fix or output. The scanner is list-only (FX/D11): it detects a discrepancy and proposes; it does not heal.

A2 — MT3 vision reframed: detect → propose → checker → render-at-promote (reframe U2). Reframe the MT3 pipeline: policy change → PG update (via legal write path) → DOT detects discrepancy + proposes → Agent/AI proposes a fix (it does not auto-fix) → output is rendered at promote under the checker (F4) + Owner / Mức 3 / Điều 32. "Con người chỉ duyệt" is preserved as human approval before the mutation, not as a rubber stamp after auto-application. No Agent auto-fix; no auto-regeneration of output ahead of the gate. (Aligned with Điều 22 draft: a finding is detected/listed/proposed automatically; a mutation is not run from the scanner.)

A3 — Output generation = render-at-promote (reframe U3). Keep MT2/§E's goal (generate contracts/notices/forms from PG data + templates). Reframe: output documents are a deterministic render (projection) of approved PG data, produced at promote through the checker + Điều 32 gate; rendering is not an authorization to auto-publish. "Đã ký = bất biến" is preserved as an approval/authority act (signing is a human authorization, after which the artifact is immutable) — not an automatic event. PG = SSOT; every output = render view (Phụ lục 01 MT14), rendered under approval.

A4 — No automatic rewrite of legal text; enacted text immutable (reframe U6). State explicitly: there is no automatic rewrite of legal/normative text. Enacted normative text is immutable; any structural or textual change goes through a versioned change-set + APR (Đ32) (LSL-01 §10.3: enacted publications are not auto-re-segmented; split/merge/parent/section-type change → change-set + APR). "Text as Code" means the mechanical/enforceable part is structured + bound + mapped to code/config with controlnot an LLM regenerating the text (Phụ lục 01 GR1). The A3 integrity guards are kept (REJECT edit-enacted, SHA256 tamper-detect, dup-enacted REJECT, enact-without-APR REJECT): they enforce existing rules and reject; they do not auto-mutate, so they are fully compatible.

A5 — Auto-retire of an enacted document → detect + propose (reframe U4). Reframe §B2.1: retiring an enacted normative document is a high-stakes status mutation, not trigger bookkeeping. By default it is proposal-only: the trigger may detect that a predecessor is superseded and propose the retire (DOT_NRM_ENACT writes the proposed action / audit, not an auto_retired mutation); the actual status='retired' of an enacted VB runs through Điều 32. (Same shape as the Điều 22 draft's auto-close reframe.) Retaining auto-retire as pure lifecycle bookkeeping — bounded, no downstream governed mutation, never asserting the underlying policy changed — is a separate Owner decision; until then, treat auto-retire as default off.

A6 — Classification/relabel by collection → detect + propose (reframe U5). Reframe §C: labeling/classification by collection may be detected and proposed; it is not auto-reclassified from a scanner. This aligns with the Điều 36 amendment draft (no scanner auto-classify; classification change runs design + checker + Điều 32) and the Điều 22 draft (scanner list-only).

A7 — No automatic schema / table / registry creation (reframe U7). State: any Điều 38 schema (text-unit / publication / binding / annotation tables, SSOT Catalog, Component Registry) is created only through the Điều 33 design chain — design-before-execution (NT15/Đ20) → checker (F4) → Điều 32 → Điều 30 regression. No auto-DDL, no auto-create of tables/registries/indexes from a scanner or from "deploying schema vỏ." (Điều 33 amendment draft A1/A3/A7.)

A8 — Information-Unit-first alignment (LSL-01), where compatible (preserve + align). Align with LSL-01 where compatible: the miếng thông tin / unit (unit_version) is the SSOT subject; file / KB markdown / document envelope / Qdrant vector = projection, never the source of truth (LSL-01 §5 NT15, §9.2/§9.4 "PG thắng"). Reuse-first content across publications (§8.4) and relationship-intelligence (§17, pushes toward Đ39) are preserved. Risk-tiered finalization (LSL-01 §10.2): constitution/law/policy = propose-only, need approval (Council/Owner); only low-risk draft/memo/knowledge may be agent-finalized through the legal write path + birth gate + audit, never bypassing governance. Owner cannot self-downgrade a high/highest-risk publication's tier (anti-bypass). Vector chunking = projection, not segmentation (§9.2).

A9 — MT0A / MT0B are reference material, not live auto-authority (reframe; Phụ lục 01). MT0A SSOT Catalog and MT0B Component Registry (from the enacted Phụ lục 01 objectives) are reference-only Module-Contract-First, not the live IO contract and not a central system to auto-build now. The live IO contract is the thin 5-field one; which source wins is CONS-002 (open). Do not auto-build SSOT Catalog / Component Registry, and do not treat MT0A/MT0B as the live contract, while CONS-002 is open. (Điều 38 Appendix-01 compatibility note.)

A10 — Authority statement (new clause). Add: "DOT/AI phát hiện và đề xuất; chỉ Owner (hoặc Điều 32 được uỷ quyền) cho phép sửa text / sinh output / đổi status / đổi schema. Scanner xanh / DOT so khớp 100% = bằng chứng, không phải uỷ quyền. Engineering / DOT-scan PASS ≠ authority PASS. AI đề xuất không tự ban hành tri thức/văn bản chuẩn (Đ39-aligned)."


4. Proposed amended wording (DRAFT — not enacted)

Draft recommended wording for a future, Owner-gated amended Điều 38 v3.0. Not enacted, not in force. Final wording decided later under Owner gate, in newlaws/. (Điều 38 v3.0 is itself a DRAFT chờ Huyền duyệt; this wording adjusts its direction, it does not enact it.)

MT1 (reframed) — DOT 100% = phát hiện, không phải tự sửa. "Phần cứng (số/status/deadline/binding): DOT so sánh + phát hiện tự động 100% (không AI, không token) — đây là cơ chế Semantic Annotation list-only. '100%' = 100% phát hiện tự động hoá được, không phải 100% tự áp fix/output. AI phần mềm: đề xuất, con người duyệt."

MT3 (reframed) — Pipeline detect → propose → checker → render-at-promote. "Chính sách đổi → PG cập nhật (write path hợp pháp) → DOT phát hiện chênh lệch + đề xuất → Agent/AI đề xuất fix (không tự sửa) → output render tại promote qua checker (F4) + Owner / Mức 3 / Điều 32. 'Con người duyệt' = duyệt trước mutation, không phải đóng dấu sau khi đã tự sinh."

MT2 / §E (reframed) — Render-at-promote. "Output (hợp đồng/thông báo/giấy tờ) = render xác định từ data PG đã duyệt, sinh tại promote qua checker + Điều 32. Render không uỷ quyền auto-publish. 'Đã ký = bất biến' = hành vi phê duyệt/uỷ quyền của con người, không tự động."

§A3 (kept + clarified) — Bảo vệ toàn vẹn. "Giữ nguyên: REJECT sửa-VB-enacted (ép version mới); SHA256 phát hiện sửa lén; 2 VB cùng article_number đều enacted → REJECT; ban hành không qua duyệt → REJECT (trigger kiểm APR). Đây là enforce + reject, không auto-mutate — tương thích mô hình mới."

§B2.1 (reframed) — Auto-retire. "Retire một VB enacted = mutation status cao rủi ro → mặc định đề xuất-only: trigger phát hiện predecessor superseded và đề xuất retire (DOT_NRM_ENACT ghi proposed action/audit, không auto_retired). Retire thật chạy qua Điều 32. Giữ auto-retire như bookkeeping thuần (bounded, không kéo mutation governed) = quyết định Owner riêng; tới đó mặc định off."

§C (reframed) — Khoanh vùng / dán nhãn. "Phân loại theo chuồng = phát hiện + đề xuất, không auto-reclassify từ scanner. Đổi phân loại chạy design + checker + Điều 32 (đồng bộ Điều 36)."

New §F — Không auto-rewrite, không auto-schema, không tự uỷ quyền. "Không tự rewrite text pháp lý: text enacted bất biến; đổi cấu trúc/text = change-set + APR (Đ32) (LSL-01 §10.3). Không auto-tạo SQL output / schema / table / registry — qua Điều 33 design chain (không auto-DDL). Miếng thông tin (unit_version) = SSOT; file/vector = projection. MT0A/MT0B = tham khảo, không phải contract live (CONS-002 mở). Điều 38 không tự uỷ quyền Phase-1/technical design. DOT/scan PASS ≠ authority PASS."


5. Mapping to F0→F5/FX

Điều 38 v3.0 element F0→F5/FX placement
MT1 atomize + metadata; Information Unit / Smart Brick D4 (Information Unit / Smart Brick) — unit = subject; PG unit_version authoritative; vector/file = projection
DOT "phần cứng" compare; Semantic Annotation; daily binding check (§D) Scanner / Observability (FX · D11) — list-only, detect + propose, no auto-fix
AI "phần mềm" review (semantics/logic) Propose → human approves (Điều 32); never auto-enact knowledge/text (Đ39-aligned)
MT2/§E output generation Render-at-promote from approved data via checker (F4) + Điều 32
§A3 integrity guards (REJECT/hash) PG enforcement (kept) — reject, not auto-mutate
§B2.1 auto-retire; §C reclassify Approval (Điều 32) proposed actions — propose-only by default
Text-as-Code / "phần enforceable → code/config" Mapped under control (GR1); enacted text immutable; change-set + Đ32 (LSL-01 §10.3)
Schema (unit/publication/binding tables), SSOT Catalog, Component Registry Deferred / design-gated — Điều 33 design chain; CONS-002 (thin 5-field vs MT0A/MT0B); no auto-DDL
Đ39 KG (consumer of Đ38 output / Semantic Annotation) Direction preserved; Đ39 runtime-EMPTY (enacted ≠ live)

Consistent with the bad-readings the index already rejects (LAW_READING_INDEX.md §4): scanner is list-only / no auto-fix (#7); Đ39 enacted ≠ live (#5); registered ≠ executed ≠ live (#6); newlaws/ does not auto-replace laws/ (#11).


6. Held blockers carried (not resolved here)

  • CONS-002 (BLOCKER) — IO Contract field-set: thin 5-field vs Module-Contract-First (MT0A/MT0B SSOT Catalog / Component Registry); blocks IO_STAMP and the contract decision. Carried; this draft treats MT0A/MT0B as reference-only.
  • CONS-003 — 6 Lớp (Đ0-B) vs 7 dimension (Constitution/Đ29); relevant where Đ38 labels by collection/species (§C) and via NĐ-36-01. Carried; no classification proceeds as if settled.
  • CELL-003 / 004 / 007 — the canonical species × collection cell is unmaterialized; relevant to §C classification and to "đúng chuồng" labeling. Carried; no cell_id materialized.
  • Đ39 runtime-EMPTY — Đ38's downstream consumer (KG) is enacted but runtime-empty (0 DOT exec / 0 KG events; owner unregistered). Carried; no Đ39 build authorized.
  • HOLD-1iu_staging_* temp store is documentary, Phase-1-gated; relevant to the unit/candidate substrate. Carried.
  • RISK-BYPASS — runtime governance bypass (fn_auto_approve_add). Carried; this draft reinforces "AI proposes, Owner approves" but does not close it.
  • Coverage-scanner BUILD-NO-GO — the MT14-style dashboard / dot_governance_coverage_* is design-only, absent live. Carried.
  • Engineering / DOT-scan PASS ≠ authority PASS — restated, not a runtime proof.

7. Bad readings this draft explicitly REJECTS

  1. "This draft is adopted / Điều 38 v3.0 is now amended (or enacted)." FALSE — non-enacting draft; laws/dieu38-normative-document-law.md is unchanged and remains a DRAFT chờ Huyền duyệt.
  2. "DOT 100% means DOT can auto-regenerate outputs / auto-fix discrepancies." FALSE — "100%" is 100% automatable detection/comparison; mutation/regeneration is proposal-only through checker + Điều 32; output is render-at-promote.
  3. "Text as Code means the system can auto-rewrite legal text." FALSE — enacted text is immutable; structural/text change goes through a versioned change-set + APR (Đ32); Text-as-Code ≠ free text-to-code (GR1).
  4. "Điều 38 authorizes auto-creating schema / tables / registries (SSOT Catalog, Component Registry, binding tables)." FALSE — those run the Điều 33 design chain; no auto-DDL; MT0A/MT0B are reference-only while CONS-002 is open.
  5. "The auto-retire trigger may auto-retire an enacted document." FALSE — retiring an enacted VB is a status mutation; default proposal-only; the retire runs through Điều 32.
  6. "DOT may auto-reclassify documents by collection." FALSE — classification is detect + propose; reclassify runs design + checker + Điều 32 (aligned with Điều 36).
  7. "CONS-002 / CONS-003 / CELL are resolved." FALSE — all carried; the contract (CONS-002) and the 6-vs-7 (CONS-003) and the cell (CELL) remain open.
  8. "Điều 38 authorizes Phase-1 / technical design / live query / implementation." FALSE — Điều 38 does not self-authorize any of these; the Owner opens a phase. DOT-scan PASS ≠ authority PASS.
  9. "The 3 MT goals / Text-as-Code / Information-Unit / LSL-01 direction are being weakened." FALSE — they are preserved and aligned; only "DOT 100% = auto-everything," auto-output-regen, auto-fix, auto-rewrite, and auto-schema are reframed.

8. Non-authorization checklist

  • no adopted/enacted amendment: confirmed (DRAFT only) · no rewrite: confirmed · no technical design: confirmed · no Phase-1: confirmed · no DB/runtime query: confirmed · no implementation/schema/table/registry/index: confirmed · no auto-output regeneration / auto-fix / auto-rewrite of text: confirmed · no auto-DDL / schema-auto-create: confirmed · no cell_id / dot_role / canonical_fields materialization: confirmed · no SSOT-Catalog / Component-Registry build: confirmed · no authority-order change: confirmed · no edit/move/delete under knowledge/dev/laws/: confirmed · no Constitution patch: confirmed · no resolution of CONS-002/003 / CELL / HOLD / RISK: confirmed · no change to v0.1-stable / FIX7 V3 baseline: confirmed · no v0.2-hardening promotion: confirmed.
  • Codex/GPT PASS ≠ Owner authorization. Default disposition: HOLD.

Điều 38 v3.0 amendment DRAFT rev1 | 2026-06-17 | non-enacting | preserve 3 MT / Text-as-Code / Information-Unit / LSL-01 (where compatible) · "DOT 100%" = detect-only, no auto-output-regen / no auto-fix / no auto-rewrite / no auto-schema · output render-at-promote via checker + Owner/Mức 3/Điều 32 · carry CONS-002/003 + CELL | read-only · non-authorizing

Back to Knowledge Hub knowledge/dev/laws-new/newlaws/amendments/dieu38-normative-document-law-v3-amendment-draft.md