---
id: TST-ACC-REC-066
title: Investigation and acceptance records
kind: integration
product_area: accounting
module: reconciliation
revision: 1
status: draft
source_sha:
  services-accounting: f47cb263875bbc0c5640fba7dae6785ec32695f8
repository: services-accounting
files:
  - >-
    modules/reconciliation/tests/integration/services/persistence/reconciliation-exceptions.integration.spec.js
implements:
  - ATS-ACC-REC-015-01
  - ATS-ACC-REC-015-02
  - ATS-ACC-REC-015-03
  - ATS-ACC-REC-015-04
  - ATS-ACC-REC-015-05
  - ATS-ACC-REC-015-06
  - ATS-ACC-REC-015-08
  - ATS-ACC-REC-016-01
  - ATS-ACC-REC-016-02
  - ATS-ACC-REC-016-03
  - ATS-ACC-REC-016-04
  - ATS-ACC-REC-016-06
  - ATS-ACC-REC-016-07
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 workspace fixtures and deterministic records removed by suite cleanup.
evidence:
  - >-
    services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-exceptions.integration.spec.js
  - 'Declared test doubles: Doubled: the clock (`TEST_CLOCK`, 2026-10-07T12:00:00Z).'
bindings:
  - scenario: ATS-ACC-REC-015-01
    assertions:
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-exceptions.integration.spec.js#raises
        a manual exception about its subjects, answering each subject’s navigation target
  - scenario: ATS-ACC-REC-015-02
    assertions:
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-exceptions.integration.spec.js#raises
        nothing while the key’s exception is open
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-exceptions.integration.spec.js#raises
        nothing while the key’s exception is accepted
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-exceptions.integration.spec.js#raises
        nothing when the dedupe index already holds the key open (two detectors racing)
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-exceptions.integration.spec.js#reopens
        the key’s resolved exception, recording `exception.reopened`
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-exceptions.integration.spec.js#raises
        a new exception, numbered after the tenant’s highest, with its steps and its event
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-exceptions.integration.spec.js#clears
        the open exceptions of a kind about a subject, recording `exception.auto-resolved`
  - scenario: ATS-ACC-REC-015-03
    assertions:
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-exceptions.integration.spec.js#sets
        the owner and moves the exception to investigating, recording `exception.updated`
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-exceptions.integration.spec.js#refuses
        a change at a version that is not the exception’s (409, `stale_version`)
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-exceptions.integration.spec.js#refuses
        an owner or status change of a closed exception (409, `exception_closed`)
  - scenario: ATS-ACC-REC-015-04
    assertions:
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-exceptions.integration.spec.js#refuses
        the note after the 200th (409, `notes_limit`)
  - scenario: ATS-ACC-REC-015-05
    assertions:
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-exceptions.integration.spec.js#marks
        a step done by the caller now, and undone again
  - scenario: ATS-ACC-REC-015-06
    assertions:
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-exceptions.integration.spec.js#refuses
        to resolve an overdue-settlement exception while its item is still overdue and unclaimed (409,
        `condition_still_holds`)
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-exceptions.integration.spec.js#resolves
        an overdue-settlement exception once its item is claimed, recording `exception.resolved`
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-exceptions.integration.spec.js#refuses
        to resolve as of 2026-10-06, when the item is overdue then (409, `condition_still_holds`)
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-exceptions.integration.spec.js#resolves
        as of 2026-10-05, when the item is only late then, though it is overdue today
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-exceptions.integration.spec.js#resolves
        an exception whose item was written off, as of a later date too (200)
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-exceptions.integration.spec.js#refuses
        to resolve a closed exception (409, `exception_closed`)
  - scenario: ATS-ACC-REC-015-08
    assertions:
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-exceptions.integration.spec.js#filters
        by status, severity, kind and subject type, newest number first
  - scenario: ATS-ACC-REC-016-01
    assertions:
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-exceptions.integration.spec.js#accepts
        a warning by one user, without a second and with no request
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-exceptions.integration.spec.js#answers
        the stored acceptance for the same key and request
  - scenario: ATS-ACC-REC-016-02
    assertions:
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-exceptions.integration.spec.js#records
        a blocker’s acceptance request by the first user and leaves it open (`exception.acceptance-requested`)
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-exceptions.integration.spec.js#refuses
        a second acceptance request while one is pending (409, `acceptance_already_requested`)
  - scenario: ATS-ACC-REC-016-03
    assertions:
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-exceptions.integration.spec.js#refuses
        the requester’s own approval (403, `second_user_required`)
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-exceptions.integration.spec.js#refuses
        an approval at a version that is not the exception’s (409, `stale_version`)
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-exceptions.integration.spec.js#accepts
        the blocker on a second user’s approval, the requester its resolver (`exception.accepted`)
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-exceptions.integration.spec.js#answers
        the approver’s own approval again under a new key (state idempotency)
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-exceptions.integration.spec.js#refuses
        the approval of a blocker with no acceptance requested (409, `no_acceptance_requested`)
  - scenario: ATS-ACC-REC-016-04
    assertions:
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-exceptions.integration.spec.js#refuses
        another user’s withdrawal (403, `acceptance_requester_only`)
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-exceptions.integration.spec.js#withdraws
        the request by its requester, clearing it and leaving the blocker open
        (`exception.acceptance-withdrawn`)
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-exceptions.integration.spec.js#refuses
        a withdrawal with no acceptance requested (409, `no_acceptance_requested`)
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-exceptions.integration.spec.js#records
        each refused withdrawal as `exception.acceptance-withdrawal-refused`
  - scenario: ATS-ACC-REC-016-06
    assertions:
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-exceptions.integration.spec.js#clears
        a pending acceptance request when the exception is resolved, saying so in `exception.resolved`
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-exceptions.integration.spec.js#clears
        a pending acceptance request when its condition is cleared
  - scenario: ATS-ACC-REC-016-07
    assertions:
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-exceptions.integration.spec.js#refuses
        the request’s key sent with another request (409, `idempotency_key_reused`)
---

# Investigation and acceptance records

## Verification Boundary

This suite calls production services over the real test database. Fixture setup may write records directly; the exercised commands and queries retain their normal database enforcement.

## What This Suite Proves

The executable assertions identified in the binding records supply the registered scenario observations. When a scenario names several suites, this suite supplies its listed assertions and does not independently establish every clause.

## What It Does Not Prove

Deployed infrastructure, live console behavior and shared scheduling delivery are outside this local boundary.

## Real Dependencies and Test Doubles

PostgreSQL, migrations and the exercised production code are real. Fixtures supply the financial world and caller context; deterministic setup and owner-side inspection do not replace database enforcement.

## Must Not Be Doubled

The exercised database constraints, transactional services and route enforcement remain real. Replacing them would remove the boundary this suite registers.
