---
id: ATS-ACC-CLS-012
scope: CAP-ACC-CLS-012
product_area: accounting
module: close
revision: 1
status: proposed
approved_by: null
approved_at: null
source_sha:
  services-accounting: f47cb263875bbc0c5640fba7dae6785ec32695f8
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
scenarios:
  - id: ATS-ACC-CLS-012-01
    title: Resume a retained period after execution failure
    level: api
    proves:
      - BR-CAP-ACC-CLS-012-01
      - BR-CAP-ACC-CLS-012-02
    preconditions: A reopen fails after locking and a close has a failed recognition attempt.
    steps: Inspect each period and retry eligible work.
    expected: >-
      Protection remains during failure and resumed work completes without
      duplicate recognition.
    negative: false
    data_needs: Close and reopen fault fixtures.
    bound_to:
      - >-
        services-accounting:modules/fiscal-close/tests/integration/services/jobs/reopen-job.integration.spec.js#fails
        the run on reverseRevenue, retryable
      - >-
        services-accounting:modules/fiscal-close/tests/integration/services/jobs/reopen-job.integration.spec.js#leaves
        the period reopening
      - >-
        services-accounting:modules/fiscal-close/tests/integration/services/jobs/reopen-job.integration.spec.js#finishes
        the reopen on retry
      - >-
        services-accounting:modules/fiscal-close/tests/integration/services/jobs/revenue-recognition.integration.spec.js#retries
        the step in the same job and ends the run succeeded
      - >-
        services-accounting:modules/fiscal-close/tests/integration/services/jobs/close-job.integration.spec.js#leaves
        the run failed and the period closing, held by it
      - TST-ACC-CLS-022
      - TST-ACC-CLS-023
      - TST-ACC-CLS-021
    provenance: test
    source: >-
      services-accounting:modules/fiscal-close/tests/integration/services/jobs/reopen-job.integration.spec.js#a
      reopen failing after its lock
    category: failure
  - id: ATS-ACC-CLS-012-02
    title: Require a fresh close after period release
    level: api
    proves:
      - BR-CAP-ACC-CLS-012-03
      - BR-CAP-ACC-CLS-012-04
    preconditions: Readiness refuses one run and empty finalization fails another.
    steps: Attempt retry and then submit a fresh close after fixing the cause.
    expected: Retries are refused for released periods and the new close can complete.
    negative: true
    data_needs: Readiness and empty-finalization failure fixtures.
    bound_to:
      - >-
        services-accounting:modules/fiscal-close/tests/integration/services/jobs/close-job.integration.spec.js#refuses
        a retry: the period is no longer held
      - >-
        services-accounting:modules/fiscal-close/tests/integration/services/jobs/close-job.integration.spec.js#fails
        the run on finalize, not retryable, saying the period was given back
        (DEF-ACT-0819)
      - >-
        services-accounting:modules/fiscal-close/tests/integration/services/jobs/close-job.integration.spec.js#gives
        the period back: open, no run holding it
      - >-
        services-accounting:modules/fiscal-close/tests/integration/services/jobs/close-job.integration.spec.js#refuses
        a retry of the released run, naming a new close
      - >-
        services-accounting:modules/fiscal-close/tests/integration/services/jobs/close-job.integration.spec.js#lets
        a new close succeed and close the period
      - TST-ACC-CLS-021
    provenance: test
    source: >-
      services-accounting:modules/fiscal-close/tests/integration/services/jobs/close-job.integration.spec.js#a
      failure in finalize, then a new close
    category: failure
  - id: ATS-ACC-CLS-012-03
    title: Cancel only before committed recognition
    level: api
    proves:
      - BR-CAP-ACC-CLS-012-05
      - BR-CAP-ACC-CLS-012-06
      - BR-CAP-ACC-CLS-012-07
    preconditions: One failed close recognized revenue and another did not.
    steps: Attempt cancellation and repeat an already-completed cancellation.
    expected: >-
      The eligible cancellation leaves the month open; recognized revenue
      prevents cancellation and repeated cancellation is refused.
    negative: true
    data_needs: Two failed-close variants.
    bound_to:
      - >-
        services-accounting:modules/fiscal-close/tests/integration/services/jobs/close-job.integration.spec.js#answers
        the run cancelled
      - >-
        services-accounting:modules/fiscal-close/tests/integration/services/jobs/close-job.integration.spec.js#leaves
        the period open with no run holding it (finalize had already given it
        back)
      - >-
        services-accounting:modules/fiscal-close/tests/integration/services/jobs/close-job.integration.spec.js#refuses
        the cancel as run-not-cancellable, naming the way out
      - >-
        services-accounting:modules/fiscal-close/tests/integration/services/jobs/close-job.integration.spec.js#reverses
        nothing: the port was asked to recognise once, by the close’s event key
      - >-
        services-accounting:modules/fiscal-close/tests/integration/services/jobs/close-job.integration.spec.js#refuses
        a cancel of the cancelled run as finished
      - >-
        services-accounting:modules/fiscal-close/tests/e2e/fiscal-close-runs.e2e.spec.js#refuses
        retrying a run that did not fail with 409
      - >-
        services-accounting:modules/fiscal-close/tests/e2e/fiscal-close-runs.e2e.spec.js#refuses
        cancelling a finished run with 409
      - TST-ACC-CLS-021
      - TST-ACC-CLS-017
    provenance: test
    source: >-
      services-accounting:modules/fiscal-close/tests/integration/services/jobs/close-job.integration.spec.js#a
      cancel before finalize
    category: transition
  - id: ATS-ACC-CLS-012-04
    title: Restore close details after cancelling a reopen
    level: api
    proves:
      - BR-CAP-ACC-CLS-012-05
    preconditions: The reopen failed after locking but before reversal.
    steps: Cancel its run.
    expected: >-
      The original closed state, closer and close time return while the run
      becomes cancelled.
    negative: false
    data_needs: A pre-reversal reopen failure.
    bound_to: []
    provenance: proposed
    source: >-
      services-accounting:modules/fiscal-close/services/jobs/close-run-actions.ts:cancelCloseRun
    category: transition
  - id: ATS-ACC-CLS-012-05
    title: Authorize recovery by run kind
    level: api
    proves:
      - BR-CAP-ACC-CLS-012-08
      - INV-DOM-ACC-CLS-003-11
    preconditions: The caller lacks the close grant on a failed close.
    steps: Request retry and cancellation.
    expected: Both are denied and the run remains unchanged.
    negative: true
    data_needs: A failed close and callers without its action grant.
    bound_to:
      - >-
        services-accounting:modules/fiscal-close/tests/e2e/fiscal-close-runs.e2e.spec.js#refuses
        a reader’s retry with 403: the handler requires the run’s kind’s key
      - >-
        services-accounting:modules/fiscal-close/tests/integration/services/jobs/close-job.integration.spec.js#refuses
        a cancel to a caller without the close permission
      - TST-ACC-CLS-017
      - TST-ACC-CLS-021
    provenance: test
    source: >-
      services-accounting:modules/fiscal-close/tests/e2e/fiscal-close-runs.e2e.spec.js#refuses
      a reader’s retry with 403: the handler requires the run’s kind’s key
    category: permission
  - id: ATS-ACC-CLS-012-06
    title: Describe cancellation honestly before confirmation
    level: browser
    proves:
      - BR-CAP-ACC-CLS-012-10
    preconditions: Failed closes differ in committed recognition work.
    steps: Open their cancellation confirmations.
    expected: >-
      The product should explain refusal after recognition and the eligible
      return to open before asking for confirmation.
    negative: true
    data_needs: Failed runs with and without recognition.
    bound_to: []
    provenance: proposed
    source: >-
      react-console:acceptance/accounting/journeys/reconciliation-close/ACT-ACC-0618.json
    category: permission
  - id: ATS-ACC-CLS-012-07
    title: Inspect recovery history without repeating financial work
    category: interaction
    level: api
    proves:
      - BR-CAP-ACC-CLS-012-01
      - BR-CAP-ACC-CLS-012-02
      - BR-CAP-ACC-CLS-012-06
    preconditions: A close has recognized revenue and fails during finalization.
    steps: >-
      Inspect the failed step, refuse cancellation, retry, then read the
      combined attempt history and recognition output.
    expected: >-
      The same run resumes through a linked job with its committed revenue
      retained; the view reports the available attempts and completion.
    negative: false
    data_needs: A close has recognized revenue and fails during finalization.
    bound_to: []
    provenance: proposed
    source:
      - >-
        rhythm-v2-docs:specs/accounting/close/design/workflows/WF-ACC-CLS-003-retry-an-interrupted-close-or-reopen.md#What
        It Does
      - >-
        services-accounting:modules/fiscal-close/tests/integration/services/jobs/reopen-job.integration.spec.js#leaves
        the period reopening
      - >-
        services-accounting:modules/fiscal-close/tests/integration/services/jobs/reopen-job.integration.spec.js#finishes
        the reopen on retry
      - >-
        services-accounting:modules/fiscal-close/tests/integration/services/jobs/close-job.integration.spec.js#refuses
        the cancel as run-not-cancellable, naming the way out
    exercises:
      - CAP-ACC-CLS-012
      - CAP-ACC-CLS-009
      - CAP-ACC-CLS-013
    workflows:
      - WF-ACC-CLS-003
      - WF-ACC-CLS-004
  - id: ATS-ACC-CLS-012-08
    title: Cancel a queued request before its job starts
    category: transition
    level: api
    proves:
      - BR-CAP-ACC-CLS-012-05
      - BR-CAP-ACC-CLS-012-07
    preconditions: >-
      A close is saved as queued while its month remains open and its job has
      not started.
    steps: Cancel it and then invoke its lock task.
    expected: >-
      Cancellation leaves the month open, records a final cancelled run and
      prevents the late job from taking the month.
    negative: true
    data_needs: >-
      A close is saved as queued while its month remains open and its job has
      not started.
    bound_to: []
    provenance: proposed
    source: >-
      services-accounting:modules/fiscal-close/services/jobs/close-run-actions.ts:cancelCloseRun
  - id: ATS-ACC-CLS-012-09
    title: Keep completed and cancelled run outcomes final
    category: invariant
    level: unit
    proves:
      - BR-CAP-ACC-CLS-012-07
      - INV-DOM-ACC-CLS-003-03
    preconditions: Run fixtures cover successful and cancelled outcomes.
    steps: >-
      Ask the transition rule to move each final outcome into every other
      status.
    expected: Every attempted outgoing move receives a finished-run refusal.
    negative: false
    data_needs: Run fixtures cover successful and cancelled outcomes.
    bound_to:
      - TST-ACC-CLS-047
      - >-
        services-accounting:modules/fiscal-close/tests/unit/rules/transitions.spec.js#is
        refused every move out of a succeeded or cancelled run as finished
    provenance: test
    source: >-
      services-accounting:modules/fiscal-close/tests/unit/rules/transitions.spec.js#is
      refused every move out of a succeeded or cancelled run as finished
