KB-7095

GPT Review — 18c IU Birth Trigger Install Prompt rev1

4 min read Revision 1
gpt-review18ciu-birth-triggerdot-119rev2-requiredanti-hardcode

GPT Review — 18c IU Birth Trigger Install Prompt rev1

Date: 2026-05-05 Reviewer: GPT-5.5 Thinking / Incomex Hội đồng AI Reviewed: knowledge/dev/laws/dieu44-trien-khai/prompts/18c-iu-birth-trigger-install-prompt.md rev1

Verdict

Direction PASS, but rev2 patch required before dispatch.

The prompt correctly uses DOT-119 v2 only, avoids raw CREATE TRIGGER, and keeps the scope narrow: install/verify the information_unit birth trigger only. Anti-hardcode behavior checks are correctly preferred over exact DOT-119 md5 gating.

Two operational issues must be fixed before dispatch.

Required rev2 patches

B1 — Do not gate on total birth_registry count equality

Rev1 says:

birth_count_after must equal birth_count_baseline.

This repeats the hardcode/drift problem in softer form. birth_registry is live; unrelated system activity can insert rows during the run.

For 18c, the true invariant is:

  • installing a trigger must not create information_unit birth rows;
  • information_unit table remains 0 rows;
  • no birth_registry row for collection_name='information_unit' should appear during 18c.

Patch:

  1. Capture total birth_registry count as audit only.
  2. Add IU-specific birth count baseline:
SELECT count(*) AS iu_birth_count_baseline
FROM birth_registry
WHERE collection_name='information_unit';

Expected before 18c: 0.

  1. Post-verify:
SELECT count(*) AS iu_birth_count_after
FROM birth_registry
WHERE collection_name='information_unit';

Must equal baseline, expected 0.

  1. Total birth count may be reported as audit/drift, not a hard STOP unless the report can prove 18c caused it.

B2 — Add rollback rule if post-install verification fails

After --execute, if DOT-119 verify or independent SQL verification fails, the system may be left with a bad trg_birth_information_unit trigger.

Rev2 must add rollback using DOT-119 v2, not raw DROP:

DOT119_ALLOW_DROP=1 "$DOT119" --collection=information_unit --drop --confirm-drop --json

Use this rollback if:

  • --execute returns success but --verify fails;
  • independent SQL trigger definition is not exactly 1 row;
  • function is not fn_birth_registry_auto;
  • trigger def does not include '__birth_synthetic_id__';
  • trigger count is not baseline + 1 due to this operation.

After rollback, verify:

  • no trg_birth_information_unit trigger;
  • function hash unchanged;
  • IU rows still 0;
  • IU birth count still 0.

Then upload partial report and HARD STOP.

For fn_birth_registry_auto hash drift, STOP CRITICAL and report; do not attempt to repair function.

Non-blocking note

Preflight --help is fine because DOT-119 v2 has explicit --help exit 0. Keep it.

Directive to Opus/Ocus

Patch:

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

to rev2 with B1–B2:

  1. Replace total birth_registry equality gate with IU-specific birth count gate.
  2. Keep total birth count as audit/drift evidence only.
  3. Add rollback via DOT-119 --drop --confirm-drop for failed post-install verification.
  4. Update report requirements to include:
    • total birth count audit before/after;
    • IU-specific birth count before/after;
    • rollback happened? yes/no;
    • if rollback happened: drop JSON + post-rollback SQL verification.

Do not dispatch until rev2 is reviewed.

Hard boundaries remain:

  • no raw CREATE TRIGGER;
  • no raw DROP TRIGGER;
  • no function edits;
  • no IU rows;
  • no Pack 2B CRUD;
  • no seed/DDL;
  • no P3/HC registration.
Back to Knowledge Hub knowledge/dev/laws/dieu44-trien-khai/reviews/gpt-review-18c-iu-birth-trigger-install-prompt-rev1-2026-05-05.md