KB-7310

P10B-2C — Điều 28 Execute Report (FAIL — birth-gate BG-UV-02 blocker)

8 min read Revision 1
dieu38p10b-2cexecuteFAILbirth-gateBG-UV-02

title: P10B-2C — Điều 28 Execute Report date: 2026-04-29 phase: P10B-2C spec_version: v0.2 verdict: FAIL blocker: BG-UV-02 birth-gate (description required) state_change: NONE (transaction auto-rolled back; baseline preserved)

P10B-2C — Điều 28 v2.0 Execute Report

Verdict: FAIL — INSERT package incompatible with current birth-gate (added 2026-04-22, post-package-generation). Transaction auto-rolled back via ON_ERROR_STOP=1. Database state unchanged from baseline. STOPPED before T5 (render); diff/tree skipped because no rows to render.


§1 — Preflight (T1)

Check Result
1a DB+role directus / directus
1b Schema (4 tables) tac_publication=15c, tac_logical_unit=13c, tac_unit_version=20c, tac_publication_member=6c ✅
1c Triggers 6 triggers ENABLED on 4 tables (compute_derived, birth_gate_lu, birth_gate_uv, enacted_immut, pm_consistency, pm_enacted_lock) ✅
1d Collision pub=0, lu=0 ✅
1e SHA × 5 files all match P10B-2B ✅
1f Source SHA fa5ed5c1…3277d7b matches knowledge/dev/laws/dieu28-display-technology-law.md (9289 bytes raw) ✅
1g Baseline captured (see §2) ✅

§1 verdict: PASS.

§2 — Pre-insert baseline counts

 tac_publication        |     2
 tac_logical_unit       |    59
 tac_unit_version       |    59
 tac_publication_member |    59

(Backup dir /opt/incomex/data/backups/ does NOT exist — warning logged. Baseline counts are the required evidence.)

§3 — Run-file (T2)

Source /tmp/p10b-2b/insert-candidate.sql (SHA 767450fd…0627489b — unchanged after copy)
Run-file /tmp/p10b-2c/d28-insert-run.sql (SHA adc31510 2c70917e1113faa0b83eddc4b01a8a25819db74e3c6bf9361fd4222e)
Edit last -- COMMIT; line uncommented to COMMIT;
Verification ^COMMIT; count=1, ^ROLLBACK; count=0, last non-comment statement = COMMIT;

§4 — Execute (T3) — FAIL

docker exec -i postgres psql -U directus -d directus -v ON_ERROR_STOP=1 -X \
  < /tmp/p10b-2c/d28-insert-run.sql

Output:

BEGIN
INSERT 0 1   ← tac_publication
INSERT 0 1   ← tac_logical_unit × 27 (28 successful INSERTs total)
... (27 LU rows)
ERROR:  BG-UV-02: description required cho section_type paragraph
CONTEXT:  PL/pgSQL function fn_tac_birth_gate_uv() line 31 at RAISE

Failure point: first INSERT INTO tac_unit_version (run-file line 45, ROOT row title=ĐIỀU 28: LUẬT KỸ THUẬT HIỂN THỊ — v2.0 BAN HÀNH).

Wait — ROOT is section_type=heading which has description_required=false. The trigger fires per-row; the 27 LU INSERTs all succeeded; the ERROR is on the first UV INSERT whose section_type requires description. Actually the error message says paragraph. Inspecting the run-file UV order: row 1 ROOT (heading, no desc required) likely passed; row 2 S0 Preamble is paragraph (description_required=true, body present). The UV INSERT does not populate description at all — column omitted from INSERT list — so trigger fires BG-UV-02.

Run psql under ON_ERROR_STOP=1 aborted the transaction at the first error. Transaction rolled back automatically by psql (no manual ROLLBACK needed).

No pub_id obtained. No rows persisted.

§5 — Post-failure state verify

 tac_publication        |     2     (unchanged)
 tac_logical_unit       |    59     (unchanged)
 tac_unit_version       |    59     (unchanged)
 tac_publication_member |    59     (unchanged)