evidence:
  - >-
    services-accounting examination inputs: the bound integration and end-to-end
    files.
  - >-
    react-console examination inputs: the run page and the failed-close journey
    (automation blocked).
  - >-
    Testing back-fill: pinned executable files are inspected; no backend or
    browser result is claimed.
coverage:
  rule: 'gap: FND-ACC-CLS-068'
  transition: covered
  validation: 'gap: FND-ACC-CLS-068'
  permission: covered
  edge: 'gap: FND-ACC-CLS-068'
  failure: covered
  boundary: 'gap: FND-ACC-CLS-068'
  concurrency: 'gap: FND-ACC-CLS-068'
  invariant: covered
  interaction: covered
coverage_notes:
  rule:
    reason: >-
      Queued cancellation, restoring prior close details, stale failure delivery
      during retry and reopen-kind recovery authority need complete proof.
    provenance: unknown
    source: FND-ACC-CLS-068
  transition:
    scenarios:
      - ATS-ACC-CLS-012-03
      - ATS-ACC-CLS-012-04
      - ATS-ACC-CLS-012-08
    provenance: inferred
    source:
      - ATS-ACC-CLS-012-03
      - ATS-ACC-CLS-012-04
      - ATS-ACC-CLS-012-08
    note: Specified coverage does not establish that all variants execute or pass.
  validation:
    reason: >-
      Queued cancellation, restoring prior close details, stale failure delivery
      during retry and reopen-kind recovery authority need complete proof.
    provenance: unknown
    source: FND-ACC-CLS-068
  permission:
    scenarios:
      - ATS-ACC-CLS-012-05
      - ATS-ACC-CLS-012-06
    provenance: inferred
    source:
      - ATS-ACC-CLS-012-05
      - ATS-ACC-CLS-012-06
    note: Specified coverage does not establish that all variants execute or pass.
  edge:
    reason: >-
      Queued cancellation, restoring prior close details, stale failure delivery
      during retry and reopen-kind recovery authority need complete proof.
    provenance: unknown
    source: FND-ACC-CLS-068
  failure:
    scenarios:
      - ATS-ACC-CLS-012-01
      - ATS-ACC-CLS-012-02
    provenance: inferred
    source:
      - ATS-ACC-CLS-012-01
      - ATS-ACC-CLS-012-02
    note: Specified coverage does not establish that all variants execute or pass.
  boundary:
    reason: >-
      Queued cancellation, restoring prior close details, stale failure delivery
      during retry and reopen-kind recovery authority need complete proof.
    provenance: unknown
    source: FND-ACC-CLS-068
  concurrency:
    reason: >-
      Queued cancellation, restoring prior close details, stale failure delivery
      during retry and reopen-kind recovery authority need complete proof.
    provenance: unknown
    source: FND-ACC-CLS-068
  invariant:
    scenarios:
      - ATS-ACC-CLS-012-09
    provenance: inferred
    source:
      - ATS-ACC-CLS-012-09
    note: Specified coverage does not establish that all variants execute or pass.
  interaction:
    scenarios:
      - ATS-ACC-CLS-012-07
    provenance: inferred
    source:
      - ATS-ACC-CLS-012-07
    note: Specified coverage does not establish that all variants execute or pass.
