From bbfef00607a56dad3ab4739b4a298a2687533b7d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 6 Jul 2026 21:26:13 +0000 Subject: [PATCH 1/2] Initial plan From 3e55be9241d24ed3449e68e1b1cc6448c1ba5056 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 6 Jul 2026 21:30:09 +0000 Subject: [PATCH 2/2] fix: apply Black 24.8.0 formatting to files reformatted by CodeQL autofix The CodeQL autofix workflow used ruff format which changed assert statements to the style `assert cond, (\n msg\n)`. Black 24.8.0 (used in pre-commit) prefers `assert (\n cond\n), msg`, causing the pre-commit check to fail. Apply Black to the 7 affected files to restore correct formatting. --- shared/db_logging.py | 4 +++- tests/test_agent_mode_delegation_contracts.py | 6 +++--- tests/test_aria_auto_execute_html.py | 6 +++--- tests/test_orchestrator_health_integration.py | 6 +++--- tests/test_parallel_status.py | 6 +++--- tests/test_training_analytics_cli.py | 18 +++++++++--------- tests/test_ui_playwright.py | 6 +++--- 7 files changed, 27 insertions(+), 25 deletions(-) diff --git a/shared/db_logging.py b/shared/db_logging.py index 007c2c897..3bf586a12 100644 --- a/shared/db_logging.py +++ b/shared/db_logging.py @@ -132,7 +132,9 @@ def _parse_quantum_summary() -> dict[str, Any]: return {} -def log_quantum_run_safe(job, result: dict[str, Any], dataset_name: str, log_path: str) -> dict[str, Any]: # noqa: ANN001 +def log_quantum_run_safe( + job, result: dict[str, Any], dataset_name: str, log_path: str +) -> dict[str, Any]: # noqa: ANN001 """Best-effort quantum run logging; returns a skip/error dict on failure.""" conn = _get_conn() if not conn: diff --git a/tests/test_agent_mode_delegation_contracts.py b/tests/test_agent_mode_delegation_contracts.py index 9dbb22d89..95aacf559 100644 --- a/tests/test_agent_mode_delegation_contracts.py +++ b/tests/test_agent_mode_delegation_contracts.py @@ -153,9 +153,9 @@ def test_alias_sources_exist_as_alternate_mode_agent_names() -> None: assert sources, "Expected alias source entries in alias section" available = {n for n in (_extract_agent_name(p) for p in AGENTS_DIR.glob("*.agent.md")) if n} missing_sources = sorted({s for s in sources if s not in available}) - assert not missing_sources, ( - f"Alias source names should map to existing alternate-mode agent names: {missing_sources}" - ) + assert ( + not missing_sources + ), f"Alias source names should map to existing alternate-mode agent names: {missing_sources}" @pytest.mark.unit diff --git a/tests/test_aria_auto_execute_html.py b/tests/test_aria_auto_execute_html.py index e039b733a..0c0ad5412 100644 --- a/tests/test_aria_auto_execute_html.py +++ b/tests/test_aria_auto_execute_html.py @@ -35,9 +35,9 @@ def test_auto_execute_settings_persistence_wiring_present() -> None: assert "aria-autoexec-use-llm" in html, "Auto-execute should persist use-llm toggle" assert "aria-autoexec-show-state" in html, "Auto-execute should persist show-state toggle" assert "restoreAutoExecuteSettings()" in html, "Auto-execute should restore saved settings on load" - assert "persistAutoExecuteSettings(provider, model, useLlm, showState)" in html, ( - "Auto-execute should persist settings before requests" - ) + assert ( + "persistAutoExecuteSettings(provider, model, useLlm, showState)" in html + ), "Auto-execute should persist settings before requests" def test_auto_execute_quantum_toolbar_and_presets() -> None: diff --git a/tests/test_orchestrator_health_integration.py b/tests/test_orchestrator_health_integration.py index 19046ce1b..ca54e8b32 100644 --- a/tests/test_orchestrator_health_integration.py +++ b/tests/test_orchestrator_health_integration.py @@ -87,9 +87,9 @@ def test_orchestrator_health_aggregates_autonomous_training(app_module: ModuleTy orchestrators = data["orchestrator_health"]["orchestrators"] # If status file exists, should be included - assert "autonomous_training" in orchestrators, ( - "autonomous_training orchestrator missing despite status file present." - ) + assert ( + "autonomous_training" in orchestrators + ), "autonomous_training orchestrator missing despite status file present." orch = orchestrators["autonomous_training"] assert "status" in orch assert "cycles_completed" in orch or "error" in orch diff --git a/tests/test_parallel_status.py b/tests/test_parallel_status.py index c8a191ad1..cb2043b2d 100644 --- a/tests/test_parallel_status.py +++ b/tests/test_parallel_status.py @@ -38,6 +38,6 @@ def test_parallel_status_structure(): # diversity_avg must equal score assert entry.get("diversity_avg") == entry.get("score"), "alias score mismatch" if metric == "perplexity_improvement" and "perplexity_improvement" in entry: - assert pytest.approx(entry["perplexity_improvement"], rel=1e-3) == entry["score"], ( - "improvement score mismatch" - ) + assert ( + pytest.approx(entry["perplexity_improvement"], rel=1e-3) == entry["score"] + ), "improvement score mismatch" diff --git a/tests/test_training_analytics_cli.py b/tests/test_training_analytics_cli.py index 9d8308675..06c6bb960 100644 --- a/tests/test_training_analytics_cli.py +++ b/tests/test_training_analytics_cli.py @@ -66,9 +66,9 @@ def test_training_analytics_report_pipe_head_with_pipefail_exits_zero() -> None: timeout=30, ) - assert proc.returncode == 0, ( - f"expected zero exit with pipefail enabled, got {proc.returncode}; stderr={proc.stderr!r}" - ) + assert ( + proc.returncode == 0 + ), f"expected zero exit with pipefail enabled, got {proc.returncode}; stderr={proc.stderr!r}" @pytest.mark.unit @@ -173,9 +173,9 @@ def test_training_analytics_chart_pipe_head_with_pipefail_exits_zero() -> None: timeout=30, ) - assert proc.returncode == 0, ( - f"expected zero exit for chart mode under pipefail, got {proc.returncode}; stderr={proc.stderr!r}" - ) + assert ( + proc.returncode == 0 + ), f"expected zero exit for chart mode under pipefail, got {proc.returncode}; stderr={proc.stderr!r}" @pytest.mark.unit @@ -194,6 +194,6 @@ def test_training_analytics_default_mode_pipe_head_with_pipefail_exits_zero() -> timeout=30, ) - assert proc.returncode == 0, ( - f"expected zero exit for default mode under pipefail, got {proc.returncode}; stderr={proc.stderr!r}" - ) + assert ( + proc.returncode == 0 + ), f"expected zero exit for default mode under pipefail, got {proc.returncode}; stderr={proc.stderr!r}" diff --git a/tests/test_ui_playwright.py b/tests/test_ui_playwright.py index 28967fcc9..bc4985d06 100644 --- a/tests/test_ui_playwright.py +++ b/tests/test_ui_playwright.py @@ -141,9 +141,9 @@ def test_client_add_pickup_and_drag_updates_server(): # wait for server to report it obj = wait_for_object(unique_name, timeout=5.0) - assert obj is not None, ( - f"Server didn't report new object {unique_name}: {requests.get(SERVER_URL + '/api/aria/state').text}" - ) + assert ( + obj is not None + ), f"Server didn't report new object {unique_name}: {requests.get(SERVER_URL + '/api/aria/state').text}" # Now pick the object up using client function page.evaluate("(name) => pickUpObject(name)", unique_name)