---
id: TST-PFM-DJE-161
title: Run sentinel
kind: unit
product_area: platform
module: data-job-engine
revision: 1
status: draft
source_sha:
  services-platform: ad3f6a6582843008ed0f5a17b131878d15829af1
  macroservice-libraries: 54536a441935c6e09fdb7f96f0bec71c52ba4e03
  services-crm: a8d1364f1dd44b723bb5f9acba12f983e9ec8d69
  services-membership: 5994c270e8a37a30f848e99ba5b5ee6b87c08893
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
repository: services-platform
files:
  - modules/capacity/tests/unit/services/capacity/run-sentinel.spec.ts
implements: []
environment: local
implementation_state: implemented
latest_result: not-run
latest_run_at: null
latest_run_ref: null
conformance: not-verified
estimated_minutes: 1
isolation: In-memory fixtures and restored dependency doubles.
evidence:
  - 'services-platform:modules/capacity/tests/unit/services/capacity/run-sentinel.spec.ts'
assertion_inventory:
  - capacity sentinel tick
  - a calm minute
  - publishes normal on the parameter channel
  - publishes on the cache channel too
  - emits the capacity.state gauge at 0
  - emits no transition
  - reads only the window when the baseline is fresh
  - a saturated minute after critical has held
  - publishes emergency with its factors
  - emits the gauge at 3 and one transition
  - keeps the new state and when it began in its memory
  - the baseline
  - is recomputed from seven days of hourly p95 when none is stored
  - is recomputed when it is an hour old
  - CloudWatch unreadable
  - keeps the previous state for one minute
  - the pin unreadable
  - decides as though nothing were pinned
  - a pin
  - is published as the state
  - 'the stage throttles due, with the flag on'
  - patches the stage
  - remembers them as applied
  - 'remembers them as not applied when the patch failed, so the next minute tries again'
  - 'the stage throttles due, with module APIs publishing theirs'
  - 'gives every module stage its own emergency values, in module order'
  - leaves the fallback stage of the environment alone
  - 'reads the parameters of the module APIs once, under /rhythm/platform/apis/'
  - skips a malformed parameter and still throttles the others
  - restores every module stage to its own normal values on recovery
  - 'the stage throttles due, with no module API publishing any'
  - throttles the fallback stage of the environment
  - 'the stage throttles due, with the parameters of the module APIs unreadable'
  - changes no stage
  - 'remembers the throttles as not applied, so the next minute tries again'
  - counts the step as failed
  - a minute that moves no throttle
  - reads no parameter of the module APIs
  - 'the stage throttles due, with the flag off'
  - changes no stage
  - both channels down
  - 'fails the invocation, so it reaches the dead-letter queue'
  - only the cache down
  - still publishes on the parameter channel and succeeds
registration_note: Registration describes existing source; the suite is not executed by this documentation job.
---

# Run sentinel

## Verification Boundary

The suite checks an isolated production calculation, declaration or adapter. The structured assertion inventory records the checks present at the pinned revision.

## What This Suite Proves

The existing checks exercise run sentinel. The specification bindings identify the narrower outcomes supported by those assertions.

## What It Does Not Prove

An isolated check does not establish a deployed workflow, database enforcement or complete feature acceptance.

## Real Dependencies and Test Doubles

The production function or declaration is exercised with in-memory inputs and dependency doubles. This boundary does not require a live database.

## Must Not Be Doubled

The production function under examination and its returned decisions remain real; replacing their answers defeats the check.
