GPT Review — DOT-119 P1 Report and P2 Directive
GPT Review — DOT-119 P1 Report and P2 Directive
Date: 2026-05-05 Reviewer: GPT-5.5 Thinking / Incomex Hội đồng AI Reviewed:
knowledge/dev/laws/dieu44-trien-khai/reports/dot119-repair-p1-metadata-ddl-seed-report.mdrev4
Verdict
P1 PASS.
Agent executed the mutation run correctly and honored scope boundaries.
Verified outcomes
- 3 new metadata fields created in PG + Directus:
birth_code_strategybirth_code_columnbirth_identity_source
- Metadata distribution exactly matches expected:
column = 25disabled = 63legacy_id_single_colon = 3subordinate = 1synthetic_id = 1unclassified = 73- total = 166
- NULL cleanup completed:
birth_code_strategy IS NULL = 0birth_identity_source IS NULL = 0
- PG enforcement installed:
- 2 CHECK constraints
- NOT NULL + DEFAULT on strategy/source
birth_code_columnremains nullable
- Core invariants preserved:
fn_birth_registry_autohash unchanged:1f729b3571a74963089bb3ef388217f3- birth trigger count unchanged: 30
- no birth drift inside mutation transactions
- Boundaries honored:
- no DOT-119 execution
- no DOT-119 script rewrite
- no function edit
- no IU trigger
- no IU rows
- no Pack 2B
Notes
The first seed transaction rolled back due to a verification query error, then retried cleanly. This is acceptable: no partial state, invariants held, final transaction committed successfully.
The live birth_registry drift from 75,469 to 75,472 across the full run is normal background activity and was handled correctly under the anti-hardcode run-local baseline model.
No-hardcode directive for P2
P2 is the phase where the actual DOT-119 script is rewritten. This is the highest-risk phase for the anti-hardcode principle.
DOT-119 v2 must be metadata-driven. It must not embed collection-specific lists such as:
information_unitunit_versionlaw_catalogworkflows- hardcoded
code/process_code/law_codemappings
The only acceptable logic is:
- read
collection_registryfor the requested--collection; - read
birth_code_strategy,birth_code_column,birth_identity_source; - validate according to strategy;
- generate trigger SQL from metadata;
- never replace
fn_birth_registry_auto.
Next directive to Opus
Proceed to P2 design/prompt drafting, not runtime execution yet.
Opus should create:
knowledge/dev/laws/dieu44-trien-khai/prompts/18b-p2-dot119-script-rewrite-prompt.md
But before finalizing the prompt, Opus must inspect current DOT-119 source and produce exact full v2 script content. Claude Code must not be asked to invent code from pseudocode.
P2 prompt must include:
-
Read controlling docs:
- 18a rev4
- 18b rev3
- P1 report
- this GPT review
-
Preflight:
- confirm P1 fields/constraints exist;
- confirm distribution remains valid or at least no NULL/constraint drift;
- capture
fn_birth_registry_autohash and require it remains1f729b3571a74963089bb3ef388217f3; - trigger count baseline = 30;
- no IU rows created;
- inspect current DOT-119 script and backup exact file path.
-
Exact v2 script:
- P2 runtime prompt must include the full script content.
- No pseudocode.
- No hardcoded collection mappings.
- No
CREATE OR REPLACE FUNCTION fn_birth_registry_auto. - Explicit CLI modes:
--dry-run,--execute,--verify, optional admin--drop,--json. - Exit codes aligned with 18a rev4.
- JSON output for agents.
- No implicit execute.
-
Installation:
- backup current script to exact path;
- write temp file;
bash -nsyntax check;- grep no function replacement;
- chmod;
- atomic mv;
- verify installed hash/path.
-
Smoke tests:
- no-args/help;
- dry-run existing
columnstrategy collection; - dry-run non-code column collection;
- dry-run
information_unitsynthetic strategy; - dry-run one unclassified collection should exit 10 + JSON finding;
- verify existing trigger collection should exit 0 if matching;
- disabled/subordinate collection should skip/no-op correctly;
- function hash unchanged;
- trigger count unchanged;
- birth_registry count run-local baseline handled without hardcoded stale number.
-
Report:
- path:
knowledge/dev/laws/dieu44-trien-khai/reports/dot119-repair-p2-script-rewrite-report.md - include exact script md5, backup path, smoke outputs, function hash trail, trigger count trail, no-hardcode self-check result.
- path:
-
Hard boundaries:
- no
fn_birth_registry_autoedit; - no IU trigger install (18c only);
- no IU rows;
- no Pack 2B;
- no seed/DDL changes.
- no
Current state
P1 is accepted. The next deliverable is a P2 prompt with exact DOT-119 v2 script content for GPT/User review before dispatch.