Files
atm/calibration
Marius Mutu 5ebe26e5d5 test(calibration): 8 labels + 3 scenarii noi (inclusiv regresie 2026-04-21)
calibration_labels.json: 16 → 24 entry-uri. Toate cele 8 frame-uri dumpate
automat de live loop azi (gray×5, dark_green×1, yellow×1, dark_red×1) trec
prin validate-calibration cu detector-ul curent (24/24 PASS).

scenarios.json: 8 → 11 scenarii:

1. buy_catchup_opposite_rearm_to_sell — REGRESSION pentru bug-ul de azi.
   Trace real din log: 17:00 catchup dark_green → PRIMED_BUY (synth arm+prime),
   apoi 17:45 yellow → ARMED_SELL via opposite_rearm. Verifică că dispatch-ul
   nou emite kind=opposite_rearm și că scheduler-ul se oprește.

2. buy_armed_gray_persist — gray între arm și prime ține ARMED_BUY
   (reason=persist). Acoperă o ramură FSM neacoperită.

3. buy_primed_gray_cooldown — gray după prime ucide ciclul (reason=cooled,
   IDLE, scheduler stop). Confirmă semantica M2D că chart-ul tăcut post-prime
   înseamnă setup expirat.

Total: 11/11 scenarii PASS, 238/238 teste (235 + 3 noi scenarii regresie).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-21 22:35:22 +03:00
..

calibration/ — frame corpus for validation & regression

Two artifacts, one frame pool:

  • calibration_labels.json — per-frame color labels. Used by atm validate-calibration to check the current palette classifies known-good dots correctly before a live session.
  • scenarios.json — ordered frame sequences per FSM scenario (full cycle, phase skip, catchup, post-fire suppression). Consumed by tests/test_scenarios_regression.py which runs each sequence through the full Detector → _handle_tick pipeline and asserts color, FSM reason/state, emitted alerts, and scheduler on/off.

Frames live in calibration/frames/ and are self-contained: purging logs/fires/ or samples/ does not break either artifact.

calibration_labels.json schema

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 calibration/calibration_labels.json

Exit codes:

  • 0 — every sample PASS
  • 1 — one or more FAIL
  • 2 — label file missing or malformed JSON

Adding new samples

  1. Find a screenshot in logs/fires/ whose dot color you can verify by eye.
  2. Copy it into calibration/frames/ — this directory is self-contained so logs/fires/ and samples/ can be emptied without breaking validation.
  3. Append an entry with path (pointing to calibration/frames/...), expected, and an optional note.
  4. 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.