---
id: TST-ACC-REC-076
title: Overdue drift and replay cleanup work
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/scheduled/reconciliation-scheduled-work.integration.spec.js
implements:
  - ATS-ACC-REC-017-02
  - ATS-ACC-REC-017-03
  - ATS-ACC-REC-017-04
  - ATS-ACC-REC-017-05
  - ATS-ACC-REC-017-06
  - ATS-ACC-REC-017-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/scheduled/reconciliation-scheduled-work.integration.spec.js
  - >-
    Declared test doubles: Doubled: the telemetry's metric sink (captured), the scheduled run (built here, as
    the consumer builds it from a claimed run).
bindings:
  - scenario: ATS-ACC-REC-017-02
    assertions:
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/scheduled/reconciliation-scheduled-work.integration.spec.js#raises
        the item past its grace as an open `overdue-settlement` blocker
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/scheduled/reconciliation-scheduled-work.integration.spec.js#titles
        the item’s exception with its amount, payment method, kind and the date it occurred, never its source
        key
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/scheduled/reconciliation-scheduled-work.integration.spec.js#raises
        nothing for an item in transit, resolved or already under investigation
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/scheduled/reconciliation-scheduled-work.integration.spec.js#leaves
        the gift in transit on 2026-10-12, raising nothing for it
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/scheduled/reconciliation-scheduled-work.integration.spec.js#raises
        nothing when it runs again at the same occurrence
  - scenario: ATS-ACC-REC-017-03
    assertions:
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/scheduled/reconciliation-scheduled-work.integration.spec.js#clears
        the exception of an item a finalized batch now claims, naming the batch
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/scheduled/reconciliation-scheduled-work.integration.spec.js#clears
        the exception of an item since resolved, naming the resolution
  - scenario: ATS-ACC-REC-017-04
    assertions:
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/scheduled/reconciliation-scheduled-work.integration.spec.js#raises
        no unbalanced payout on 2026-10-12: the old payout’s fifth business day is Tuesday 10-13
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/scheduled/reconciliation-scheduled-work.integration.spec.js#raises
        the old payout and not the payout exactly five business days old, nor the voided one
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/scheduled/reconciliation-scheduled-work.integration.spec.js#clears
        the unbalanced exception of a payout now in a finalized batch
  - scenario: ATS-ACC-REC-017-05
    assertions:
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/scheduled/reconciliation-scheduled-work.integration.spec.js#checks
        every open and finalized batch, and raises the drifting one
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/scheduled/reconciliation-scheduled-work.integration.spec.js#raises
        `totals-drift` naming each total that differs from the rows
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/scheduled/reconciliation-scheduled-work.integration.spec.js#rewrites
        no total
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/scheduled/reconciliation-scheduled-work.integration.spec.js#raises
        nothing new when it runs again
  - scenario: ATS-ACC-REC-017-06
    assertions:
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/scheduled/reconciliation-scheduled-work.integration.spec.js#removes
        every tenant’s old completions and lost claims and answers how many (at least these four; the purge is
        every tenant’s)
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/scheduled/reconciliation-scheduled-work.integration.spec.js#keeps
        the fresh completion
  - scenario: ATS-ACC-REC-017-07
    assertions:
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/scheduled/reconciliation-scheduled-work.integration.spec.js#raises
        one exception: the beta unit’s overdue item, and leaves alpha’s item alone
---

# Overdue drift and replay cleanup work

## 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.
