GPT Review — P10A-2A D35 Insert/Render Package
GPT Review — P10A-2A D35 Insert/Render Package
Date: 2026-04-29
Reviewed input
- Agent report:
knowledge/dev/laws/dieu38-trien-khai/reports/p10a-2a-d35-insert-package-2026-04-29.md. - Opus assessment and GPT review request.
Verdict
P10A-2A PASS accepted.
Package approved for P10A-2B prompt drafting, with conditions.
Do not execute yet. Opus should draft P10A-2B execution prompt using this package and the decisions below.
Accepted evidence
- Read-only package generation: PASS.
- Schema reverify: PASS.
- Candidate v3: PASS, 36 units.
- Collision check: PASS, no existing DIEU-35 rows.
- Execution path discovery: PASS,
directushas DML on four target tables. - Insert SQL generated: PASS, single transaction DO block.
- Render SQL generated: PASS, parameterized materialized-path CTE.
- Rollback SQL generated: PASS, mutable-state guard.
- Rollback feasibility analysis: PASS by trigger source analysis.
- Full body hash: PASS, 31/31 prior hashes match + 5 new §8 hashes.
- No SQL executed in P10A-2A.
Decisions on 9 open issues
O1 — Canonical address namespace
Decision: ACCEPT FOR P10A PILOT ONLY.
Use D38-DIEU35-* in P10A-2B because the current production birth gate regex requires ^D38-... and changing regex/schema is out of scope.
This is a technical compatibility namespace, not the final multi-law namespace design.
Do not modify fn_tac_birth_gate_lu or regex during P10A.
Record follow-up: multi-law canonical address namespace must be redesigned in a future schema/label architecture gate, likely alongside P11 Label & Object-Layer Expansion Architecture.
O2 — §4 KHOẢN children mapping
Decision: ACCEPT.
Use S4-P1-1 / S4-P1-2 / S4-P1-3 for the ★ KHOẢN children under §4.1 for this pilot. It is deterministic and reversible.
O3 — §8.2 empty body
Decision: DO NOT INVENT SUBSTANTIVE BODY.
Use the heading/title as the visible content carrier. Keep body empty/minimal only if insert package already satisfies hard gates. Since BG-UV-03 is warn mode, the warning is acceptable for pilot.
P10A-2B must capture the warning if emitted and explain it in the final report. Do not create fake content merely to silence the warning.
O4 — §8 has 5 children, not 4
Decision: ACCEPT.
Source structure has 3 numbered headings + 2 KHOẢN markers. Follow source reality.
O5 — body_sha256_candidate vs trigger content_hash
Decision: ACCEPT.
Keep both:
body_sha256_candidate= source/body audit;- trigger
content_hash= PG-side derived identity.
O6 — DO block transaction safety
Decision: ACCEPT.
Single transaction DO block is appropriate for P10A pilot. Any single-row failure rolls back the whole transaction.
P10A-2B must use psql -v ON_ERROR_STOP=1 -X and capture transaction output.
O7 — Execution role = directus
Decision: ACCEPT FOR P10A PILOT.
Use directus for P10A-2B because catalog confirms it is the only role with DML grants on the four target tables.
Record follow-up: design a dedicated tac_writer/service role later if governance requires it. Do not create roles in P10A.
O8 — Description template diverges from future Đ43
Decision: ACCEPT FOR PILOT.
The current clean description template is acceptable for P10A visible pilot. Record follow-up for future Đ43-compliant description governance.
O9 — Appendix/changelog/post_merge_todo mapped to S13/S14/S15
Decision: ACCEPT FOR PILOT.
The current regex does not allow non-numeric tail slots. Sequential S13/S14/S15 is acceptable for pilot. Record follow-up for richer section address model.
Additional required P10A-2B guardrails
P10A-2B may proceed only after Opus drafts execution prompt with these guardrails:
-
Fresh preflight before execution
- DB/current_user;
- schema unchanged;
- collision still 0;
- trigger status still enabled;
- backup/safety snapshot availability or recent backup check;
- ensure generated SQL SHA matches package SHA.
-
Use package artifacts exactly
- Insert SQL SHA must equal
c6c6781cfc33dc37191db8096569e28d3afa0714e97bfc3810481d0589073563unless GPT approves regeneration. - Render SQL SHA must equal
2142f6abcc1c94386a848745fb13f64584d2f716c2c2631e43b25a17f99ed579. - Rollback SQL SHA must equal
25cc49d9bcc96b8b7cd434fcf3d92656ce8fedd11f5edf6337e3e1ee5f18e184. - Verify-counts SQL SHA must equal
fb0a802049817190b6e75ba9b91c64c7071878d6fd53285fd8af214db8519363.
- Insert SQL SHA must equal
-
Execute insert once
docker exec -i postgres psql -U directus -d directus -v ON_ERROR_STOP=1 -X.- Capture all output, notices, warnings, and final exit code.
- If exit != 0, transaction should rollback; verify no partial D35 rows.
-
Post-insert verification
- 1 publication, 36 LU, 36 UV, 36 publication members.
- Capture pub_id, LU IDs, UV IDs.
- Verify all lifecycle states remain mutable (
proposed,draft_only,draft). - Verify no change to seed/roles/permissions/tokens/schema.
-
Render and deliver visible result
- Run render SQL with actual
pub_id. - Produce original markdown snapshot.
- Produce reassembled markdown.
- Produce diff report.
- Produce tree/outline report.
- Produce row-count/ID report.
- Produce rollback instructions.
- Run render SQL with actual
-
Rollback not executed by default
- Generate/keep rollback instructions only.
- Execute rollback only if GPT explicitly directs after reviewing failure or if insert transaction fails before commit.
-
No scope expansion
- No schema/regex changes.
- No Nuxt/KG/vector.
- No broad migration.
- No seed/role/permission/token changes.
- No change_set/change_set_member.
Directive to Opus 4.6
Draft P10A-2B — Execute D35 Pilot Insert + Render Prompt v0.1 for GPT review.
Keep it concise. Do not re-litigate all package details. Use package SHA checks and the decisions above.
Do not dispatch Agent until GPT reviews the P10A-2B prompt.
Current state
- P10A-1 discovery: PASS.
- P10A-1B candidate v2: PASS.
- P10A-2A package: PASS accepted.
- P10A-2B prompt drafting: next.
- User-visible result: not yet produced.