Files
atm/TODOS.md
Marius Mutu 45ed502b3d feat(telegram): /ss + /resume cu verify multi-bulină și header FSM step
/ss și /resume afișează acum markerii top-3 buline sub ROI (cercuri pline,
r=7, culoarea clasificată) cu tick vertical roșu pe pick-ul FSM (rightmost).
Caption compact: `N/3 STATE` header + `emoji c1/c2/c3: name ← pick`.
FIRE_{BUY|SELL} afișat ca 3/3 când fire_ts e în ultimele 30s.

/resume face capture ÎNAINTE de clearing state → zero race cu FSM tick
simultan. Capture fail → title marchează "⚠️ captură eșuată", resume-ul
rulează oricum.

config: <version> mutat din caption în /status (acolo are sens pentru
verificare de calibrare, nu la fiecare /ss).

Adaugă find_top_dots în vision.py (top-N variantă a find_rightmost_dot,
tie-break determinist pe y). 5 teste sintetice noi + 4 teste noi pentru
dispatcher resume (screenshot inline, capture-fail, order-of-ops,
parity /ss <-> fire path).

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

5.3 KiB

TODOS

Post-Faza 1 backlog. Priority tags: P1 (next sprint), P2 (after baseline proven), P3 (nice-to-have).


P2-ack-loop — Discord reaction feedback

Deferred from Faza 1. Operator reacts to alert with emoji (👍 = good call, 👎 = false positive, ⏭️ = phase-skip). Bot reads reactions via Discord Bot API (not webhook), appends to labels_live.json. Feeds precision tuning without manual labeling.

  • Requires upgrading Discord integration from webhook to bot (token + gateway).
  • Ack loop runs as separate async task; not in hot detection path.
  • Start after 5+ sessions of stable Faza 1 baseline.

P2-screenshot-dump

Standalone helper atm dump --duration 4h --dir samples/ that just captures frames every N seconds to a directory without running detection. Used during early sessions to accumulate labeled corpus.

  • Small module src/atm/dumper.py invoked via main.py.
  • Separate from run so operator can capture raw data even before calibration is dialed in.

P2-windows-scheduler-docs

Expand README with concrete Windows Task Scheduler XML export + import steps, example triggers for 16:30→18:30 and 21:00→23:00, and DST-change checklist reminder.

P2-alert-mute-flags

Per-kind mute toggles for notifications in case arm/prime turn out too noisy in live sessions:

  • cfg.notify.arm: bool = true
  • cfg.notify.prime: bool = true
  • cfg.notify.late_start: bool = true
  • cfg.notify.resume_screenshot: bool = true — gate _save_inspect_frame + inline screenshot în /resume Alert dacă recover-urile dese din drift devin zgomotoase.

Default all true. Gate each notifier.send() in _handle_tick() on the flag. Start after 3+ live sessions confirm the signal/noise ratio.

Blocked on: Faza 1 baseline evidence.

P3-inspect-top-n-configurable

Parser comandă /ss N (ex: /ss 5) ca override pentru n în find_top_dots (default 3). Util dacă ROI scope se extinde și vrei o privire de ansamblu pe mai multe buline.

  • Extindere _parse_command în commands.py (similar cu /set_interval N).
  • Caption scaling: pentru N>3 formatter-ul trebuie să limiteze cele mai puțin relevante detections (ex: doar top-3 labels vizibile în poză, restul doar listate în caption).
  • Start când find_top_dots + caption multi-bulină s-au dovedit util în practică.

P3-faza2-exec

Auto-execution on TradeLocker. Blocked on TOS audit (see docs/phase2-prop-firm-audit.md). Not started until GO decision + 20+ Faza 1 sessions.

P3-multi-symbol

Monitor DIA and GLD concurrently (two separate charts). Current scope: one at a time, operator switches. Multi-symbol needs per-symbol config, separate state machines, and separate notification threads.

P3-web-dashboard

Read-only web view of today's audit JSONL + recent triggers. Useful for review after a session but not essential. Would share audit.py log format.


P2-yaxis-recalib-detect — Y-axis recalibration detection

Price overlay (from Telegram commands feature) uses y_axis linear interpolation to show current price on screenshots. When the user rescales the chart y-axis (common after overnight price gaps), the calibration becomes stale and prices shown are incorrect. Canary check detects layout drift but NOT y-axis range changes.

  • Possible approaches: OCR on y-axis labels (fragile), track price range consistency across sessions, or simple "calibration age" warning after N hours.
  • Start after price overlay is live and the false-price frequency is known.
  • Depends on: Telegram commands + price overlay feature being shipped.

Quality debt

  • Integration test for run_live loop: lifecycle async test added in tests/test_main.py (IDLE→ARMED→PRIMED auto-poll→FIRE auto-stop).
  • Detection-loop hang on canary pause (2026-04-17 incident): _drain_cmd_queue now runs unconditionally; helpers extracted to module scope for testability (commit c5024ce).
  • Silent canary drift-pause: single-shot Telegram alert on not_paused → paused (commit 9cf49ca).
  • Phase-skip backstop: fire_on_phase_skip (default on) emits alert when ARMED→light_* direct (commit 8b53b8d).
  • Operating hours window: NYSE-timezone-aware gate with /pause /resume /resume force control (commits 54f5575, 2386577).
  • Offline calibration gate: atm validate-calibration replays labeled frames through detector (commit 8bae507).
  • Coverage report: run pytest --cov=atm --cov-report=term-missing, aim for ≥ 85% per module.
  • Typing strictness: run pyright src/ with strict mode, fix reported issues.
  • Perf baseline: profile one detection cycle on a representative frame; ensure < 100ms so 5s loop has ample headroom.
  • Exchange calendar holidays: operating_hours doesn't know about NYSE closures (MLK, Thanksgiving, Good Friday). User /pauses manually for now.

P3-secret-scan-hook

Pre-commit hook (gitleaks sau detect-secrets) care scanează diff-urile pentru pattern-uri de secrete înainte de commit. Centură de siguranţă acum că configs/*.toml se comit — risc crescut de leak prin copy-paste viitor (ex: cineva pune un token de test direct în TOML pentru un quick hack şi uită).

  • Start după ce avem 2+ contributors sau după primul incident "aproape am comis un secret".
  • Tool de ales: gitleaks (binary, fără Python dep) > detect-secrets (Python, config mai complex).