KB-249D

IU Core MVP Sandbox — 08 Tests After Sandbox Hardening

2 min read Revision 1

IU Core MVP Sandbox — 08 Tests After Sandbox Hardening

Date: 2026-05-21 · Branch 7. stdlib unittest, Python 3.

Commands + results

$ python3 -m unittest tests.test_iu_core_ddl
Ran 39 tests ... OK

$ python3 -m unittest discover -s tests
Ran 525 tests ... OK
  • test_iu_core_ddl: 33 → 39 (+6).
  • Full suite: 519 → 525 (+6). Zero regressions.

New tests — TestSandboxPackage (6)

Static validation of the new sql/iu-core/sandbox/ package:

  1. test_sandbox_files_exist — the 4 sandbox files exist.
  2. test_sandbox_files_marked_sandbox_only — every sandbox file header carries SANDBOX-ONLY.
  3. test_seed_is_additive_only_to_anchor_tables — the probe seed never INSERT/UPDATE/DELETEs information_unit or unit_version (FK anchors are read-only).
  4. test_seed_creates_sandbox_probe_source — the seed creates iu_core_probe_source idempotently.
  5. test_verification_and_drill_are_non_mutating020 and 030 end with ROLLBACK and contain no COMMIT (non-mutating contract).
  6. test_seed_is_committed_and_rollback_guards_match — the seed COMMITs; its rollback drops iu_core_probe_source.

Coverage gap surfaced by the sandbox

The sandbox drill confirmed the existing 33 DDL/helper tests held true against a live PG instance (objects created, constraints enforced, rollback guards fired, idempotency held). The only gap surfaced was static coverage of the new sandbox scripts themselves — closed by the 6 tests above.

Live (non-unittest) validation performed in the sandbox

Not part of the Python suite, but proven against restore_test:

  • 020 verification suite: 25/25 PASS.
  • 030 reparent drill: 6/6 PASS.
  • Rollback row-loss guard: 4/4 REFUSED with rows present.
  • Full forward+rollback cycle on a pristine DB: 5/5 + 5/5 clean.
  • Forward DDL idempotency: 5/5 re-apply, 0 errors.

Verdict

Tests PASS — targeted 39/39, full 525/525, zero regressions.

Back to Knowledge Hub knowledge/dev/laws/dieu44-trien-khai/v0.6-iu-core-mvp-sandbox-execution-hardening-rollback-drill/08-tests-after-sandbox-hardening.md