SRE Assessment

Market Data Freshness

Improve the provided Python CLI starter so it can evaluate freshness for three fictional feed consumers: `alpha`, `bravo`, and `charlie`. The system reads local JSON state, reports whether each feed is alive and safe to serve, blocks unsafe work when data is stale or unknown, and records a repeatable recovery path.

The input data is already provided in `starter/data/healthy.json`. `alpha`, `bravo`, and `charlie` are fixture feeds, not real systems. The task is to design the local reliability behavior around that fixture: classify freshness, fail closed, recover, and prove the result.

Evidence diagram
Assignment model
Stack
Python 3 CLI, standard library `argparse`, JSON state files, `unittest`
Tooling hint
`uv run python -m ...` is fine if you use uv locally
Starter path
`starter/freshness`, `starter/data/healthy.json`, `starter/tests`
Feeds
`alpha`, `bravo`, and `charlie` are fictional market-data consumers
Input data
`starter/data/healthy.json`; scenario commands write `/tmp/bravo-stale.json` and `/tmp/bravo-recovered.json`
Fixture schema
`max_age_seconds`, `feeds[].name`, `feeds[].alive`, `feeds[].last_tick_age_seconds`
Design target
A local reliability contract: status, safe-to-serve decisions, fail-closed blocking, recovery, tests, and CI
Implementation rules
Do not use real exchanges, broker APIs, streaming systems, cloud services, or external market data
Execution path

Run the starter, create stale data, recover, and submit evidence

  1. 01Open `starter/`; the codebase is a Python CLI package named `freshness`.
  2. 02Run the starter commands from `starter/`.
  3. 03Run `python3 -m unittest discover -s tests`.
  4. 04Run `python3 -m freshness smoke` against the bundled fixture data.
  5. 05Create stale `bravo` data with `python3 -m freshness scenario stale --feed bravo --output /tmp/bravo-stale.json`.
  6. 06Run `python3 -m freshness status --state /tmp/bravo-stale.json` and show only `bravo` is unsafe.
  7. 07Recover `bravo` with `python3 -m freshness recover --feed bravo --state /tmp/bravo-stale.json --output /tmp/bravo-recovered.json`.
  8. 08Add GitHub Actions that runs environment checks, unit tests, and smoke.
  9. 09Submit command output, the GitHub Actions run, the incident note, AI usage, and tradeoffs.
Acceptance gates
Fresh-checkout setup works.
Unit tests and smoke run locally.
GitHub Actions runs environment checks, tests, and smoke.
Stale feed behavior is detectable.
Unsafe work fails closed.
Recovery is reproducible.
Constraints are respected.
A short incident note is present.
Window
6 calendar days
6-8 focused hours total
Hard gates
8
acceptance gates
Checklist
11
6 evidence outputs
Source package
README.mdCANDIDATE_RUNBOOK.htmlHEALTH_MODEL_GUIDE.htmlEVIDENCE_AND_VALIDATION_GUIDE.htmlSUBMISSION_TEMPLATE.md
Starter runtime
  • Python CLI in starter/
  • starter/data/healthy.json
  • unittest coverage
Failure scenario
  • Write /tmp/bravo-stale.json
  • Block unsafe bravo actions
  • Keep alpha and charlie eligible
Evidence packet
  • Command output
  • GitHub Actions run
  • Incident response
  • Tradeoffs and AI usage

Instruction packet: README.md, CANDIDATE_RUNBOOK.html, HEALTH_MODEL_GUIDE.html, EVIDENCE_AND_VALIDATION_GUIDE.html, SUBMISSION_TEMPLATE.md. Produced files are evidence outputs, not source documents. This page does not track progress.

Assignment overview

Assignment checklist

README order
Hard gates for proceeding

Proceed-or-stop evidence from the public README.

SRE
What to showImplementersre-001

Fresh-checkout setup is the first hard gate for proceeding.

cd starterpython3 -m freshness status --state data/healthy.json
  • Setup commandfresh checkout

    Show the setup command and expected output from a clean clone.

    cd starter
    python3 -m freshness status --state data/healthy.json
  • Hard gateproceeding check

    Fresh-checkout setup must work without hidden services or prior local state.

Scored depth

Evidence quality, judgment, and tradeoffs from the report.

Follow-up interview

Discussion topics after the submitted work is reviewed.