KB-3CF6

Lifecycle DDL Ratification · 06 Final Report (Result A LIFECYCLE_DDL_RATIFIED_IN_REPO_PASS)

8 min read Revision 1
dot-iu-cutterv0.5lifecycle-ddl-ratificationfinal-reportresult-alifecycle-ddl-ratified-in-repo-passstop-route-gpt-userdieu442026-05-20

dot-iu-cutter v0.5 — Final Lifecycle DDL Ratification Report

doc 6 of 6 · 2026-05-20 · macro outcome

final_result         : A — LIFECYCLE_DDL_RATIFIED_IN_REPO_PASS
route_back           : GPT / User
production_mutation  : NONE this macro (read-only PG, local commit only)

1. Verdict

status                       : LIFECYCLE_DDL_RATIFIED_IN_REPO_PASS
gates                        : G0..G6 all PASS
ddl_provenance               : KB SSOT + live PG (md5 byte-equal)
repo_location                : sql/lifecycle/ (new top-level)
files_committed              : 11
commit_sha                   : 1cd286e039357018c40a1281599e17961b848749
branch                       : feature/constitution-snapshot-mark-dryrun
main_unchanged_at            : 32cfa93
fingerprints_pinned          : 4/4 (byte-equal to live pg_proc.prosrc)
verification_commands_present : preflight + postapply + behavioral (B-1..B-8)
rollback_runbook_present     : per-bundle + safety constraints
tests_passing                : 264/265 (1 pre-existing baseline)
no_production_DDL            : CONFIRMED
no_lifecycle_mutation        : CONFIRMED
no_deploy_restart            : CONFIRMED
no_push_no_tag               : CONFIRMED
KB_reports_uploaded          : 6/6

2. Why this matters

Until this commit, the lifecycle substrate (fn_iu_enact, immut triggers, iu_lifecycle_vocab/log, gateway extension, fn_iu_apply_edit_draft patch) existed only in live PG and in KB authoring docs. The repo had no git-tracked SQL — recovery from a lost-DB scenario would require fishing the bytes back out of KB authoring docs (which, as we discovered, are NOT byte-equal to live prosrc).

After this commit:

reproducibility :
  - 4/4 lifecycle function bodies are byte-pinned in sql/lifecycle/bundle_*.sql
  - applying these bundles in a fresh PG ≥ 16 will produce the same md5(prosrc)
  - the operator can independently verify the live substrate against the
    fingerprints.yaml manifest
  - rollback path is documented with explicit safety constraints

operator_clarity :
  - apply order encoded in filenames (A..E)
  - WARNING header on every .sql file
  - README.md FIRST file an operator reads; warns against live re-apply
  - no auto-apply hook anywhere in the repo

KB_relationship :
  - KB authoring docs remain the design intent SSOT (the "why")
  - repo SQL files become the byte-level apply SSOT (the "what")
  - fingerprints.yaml is the cross-check between them

3. Gate-by-gate summary

G0_SSOT_repo_precheck:
  status   : PASS
  evidence : KB PATH 1 ruling read; HEAD = main = 32cfa93; tree clean

G1_DDL_provenance_trace:
  status   : PASS
  evidence : doc 01
  fingerprints : 4/4 byte-equal to live md5(prosrc)
  divergence_surfaced : authoring docs include comments that PG strips and
                        UTF-8 arrows that PG normalizes to ASCII '->';
                        repo uses LIVE bodies for byte-equality

G2_repo_placement:
  status   : PASS
  evidence : doc 02
  chosen   : sql/lifecycle/ (new top-level)
  rejected : OPT_P2 (inside cutter_agent/) / OPT_P3 (tests/fixtures/) / OPT_P4 (specs/runbooks)

G3_author_artefacts:
  status   : PASS
  evidence : doc 03
  files    : 11 / 11 (README + 5 bundles + 3 verifies + rollback + fingerprints)
  total_bytes : 67,153
  warning_headers : present on every .sql file

G4_tests_static_check:
  status   : PASS
  evidence : doc 04
  md5_byte_equality : 4/4
  regression        : 264/265 PASS (R-8 pre-existing baseline; not caused by this commit)
  no_PG_write       : CONFIRMED  (read-only `context_pack_readonly`)

G5_local_commit:
  status   : PASS
  evidence : doc 05
  commit   : 1cd286e (parent 32cfa93, feature branch only)
  main     : UNCHANGED at 32cfa93
  push/tag/deploy : NONE

G6_KB_closeout:
  status   : PASS
  evidence : docs 01..06 uploaded under
             knowledge/dev/laws/dieu44-trien-khai/v0.5-lifecycle-ddl-ratification-runbook/

