KB-87F4

dot-iu-cutter v0.2 — P0-2 Rollback Draft (2026-05-16)

5 min read Revision 1
dot-iu-cutterdieu44v0.2p0-2ddl-authoringrollback-draftnot-executed

dot-iu-cutter v0.2 — P0-2 Rollback Draft

document_path: knowledge/dev/laws/dieu44-trien-khai/v0.2-ddl-authoring/dot-iu-cutter-v0.2-p0-2-rollback-draft-2026-05-16.md
revision: r1
date: 2026-05-16
author: Agent (Claude Code CLI, Opus 4.7 1M)
phase: v0.2 — P0-2 DDL AUTHORING (rollback draft; NOT executed)
rollback_executed: false

Rollback DRAFT — NOT executed. This is the authored reversal for the P0-2 DDL draft. It must NOT be run unless: (a) a P0-2 DDL execution actually occurred under explicit authorization, and (b) rollback is explicitly prompted by GPT/User. Authoring this draft performs no DB action.


§1 — Rollback Model

P0-2 adds only two empty tables and their constraints (1 composite PK, 1 single-column PK, 1 in-schema FK). The reversal is a pure structural drop — no data migration, no restore, no tac_logical_unit / sandbox_tac touch, because P0-2 never wrote any business data.

Drop order is mandatory: child first, then parent. manifest_unit_block.envelope_id FK references manifest_envelope, so manifest_unit_block must be dropped before manifest_envelope.

§2 — Rollback Draft (NOT executed)

-- =====================================================================
-- dot-iu-cutter v0.2 — P0-2 ROLLBACK DRAFT
-- ⛔ DO NOT EXECUTE WITHOUT EXPLICIT GPT/USER PROMPT
--    (and only if a P0-2 DDL execution actually occurred)
-- =====================================================================
-- order  : child (manifest_unit_block) FIRST, parent (manifest_envelope) SECOND
-- data    : no data loss expected — both tables are empty in P0-2
-- wrapper : single BEGIN … COMMIT (atomic)
-- =====================================================================

BEGIN;

-- 1) child first — has the FK to manifest_envelope
DROP TABLE cutter_governance.manifest_unit_block;

-- 2) parent second
DROP TABLE cutter_governance.manifest_envelope;

COMMIT;

-- =====================================================================
-- END OF ROLLBACK DRAFT — NOTHING ABOVE HAS BEEN EXECUTED.
-- Plain DROP TABLE (no CASCADE): both tables are empty and the only FK
-- is internal to this pair, so CASCADE is unnecessary; fail-fast if an
-- unexpected dependency exists.
-- =====================================================================

§3 — Data-Loss Assessment

data_loss_expected: NONE
reason: P0-2 creates both tables EMPTY and performs NO INSERT; there are
        zero writers in v0.2. Dropping them removes only structure.
business_data_touched: NONE (no tac_logical_unit / sandbox_tac / alias write)
pre_existing_objects: untouched by rollback (drop targets the 2 new tables only)

If — contrary to P0-2 scope — either table is found non-empty at rollback time, that is itself a STOP / escalate condition (a scope breach occurred): do not silently DROP; halt and report to GPT/User first. DROP TABLE without CASCADE is chosen so an unexpected dependency also fails fast rather than cascading silently.

§4 — Rollback Trigger Conditions

rollback_only_if:
  - a P0-2 DDL execution actually occurred under explicit authorization, AND
  - verification plan returned a hard_stop FAIL post-commit, OR
  - GPT/User explicitly prompts rollback
rollback_requires_explicit_prompt_if_post_commit: TRUE
pre_commit_failure: no rollback needed — the single-transaction DDL draft
  aborts and auto-rolls-back; nothing was persisted
agent_self_trigger: PROHIBITED (no autonomous rollback execution)

§5 — Post-Rollback Verification (authored, NOT executed)

Check Query (read-only) Expected
both tables gone SELECT to_regclass('cutter_governance.manifest_unit_block'), to_regclass('cutter_governance.manifest_envelope'); both NULL
schema back to baseline SELECT count(*) FROM information_schema.tables WHERE table_schema='cutter_governance'; back to 6
v0.1 + Phase α intact 5 v0.1 tables + canonical_address_alias still present, unchanged unchanged

§6 — Hard Boundaries

rollback_executed: FALSE
ddl_executed: FALSE
no_DROP_run: TRUE
no_psql_run: TRUE
no_mutation: TRUE
output_form: p0_2_rollback_draft

End of P0-2 rollback draft.

Back to Knowledge Hub knowledge/dev/laws/dieu44-trien-khai/v0.2-ddl-authoring/dot-iu-cutter-v0.2-p0-2-rollback-draft-2026-05-16.md