---
id: FAS-PFM-DJE-02
feature: FEAT-PFM-DJE-02
product_area: platform
module: data-job-engine
revision: 1
status: proposed
product_intent: proposed
source_sha:
  services-platform: ad3f6a6582843008ed0f5a17b131878d15829af1
  macroservice-libraries: 54536a441935c6e09fdb7f96f0bec71c52ba4e03
  services-crm: a8d1364f1dd44b723bb5f9acba12f983e9ec8d69
  services-membership: 5994c270e8a37a30f848e99ba5b5ee6b87c08893
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
capabilities:
  - CAP-PFM-DJE-006
  - CAP-PFM-DJE-007
  - CAP-PFM-DJE-008
scenarios:
  - id: FAS-PFM-DJE-02-01
    title: Selective restoration preserves later corrections
    kind: behaviour
    exercises:
      - CAP-PFM-DJE-006
      - CAP-PFM-DJE-008
    relies_on:
      - ATS-PFM-DJE-006-01
      - ATS-PFM-DJE-008-02
      - ATS-PFM-DJE-008-03
    preconditions: Change thirty-five contacts and correct one title afterward.
    steps:
      - do: Plan and approve restoration of the completed update and inspect every affected contact.
        expect: >-
          Thirty-four titles return to their prior values; the correction remains with an explained
          exclusion.
        provenance: proposed
        source: >-
          services-crm:modules/data-jobs/tests/integration/services/jobs/contact-update-versions.integration.spec.js#freezes
          the version of each of the three contacts on the validated job, by item position;
          services-crm:modules/data-jobs/tests/integration/services/jobs/contact-update-rollback.integration.spec.js#plans
          a rollback of the eight nobody touched, and refuses the two somebody did;
          macroservice-libraries:packages/data-jobs/src/tests/integration/rollback-and-retry.integration.spec.ts#refuses
          a rollback plan with an unversioned item, and writes no rollback job
    expected: >-
      Thirty-four titles return to their prior values; the correction remains with an explained
      exclusion.
    negative: false
    data_needs: Change thirty-five contacts and correct one title afterward.
    bound_to: []
    provenance: proposed
    source: >-
      services-crm:modules/data-jobs/tests/integration/services/jobs/contact-update-versions.integration.spec.js#freezes
      the version of each of the three contacts on the validated job, by item position;
      services-crm:modules/data-jobs/tests/integration/services/jobs/contact-update-rollback.integration.spec.js#plans
      a rollback of the eight nobody touched, and refuses the two somebody did;
      macroservice-libraries:packages/data-jobs/src/tests/integration/rollback-and-retry.integration.spec.ts#refuses
      a rollback plan with an unversioned item, and writes no rollback job
  - id: FAS-PFM-DJE-02-02
    title: Deletion removes the possibility of restoring that record
    kind: interaction
    exercises:
      - CAP-PFM-DJE-007
      - CAP-PFM-DJE-008
    relies_on:
      - ATS-PFM-DJE-007-03
      - ATS-PFM-DJE-008-04
    preconditions: Complete a title update and later delete one of its contacts through counted approval.
    steps:
      - do: 'Plan restoration of the earlier update, then request rollback of the delete job.'
        expect: >-
          The earlier plan identifies the absent contact as excluded and the delete job creates no
          restoration.
        provenance: proposed
        source: >-
          services-crm:modules/data-jobs/tests/integration/services/jobs/contact-delete.integration.spec.js#refuses
          an apply that echoes no impact digest;
          macroservice-libraries:packages/data-jobs/src/data-job-actions.spec.ts#refuses Rollback by
          the code the service would answer
    expected: >-
      The earlier plan identifies the absent contact as excluded and the delete job creates no
      restoration.
    negative: false
    data_needs: Complete a title update and later delete one of its contacts through counted approval.
    bound_to: []
    provenance: proposed
    source: >-
      services-crm:modules/data-jobs/tests/integration/services/jobs/contact-delete.integration.spec.js#refuses
      an apply that echoes no impact digest;
      macroservice-libraries:packages/data-jobs/src/data-job-actions.spec.ts#refuses Rollback by the
      code the service would answer
  - id: FAS-PFM-DJE-02-03
    title: Planning and applying restoration have distinct retry effects
    kind: lifecycle
    exercises:
      - CAP-PFM-DJE-006
      - CAP-PFM-DJE-008
    relies_on:
      - ATS-PFM-DJE-008-01
      - ATS-PFM-DJE-004-05
    preconditions: Finish a supported update with reversible and blocked work.
    steps:
      - do: >-
          Plan restoration, inspect the original's retry availability, apply restoration and attempt
          original retry.
        expect: >-
          Planning alone leaves retry available; applied restoration prevents blocked original work
          from overwriting restored values.
        provenance: proposed
        source: >-
          services-crm:modules/data-jobs/tests/integration/services/jobs/contact-update-rollback.integration.spec.js#answers
          a rollback job of its own, linked to the job it compensates;
          macroservice-libraries:packages/data-jobs/src/tests/integration/rollback-and-retry.integration.spec.ts#refuses
          to retry a job that has been rolled back, so its blocked rows are not written after the
          undo
    expected: >-
      Planning alone leaves retry available; applied restoration prevents blocked original work from
      overwriting restored values.
    negative: true
    data_needs: Finish a supported update with reversible and blocked work.
    bound_to: []
    provenance: proposed
    source: >-
      services-crm:modules/data-jobs/tests/integration/services/jobs/contact-update-rollback.integration.spec.js#answers
      a rollback job of its own, linked to the job it compensates;
      macroservice-libraries:packages/data-jobs/src/tests/integration/rollback-and-retry.integration.spec.ts#refuses
      to retry a job that has been rolled back, so its blocked rows are not written after the undo
  - id: FAS-PFM-DJE-02-04
    title: Restoration cannot bypass update authority
    kind: permission
    exercises:
      - CAP-PFM-DJE-006
      - CAP-PFM-DJE-008
    relies_on:
      - ATS-PFM-DJE-008-06
    preconditions: Complete an update and prepare a caller holding bulk authority but lacking update authority.
    steps:
      - do: Request restoration with that caller and compare with an authorized planner.
        expect: >-
          The limited caller creates no compensating job; the authorized caller receives a reviewed
          versioned plan.
        provenance: proposed
        source: >-
          macroservice-libraries:packages/data-jobs/src/data-job-actions.spec.ts#offers Rollback for
          a finished job, requiring the bulk key and the per-record key the plan re-checks
    expected: >-
      The limited caller creates no compensating job; the authorized caller receives a reviewed
      versioned plan.
    negative: false
    data_needs: Complete an update and prepare a caller holding bulk authority but lacking update authority.
    bound_to: []
    provenance: proposed
    source: >-
      macroservice-libraries:packages/data-jobs/src/data-job-actions.spec.ts#offers Rollback for a
      finished job, requiring the bulk key and the per-record key the plan re-checks
  - id: FAS-PFM-DJE-02-05
    title: A correction after restoration preview remains intact
    kind: regression
    exercises:
      - CAP-PFM-DJE-006
      - CAP-PFM-DJE-008
    relies_on:
      - ATS-PFM-DJE-008-03
    preconditions: Prepare a restoration of two reversible contacts.
    steps:
      - do: Edit one title after planning and apply the original restoration preview.
        expect: >-
          Only the unedited contact is restored; the edited contact retains its correction and
          reports changed since planning.
        provenance: proposed
        source: >-
          macroservice-libraries:packages/data-jobs/src/tests/integration/rollback-and-retry.integration.spec.ts#refuses
          a rollback plan with an unversioned item, and writes no rollback job
    expected: >-
      Only the unedited contact is restored; the edited contact retains its correction and reports
      changed since planning.
    negative: false
    data_needs: Prepare a restoration of two reversible contacts.
    bound_to: []
    provenance: proposed
    source: >-
      macroservice-libraries:packages/data-jobs/src/tests/integration/rollback-and-retry.integration.spec.ts#refuses
      a rollback plan with an unversioned item, and writes no rollback job
evidence:
  - CAP-PFM-DJE-006
  - CAP-PFM-DJE-007
  - CAP-PFM-DJE-008
  - specs/CONVENTIONS.md#5.3 Feature Acceptance Suite
  - specs/CONVENTIONS.md#9.10 Capability Test Specification
---

# Safeguards for bulk changes: Feature Acceptance Suite

## What the Feature Must Do as a Whole

Selective restoration preserves later corrections is the feature-level acceptance outcome. The suite follows the work through its participating capabilities and checks the final records, job accounts and refusals together. Permission and regression cases revisit the same feature boundary with changed authority or input.

## Interactions Between Capabilities

Deletion removes the possibility of restoring that record. The interaction case changes a shared prerequisite and checks how that change affects the next capability's result. Lifecycle cases retain partial work and distinguish a new attempt from resuming existing work. These feature expectations remain proposed until their complete executable coverage is established.

## Regression Record

| Revision | Change | Scenario | Why |
|---|---|---|---|
| 1 | initial | all | Establish cumulative acceptance across the feature's landed capabilities. |