4. Single-line digest

ratification_commit=1cd286e | files=11 | branch=feature/constitution-snapshot-mark-dryrun |
parent=32cfa93 | main_unchanged=32cfa93 | md5_byte_equality=4/4 |
fn_iu_enact=6ca9bc39e2d2be93dd8a71739fa80dc4 |
fn_iu_apply_edit_draft=42e96b6c9e81a2d0a28b30644d178a26 |
fn_iu_enacted_immut=aeb3fa4fdb225f6ba6b7073582caa454 |
fn_uv_enacted_immut=03f035a23cbc79a9e811a6da6f5266ba |
regression=264/265 (1 pre-existing baseline R-8) |
production_DDL=NONE | deploy=NONE | push=NONE | tag=NONE

5. Boundaries honored this macro

not_done:
  - production DDL (only LIVE READS of pg_proc/pg_trigger/pg_class)
  - lifecycle mutation (no UPDATE / INSERT / DELETE / DDL on directus)
  - deploy / restart
  - remote push (no remote configured; would be denied anyway)
  - tag creation
  - hard delete
  - source_document/source_version mutation (columns absent in any case)
  - real crypto / StubSigning replacement
  - main-branch fast-forward (feasible; deferred to sovereign single-line ruling)
  - duplicate runbook creation (no prior sql/* tree existed)
  - any wiring of these SQL files into CI / auto-apply / migration framework

6. Backlog updates (effect of this macro)

closed_by_this_macro:
  B-DDL-RATIFY:
    status: CLOSED  (PATH 1 executed; OPT_R2 — operator-runbook track adopted)

unchanged:
  B-AUTOMATION-ORCHESTRATOR-DESIGN  (xhigh; design only)
  B-DEPLOY-V0_5-CONTABO             (high/xhigh; sovereign)
  B-FN-IU-ENACT-SUPERSEDE-RETIRE    (medium; defer until next doc needs it)
  B-STUBSIGNING-CRYPTO-DESIGN       (medium-low)
  B-TAG-V0_5                        (low; sovereign single-line)
  B-REMOTE-CONFIG-PUSH              (low)
  B-AUDIT-RO-ROLE                   (low; grant cutter_governance USAGE to a
                                     closeout-audit read role)
  B-FN-IU-CREATE-FINGERPRINT-NOTE   (low; cross-check survey-memory pin)
  B-DB-ENV-GUARD-BASELINE-CLEAN     (low; the cutwrite.py PGPASSWORD baseline)

new_backlog_items:
  B-MAIN-FF-AFTER-RATIFY:
    title    : FF main from 32cfa93 → 1cd286e to bring sql/lifecycle/ onto main
    priority : LOW-MEDIUM (clean repo hygiene)
    effort   : TRIVIAL  (single sovereign single-line command)
    depends_on : sovereign approval
  B-SANDBOX-APPLY-HARNESS:
    title    : Build a transient-PG sandbox apply test for sql/lifecycle/*
    priority : LOW
    effort   : MEDIUM  (needs schema mocks for IU/UV/edit_draft/dot_config
                         + roles + fn_iu_verify_invariants + fn_content_hash)
    depends_on : nothing; can fold into orchestrator design (B-AUTOMATION-ORCHESTRATOR-DESIGN)
PATH_R1_LIGHT_HYGIENE:
  macro    : B-MAIN-FF-AFTER-RATIFY  (single sovereign single-line)
  effort   : trivial
  side_effects : repo only; main moves from 32cfa93 → 1cd286e

PATH_R2_LIGHT_FOLLOW_UPS:
  macros   : B-FN-IU-CREATE-FINGERPRINT-NOTE + B-DB-ENV-GUARD-BASELINE-CLEAN
  effort   : low (combine into one small macro)

PATH_R3_ARCHITECTURE:
  macro    : B-AUTOMATION-ORCHESTRATOR-DESIGN (xhigh)
  effort   : xhigh
  side_effects : KB only; produces design package

PATH_R4_OPERATIONAL:
  macro    : B-DEPLOY-V0_5-CONTABO
  effort   : high or xhigh
  depends_on : sovereign deploy ruling

8. STOP

Macro closed. Reports uploaded (6/6). STOP and route back to GPT/User for the next ruling.

final_status : LIFECYCLE_DDL_RATIFIED_IN_REPO_PASS
next_action  : await_sovereign_ruling_on_PATH_R1_R2_R3_R4
Back to Knowledge Hub knowledge/dev/laws/dieu44-trien-khai/v0.5-lifecycle-ddl-ratification-runbook/06-final-ddl-ratification-report-2026-05-20.md