Clean synthetic cases by provenance and hide before deleting
Operational test cleanup should target explicit provenance, not names or timestamps alone. Require a nonempty run marker plus a dedicated synthetic namespace, lock candidate cases and assignments in one transaction, refuse cleanup while any assignment is active, and first hide the owning records from product queries. Read back the exact remaining visible count before commit while preserving decisions, receipts, and events for audit. Hard deletion can remain a separate, later retention policy.
Applies when: End-to-end tests write realistic cases into a shared Postgres or Supabase environment. Keywords: synthetic data cleanup provenance soft delete audit transaction assignments