Adds `atm validate-calibration LABEL_FILE` subcommand that runs the Detector on a set of labeled PNG frames and reports per-sample PASS/FAIL with top-3 candidate colors and RGB-distance suggestions for failures. Exits 0 on 100% PASS, 1 on any FAIL, 2 on missing/malformed label file. - New module src/atm/validate.py with ValidationReport + SampleRecord dataclasses; reuses Detector.step(frame), does not reimplement color classification. - main.py: new `validate-calibration` subparser and _cmd_validate_calibration handler wired into the dispatch map. - samples/calibration_labels.json seeded with 3 entries from the 2026-04-17 incident, plus a README describing the schema. - tests/test_validate.py covers the 3 planned cases: PASS, FAIL w/ top-3 + suggestion, missing file (graceful error, no traceback). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1.3 KiB
1.3 KiB
calibration_labels.json — schema
Used by atm validate-calibration to check that the current color calibration
classifies known-good screenshots correctly before a live session.
Schema
A JSON array of entries. Each entry:
| Field | Type | Required | Description |
|---|---|---|---|
path |
string | yes | Path to a PNG frame (relative to CWD or absolute). |
expected |
string | yes | Expected color name: one of turquoise, yellow, dark_green, dark_red, light_green, light_red, gray. |
note |
string | no | Freeform annotation; shown in SUGGESTIONS output. |
Usage
atm validate-calibration samples/calibration_labels.json
Exit codes:
0— every sample PASS1— one or more FAIL2— label file missing or malformed JSON
Adding new samples
- Find a screenshot in
logs/fires/whose dot color you can verify by eye. - Append an entry with
path,expected, and an optionalnote. - Re-run validation. If it FAILs, the SUGGESTIONS section will tell you the
RGB distance between the observed pixel and the expected color's center —
use that as input for
atm calibrate.