design_coverage:
  objects:
    - DOM-ACC-CLS-003
  invariants:
    - id: INV-DOM-ACC-CLS-003-01
      scenarios: []
      gap: FND-ACC-CLS-068
      provenance: unknown
      source: FND-ACC-CLS-068
    - id: INV-DOM-ACC-CLS-003-02
      scenarios: []
      gap: FND-ACC-CLS-068
      provenance: unknown
      source: FND-ACC-CLS-068
    - id: INV-DOM-ACC-CLS-003-03
      scenarios:
        - ATS-ACC-CLS-012-09
      provenance: test
      source:
        - >-
          services-accounting:modules/fiscal-close/tests/unit/rules/transitions.spec.js#is
          refused every move out of a succeeded or cancelled run as finished
    - id: INV-DOM-ACC-CLS-003-04
      scenarios: []
      gap: FND-ACC-CLS-068
      provenance: unknown
      source: FND-ACC-CLS-068
    - id: INV-DOM-ACC-CLS-003-05
      scenarios: []
      gap: FND-ACC-CLS-068
      provenance: unknown
      source: FND-ACC-CLS-068
    - id: INV-DOM-ACC-CLS-003-06
      scenarios: []
      gap: FND-ACC-CLS-068
      provenance: unknown
      source: FND-ACC-CLS-068
    - id: INV-DOM-ACC-CLS-003-07
      scenarios: []
      gap: FND-ACC-CLS-068
      provenance: unknown
      source: FND-ACC-CLS-068
    - id: INV-DOM-ACC-CLS-003-08
      scenarios: []
      gap: FND-ACC-CLS-068
      provenance: unknown
      source: FND-ACC-CLS-068
    - id: INV-DOM-ACC-CLS-003-09
      scenarios: []
      gap: FND-ACC-CLS-068
      provenance: unknown
      source: FND-ACC-CLS-068
    - id: INV-DOM-ACC-CLS-003-10
      scenarios: []
      gap: FND-ACC-CLS-068
      provenance: unknown
      source: FND-ACC-CLS-068
    - id: INV-DOM-ACC-CLS-003-11
      scenarios:
        - ATS-ACC-CLS-012-05
      provenance: test
      source:
        - >-
          services-accounting:modules/fiscal-close/tests/e2e/fiscal-close-runs.e2e.spec.js#refuses
          a reader’s retry with 403: the handler requires the run’s kind’s key
  permissions:
    - key: accounting.fiscal-periods.read
      where_checked: api
      gap: FND-ACC-CLS-068
      provenance: unknown
      source: FND-ACC-CLS-068
      note: >-
        Existing permission scenarios cover the named cases; complete grant and
        surface variants need qualification.
    - key: accounting.fiscal-periods.close
      where_checked: service
      gap: FND-ACC-CLS-068
      provenance: unknown
      source: FND-ACC-CLS-068
      note: >-
        Existing permission scenarios cover the named cases; complete grant and
        surface variants need qualification.
    - key: accounting.fiscal-periods.reopen
      where_checked: service
      gap: FND-ACC-CLS-068
      provenance: unknown
      source: FND-ACC-CLS-068
      note: >-
        Existing permission scenarios cover the named cases; complete grant and
        surface variants need qualification.
  workflows:
    - WF-ACC-CLS-003
    - WF-ACC-CLS-004
  state_models:
    - STATE-ACC-CLS-001
    - STATE-ACC-CLS-002
  transitions:
    - model: STATE-ACC-CLS-001
      from: open
      to: closing
      provenance: unknown
      source: FND-ACC-CLS-068
      gap: FND-ACC-CLS-068
      note: >-
        Writer and workflow scenarios supply selected outcomes; full guard,
        side-effect and race variants require qualification.
    - model: STATE-ACC-CLS-001
      from: closing
      to: closed
      provenance: unknown
      source: FND-ACC-CLS-068
      gap: FND-ACC-CLS-068
      note: >-
        Writer and workflow scenarios supply selected outcomes; full guard,
        side-effect and race variants require qualification.
    - model: STATE-ACC-CLS-001
      from: closing
      to: open
      provenance: unknown
      source: FND-ACC-CLS-068
      gap: FND-ACC-CLS-068
      note: >-
        Writer and workflow scenarios supply selected outcomes; full guard,
        side-effect and race variants require qualification.
    - model: STATE-ACC-CLS-001
      from: closed
      to: reopening
      provenance: unknown
      source: FND-ACC-CLS-068
      gap: FND-ACC-CLS-068
      note: >-
        Writer and workflow scenarios supply selected outcomes; full guard,
        side-effect and race variants require qualification.
    - model: STATE-ACC-CLS-001
      from: reopening
      to: open
      provenance: unknown
      source: FND-ACC-CLS-068
      gap: FND-ACC-CLS-068
      note: >-
        Writer and workflow scenarios supply selected outcomes; full guard,
        side-effect and race variants require qualification.
    - model: STATE-ACC-CLS-001
      from: reopening
      to: closed
      provenance: unknown
      source: FND-ACC-CLS-068
      gap: FND-ACC-CLS-068
      note: >-
        Writer and workflow scenarios supply selected outcomes; full guard,
        side-effect and race variants require qualification.
    - model: STATE-ACC-CLS-002
      from: queued
      to: running
      provenance: unknown
      source: FND-ACC-CLS-068
      gap: FND-ACC-CLS-068
      note: >-
        Writer and workflow scenarios supply selected outcomes; full guard,
        side-effect and race variants require qualification.
    - model: STATE-ACC-CLS-002
      from: running
      to: succeeded
      provenance: unknown
      source: FND-ACC-CLS-068
      gap: FND-ACC-CLS-068
      note: >-
        Writer and workflow scenarios supply selected outcomes; full guard,
        side-effect and race variants require qualification.
    - model: STATE-ACC-CLS-002
      from: running
      to: failed
      provenance: unknown
      source: FND-ACC-CLS-068
      gap: FND-ACC-CLS-068
      note: >-
        Writer and workflow scenarios supply selected outcomes; full guard,
        side-effect and race variants require qualification.
    - model: STATE-ACC-CLS-002
      from: queued
      to: failed
      provenance: unknown
      source: FND-ACC-CLS-068
      gap: FND-ACC-CLS-068
      note: >-
        Writer and workflow scenarios supply selected outcomes; full guard,
        side-effect and race variants require qualification.
    - model: STATE-ACC-CLS-002
      from: failed
      to: running
      provenance: unknown
      source: FND-ACC-CLS-068
      gap: FND-ACC-CLS-068
      note: >-
        Writer and workflow scenarios supply selected outcomes; full guard,
        side-effect and race variants require qualification.
    - model: STATE-ACC-CLS-002
      from: queued
      to: cancelled
      provenance: unknown
      source: FND-ACC-CLS-068
      gap: FND-ACC-CLS-068
      note: >-
        Writer and workflow scenarios supply selected outcomes; full guard,
        side-effect and race variants require qualification.
    - model: STATE-ACC-CLS-002
      from: failed
      to: cancelled
      provenance: unknown
      source: FND-ACC-CLS-068
      gap: FND-ACC-CLS-068
      note: >-
        Writer and workflow scenarios supply selected outcomes; full guard,
        side-effect and race variants require qualification.
  interactions:
    - with: CAP-ACC-CLS-009
      scenario: ATS-ACC-CLS-012-07
      provenance: proposed
      source:
        - >-
          rhythm-v2-docs:specs/accounting/close/design/workflows/WF-ACC-CLS-003-retry-an-interrupted-close-or-reopen.md#What
          It Does
        - >-
          services-accounting:modules/fiscal-close/tests/integration/services/jobs/reopen-job.integration.spec.js#leaves
          the period reopening
        - >-
          services-accounting:modules/fiscal-close/tests/integration/services/jobs/reopen-job.integration.spec.js#finishes
          the reopen on retry
        - >-
          services-accounting:modules/fiscal-close/tests/integration/services/jobs/close-job.integration.spec.js#refuses
          the cancel as run-not-cancellable, naming the way out
    - with: CAP-ACC-CLS-013
      scenario: ATS-ACC-CLS-012-07
      provenance: proposed
      source:
        - >-
          rhythm-v2-docs:specs/accounting/close/design/workflows/WF-ACC-CLS-003-retry-an-interrupted-close-or-reopen.md#What
          It Does
        - >-
          services-accounting:modules/fiscal-close/tests/integration/services/jobs/reopen-job.integration.spec.js#leaves
          the period reopening
        - >-
          services-accounting:modules/fiscal-close/tests/integration/services/jobs/reopen-job.integration.spec.js#finishes
          the reopen on retry
        - >-
          services-accounting:modules/fiscal-close/tests/integration/services/jobs/close-job.integration.spec.js#refuses
          the cancel as run-not-cancellable, naming the way out
