feat: mută secretele Discord/Telegram din TOML în .env

TOML-urile din configs/ rămân 100% calibrare — safe to commit. Secretele
(ATM_DISCORD_URL, ATM_TG_TOKEN, ATM_TG_CHAT) trăiesc în .env la rădăcină
(ignored), cu loader stdlib (shell wins peste file). Validare fail-fast
pentru env lipsă, placeholder REPLACE_ME, chat_id non-numeric.

Include .env.example + secţiune README §Secrets. Tests: 19 noi (env loader +
missing-env + placeholder + chat_id + regression post-migrate snapshot).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-21 09:37:24 +03:00
parent 9e8cbafbd4
commit 9c44eb6e31
14 changed files with 610 additions and 33 deletions

View File

@@ -0,0 +1,100 @@
window_title = "m2d"
[dot_roi]
x = 0
y = 712
w = 1796
h = 35
[chart_roi]
x = 17
y = 125
w = 1767
h = 567
[colors]
[colors.turquoise]
rgb = [0, 153, 153]
tolerance = 60.0
[colors.yellow]
rgb = [153, 153, 0]
tolerance = 60.0
[colors.dark_green]
rgb = [0, 122, 0]
tolerance = 60.0
[colors.dark_red]
rgb = [128, 0, 0]
tolerance = 60.0
[colors.light_green]
rgb = [0, 171, 0]
tolerance = 60.0
[colors.light_red]
rgb = [171, 0, 0]
tolerance = 60.0
[colors.gray]
rgb = [128, 128, 128]
tolerance = 60.0
[colors.background]
rgb = [0, 0, 0]
tolerance = 25.0
[y_axis]
p1_y = 166
p1_price = 485.2
p2_y = 664
p2_price = 483.2
[canary]
baseline_phash = "fbe145390c1abec23204017757a326b8e37077288ef79947310a89c70e07ffff"
drift_threshold = 8
[canary.roi]
x = 26
y = 27
w = 197
h = 15
[chart_window_region]
x = 3
y = 0
w = 1918
h = 1029
# Secretele Discord/Telegram se setează în .env la rădăcina proiectului — vezi .env.example.
[options]
debounce_depth = 1
loop_interval_s = 5.0
heartbeat_min = 30
lockout_s = 240
low_conf_threshold = 0.2
low_conf_run = 3
phaseb_timeout_s = 600
dead_letter_path = "logs/dead_letter.jsonl"
[options.alerts]
fire_on_phase_skip = true
[options.operating_hours]
enabled = true
timezone = "America/New_York"
weekdays = ["MON", "TUE", "WED", "THU", "FRI"]
start_hhmm = "09:30"
stop_hhmm = "16:00"
# Per-kind screenshot-attach toggles. All default to true on upgrade.
# Accepts either a bare bool (legacy: attach_screenshots = true) or this table.
[options.attach_screenshots]
late_start = true # screenshot on startup-late alerts
catchup = true # screenshot on mid-session catchup arm + prime
arm = true # screenshot on normal arm (turquoise/yellow) — noisiest
prime = true # screenshot on normal prime (dark_green/dark_red)
trigger = true # screenshot on FIRE

View File

@@ -0,0 +1,98 @@
window_title = "m2d"
[dot_roi]
x = 0
y = 712
w = 1796
h = 35
[chart_roi]
x = 17
y = 125
w = 1767
h = 567
[colors]
[colors.turquoise]
rgb = [0, 253, 253]
tolerance = 60.0
[colors.yellow]
rgb = [253, 253, 0]
tolerance = 60.0
[colors.dark_green]
rgb = [0, 122, 0]
tolerance = 60.0
[colors.dark_red]
rgb = [128, 0, 0]
tolerance = 60.0
[colors.light_green]
rgb = [0, 255, 0]
tolerance = 60.0
[colors.light_red]
rgb = [255, 0, 0]
tolerance = 60.0
[colors.gray]
rgb = [128, 128, 128]
tolerance = 60.0
[colors.background]
rgb = [0, 0, 0]
tolerance = 25.0
[y_axis]
p1_y = 166
p1_price = 485.2
p2_y = 664
p2_price = 483.2
[canary]
baseline_phash = "fbe145390c1abec23204017757a326b8e37077288ef79947310a89c70e07ffff"
drift_threshold = 8
[canary.roi]
x = 26
y = 27
w = 197
h = 15
[chart_window_region]
x = 3
y = 0
w = 1918
h = 1029
# Secretele Discord/Telegram se setează în .env la rădăcina proiectului — vezi .env.example.
[options]
debounce_depth = 1
loop_interval_s = 5.0
heartbeat_min = 30
lockout_s = 240
low_conf_threshold = 0.2
low_conf_run = 3
phaseb_timeout_s = 600
dead_letter_path = "logs/dead_letter.jsonl"
[options.alerts]
fire_on_phase_skip = true
[options.operating_hours]
enabled = true
timezone = "America/New_York"
weekdays = ["MON", "TUE", "WED", "THU", "FRI"]
start_hhmm = "09:30"
stop_hhmm = "16:00"
[options.attach_screenshots]
late_start = true
catchup = true
arm = true
prime = true
trigger = true

1
configs/current.txt Normal file
View File

@@ -0,0 +1 @@
2026-04-21-recalib.toml

View File

@@ -64,12 +64,8 @@ y = 100
w = 100
h = 50
[discord]
webhook_url = "https://discord.com/api/webhooks/REPLACE_ME"
[telegram]
bot_token = "REPLACE_ME"
chat_id = "REPLACE_ME"
# Secretele (Discord webhook + Telegram bot/chat) se setează în `.env` la rădăcina
# proiectului — vezi `.env.example`. TOML-ul rămâne 100% public, doar calibrare.
[options]
debounce_depth = 1