KB-64E9

GPT Handoff — Opus New Session DOT-119 Repair

10 min read Revision 1
handoffopusdot-119iu-018bdieu20birth-process

GPT Handoff — Opus New Session DOT-119 Repair

Date: 2026-05-05 Author: GPT-5.5 Thinking / Incomex Hội đồng AI Purpose: Handoff for a new Opus session so it can resume DOT-119 repair work without rediscovering the whole history.

0. Current strategic state

We are working on IU-0 / Information Unit so that “miếng thông tin” can become usable and later support Đ38/TAC.

We paused IU Pack 2B because we discovered the existing birth-trigger tool DOT-119 is stale and potentially dangerous. Per Điều 20, we are fixing the tool design before continuing.

1. Roadmap from here

DONE

  1. IU-0 Pack 1 DB foundation: DONE/PASS.
  2. Pack 2A governance registration: DONE/PASS.
  3. Description Policy runtime: DONE/RATIFIED WITH TDs.
  4. Existing birth-code investigation: DONE/PASS.
  5. Misleading docs cleaned:
    • file 16 superseded;
    • file 17 superseded;
    • file 16b rev2 corrected assumptions.
  6. 18a DOT-119 redesign: rev4 FINAL / DESIGN PASS.

NOW

  1. Review and harden 18b DOT-119 repair execution pack.

NEXT AFTER 18b PASS

  1. Dispatch Claude Code to execute 18b: DDL metadata + seed + DOT-119 script rewrite + HC.
  2. Review 18b runtime report.
  3. Create/execute 18c: use repaired DOT-119 to install trg_birth_information_unit.
  4. Only then resume IU Pack 2B CRUD pilot.

2. Key reason for the pause

Agent investigation proved the birth system already solved “collections without code” at scale.

Important findings:

  • Current installed fn_birth_registry_auto is v2 and has synthetic fallback.
  • Dominant precedent is table::uuid synthetic entity_code (~70k rows).
  • DOT-119 script on disk is stale v1 and may clobber the installed v2 function if run.
  • Therefore DOT-119 must be repaired before using it for IU.

3. Legal/jurisdiction principle

DOT-119 is under Đ4 — Birth Process Law because it performs birth-trigger setup.

But DOT-119 repair touches multiple laws:

  • Đ4: birth semantics and strategy.
  • Đ35: DOT lifecycle/tool governance.
  • Đ36 / collection protocol: collection_registry schema fields.
  • Đ20 / NT15: design-before-execution, cost/roundtrip discipline.
  • Đ43: context graph / metadata discoverability.

Each specialty must follow its governing law. Do not treat this as a free-form script edit.

4. Files to read first, in order

Read these exact files before doing anything:

  1. knowledge/dev/laws/dieu44-trien-khai/reviews/gpt-handoff-opus-new-session-dot119-repair-2026-05-05.md
  2. knowledge/dev/laws/dieu44-trien-khai/design/18a-dot119-metadata-driven-no-clobber-redesign.md
  3. knowledge/dev/laws/dieu44-trien-khai/design/18b-dot119-repair-execution-pack.md
  4. knowledge/dev/laws/dieu44-trien-khai/reports/existing-birth-code-column-patterns-report.md
  5. knowledge/current-state/reports/s145-m2-dot119-birth-triggers-report
  6. knowledge/dev/laws/dieu44-trien-khai/reviews/gpt-roadmap-pause-iu-fix-dot119-first-2026-05-05.md
  7. knowledge/ops/processes/birth-process-v1.md
  8. knowledge/dev/laws/law-04-birth-process.md
  9. knowledge/dev/laws/dieu20-thiet-ke-truoc-trien-khai.md
  10. knowledge/dev/laws/dieu44-trien-khai/design/16b-iu0-existing-birth-pipeline-adaptation.md

Optional but useful:

  • knowledge/dev/laws/dieu44-trien-khai/design/16-iu0-pack2b-f6-birth-path-design.md — superseded; read only to understand why not to follow it.
  • knowledge/dev/laws/dieu44-trien-khai/design/17-iu0-pack2b-option-b-persisted-pilot-execution-pack.md — superseded; read only to understand why not to follow it.

5. Current accepted design decisions from 18a rev4

  1. Metadata endpoint: collection_registry.
  2. Minimum fields: 3 fields:
    • birth_code_strategy
    • birth_code_column
    • birth_identity_source
  3. Default strategy: unclassified, not synthetic_id.
  4. DOT-119 must require explicit mode:
    • --dry-run
    • --execute
    • --verify
    • optional admin --drop
  5. DOT-119 must support --json output.
  6. DOT-119 must not embed or replace fn_birth_registry_auto.
  7. DOT-119 must be no-clobber: function hash before/after must not change.
  8. DOT-119 emits JSON findings, but does not raw INSERT system_issues.
  9. H-BIRTH-IDENTITY-UNCLASSIFIED health check/report path aggregates unclassified metadata.
  10. Execution split:
    • 18b: metadata fields + seed + DOT-119 repair + HC.
    • 18c: IU trigger setup via repaired DOT-119.

