KB-446F

GPT Review — DOT-119 P2 Report and 18c Directive

6 min read Revision 1
gpt-reviewdot-119p2pass18ciu-triggerno-hardcode

GPT Review — DOT-119 P2 Report and 18c 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-p2-script-rewrite-report.md

Verdict

P2 PASS.

Agent executed the DOT-119 script rewrite correctly and honored all hard boundaries.

Evidence verified from actual P2 report

  • v1 backup created:
    • /opt/incomex/backups/dot-birth-trigger-setup.v1.bak.20260505080351
    • md5 a0b926d3fd373b8995aea2f4e8136e01
  • v2 installed:
    • md5 5883bce405b86ab436e885cf16fd22de
    • 365 lines
    • permissions executable
  • 18/18 smoke tests PASS.
  • synthetic_capability:"pass" verified for information_unit dry-run.
  • No-clobber checks PASS:
    • 0 occurrences of CREATE OR REPLACE FUNCTION fn_birth_registry_auto
    • 0 occurrences of KNOWN_V2_FN_HASH
  • Core invariants preserved:
    • fn_birth_registry_auto hash unchanged: 1f729b3571a74963089bb3ef388217f3
    • birth trigger count unchanged: 30
    • birth_registry count stable within P2 run: 75,613 → 75,613
  • Rollback did not happen:
    • final state = v2 active
  • Out-of-scope boundaries respected:
    • no function edit
    • no IU trigger
    • no IU rows
    • no Pack 2B
    • no DDL/seed changes

Hardcode assessment

P2 satisfies the anti-hardcode direction:

  • no hardcoded collection-to-column mapping in script;
  • strategy/column/function choice derived from collection_registry metadata;
  • no hardcoded function hash as execution gate;
  • function hash used only as audit/no-clobber evidence;
  • smoke samples selected by metadata queries rather than fixed collections, except explicit target information_unit for synthetic dry-run, which is the intended next collection.

P3 decision

18b originally had P3 for HC registration. P3 is useful but not blocking for the main objective.

Given User priority is to continue toward IU usability, GPT recommends:

Skip/defer P3 as TD for now, and proceed to 18c — install IU birth trigger using repaired DOT-119.

Rationale:

  • DOT-119 repair objective is complete.
  • HC registration can be done later without blocking IU birth trigger.
  • The main unresolved gate before Pack 2B is IU birth trigger.

Next directive to Opus/Ocus

Create 18c prompt, not runtime execution yet:

knowledge/dev/laws/dieu44-trien-khai/prompts/18c-iu-birth-trigger-install-prompt.md

18c should use the repaired DOT-119 v2, not raw CREATE TRIGGER.

18c scope

Install/verify birth trigger for information_unit only:

dot-birth-trigger-setup --collection=information_unit --dry-run --json
dot-birth-trigger-setup --collection=information_unit --execute --json
dot-birth-trigger-setup --collection=information_unit --verify --json

18c preflight

Prompt must verify:

  1. DOT-119 v2 is installed:
    • md5 5883bce405b86ab436e885cf16fd22de or at least v2 behavior checks pass;
    • no CREATE OR REPLACE FUNCTION fn_birth_registry_auto in script;
    • no KNOWN_V2_FN_HASH in script.
  2. collection_registry row:
    • information_unit.birth_code_strategy = synthetic_id
    • birth_code_column IS NULL
    • birth_identity_source = manual
  3. information_unit table exists.
  4. No IU rows yet:
    • SELECT count(*) FROM information_unit; expected 0.
  5. No existing trg_birth_information_unit trigger.
  6. fn_birth_registry_auto hash captured as run-local baseline and unchanged after 18c.
  7. Current birth trigger count captured as run-local baseline.
  8. Current birth_registry count captured as run-local baseline; use run-local model, not hardcoded count.

18c execution

Use DOT-119 v2 only:

  1. --dry-run --json must show:
    • strategy synthetic_id
    • args '__birth_synthetic_id__'
    • synthetic_capability:"pass"
    • proposed trigger SQL for trg_birth_information_unit
  2. --execute --json
    • creates trigger if absent;
    • if already exists and matches, should be idempotent/skip; but preflight expects absent.
  3. --verify --json
    • must return exit 0 and status verified.

18c post-verify

Verify independently via SQL:

SELECT tgname, tgfoid::regproc, pg_get_triggerdef(oid)
FROM pg_trigger
WHERE tgname='trg_birth_information_unit' AND NOT tgisinternal;

Expected:

  • exactly 1 row;
  • function fn_birth_registry_auto;
  • trigger definition includes '__birth_synthetic_id__'.

Also verify:

  • function hash unchanged;
  • birth trigger count increased by exactly +1 from run-local baseline;
  • birth_registry count unchanged during trigger install;
  • information_unit row count remains 0.

18c report

Upload:

knowledge/dev/laws/dieu44-trien-khai/reports/iu-birth-trigger-install-18c-report.md

Report must include:

  • preflight outputs;
  • dry-run JSON;
  • execute JSON;
  • verify JSON;
  • independent SQL trigger definition;
  • function hash before/after;
  • trigger count before/after;
  • birth_registry count before/after;
  • IU row count before/after;
  • hard boundaries confirmation.

18c hard boundaries

  • no raw CREATE TRIGGER;
  • no function edits;
  • no IU rows;
  • no Pack 2B CRUD;
  • no seed/DDL;
  • no system_health_checks / P3 work.

After 18c report: HARD STOP. GPT/User reviews before opening Pack 2B.

TD / deferred item

P3 health-check registration remains deferred:

  • H-BIRTH-IDENTITY-UNCLASSIFIED / related HC registration;
  • should be handled after 18c or during a later health-check hygiene pass.
Back to Knowledge Hub knowledge/dev/laws/dieu44-trien-khai/reviews/gpt-review-dot119-p2-report-and-18c-directive-2026-05-05.md