KB-63F3

GPT Review — File 18 Existing Birth Trigger Execution Pack rev1

6 min read Revision 1
gpt-reviewfile18birth-triggerdot-119iu-0rev2-required

GPT Review — File 18 Existing Birth Trigger Execution Pack rev1

Date: 2026-05-05 Reviewer: GPT-5.5 Thinking / Incomex Hội đồng AI Reviewed:

  • knowledge/dev/laws/dieu44-trien-khai/design/16-iu0-pack2b-f6-birth-path-design.md rev 3
  • knowledge/dev/laws/dieu44-trien-khai/design/17-iu0-pack2b-option-b-persisted-pilot-execution-pack.md rev 3
  • knowledge/dev/laws/dieu44-trien-khai/design/16b-iu0-existing-birth-pipeline-adaptation.md rev 2
  • knowledge/dev/laws/dieu44-trien-khai/design/18-iu0-birth-trigger-existing-pipeline-execution-pack.md rev 1

Verdict

Direction PASS, but file 18 rev2 required before execution.

Opus correctly cleaned the misleading design direction:

  • File 16 marked SUPERSEDED.
  • File 17 marked SUPERSEDED.
  • File 16b corrected the bad assumptions from rev1.
  • File 18 correctly returns to the existing birth pipeline and proposes one trigger using installed fn_birth_registry_auto v2 fallback.

This is the right strategic correction.

What is now correct

  • No new birth process.
  • No pilot birth exception path.
  • No DOT-119 execution while DOT-119 script is stale.
  • No function replacement.
  • unit_version remains subordinate, no birth trigger now.
  • IU birth code follows existing synthetic precedent: information_unit::<uuid>.

Required fixes before execution

B1 — DOT-119 TD must be formal, not a footnote

User explicitly warned: old DOTs often lag behind schema/process because of chicken-and-egg / text-as-code issues. If we discover DOT-119 is stale and dangerous, we must either fix it now or record a concrete TD so future agents do not run it and clobber v2.

For this IU trigger task, fixing DOT-119 is not required to unblock IU, but file 18 rev2 must add a formal TD section:

  • title: TD-DOT119-STALE-BIRTH-TRIGGER-SETUP
  • problem: script on disk v1 lacks synthetic fallback and lacks current code-column behavior; running it may clobber installed v2 fn_birth_registry_auto.
  • immediate guard: do not run DOT-119 until reconciled.
  • future fix: update DOT-119 to preserve/use installed v2 or remove embedded function body, add dry-run safety, add no-clobber check, document supported code patterns.
  • priority: high governance tooling debt, non-blocking for IU if file 18 avoids DOT-119.

B2 — Preflight fallback detection should be stronger

Current check:

LIKE '%TG_TABLE_NAME%||%::%||%NEW.id%'

May fail due whitespace or function formatting. Use pg_get_functiondef output plus more robust evidence:

  • print full function source or at least relevant fallback lines;
  • check for TG_TABLE_NAME, '::', and NEW.id separately;
  • confirm it reads TG_ARGV[0] / to_jsonb(NEW) so absent column triggers fallback.

B3 — Direct CREATE TRIGGER must be justified as exception to DOT-only norm

Because DOT-119 is stale/dangerous, direct CREATE TRIGGER is acceptable only as a documented, reviewed migration/admin path for this run. File 18 rev2 should explicitly state:

  • normally birth trigger setup should use DOT tooling;
  • DOT-119 is unsafe in current state;
  • direct SQL is narrowly approved here to avoid clobbering a live v2 shared function;
  • DOT-119 TD must be resolved later.

B4 — Test transaction should clarify trigger persistence

The test row uses BEGIN ... ROLLBACK; this rolls back only test row/birth row, not the trigger if trigger was already created outside the transaction. File 18 should state this explicitly to avoid confusion.

B5 — Test insert may need exact required fields validation against Pack 1 gates

The test row uses minimal identity_profile. File 18 should require preflight or note that the row must satisfy Pack 1 L1/L2 trigger rules. If the insert fails because Pack 1 requires additional JSON fields, STOP and report; do not weaken gates.

B6 — Report must include DOT-119 TD status

Execution report should include:

  • whether DOT-119 was not run;
  • TD recorded;
  • exact trigger SQL executed;
  • function source/fallback evidence;
  • test result or test skipped;
  • whether IU birth trigger is active.

Directive to Opus/Ocus

Patch file 18 to rev2. Do not execute yet.

Required changes:

  1. Add formal DOT-119 TD section as described above.
  2. Strengthen preflight fallback detection and require evidence of v2 fallback.
  3. Add explicit justification for direct CREATE TRIGGER despite DOT-first norm.
  4. Clarify test ROLLBACK affects only test row/birth row, not installed trigger.
  5. Add STOP if Pack 1 L1/L2 rejects the test row unexpectedly; do not modify gates.
  6. Add report requirements for DOT-119 TD, exact SQL, fallback evidence, and trigger verification.

Keep boundaries:

  • no DOT-119 execution;
  • no function replacement;
  • no Pack 2B CRUD expansion;
  • no vector/outbox/Directus;
  • no unit_version birth trigger;
  • no IU rows retained unless separately approved.

After rev2 upload, GPT/User reviews again. If rev2 passes, next step can be a compact Claude Code execution prompt for the one-trigger operation.

Back to Knowledge Hub knowledge/dev/laws/dieu44-trien-khai/reviews/gpt-review-file18-existing-birth-trigger-execution-pack-rev1-2026-05-05.md