---
# Recover an interrupted close or reopen: Capability Test Specification

## Coverage

The table maps each required rule to its specified cases or an explicit finding. Category coverage describes the specification; executable bindings and recorded run results establish different kinds of evidence. Proposed cases remain unqualified.

| Rule | Scenarios or Finding |
|---|---|
| `BR-CAP-ACC-CLS-012-01` | `ATS-ACC-CLS-012-01`, `ATS-ACC-CLS-012-07` |
| `BR-CAP-ACC-CLS-012-02` | `ATS-ACC-CLS-012-01`, `ATS-ACC-CLS-012-07` |
| `BR-CAP-ACC-CLS-012-03` | `ATS-ACC-CLS-012-02` |
| `BR-CAP-ACC-CLS-012-04` | `ATS-ACC-CLS-012-02` |
| `BR-CAP-ACC-CLS-012-05` | `ATS-ACC-CLS-012-03`, `ATS-ACC-CLS-012-04`, `ATS-ACC-CLS-012-08` |
| `BR-CAP-ACC-CLS-012-06` | `ATS-ACC-CLS-012-03`, `ATS-ACC-CLS-012-07` |
| `BR-CAP-ACC-CLS-012-07` | `ATS-ACC-CLS-012-03`, `ATS-ACC-CLS-012-08`, `ATS-ACC-CLS-012-09` |
| `BR-CAP-ACC-CLS-012-08` | `ATS-ACC-CLS-012-05` |

## Interactions With Related Capabilities

Recovery changes job attempts while retaining the request and any committed financial work. The interaction case asks for both execution history and recognition output around retry. A successful retry assertion alone does not establish the entire displayed history.
