From 9e988a63b3c1fb9276a80dbdec01701ba7529a11 Mon Sep 17 00:00:00 2001 From: AIOSAI Date: Mon, 29 Jun 2026 09:37:43 -0700 Subject: [PATCH] =?UTF-8?q?fix(daemon):=20CI=20green=20=E2=80=94=20.archiv?= =?UTF-8?q?e-existence=20tests=20=E2=86=92=20import-path=20assertions;=20b?= =?UTF-8?q?are=20'queue'=20renders=20Rich=20table=20(TDPLAN-0008,=20td-47)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit test_scheduler_bot.py: replaced test_data_files_archived + test_handler_files_archived (asserted gitignored .archive paths → failed in CI clean checkout) with test_task_registry_not_importable + test_actions_registry_not_importable (assert ImportError — env-independent). queue.py: bare 'drone @daemon queue' now renders the Rich table instead of print_introspection (matches --help). 24 scheduler_bot tests green. Fix by @daemon, verified by devpulse. --- src/aipass/daemon/apps/modules/queue.py | 7 +++++- src/aipass/daemon/tests/test_scheduler_bot.py | 23 ++++++++----------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/aipass/daemon/apps/modules/queue.py b/src/aipass/daemon/apps/modules/queue.py index 3b5aeca9..31e814ef 100644 --- a/src/aipass/daemon/apps/modules/queue.py +++ b/src/aipass/daemon/apps/modules/queue.py @@ -169,7 +169,12 @@ def handle_command(command: str, args: List[str]) -> bool: return False if not args: - print_introspection() + json_handler.log_operation("queue_command", {"json": False}) + jobs = discover_jobs() + runstate = load_runstate() + entries = _build_queue(jobs, runstate) + _print_rich_table(entries) + logger.info("[queue] Queue displayed (%d jobs)", len(entries)) return True if args[0] in ("--help", "-h"): diff --git a/src/aipass/daemon/tests/test_scheduler_bot.py b/src/aipass/daemon/tests/test_scheduler_bot.py index 2af59e22..eaee3127 100644 --- a/src/aipass/daemon/tests/test_scheduler_bot.py +++ b/src/aipass/daemon/tests/test_scheduler_bot.py @@ -315,26 +315,21 @@ class TestFailSoft: class TestDormantArchived: """Verify dormant registries are archived and no live code references them.""" - def test_data_files_archived(self): - """schedule.json and actions_registry.json moved to .archive.""" - daemon_root = Path(__file__).resolve().parents[1] - archive_dir = daemon_root / "daemon_json" / ".archive" - assert (archive_dir / "schedule.json").exists() - assert (archive_dir / "actions_registry.json").exists() - def test_original_data_files_gone(self): """Original data files no longer at daemon_json/ root.""" daemon_root = Path(__file__).resolve().parents[1] assert not (daemon_root / "daemon_json" / "schedule.json").exists() assert not (daemon_root / "daemon_json" / "actions_registry.json").exists() - def test_handler_files_archived(self): - """task_registry.py and actions_registry.py moved to .archive.""" - daemon_root = Path(__file__).resolve().parents[1] - sched_archive = daemon_root / "apps" / "handlers" / "schedule" / ".archive" - actions_archive = daemon_root / "apps" / "handlers" / "actions" / ".archive" - assert (sched_archive / "task_registry.py").exists() - assert (actions_archive / "actions_registry.py").exists() + def test_task_registry_not_importable(self): + """task_registry handler is gone from the live import path.""" + with pytest.raises(ImportError): + from aipass.daemon.apps.handlers.schedule.task_registry import load_tasks # type: ignore[import-not-found] # noqa: F401 + + def test_actions_registry_not_importable(self): + """actions_registry handler is gone from the live import path.""" + with pytest.raises(ImportError): + from aipass.daemon.apps.handlers.actions.actions_registry import load_registry # type: ignore[import-not-found] # noqa: F401 def test_schedule_module_retired(self): """Schedule module handle_command shows retirement notice, not old CRUD."""