# Spotify Daily Chart Freshness

Lambda function that:
* polls the Spotify provider API every 5 minutes for the latest daily chart date
* detects when a new chart date becomes available and starts a lag timer
* queries `FACTS.PROD.FACT_CHARTS` only when a new date is pending.
* emits a DataDog alert metric if FACT_CHARTS hasn't caught up within 15 minutes
* auto-resolves once FACT_CHARTS reaches the expected date

State is persisted in SSM Parameter Store across invocations.

# Local development

Requirements:
* Python 3.11
* `uv` installed globally or in a virtual environment
```shell
brew install uv
```
* Docker (aka colima)
* docker compose plugin

## Commands
```bash
# Start the local Lambda runtime
docker compose up --build -d function

# Run lint + unit tests
docker compose up --build lint-and-test

# Skip linting, run only tests
SKIP_LINT=true docker compose up --build lint-and-test

# Trigger a test invocation against the local runtime
make docker-trigger
```
