diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d1b76b6..6c1bd1c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -134,7 +134,7 @@ repos: # than merely an old one. - gatelock @ git+https://github.com/kuhyx/utils@gatelock-v0.9.0#subdirectory=gatelock - crdt-sync @ git+https://github.com/kuhyx/utils@crdt-sync-v0.9.2#subdirectory=crdt-sync - - earned-time @ git+https://github.com/kuhyx/utils@earned-time-v0.8.0#subdirectory=earned_time + - earned-time @ git+https://github.com/kuhyx/utils@earned-time-v0.9.0#subdirectory=earned_time - freedays @ git+https://github.com/kuhyx/utils@freedays-v0.3.1#subdirectory=freedays - mcp>=2,<3 - pydantic @@ -155,7 +155,7 @@ repos: # than merely an old one. - gatelock @ git+https://github.com/kuhyx/utils@gatelock-v0.9.0#subdirectory=gatelock - crdt-sync @ git+https://github.com/kuhyx/utils@crdt-sync-v0.9.2#subdirectory=crdt-sync - - earned-time @ git+https://github.com/kuhyx/utils@earned-time-v0.8.0#subdirectory=earned_time + - earned-time @ git+https://github.com/kuhyx/utils@earned-time-v0.9.0#subdirectory=earned_time - freedays @ git+https://github.com/kuhyx/utils@freedays-v0.3.1#subdirectory=freedays - mcp>=2,<3 - pydantic diff --git a/pyproject.toml b/pyproject.toml index 9eb1b79..2b9a375 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,7 +10,7 @@ dependencies = [ "gatelock @ git+https://github.com/kuhyx/utils@gatelock-v0.9.0#subdirectory=gatelock", "crdt-sync @ git+https://github.com/kuhyx/utils@crdt-sync-v0.9.2#subdirectory=crdt-sync", "freedays @ git+https://github.com/kuhyx/utils@freedays-v0.3.1#subdirectory=freedays", - "earned-time @ git+https://github.com/kuhyx/utils@earned-time-v0.8.0#subdirectory=earned_time", + "earned-time @ git+https://github.com/kuhyx/utils@earned-time-v0.9.0#subdirectory=earned_time", ] [project.scripts] diff --git a/requirements.txt b/requirements.txt index 5d1b272..2d0dbbd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,13 +4,13 @@ bandit==1.9.4 codespell==2.4.3 coverage==7.16.2 crdt-sync @ git+https://github.com/kuhyx/utils@crdt-sync-v0.9.2#subdirectory=crdt-sync -earned-time @ git+https://github.com/kuhyx/utils@earned-time-v0.8.0#subdirectory=earned_time +earned-time @ git+https://github.com/kuhyx/utils@earned-time-v0.9.0#subdirectory=earned_time freedays @ git+https://github.com/kuhyx/utils@freedays-v0.3.1#subdirectory=freedays gatelock @ git+https://github.com/kuhyx/utils@gatelock-v0.9.0#subdirectory=gatelock mcp==2.3.0 mypy==2.4.0 pre-commit==4.6.2 -pylint==4.1.2 +pylint==4.1.3 pytest==9.1.1 pytest-cov==7.1.0 pytest-randomly==5.0.0 diff --git a/screen_locker/tests/test_gate_bonus_tutor.py b/screen_locker/tests/test_gate_bonus_tutor.py index c45a5f5..9d84284 100644 --- a/screen_locker/tests/test_gate_bonus_tutor.py +++ b/screen_locker/tests/test_gate_bonus_tutor.py @@ -30,9 +30,9 @@ def key(tmp_path: Path) -> Iterator[Path]: @pytest.mark.usefixtures("key") def test_the_real_tutor_rung_pays_legacy_blocks_as_15_minutes_up_to_60() -> None: """Legacy block rows (no ``detail.minutes``) pay 15 minutes each (0.8.0).""" - tutor = getattr(earned_time, "AUTOMATION_TUTOR", None) + tutor = getattr(earned_time, "TUTOR", None) if tutor is None: - pytest.skip("installed earned_time predates the tutor (< 0.5)") + pytest.skip("installed earned_time predates TUTOR (< 0.9)") cutover = earned_time.TUTOR_FROM.isoformat() state: dict[str, Any] = {} adjust = MagicMock(return_value=True) @@ -53,15 +53,15 @@ def test_the_real_tutor_rung_pays_legacy_blocks_as_15_minutes_up_to_60() -> None apply_counted_bonus(state, adjust, tutor, cutover) assert [c.args[0] for c in adjust.call_args_list] == [15, 15, 15, 15] # Units are minutes now: five block rows count 75; the cap stops the pay. - assert state["automation_bonus_units"] == {"date": cutover, "units": 75} + assert state["tutor_bonus_units"] == {"date": cutover, "units": 75} @pytest.mark.usefixtures("key") def test_the_real_tutor_rung_pays_each_credited_minute() -> None: """A per-minute row (``detail.minutes``) pays exactly its minutes.""" - tutor = getattr(earned_time, "AUTOMATION_TUTOR", None) + tutor = getattr(earned_time, "TUTOR", None) if tutor is None: - pytest.skip("installed earned_time predates the tutor (< 0.5)") + pytest.skip("installed earned_time predates TUTOR (< 0.9)") cutover = earned_time.TUTOR_FROM.isoformat() state: dict[str, Any] = {} adjust = MagicMock(return_value=True) @@ -71,4 +71,4 @@ def test_the_real_tutor_rung_pays_each_credited_minute() -> None: write_ledger(tutor, [signed(row)]) apply_counted_bonus(state, adjust, tutor, cutover) adjust.assert_called_once_with(7) - assert state["automation_bonus_units"] == {"date": cutover, "units": 7} + assert state["tutor_bonus_units"] == {"date": cutover, "units": 7} diff --git a/screen_locker/tests/test_grace_floor.py b/screen_locker/tests/test_grace_floor.py index b995141..ee0d533 100644 --- a/screen_locker/tests/test_grace_floor.py +++ b/screen_locker/tests/test_grace_floor.py @@ -28,7 +28,7 @@ if TYPE_CHECKING: _DAY = date(2026, 10, 10) _ISO = _DAY.isoformat() -_FLAT = {"leetcode": False, "reading": False, "anki": False, "automation": False} +_FLAT = {"leetcode": False, "reading": False, "anki": False, "tutor": False} def at(hhmm: str, day: date = _DAY) -> float: diff --git a/screen_locker/tests/test_shutdown_ceiling_invariant.py b/screen_locker/tests/test_shutdown_ceiling_invariant.py index f06c1af..546197b 100644 --- a/screen_locker/tests/test_shutdown_ceiling_invariant.py +++ b/screen_locker/tests/test_shutdown_ceiling_invariant.py @@ -58,7 +58,7 @@ def _credits(fill: Callable[[date], date | None] | None) -> Callable[[date], Cre def _new_tutor_beside_mature(day: date) -> Credits: mature = {e.name: date(2026, 8, 1) for e in registry_for(day)} - return {**mature, "automation": None} + return {**mature, "tutor": None} _MATURITY: Mapping[str, Callable[[date], Credits]] = { diff --git a/screen_locker/tests/test_shutdown_target.py b/screen_locker/tests/test_shutdown_target.py index e1580c4..5c3f291 100644 --- a/screen_locker/tests/test_shutdown_target.py +++ b/screen_locker/tests/test_shutdown_target.py @@ -21,7 +21,7 @@ if TYPE_CHECKING: _DAY = date(2026, 10, 10) _ISO = _DAY.isoformat() -_FLAT = {"leetcode": False, "reading": False, "anki": False, "automation": False} +_FLAT = {"leetcode": False, "reading": False, "anki": False, "tutor": False} def at(hhmm: str) -> float: diff --git a/screen_locker/tests/test_tutor_cutover.py b/screen_locker/tests/test_tutor_cutover.py index 23d5765..bdd6924 100644 --- a/screen_locker/tests/test_tutor_cutover.py +++ b/screen_locker/tests/test_tutor_cutover.py @@ -41,10 +41,9 @@ def tutor(monkeypatch: pytest.MonkeyPatch, tmp_path: Path) -> Iterator[Any]: Yields: The tutor earner, penalised from ``_CUTOVER``. """ - item = replace(earned_time.AUTOMATION_TUTOR, penalty_from=_CUTOVER) + item = replace(earned_time.TUTOR, penalty_from=_CUTOVER) swapped = tuple( - item if e is earned_time.AUTOMATION_TUTOR else e - for e in earned_time.TUTOR_EARNERS + item if e is earned_time.TUTOR else e for e in earned_time.TUTOR_EARNERS ) monkeypatch.setattr(earned_time, "TUTOR_EARNERS", swapped) monkeypatch.setattr("earned_time._registry.TUTOR_FROM", _CUTOVER) @@ -82,7 +81,7 @@ class TestConfirmedButNeverCredited: def test_the_map_says_never(self) -> None: starts = first_credits(registry(_CUTOVER), _CUTOVER) assert starts is not None - assert starts["automation"] is None + assert starts["tutor"] is None def test_the_tutor_penalty_is_on_the_gaming_base_unpaid(self) -> None: answers = {e.name: 0 for e in registry(_CUTOVER)} @@ -103,7 +102,7 @@ class TestConfirmedButNeverCredited: starts = first_credits(registry(_CUTOVER), _CUTOVER) wired = derive(DayInputs(_CUTOVER, answers, first_credits=starts)) unwired = derive(DayInputs(_CUTOVER, answers)) - tutor = earned_time.AUTOMATION_TUTOR + tutor = earned_time.TUTOR assert tutor.shutdown_for(tutor.max_units or 1, _CUTOVER) == 60 assert wired.resolution.base.shutdown_minutes == ( unwired.resolution.base.shutdown_minutes