---
id: WF-PFM-QRY-010
title: Revalidate published custom query tables nightly
trigger: 'The nightly revalidation schedule fires at 04:20 UTC, or staff request the same bounded pass.'
product_area: platform
module: queries
revision: 1
status: draft
design_intent: confirmed
implementation_evidence: observed
source_sha:
  services-platform: ad3f6a6582843008ed0f5a17b131878d15829af1
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
inference: []
implements:
  - CAP-PFM-QRY-005
crosses:
  - SVC-PFM-QRY-queries
idempotency: >-
  Health-change history is retained, with passing history bounded to one entry per version per day.
  Repeating a pass does not mean it performs no validation work.
concurrency: >-
  Revalidation is a bounded scheduled operation rather than a durable job; later passes replace
  interrupted work.
hops:
  - 'n': 1
    actor_or_service: EventBridge schedule or staff route
    action: Invoke the revalidation pass from the schedule or staff route.
    anchor: 'services-platform:modules/queries/aws/logic/queries-revalidation.lambda.ts'
    seam: schedule
    on_failure: >-
      Undelivered invocation reaches its dead-letter handling; missing runs trigger the silence
      alarm.
    left_inconsistent: A newly broken table can remain undiscovered until another validation or execution.
    observer: the silence alarm (missing data is breaching)
    provenance: observed
    source: 'services-platform:modules/queries/aws/logic/queries-revalidation.lambda.ts'
  - 'n': 2
    actor_or_service: Revalidation
    action: Check validation-workspace configuration and log a skip if it is absent.
    anchor: 'services-platform:modules/queries/services/custom-tables/revalidate-custom-tables.ts'
    seam: sync
    on_failure: The configured skip completes without analyzing tables.
    left_inconsistent: That environment receives no revalidation coverage.
    observer: the function's log
    provenance: observed
    source: 'services-platform:modules/queries/services/custom-tables/revalidate-custom-tables.ts'
  - 'n': 3
    actor_or_service: Revalidation
    action: >-
      Reanalyze active or deprecated released versions and pinned versions, comparing source-derived
      and stored fingerprints.
    anchor: 'services-platform:modules/queries/services/custom-tables/revalidation-check.ts'
    seam: sync
    on_failure: Record failing health with problem codes rather than SQL or record contents.
    left_inconsistent: The version’s health indicates the failure; no automatic repair is supplied.
    observer: custom table history and the HQ detail screen's health
    provenance: observed
    source: 'services-platform:modules/queries/services/custom-tables/revalidate-custom-tables.ts'
branches: []
waits: []
evidence:
  - >-
    services-platform at ad3f6a6:
    modules/queries/services/custom-tables/revalidate-custom-tables.ts, revalidation-check.ts;
    aws/logic/queries-revalidation.lambda.ts
controls: [TC-AVL-001, TC-AVL-005, TC-AZ-001, TC-AZ-002, TC-AZ-003, TC-AZ-004, TC-AZ-005, TC-AZ-006, TC-CRY-001, TC-CRY-002, TC-CRY-003, TC-CRY-004, TC-IAM-001, TC-IAM-002, TC-IAM-003, TC-IAM-004, TC-IAM-005, TC-IAM-006, TC-LOG-001, TC-LOG-002, TC-LOG-003, TC-LOG-004, TC-LOG-005, TC-MON-001, TC-MON-002, TC-PI-001, TC-PI-002, TC-PI-003, TC-PI-005, TC-TEN-001, TC-TEN-002, TC-TEN-003, TC-VEN-001, TC-VEN-002, TC-VEN-003]
---

# Revalidate published custom query tables nightly

## What It Does

The nightly revalidation schedule fires at 04:20 UTC, or staff request the same bounded pass. 

## The Flow

```mermaid
sequenceDiagram
  participant C as Request or schedule
  participant H0 as EventBridge schedule or staff route
  participant H1 as Revalidation
  participant H2 as Revalidation
  C-)H0: Invoke the revalidation pass from the schedule or staff route
  H0->>H1: Check validation-workspace configuration and log a skip if it is absent
  H1->>H2: Reanalyze active or deprecated released versions and pinned versions, comparing source-derived and s
```

Invoke the revalidation pass from the schedule or staff route. Check validation-workspace configuration and log a skip if it is absent. Reanalyze active or deprecated released versions and pinned versions, comparing source-derived and stored fingerprints.

## When Something Fails

Undelivered invocation reaches its dead-letter handling; missing runs trigger the silence alarm. A newly broken table can remain undiscovered until another validation or execution. The configured skip completes without analyzing tables. That environment receives no revalidation coverage. Record failing health with problem codes rather than SQL or record contents. The version’s health indicates the failure; no automatic repair is supplied.

## Idempotency and Concurrency

Health-change history is retained, with passing history bounded to one entry per version per day. Repeating a pass does not mean it performs no validation work. Revalidation is a bounded scheduled operation rather than a durable job; later passes replace interrupted work.