State identical to baseline. Auto-rollback successful.

SELECT count(*) FROM tac_publication WHERE doc_code='DIEU-28' AND version='v2.0';  -- 0
SELECT count(*) FROM tac_logical_unit WHERE canonical_address LIKE 'D38-DIEU28-%'; -- 0

§6 — Root cause analysis

Birth-gate BG-UV-02 was added 2026-04-22 (S178 Fix 28 — description governance + birth gate upgrade). The Đ28 v2.0 candidate package (P10B-2A → P10B-2B) was generated to schema without considering description-required enforcement. Function fn_tac_birth_gate_uv lines 27–35:

IF v_desc_required AND (NEW.description IS NULL OR length(btrim(NEW.description))=0) THEN
    IF v_bg_uv_02_mode = 'block' THEN
        RAISE EXCEPTION 'BG-UV-02: description required cho section_type %', v_section_type

Vocab tac_section_type_vocab description_required=true for: paragraph, principle, technical_spec, governance_process, process, definition, rationale, instruction_block, article. Đ28 candidate uses paragraph, principle, technical_spec, governance_process, process — all require description. None have it.

tac_birth_gate_config row BG-UV-02.mode='block' — hard rejection.

UV INSERT in candidate (line 45 of run-file) has columns:

(logical_unit_id, version_number, title, body, lifecycle_status, review_state, provenance, editor)

No description column.

§7 — Diff / Render / Tree — SKIPPED

T5 (render), T6 (clean render), T7 (diff vs original), T8 (tree report) all require persisted rows. With 0 rows in tac_publication for DIEU-28, render produces empty output. Skipped per spec scope.

§8 — Rollback reference (T9)

Not applicable — no rows to roll back. State already at baseline.

For future re-attempt:

  • pub_id: not assigned
  • doc_code: DIEU-28
  • version: v2.0
  • rollback.sql SHA: 9a2def1e28021cf923fe48335062ecbf87c07aad8f86cd177292a2454f38b8af

§9 — PASS criteria evaluation

# Criterion Status
1 Preflight all PASS
2 INSERT 82 rows (1+27+27+27) ❌ — 28/82, then auto-rollback
3 Post-commit counts + lifecycle correct ❌ — no commit
4 Clean render produced ⏭️ skipped
5 Diff: 0 content drift ⏭️ skipped
6 Tree/order correct ⏭️ skipped
7 Deliverables uploaded KB ✅ (this report)
8 STOP

Final verdict: FAIL. Database state unchanged. Stopping per spec.

Spec a P10B-2A-R3 / P10B-2B-R2 that:

  1. Re-reads tac_section_type_vocab.description_required at generation time.
  2. Populates description column on UV inserts where description_required=true. Source can be: body_excerpt from candidate JSON (already present), or first paragraph of body, or LLM-summarised first sentence — whichever the governance accepts.
  3. Verifies all 6 BG-UV-* checkers, not just BG-UV-02.
  4. Re-derives column list via information_schema introspection (the run-file column list is missing description+anything else added since 2026-04-22).

Alternative: temporarily UPDATE tac_birth_gate_config SET mode='warn' WHERE checker_id='BG-UV-02' for the Đ28 enactment window, but this conflicts with description-governance intent (S178 Fix 28).

§11 — Renderer rules

Skipped — render not executed.

§12 — Đ41 hygiene

No git changes this session — all artifacts under /tmp/p10b-2c/ (ephemeral). N/A.

Artifacts

  • /tmp/p10b-2c/d28-baseline-counts.txt (VPS)
  • /tmp/p10b-2c/d28-insert-run.sql (VPS, SHA adc31510…1fd4222e)
  • /tmp/p10b-2c/d28-insert-output.log (VPS — 28 INSERTs + ERROR)
  • /tmp/p10b-2c/d28-original.md (VPS, SHA fa5ed5c1…3277d7b — 9289 bytes)

STOPPED. Awaiting Opus review + GPT decision (re-package vs gate-relax vs other).