ORCH-042: new ORCH_TRACKER_MODE (Settings.tracker_mode, default edit) selects the live-tracker card behaviour. bump mode re-creates the card at the bottom of the chat on every update (delete_telegram + send silently + repoint message_id), keeping the "one card per task" invariant: <=1 new message per call, repoint only on successful send, delete result never gates the send. New never-raising delete_telegram helper. Anything != "bump" resolves to edit (zero regression). Also russify/cosmetic-fix the card text (both modes): "Подтверждение BRD" label, ✅ after approve-gate, Russian stage labels, "📦 Внедрено". Docs updated in the same PR (CHANGELOG, internals.md, .env.example). Refs: ORCH-042 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
28 lines
1.0 KiB
Python
28 lines
1.0 KiB
Python
"""ORCH-042: Settings.tracker_mode config field.
|
|
|
|
AC-1: tracker_mode defaults to "edit" and is read from env ORCH_TRACKER_MODE.
|
|
Settings is a Pydantic BaseSettings reading env at instantiation, so each case
|
|
builds a FRESH Settings() (the process-wide singleton is not mutated).
|
|
"""
|
|
|
|
from src.config import Settings
|
|
|
|
|
|
def test_tracker_mode_defaults_to_edit(monkeypatch):
|
|
# No env var -> default "edit" (TC-01 / AC-1).
|
|
monkeypatch.delenv("ORCH_TRACKER_MODE", raising=False)
|
|
assert Settings().tracker_mode == "edit"
|
|
|
|
|
|
def test_tracker_mode_reads_env_bump(monkeypatch):
|
|
# ORCH_TRACKER_MODE=bump -> "bump" (TC-01 / AC-1).
|
|
monkeypatch.setenv("ORCH_TRACKER_MODE", "bump")
|
|
assert Settings().tracker_mode == "bump"
|
|
|
|
|
|
def test_tracker_mode_reads_env_arbitrary(monkeypatch):
|
|
# The field is read verbatim from env; mode RESOLUTION (anything != "bump"
|
|
# -> edit) happens in notifications, not here (AC-1/AC-2 split).
|
|
monkeypatch.setenv("ORCH_TRACKER_MODE", "garbage")
|
|
assert Settings().tracker_mode == "garbage"
|