---
id: TST-PFM-DJE-028
title: Hard delete and rollback
kind: integration
product_area: platform
module: data-job-engine
revision: 1
status: draft
source_sha:
  services-platform: ad3f6a6582843008ed0f5a17b131878d15829af1
  macroservice-libraries: 54536a441935c6e09fdb7f96f0bec71c52ba4e03
  services-crm: a8d1364f1dd44b723bb5f9acba12f983e9ec8d69
  services-membership: 5994c270e8a37a30f848e99ba5b5ee6b87c08893
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
repository: macroservice-libraries
files:
  - packages/data-jobs/src/tests/integration/hard-delete-and-rollback.integration.spec.ts
implements: []
environment: local
implementation_state: implemented
latest_result: not-run
latest_run_at: null
latest_run_ref: null
conformance: not-verified
estimated_minutes: 5
isolation: >-
  Suite-owned fixture records, job identifiers and workspace contexts; teardown removes the fixture
  data.
evidence:
  - >-
    macroservice-libraries:packages/data-jobs/src/tests/integration/hard-delete-and-rollback.integration.spec.ts
assertion_inventory:
  - hard delete and safe rollback against Postgres
  - 'hard delete, end to end'
  - >-
    refuses a delete submitted to be applied, so the impact is always counted before anything is
    removed
  - >-
    counts what it would delete, what it is blocked on and what it would cascade into, and removes
    nothing
  - removes the widgets and their parts when the apply echoes the digest and the confirmation
  - >-
    refuses an apply with no digest, a stale digest, no confirmation or the wrong confirmation, and
    removes nothing
  - 'reads a widget blocked only since the validation as that item''s conflict, and deletes the rest'
  - rolling a data job back
  - >-
    plans a rollback job from the receipts and the domain, with the reversible items and the rest as
    rejections
  - 'restores what it can when it is applied, and leaves what someone else has changed alone'
  - >-
    refuses a second plan for a job that has been rolled back, but not while the first is only
    planned
  - >-
    finishes a plan that can reverse nothing where it stands, rather than queueing a job with no
    work
  - 'never rolls back a hard delete, because nothing undoes one'
  - 'rolls back only a job that has finished, so no change of it is left out of the plan'
  - >-
    refuses a rollback of a job whose receipts are gone, which are the only record of what it
    committed
  - 'reads every receipt of a long job before it asks the domain anything, however small the page'
registration_note: Registration describes existing source; the suite is not executed by this documentation job.
---

# Hard delete and rollback

## Verification Boundary

The suite checks the production service or shared engine against its database fixture. The structured assertion inventory records the checks present at the pinned revision.

## What This Suite Proves

The existing checks exercise hard delete and rollback. The specification bindings identify the narrower outcomes supported by those assertions.

## What It Does Not Prove

Local execution does not establish deployed queue, storage or service behavior. Independent test cases do not establish a complete cross-feature process.

## Real Dependencies and Test Doubles

The shared engine uses real Postgres with a test domain operation and repository. File suites use a fake object store; transport publication uses test ports.

## Must Not Be Doubled

The database effects, security context and production operation under examination remain real. Their outcomes cannot be replaced with canned success responses.