6. Review status of 18b rev1

18b rev1 exists and is a good first execution-design draft, but GPT has not approved it for dispatch yet.

Main likely issues to review/patch before execution:

  1. 18b contains raw DDL / raw UPDATE / script rewrite / HC insert. It must specify legal tool/path and STOP conditions for each write channel.
  2. Phase 2 says “wait for review if confidence != high” but a Claude Code run cannot pause mid-run for external review unless the prompt/report is explicitly split. Consider splitting seed-mapping preflight into a separate read-only phase or require HARD STOP before Phase 3 if any uncertainty exists.
  3. Phase 3 has placeholders like “Agent fill from Phase 2 mapping”. Execution prompt must be exact or require the agent to print exact SQL and STOP for GPT/User review before running.
  4. Phase 5 HC registration uses raw INSERT INTO system_health_checks. Need legal/tooling preflight and maybe a KB query doc creation path. Do not let agent invent a raw insert path if a DOT/health-check registration tool exists.
  5. Rollback uses wildcard backup restore; should require exact backup path captured in report.
  6. Directus metadata for 3 new fields should likely be TD/verify only; no manual directus_fields insert.
  7. Script rewrite must include machine-readable JSON schema and exit-code tests; do not accept pseudocode.
  8. Function hash mismatch after COMMIT cannot roll back trigger/script automatically; report as critical and stop.

7. Immediate task for new Opus session

Do not execute. Do not dispatch Claude Code.

Task: review 18b rev1 and patch it to rev2 so that it is safe as an execution-pack draft.

Expected output:

knowledge/dev/laws/dieu44-trien-khai/design/18b-dot119-repair-execution-pack.md rev2

Rev2 should be an execution design only, not a runtime prompt.

8. Requirements for 18b rev2

Patch 18b with these concrete improvements:

  1. Add a Channel/Authority Matrix:

    • DDL on collection_registry: Đ36/schema path; exact approval required.
    • Metadata seed updates: Đ36/registry metadata path; no raw UPDATE unless approved by this execution pack.
    • DOT-119 script rewrite: Đ35 DOT governance path.
    • HC registration / KB query doc: Đ43/health-check path; inspect tool/path first.
    • Đ4 controls birth strategy semantics.
  2. Split execution into safer gates:

    • 18b-P0: read-only seed-mapping preflight and script inspection.
    • 18b-P1: DDL + metadata seed only after mapping is deterministic.
    • 18b-P2: script rewrite and smoke tests.
    • 18b-P3: HC registration, possibly separate if tooling unclear.
  3. Remove vague placeholders from SQL execution:

    • No “Agent fill …” inside SQL that could execute.
    • Require agent to produce full mapping table and exact generated seed SQL.
    • If any row is medium/low confidence, HARD STOP after report; no seed.
  4. Strengthen DDL phase:

    • inspect schema/migration tools before raw ALTER;
    • print exact DDL;
    • run in transaction;
    • verify columns;
    • function hash unchanged;
    • Directus field visibility verify/TD only.
  5. Strengthen seed phase:

    • exact mapping table;
    • exact update counts;
    • update only high-confidence rows;
    • unclassified remains default;
    • all manual classifications (information_unit, unit_version) explicitly listed.
  6. Strengthen DOT-119 rewrite:

    • backup exact path;
    • write new script atomically using temp file + chmod + move;
    • run syntax check if bash;
    • grep/assert no CREATE OR REPLACE FUNCTION fn_birth_registry_auto;
    • run --help, --dry-run --json, --verify --json tests;
    • capture function hash before/after.
  7. HC registration:

    • first inspect system_health_checks schema and any DOT/health registration tool;
    • create KB query doc only through Agent Data/authorized KB path, not VPS raw file write unless approved;
    • if legal path unclear, mark HC as follow-up and do not block DOT-119 repair.
  8. Rollback:

    • exact backup path;
    • exact restore command;
    • if DDL committed and script rewrite fails, state whether to keep metadata columns or rollback/drop them;
    • do not claim rollback can undo function changes unless hash proves unchanged.
  9. Report requirements:

    • preflight outputs;
    • mapping table;
    • exact DDL;
    • seed SQL + counts;
    • script diff summary/hash;
    • smoke outputs;
    • function hash trail;
    • birth trigger count and birth_registry count before/after;
    • HC status;
    • TDs/follow-ups.
  10. Keep hard boundaries:

    • no runtime execution from Opus;
    • no Claude Code dispatch yet;
    • no IU trigger;
    • no IU rows;
    • no Pack 2B;
    • no function edits.

9. After 18b rev2

Opus stops. GPT/User reviews 18b rev2.

Only after 18b rev2 PASS should Opus draft a Claude Code execution prompt.

10. Short summary

We are not fixing IU directly now. We are repairing the birth-trigger tool DOT-119 first so future collections are handled by metadata, not hardcoded patches. This is the correct Điều 20 path and prevents repeating the same failure later.

Back to Knowledge Hub knowledge/dev/laws/dieu44-trien-khai/reviews/gpt-handoff-opus-new-session-dot119-repair-2026-05-05.md