"""Tests for the pure, read-only predicates in _compliance_state.py.""" from __future__ import annotations from typing import TYPE_CHECKING from screen_locker import _compliance_state if TYPE_CHECKING: from pathlib import Path class TestEarlyBirdWindowIsTheCarrot: """The window is whatever wake-alarm's signed file says -- no wall clock.""" def test_no_clock_predicate_remains(self) -> None: """The wall-clock early-bird window predicate no longer exists.""" assert not hasattr(_compliance_state, "_early_bird_window_open") def test_window_open_mirrors_wake_skip(self, tmp_path: Path) -> None: """The early-bird decision follows wake_skip: true skips, false would lock.""" files = { "log_file": tmp_path / "log.json", "early_bird_pending_file": tmp_path / "eb.json", } open_ = _compliance_state.explain_lock_decision( **files, weekly_minimum_met=False, relaxed_day=False, wake_skip=True, ) shut = _compliance_state.explain_lock_decision( **files, weekly_minimum_met=False, relaxed_day=False, wake_skip=False, ) assert open_.stage == "wake_alarm_skip" assert shut.stage == "would_lock"