diff --git a/src/dashboard/app.py b/src/dashboard/app.py index bf26dd6b..205b2e01 100644 --- a/src/dashboard/app.py +++ b/src/dashboard/app.py @@ -35,9 +35,9 @@ from dashboard.routes.chat_api_v1 import router as chat_api_v1_router from dashboard.routes.daily_run import router as daily_run_router from dashboard.routes.db_explorer import router as db_explorer_router from dashboard.routes.discord import router as discord_router +from dashboard.routes.energy import router as energy_router from dashboard.routes.experiments import router as experiments_router from dashboard.routes.grok import router as grok_router -from dashboard.routes.energy import router as energy_router from dashboard.routes.health import router as health_router from dashboard.routes.hermes import router as hermes_router from dashboard.routes.loop_qa import router as loop_qa_router @@ -48,6 +48,7 @@ from dashboard.routes.models import router as models_router from dashboard.routes.nexus import router as nexus_router from dashboard.routes.quests import router as quests_router from dashboard.routes.scorecards import router as scorecards_router +from dashboard.routes.self_correction import router as self_correction_router from dashboard.routes.sovereignty_metrics import router as sovereignty_metrics_router from dashboard.routes.sovereignty_ws import router as sovereignty_ws_router from dashboard.routes.spark import router as spark_router @@ -55,7 +56,6 @@ from dashboard.routes.system import router as system_router from dashboard.routes.tasks import router as tasks_router from dashboard.routes.telegram import router as telegram_router from dashboard.routes.thinking import router as thinking_router -from dashboard.routes.self_correction import router as self_correction_router from dashboard.routes.three_strike import router as three_strike_router from dashboard.routes.tools import router as tools_router from dashboard.routes.tower import router as tower_router diff --git a/src/infrastructure/energy/monitor.py b/src/infrastructure/energy/monitor.py index a43ce4ac..c2cc97f5 100644 --- a/src/infrastructure/energy/monitor.py +++ b/src/infrastructure/energy/monitor.py @@ -19,7 +19,6 @@ Refs: #1009 """ import asyncio -import json import logging import subprocess import time diff --git a/src/infrastructure/models/__init__.py b/src/infrastructure/models/__init__.py index b0b64036..3fbb72e4 100644 --- a/src/infrastructure/models/__init__.py +++ b/src/infrastructure/models/__init__.py @@ -24,8 +24,8 @@ from infrastructure.models.registry import ( model_registry, ) from infrastructure.models.router import ( - TierLabel, TieredModelRouter, + TierLabel, classify_tier, get_tiered_router, ) diff --git a/src/infrastructure/models/router.py b/src/infrastructure/models/router.py index 1d05a9da..aee86fd8 100644 --- a/src/infrastructure/models/router.py +++ b/src/infrastructure/models/router.py @@ -27,7 +27,6 @@ References: - Issue #882 — Model Tiering Router: Local 8B / Hermes 70B / Cloud API Cascade """ -import asyncio import logging import re import time diff --git a/src/infrastructure/self_correction.py b/src/infrastructure/self_correction.py index e7166739..2cfa391f 100644 --- a/src/infrastructure/self_correction.py +++ b/src/infrastructure/self_correction.py @@ -20,13 +20,11 @@ Usage:: from __future__ import annotations -import json import logging import sqlite3 import uuid from collections.abc import Generator from contextlib import closing, contextmanager -from datetime import UTC, datetime from pathlib import Path logger = logging.getLogger(__name__) diff --git a/src/timmy/sovereignty/session_report.py b/src/timmy/sovereignty/session_report.py index d034e48c..43854c94 100644 --- a/src/timmy/sovereignty/session_report.py +++ b/src/timmy/sovereignty/session_report.py @@ -21,7 +21,6 @@ import base64 import json import logging from datetime import UTC, datetime -from pathlib import Path from typing import Any import httpx diff --git a/tests/infrastructure/test_graceful_degradation.py b/tests/infrastructure/test_graceful_degradation.py index bc508875..3ff509a0 100644 --- a/tests/infrastructure/test_graceful_degradation.py +++ b/tests/infrastructure/test_graceful_degradation.py @@ -27,7 +27,6 @@ from infrastructure.router.cascade import ( ProviderStatus, ) - # --------------------------------------------------------------------------- # Helpers # --------------------------------------------------------------------------- diff --git a/tests/infrastructure/test_tiered_model_router.py b/tests/infrastructure/test_tiered_model_router.py index 1cd5c03d..e29e73fe 100644 --- a/tests/infrastructure/test_tiered_model_router.py +++ b/tests/infrastructure/test_tiered_model_router.py @@ -10,13 +10,13 @@ Covers: - "Plan the optimal path to become Hortator" → LOCAL_HEAVY """ -from unittest.mock import AsyncMock, MagicMock, patch +from unittest.mock import AsyncMock, MagicMock import pytest from infrastructure.models.router import ( - TierLabel, TieredModelRouter, + TierLabel, _is_low_quality, classify_tier, get_tiered_router, diff --git a/tests/timmy/test_kimi_delegation.py b/tests/timmy/test_kimi_delegation.py index 998dfd3a..5fd438db 100644 --- a/tests/timmy/test_kimi_delegation.py +++ b/tests/timmy/test_kimi_delegation.py @@ -4,7 +4,6 @@ from unittest.mock import AsyncMock, MagicMock, patch import pytest - # --------------------------------------------------------------------------- # exceeds_local_capacity # --------------------------------------------------------------------------- diff --git a/tests/timmy/test_session_report.py b/tests/timmy/test_session_report.py index 54f2b736..795d0422 100644 --- a/tests/timmy/test_session_report.py +++ b/tests/timmy/test_session_report.py @@ -6,8 +6,7 @@ Refs: #957 (Session Sovereignty Report Generator) import base64 import json import time -from datetime import UTC, datetime -from pathlib import Path +from datetime import UTC from unittest.mock import MagicMock, patch import pytest @@ -18,14 +17,12 @@ from timmy.sovereignty.session_report import ( _format_duration, _gather_session_data, _gather_sovereignty_data, - _render_markdown, commit_report, generate_and_commit_report, generate_report, mark_session_start, ) - # --------------------------------------------------------------------------- # _format_duration # --------------------------------------------------------------------------- diff --git a/tests/timmy/test_tools_search.py b/tests/timmy/test_tools_search.py index dec00f2a..602be83f 100644 --- a/tests/timmy/test_tools_search.py +++ b/tests/timmy/test_tools_search.py @@ -7,11 +7,8 @@ from __future__ import annotations from unittest.mock import MagicMock, patch -import pytest - from timmy.tools.search import _extract_crawl_content, scrape_url, web_search - # --------------------------------------------------------------------------- # Helpers # --------------------------------------------------------------------------- diff --git a/tests/timmy_automations/test_orchestrator.py b/tests/timmy_automations/test_orchestrator.py index 7355bd94..deba0924 100644 --- a/tests/timmy_automations/test_orchestrator.py +++ b/tests/timmy_automations/test_orchestrator.py @@ -12,9 +12,7 @@ import argparse import json import sys from pathlib import Path -from unittest.mock import MagicMock, patch - -import pytest +from unittest.mock import patch # Add timmy_automations to path for imports _TA_PATH = Path(__file__).resolve().parent.parent.parent / "timmy_automations" / "daily_run" diff --git a/tests/unit/test_airllm_backend.py b/tests/unit/test_airllm_backend.py index 94c1cf8b..2b548960 100644 --- a/tests/unit/test_airllm_backend.py +++ b/tests/unit/test_airllm_backend.py @@ -7,7 +7,6 @@ falls back to the Ollama backend without crashing. Refs #1284 """ -import sys from unittest.mock import MagicMock, patch import pytest diff --git a/tests/unit/test_energy_monitor.py b/tests/unit/test_energy_monitor.py index 20858c4b..c7a70633 100644 --- a/tests/unit/test_energy_monitor.py +++ b/tests/unit/test_energy_monitor.py @@ -11,11 +11,9 @@ from unittest.mock import MagicMock, patch import pytest from infrastructure.energy.monitor import ( + _DEFAULT_MODEL_SIZE_GB, EnergyBudgetMonitor, InferenceSample, - _DEFAULT_MODEL_SIZE_GB, - _EFFICIENCY_SCORE_CEILING, - _WATTS_PER_GB_HEURISTIC, ) diff --git a/tests/unit/test_self_correction.py b/tests/unit/test_self_correction.py index 98c6a8fd..6f941b88 100644 --- a/tests/unit/test_self_correction.py +++ b/tests/unit/test_self_correction.py @@ -1,9 +1,5 @@ """Unit tests for infrastructure.self_correction.""" -import os -import tempfile -from pathlib import Path -from unittest.mock import patch import pytest