---
id: TST-PFM-SEC-114
title: Pool account removals database and service checks
kind: integration
product_area: platform
module: security
revision: 2
status: draft
source_sha:
  services-platform: ad3f6a6582843008ed0f5a17b131878d15829af1
repository: services-platform
files:
  - modules/security/tests/integration/services/dispatch/pool-account-removals.integration.spec.js
implements:
  - ATS-PFM-SEC-009-08
environment: local
implementation_state: implemented
latest_result: not-run
latest_run_at: null
latest_run_ref: null
conformance: not-verified
estimated_minutes: 3
isolation: Use the prepared test database and suite-owned fixture rows; retain shared seed records.
assertion_evidence:
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/dispatch/pool-account-removals.integration.spec.js#security:
      the login a delete leaves behind is removed, and retried until it is
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/dispatch/pool-account-removals.integration.spec.js#queues
      the removal of the login the delete read before the row went
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/dispatch/pool-account-removals.integration.spec.js#answers
      the account it queued, and calls Cognito for nothing: the request path never waits on the pool
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/dispatch/pool-account-removals.integration.spec.js#publishes
      one item for the row and deletes the row the queue accepted
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/dispatch/pool-account-removals.integration.spec.js#leaves
      a row the queue refused where it is, for the next run to offer again
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/dispatch/pool-account-removals.integration.spec.js#the
      consumer behind the queue
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/dispatch/pool-account-removals.integration.spec.js#gives
      the first delivery back to SQS, which is how it is tried again
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/dispatch/pool-account-removals.integration.spec.js#leaves
      the account in the pool when the call failed: nothing pretends it went
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/dispatch/pool-account-removals.integration.spec.js#removes
      the account on the second delivery, and tells SQS the item is done
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/dispatch/pool-account-removals.integration.spec.js#records
      the removal on the security trail, which is what lasts once the queue row is gone
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/dispatch/pool-account-removals.integration.spec.js#counts
      an account the pool no longer holds as the success a delete exists to reach
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/dispatch/pool-account-removals.integration.spec.js#counts
      it the same success through the refusal the gateway really raises, which carries no Cognito
      name
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/dispatch/pool-account-removals.integration.spec.js#tells
      SQS nothing is owing for that refusal, so an account already gone never reaches the
      dead-letter queue
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/dispatch/pool-account-removals.integration.spec.js#acknowledges
      a body it cannot act on rather than retrying it to the dead-letter queue
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/dispatch/pool-account-removals.integration.spec.js#removing
      a person’s access
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/dispatch/pool-account-removals.integration.spec.js#queues
      the disabling of the login, in the revocation’s own transaction
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/dispatch/pool-account-removals.integration.spec.js#disables
      the account when the queue’s consumer runs, and tells SQS the item is done
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/dispatch/pool-account-removals.integration.spec.js#a
      delete the database refuses
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/dispatch/pool-account-removals.integration.spec.js#refuses
      the delete, as it did before anything was queued for it
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/dispatch/pool-account-removals.integration.spec.js#leaves
      no removal behind: the row was written in the transaction the refusal took down
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/dispatch/pool-account-removals.integration.spec.js#queues
      one for a delete of the same shape that succeeds, so the absence above is about the rollback
dependency_evidence: >-
  The prepared PostgreSQL database supplies the persisted fixtures and constraints exercised here.
  The suite controls Cognito, the clock at the declared seams; those collaborators remain outside
  its live proof.
evidence:
  - >-
    services-platform:modules/security/tests/integration/services/dispatch/pool-account-removals.integration.spec.js
  - >-
    Static review at the recorded source revision; executable results remain not-run and conformance
    remains not-verified.
binding_note: >-
  Each binding names the scenario to which this file contributes assertions. A binding is not a
  recorded pass and does not extend the file’s dependency boundary.
examiner: codex
examined_at: '2026-10-23'
final_text: OpenAI
dependency_review:
  provenance: test
  source: >-
    services-platform:modules/security/tests/integration/services/dispatch/pool-account-removals.integration.spec.js
  explicit_no_doubles: false
  identified_double_boundaries:
    - Cognito
    - the clock
---
# Pool account removals database and service checks

## Verification Boundary

The file exercises database or service behavior through the local integration harness. The assertion references identify the source checks for pool account removals.

## What This Suite Proves

The source assertions support the observations named in the bound scenarios. A scenario spanning multiple files must retain the other files’ contributions.

## What It Does Not Prove

This examination does not run the suite. Passing behavior, deployed conformance and the behavior of substituted dependencies require separate execution evidence.

## Real Dependencies and Test Doubles

The prepared PostgreSQL database supplies the persisted fixtures and constraints exercised here. The suite controls Cognito, the clock at the declared seams; those collaborators remain outside its live proof.

## Must Not Be Doubled

Keep the queried database, applicable constraints and transaction boundaries real. Provider substitutes cannot establish delivery, cloud execution or cross-service recovery.
