---
id: TST-PFM-QRY-472
title: Platform snapshot pipeline
kind: integration
product_area: platform
module: queries
revision: 2
status: draft
source_sha:
  services-platform: ad3f6a6582843008ed0f5a17b131878d15829af1
  rhythm-v2-docs: f946bdcc118035206f18109fbf69cd8e9e785aaf
repository: services-platform
files:
  - >-
    modules/snapshots/tests/integration/lifecycle/pipeline/snapshot-pipeline.integration.spec.js
implements:
  - ATS-PFM-QRY-019-03
  - ATS-PFM-QRY-019-04
  - ATS-PFM-QRY-019-06
  - ATS-PFM-QRY-019-11
  - FAS-PFM-QRY-08-03
environment: local
implementation_state: implemented
latest_result: not-run
latest_run_at: null
latest_run_ref: null
conformance: not-verified
estimated_minutes: 5
isolation: >-
  The suite’s database fixtures, controlled execution contexts and file-owned
  external dependency seams.
evidence:
  - >-
    services-platform:modules/snapshots/tests/integration/lifecycle/pipeline/snapshot-pipeline.integration.spec.js
assertion_bindings:
  - scenario: ATS-PFM-QRY-019-03
    source:
      - >-
        services-platform:modules/snapshots/tests/integration/lifecycle/pipeline/snapshot-pipeline.integration.spec.js#plans
        the eligible tenant's September in its own zone, as version 1 of a
        captured, scheduled run
      - >-
        services-platform:modules/snapshots/tests/integration/lifecycle/pipeline/snapshot-pipeline.integration.spec.js#reads
        the disabled tenant's month in its own zone, August, and skips it with
        the policy's reason
    scope: assertions cited by the scenario
    provenance: test
  - scenario: ATS-PFM-QRY-019-04
    source:
      - >-
        services-platform:modules/snapshots/tests/integration/lifecycle/pipeline/snapshot-pipeline.integration.spec.js#plans
        one run and skips two, passing over none
      - >-
        services-platform:modules/snapshots/tests/integration/lifecycle/pipeline/snapshot-pipeline.integration.spec.js#reads
        the disabled tenant's month in its own zone, August, and skips it with
        the policy's reason
      - >-
        services-platform:modules/snapshots/tests/integration/lifecycle/pipeline/snapshot-pipeline.integration.spec.js#skips
        the loading tenant, because half-loaded data is not history
      - >-
        services-platform:modules/snapshots/tests/integration/lifecycle/pipeline/snapshot-pipeline.integration.spec.js#leaves
        the skipped runs where they are: nothing admits a skipped run
    scope: assertions cited by the scenario
    provenance: test
  - scenario: ATS-PFM-QRY-019-06
    source:
      - >-
        services-platform:modules/snapshots/tests/integration/lifecycle/pipeline/snapshot-pipeline.integration.spec.js#publishes
        version 2 as the current one and keeps version 1, published and readable
      - >-
        services-platform:modules/snapshots/tests/integration/lifecycle/pipeline/snapshot-pipeline.integration.spec.js#fails
        the run with the checks that did not pass, and queues it for a retry
      - >-
        services-platform:modules/snapshots/tests/integration/lifecycle/pipeline/snapshot-pipeline.integration.spec.js#publishes
        nothing: none of its rows were kept, and version 2 is still the current
        one
    scope: assertions cited by the scenario
    provenance: test
  - scenario: ATS-PFM-QRY-019-11
    source:
      - >-
        services-platform:modules/snapshots/tests/integration/lifecycle/pipeline/snapshot-pipeline.integration.spec.js#removes
        every snapshot row, run and override of the purged tenants, the run's
        version chain included
      - >-
        services-platform:modules/snapshots/tests/integration/lifecycle/pipeline/snapshot-pipeline.integration.spec.js#ends
        each tenant with a call that removed nothing, which is how the purge
        proves the tenant empty
    scope: assertions cited by the scenario
    provenance: test
  - scenario: FAS-PFM-QRY-08-03
    source:
      - >-
        services-platform:modules/snapshots/tests/integration/lifecycle/pipeline/snapshot-pipeline.integration.spec.js#publishes
        version 2 as the current one and keeps version 1, published and readable
    scope: >-
      complete feature scenario at the inspected file boundary; execution
      remains unverified
    provenance: test
fixture_seams:
  - >-
    services-platform:modules/snapshots/tests/integration/lifecycle/pipeline/snapshot-pipeline.integration.spec.js:84
  - >-
    services-platform:modules/snapshots/tests/integration/lifecycle/pipeline/snapshot-pipeline.integration.spec.js:103
  - >-
    services-platform:modules/snapshots/tests/integration/lifecycle/pipeline/snapshot-pipeline.integration.spec.js:63
---
# Platform snapshot pipeline

## Verification Boundary

This suite exercises the local snapshot pipeline through its real worker and database. Cloud state-machine execution is represented by recorded starts and an in-process workflow walk.

## What This Suite Proves

The local pipeline plans three workspaces, admits the eligible run, publishes a replacement, rejects corrupted self-test counts and purges owned fixtures. Its bound lifecycle scenario checks retained versions and the selected period after failed validation.

## What It Does Not Prove

The small self-test does not establish cleanup of committed staging chunks for every snapshot generator or deployed Step Functions behavior. Registration supplies a verified assertion mapping, while the execution result remains unrecorded.

## Real Dependencies and Test Doubles

PostgreSQL, the snapshot repository, planner, dispatcher, job engine, real run handler and self-test SQL execute locally. The file records Step Functions starts, walks the workflow in process and narrows the planner’s workspace loader to its fixtures. A temporary database trigger introduces invalid counts.

## Must Not Be Doubled

Keep ledger writes, validation, publication transactions and purge statements real. Replacing these operations with fixture responses removes the publication and cleanup proof.
