Slow-test trim, OPTIMIZE tier (harness owner). Profiling showed 163ms
of the shared harness's 169ms per-test beforeEach was one TRUNCATE over
~110 tables (per-table catalog/fsync constants, row-independent). The
reset is now a single DO block: transaction-local
session_replication_role=replica, DELETE only from non-empty tables,
and sequence resets reproducing RESTART IDENTITY exactly — 169ms → 10ms
per test across every harness file, with the legacy TRUNCATE retained
as an automatic error fallback for non-superuser roles. sqlite-migrator
(the live SQLite→PG upgrade path; all 43 tests kept incl.
VAL-MIGRATE-001..006) now provisions targets from a golden-template
clone via new createBaselinedPgTestDatabase/createEmptyPgTestDatabase
exports — the dry-run test keeps a pristine empty DB so its
no-schemas-left-behind assertions stay meaningful — 148.8s → ~26s.
taskstore-lifecycle, data-layer, and taskstore-remaining migrate onto
the shared harness with byte-identical test bodies (187s → ~11s
combined); data-layer's close() test closes a private layer so the
shared pool survives. Seeding hoists were measured and deliberately
skipped: the harness fix already exceeded their projected savings and a
beforeAll seed would weaken the clean-DB-per-test contract.
Verified: 287 tests green across the touched files plus untouched
harness consumers (schema-applier 80/80, mission-store 62/62).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>