fix(maintenance): auto-expiry + adaptive markdown height + tests

- Auto-expiry: expired events auto-end on GET /events via task manager
- Height: _estimate_markdown_height adapted to unit=8px scale with padding detection
- CRITICAL-1: removed dead import remove_chart_from_position (QA finding)
- CRITICAL-2: added chart alive check in ensure_banner_chart (QA finding)
- CRITICAL-3: fixed test assertions update_markdown_chart → update_banner_on_dashboard
- @POST contract: fixed return range [2,12] → [19,200]
- Tests: 8 new tests (auto-expiry + layout height)
This commit is contained in:
2026-05-25 08:36:33 +03:00
parent 2bf686674e
commit 31680a1bc9
100 changed files with 19635 additions and 7923 deletions

View File

@@ -148,20 +148,10 @@ def _resolve_target_envs(env_ids: list[str]) -> dict[str, Environment]:
resolved: dict[str, Environment] = {}
if not configured:
for config_path in [Path("config.json"), Path("backend/config.json")]:
if not config_path.exists():
continue
try:
payload = json.loads(config_path.read_text(encoding="utf-8"))
env_rows = payload.get("environments", [])
for row in env_rows:
env = Environment(**row)
configured[env.id] = env
except Exception as exc:
logger.reflect(
f"Failed loading environments from {config_path}: {exc}",
extra={"src": "_resolve_target_envs"},
)
logger.reflect(
"No environments found in DB — seed script requires environments configured via API first",
extra={"src": "_resolve_target_envs"},
)
for env_id in env_ids:
env = configured.get(env_id)