The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
ci: fix PLC0206, PLC0414 linter errors
Maciej Lisiewski7ef490ed3b16
diff --git a/evals/provider_wire/issue_103944.py b/evals/provider_wire/issue_103944.pyindex 453ef794503..46652dac07b 100644--- a/evals/provider_wire/issue_103944.py+++ b/evals/provider_wire/issue_103944.py@@ -102,7 +102,7 @@ from agent.transports.chat_completions import ChatCompletionsTransportloaded = get_compatible_custom_providers(load_config())rows = []for provider in ["custom:my-gateway", "custom"]:- for model in models:+ for model, model_spec in models.items():agent = AIAgent(model=model,provider=provider,@@ -124,7 +124,7 @@ for provider in ["custom:my-gateway", "custom"]:rows.append({"provider": agent.provider,"model": agent.model,- "declared_format": models[model].get("reasoning_format"),+ "declared_format": model_spec.get("reasoning_format"),"profile": None if profile is None else type(profile).__name__,"agent_has_custom_models": any(e.get("models") == models for e in agent._custom_providersdiff --git a/evals/toolperf_abeval/ab_eval.py b/evals/toolperf_abeval/ab_eval.pyindex cf985b1e934..f28e8c65ba0 100644--- a/evals/toolperf_abeval/ab_eval.py+++ b/evals/toolperf_abeval/ab_eval.py@@ -155,7 +155,7 @@ def run(arm: str, model: str, reps: int, pythonpath: str, only=None):except (ValueError, KeyError):continuefor rep in range(reps):- for name in TASKS:+ for name, task in TASKS.items():if only and name not in only:continuerun_id = f"{name}-r{rep}"@@ -194,7 +194,7 @@ mode = "overwrite""HERMES_HOME": str(HOME),"HERMES_NEMO_RELAY_PLUGINS_TOML": str(relay_config),})- q = TASKS[name].replace("{WORK}", str(work))+ q = task.replace("{WORK}", str(work))t0 = time.time()try:p = subprocess.run(diff --git a/gateway/platforms/api_server.py b/gateway/platforms/api_server.pyindex f28b6bf4f0f..8045b003177 100644--- a/gateway/platforms/api_server.py+++ b/gateway/platforms/api_server.py@@ -1086,7 +1086,7 @@ def _notify_cron_provider_jobs_changed() -> None:# endpoints are authenticated, so this is not the trust boundary). Optional import:# a missing scanner must not disable the cron REST API.try:- from tools.cronjob_tools import _scan_cron_prompt as _scan_cron_prompt+ from tools.cronjob_tools import _scan_cron_promptexcept Exception: # pragma: no cover - scanner is optional hardening_scan_cron_prompt = Nonediff --git a/hermes_cli/anon_auth.py b/hermes_cli/anon_auth.pyindex 45c9aadd996..d9fe32427ba 100644--- a/hermes_cli/anon_auth.py+++ b/hermes_cli/anon_auth.py@@ -1104,48 +1104,48 @@ def persist_nous_credentials(*args, **kwargs):# Public sign-in imports remain here for existing callers and module-attribute patches.# The flow imports this module only inside calls, so either module can be imported first.from hermes_cli.anon_sign_in import (- AlreadySignedIn as AlreadySignedIn,- Code as Code,- Completed as Completed,- Declined as Declined,- FREE_TIER_RATE_LIMIT_CARD as FREE_TIER_RATE_LIMIT_CARD,- FREE_TIER_RATE_LIMIT_CHAT as FREE_TIER_RATE_LIMIT_CHAT,- Failed as Failed,- LOGIN_BUSY_ELSEWHERE as LOGIN_BUSY_ELSEWHERE,- LOGIN_COMMAND as LOGIN_COMMAND,- LOGIN_DM_ONLY as LOGIN_DM_ONLY,- LOGIN_NOT_ALLOWED as LOGIN_NOT_ALLOWED,- LOGIN_STARTING as LOGIN_STARTING,- Retired as Retired,- SignInState as SignInState,- Superseded as Superseded,- TimedOut as TimedOut,- UPGRADE_ALREADY_SIGNED_IN as UPGRADE_ALREADY_SIGNED_IN,- UPGRADE_CANCELLED as UPGRADE_CANCELLED,- UPGRADE_DO_NOT_SHARE as UPGRADE_DO_NOT_SHARE,- UPGRADE_NOT_COMPLETED as UPGRADE_NOT_COMPLETED,- UPGRADE_NO_DEFAULT_CHAT as UPGRADE_NO_DEFAULT_CHAT,- UPGRADE_NO_DEFAULT_TERMINAL as UPGRADE_NO_DEFAULT_TERMINAL,- UPGRADE_REASON_COPY as UPGRADE_REASON_COPY,- UPGRADE_START as UPGRADE_START,- UPGRADE_TIMED_OUT as UPGRADE_TIMED_OUT,- UPGRADE_UNAVAILABLE as UPGRADE_UNAVAILABLE,- UPGRADE_UNAVAILABLE_CHAT as UPGRADE_UNAVAILABLE_CHAT,- UPGRADE_WAITING as UPGRADE_WAITING,- UPGRADE_WAITING_UP_TO as UPGRADE_WAITING_UP_TO,- Unavailable as Unavailable,- Waiting as Waiting,- _RETIRED_REASONS as _RETIRED_REASONS,- _default_persist_guard as _default_persist_guard,- _outcome_state as _outcome_state,- format_wait_line as format_wait_line,- run_sign_in as run_sign_in,+ AlreadySignedIn,+ Code,+ Completed,+ Declined,+ FREE_TIER_RATE_LIMIT_CARD,+ FREE_TIER_RATE_LIMIT_CHAT,+ Failed,+ LOGIN_BUSY_ELSEWHERE,+ LOGIN_COMMAND,+ LOGIN_DM_ONLY,+ LOGIN_NOT_ALLOWED,+ LOGIN_STARTING,+ Retired,+ SignInState,+ Superseded,+ TimedOut,+ UPGRADE_ALREADY_SIGNED_IN,+ UPGRADE_CANCELLED,+ UPGRADE_DO_NOT_SHARE,+ UPGRADE_NOT_COMPLETED,+ UPGRADE_NO_DEFAULT_CHAT,+ UPGRADE_NO_DEFAULT_TERMINAL,+ UPGRADE_REASON_COPY,+ UPGRADE_START,+ UPGRADE_TIMED_OUT,+ UPGRADE_UNAVAILABLE,+ UPGRADE_UNAVAILABLE_CHAT,+ UPGRADE_WAITING,+ UPGRADE_WAITING_UP_TO,+ Unavailable,+ Waiting,+ _RETIRED_REASONS,+ _default_persist_guard,+ _outcome_state,+ format_wait_line,+ run_sign_in,)from hermes_cli.anon_sign_in_cli import (- drain_sign_in_copy as drain_sign_in_copy,- render_sign_in_cli as render_sign_in_cli,- render_sign_in_cli_code as render_sign_in_cli_code,- upgrade_guest as upgrade_guest,+ drain_sign_in_copy,+ render_sign_in_cli,+ render_sign_in_cli_code,+ upgrade_guest,)FREE_TIER_STATUS_LINE = f"{FREE_TIER_LABEL} \u00b7 {GUEST_MODEL} \u00b7 {LOGIN_COMMAND} to sign in"diff --git a/hermes_yaml.py b/hermes_yaml.pyindex bae447df100..4cd43d3cbda 100644--- a/hermes_yaml.py+++ b/hermes_yaml.py@@ -8,7 +8,7 @@ from io import StringIOfrom typing import Any, IO, overloadfrom ruamel.yaml import YAML-from ruamel.yaml.error import YAMLError as YAMLError+from ruamel.yaml.error import YAMLErrorfrom ruamel.yaml.resolver import VersionedResolverdiff --git a/ruff.strict.toml b/ruff.strict.tomlindex 4213caa5613..9b627b92a1d 100644--- a/ruff.strict.toml+++ b/ruff.strict.toml@@ -284,9 +284,9 @@ select = ["PLC0131","PLC0132","PLC0205",- # "PLC0206",+ "PLC0206","PLC0208",- # "PLC0414",+ "PLC0414","PLC3002","PLE0100","PLE0101",diff --git a/skills/productivity/google-workspace/scripts/_hermes_home.py b/skills/productivity/google-workspace/scripts/_hermes_home.pyindex e50741fa6c7..b2d7606862b 100644--- a/skills/productivity/google-workspace/scripts/_hermes_home.py+++ b/skills/productivity/google-workspace/scripts/_hermes_home.py@@ -20,8 +20,8 @@ import osfrom pathlib import Pathtry:- from hermes_constants import display_hermes_home as display_hermes_home- from hermes_constants import get_hermes_home as get_hermes_home+ from hermes_constants import display_hermes_home+ from hermes_constants import get_hermes_homeexcept (ModuleNotFoundError, ImportError):def get_hermes_home() -> Path:diff --git a/skills/research/grounded-citations/scripts/_hermes_home.py b/skills/research/grounded-citations/scripts/_hermes_home.pyindex 45ed49d3773..072f4680c4f 100644--- a/skills/research/grounded-citations/scripts/_hermes_home.py+++ b/skills/research/grounded-citations/scripts/_hermes_home.py@@ -14,7 +14,7 @@ import osfrom pathlib import Pathtry:- from hermes_constants import get_hermes_home as get_hermes_home+ from hermes_constants import get_hermes_homeexcept (ModuleNotFoundError, ImportError):def get_hermes_home() -> Path:diff --git a/tests/e2e/core/history/_helpers.py b/tests/e2e/core/history/_helpers.pyindex 155a0c1f49a..7edf42a59ec 100644--- a/tests/e2e/core/history/_helpers.py+++ b/tests/e2e/core/history/_helpers.py@@ -247,9 +247,9 @@ def tools_diff(a: Any, b: Any) -> str:bn = {t["function"]["name"]: canon(t) for t in b or ()}if list(an) != list(bn):return f"names/order differ: -{sorted(set(an) - set(bn))} +{sorted(set(bn) - set(an))}"- for name in an:- if an[name] != bn[name]:- return f"tool {name!r}: {first_divergence(an[name], bn[name])}"+ for name, a_tool in an.items():+ if a_tool != bn[name]:+ return f"tool {name!r}: {first_divergence(a_tool, bn[name])}"return "?"diff --git a/tests/hermes_cli/plugin_worker_support.py b/tests/hermes_cli/plugin_worker_support.pyindex 055c5f36374..0136e00d03c 100644--- a/tests/hermes_cli/plugin_worker_support.py+++ b/tests/hermes_cli/plugin_worker_support.py@@ -18,7 +18,7 @@ import sysimport pytestimport hermes_yaml as yaml-from tests.pm._fixtures import _wheel, isolated_python as isolated_python+from tests.pm._fixtures import _wheel, isolated_python as isolated_python # noqa: PLC0414 -- the self-alias is load-bearing: it suppresses F811 for the pytest fixture parameter shadowing this importdef worker_command(worker: Path, uv: str, python: str, *, prelude: str = "", runtime_python: str | None = None) -> list[str]:diff --git a/tests/hermes_cli/test_enable_no_capabilities.py b/tests/hermes_cli/test_enable_no_capabilities.pyindex 71c92ceb54e..a64b971e5c3 100644--- a/tests/hermes_cli/test_enable_no_capabilities.py+++ b/tests/hermes_cli/test_enable_no_capabilities.py@@ -5,8 +5,8 @@ import pytestimport hermes_yaml as yamlfrom tests.hermes_cli.plugin_worker_support import (- isolated_python as isolated_python,- plugin_world as plugin_world,+ isolated_python as isolated_python, # noqa: PLC0414 -- the self-alias is load-bearing: it suppresses F811 for the pytest fixture parameter shadowing this import+ plugin_world as plugin_world, # noqa: PLC0414 -- the self-alias is load-bearing: it suppresses F811 for the pytest fixture parameter shadowing this import)diff --git a/tests/hermes_cli/test_npm_engine.py b/tests/hermes_cli/test_npm_engine.pyindex e58885c8cff..3c1a37315bc 100644--- a/tests/hermes_cli/test_npm_engine.py+++ b/tests/hermes_cli/test_npm_engine.py@@ -4,8 +4,8 @@ import pytestfrom hermes_cli.npm_engine import maybe_repair_npm_enginefrom tests.compat.old_updater_support import (- fresh_child as fresh_child,- no_external_work as no_external_work,+ fresh_child as fresh_child, # noqa: PLC0414 -- the self-alias is load-bearing: it suppresses F811 for the pytest fixture parameter shadowing this import+ no_external_work as no_external_work, # noqa: PLC0414 -- the self-alias is load-bearing: it suppresses F811 for the pytest fixture parameter shadowing this import)diff --git a/tests/hermes_cli/test_old_updater_additional_shims.py b/tests/hermes_cli/test_old_updater_additional_shims.pyindex eede7d25df6..9c949cde296 100644--- a/tests/hermes_cli/test_old_updater_additional_shims.py+++ b/tests/hermes_cli/test_old_updater_additional_shims.py@@ -10,8 +10,8 @@ from types import SimpleNamespaceimport pytestfrom tests.compat.old_updater_support import (- fresh_child as fresh_child,- no_external_work as no_external_work,+ fresh_child as fresh_child, # noqa: PLC0414 -- the self-alias is load-bearing: it suppresses F811 for the pytest fixture parameter shadowing this import+ no_external_work as no_external_work, # noqa: PLC0414 -- the self-alias is load-bearing: it suppresses F811 for the pytest fixture parameter shadowing this import)diff --git a/tests/hermes_cli/test_old_updater_main_shims.py b/tests/hermes_cli/test_old_updater_main_shims.pyindex 48428083f99..4d872a17f3b 100644--- a/tests/hermes_cli/test_old_updater_main_shims.py+++ b/tests/hermes_cli/test_old_updater_main_shims.py@@ -5,7 +5,7 @@ from pathlib import Pathimport pytestfrom tests.compat.old_updater_support import (- no_external_work as no_external_work,+ no_external_work as no_external_work, # noqa: PLC0414 -- the self-alias is load-bearing: it suppresses F811 for the pytest fixture parameter shadowing this import)diff --git a/tests/hermes_cli/test_old_updater_shims.py b/tests/hermes_cli/test_old_updater_shims.pyindex 5c517d963d5..a9d0d82b2b1 100644--- a/tests/hermes_cli/test_old_updater_shims.py+++ b/tests/hermes_cli/test_old_updater_shims.py@@ -11,8 +11,8 @@ from types import SimpleNamespaceimport pytestfrom tests.compat.old_updater_support import (- fresh_child as fresh_child,- no_external_work as no_external_work,+ fresh_child as fresh_child, # noqa: PLC0414 -- the self-alias is load-bearing: it suppresses F811 for the pytest fixture parameter shadowing this import+ no_external_work as no_external_work, # noqa: PLC0414 -- the self-alias is load-bearing: it suppresses F811 for the pytest fixture parameter shadowing this import)diff --git a/tests/hermes_cli/test_plugin_install_ref.py b/tests/hermes_cli/test_plugin_install_ref.pyindex 5f879add763..902549c1f0b 100644--- a/tests/hermes_cli/test_plugin_install_ref.py+++ b/tests/hermes_cli/test_plugin_install_ref.py@@ -9,8 +9,8 @@ from pathlib import Pathimport pytestfrom tests.hermes_cli.plugin_worker_support import (- isolated_python as isolated_python,- plugin_world as plugin_world,+ isolated_python as isolated_python, # noqa: PLC0414 -- the self-alias is load-bearing: it suppresses F811 for the pytest fixture parameter shadowing this import+ plugin_world as plugin_world, # noqa: PLC0414 -- the self-alias is load-bearing: it suppresses F811 for the pytest fixture parameter shadowing this import)import hermes_yaml as yamldiff --git a/tests/hermes_cli/test_plugin_worker_lifecycle.py b/tests/hermes_cli/test_plugin_worker_lifecycle.pyindex e90dfd2d94d..12bfff2d00f 100644--- a/tests/hermes_cli/test_plugin_worker_lifecycle.py+++ b/tests/hermes_cli/test_plugin_worker_lifecycle.py@@ -4,8 +4,8 @@ from __future__ import annotationsimport pytestfrom tests.hermes_cli.plugin_worker_support import (- plugin_world as plugin_world,- isolated_python as isolated_python,+ plugin_world as plugin_world, # noqa: PLC0414 -- the self-alias is load-bearing: it suppresses F811 for the pytest fixture parameter shadowing this import+ isolated_python as isolated_python, # noqa: PLC0414 -- the self-alias is load-bearing: it suppresses F811 for the pytest fixture parameter shadowing this import)diff --git a/tests/hermes_cli/test_plugins_admission_setter.py b/tests/hermes_cli/test_plugins_admission_setter.pyindex 39a9a6c8ba4..ed34476a0ec 100644--- a/tests/hermes_cli/test_plugins_admission_setter.py+++ b/tests/hermes_cli/test_plugins_admission_setter.py@@ -5,9 +5,9 @@ import sysimport pytestfrom tests.hermes_cli.plugin_worker_support import (- plugin_world as plugin_world,+ plugin_world as plugin_world, # noqa: PLC0414 -- the self-alias is load-bearing: it suppresses F811 for the pytest fixture parameter shadowing this importworker_command,- isolated_python as isolated_python,+ isolated_python as isolated_python, # noqa: PLC0414 -- the self-alias is load-bearing: it suppresses F811 for the pytest fixture parameter shadowing this import)diff --git a/tests/hermes_cli/test_plugins_cmd_enable_disable_nested.py b/tests/hermes_cli/test_plugins_cmd_enable_disable_nested.pyindex c98b2eb3711..60b42b3e33b 100644--- a/tests/hermes_cli/test_plugins_cmd_enable_disable_nested.py+++ b/tests/hermes_cli/test_plugins_cmd_enable_disable_nested.py@@ -5,8 +5,8 @@ import pytestimport hermes_yaml as yamlfrom tests.hermes_cli.plugin_worker_support import (- plugin_world as plugin_world,- isolated_python as isolated_python,+ plugin_world as plugin_world, # noqa: PLC0414 -- the self-alias is load-bearing: it suppresses F811 for the pytest fixture parameter shadowing this import+ isolated_python as isolated_python, # noqa: PLC0414 -- the self-alias is load-bearing: it suppresses F811 for the pytest fixture parameter shadowing this import)diff --git a/tests/hermes_cli/test_plugins_picker_effective_state.py b/tests/hermes_cli/test_plugins_picker_effective_state.pyindex 40cf8bc59fd..46409b67950 100644--- a/tests/hermes_cli/test_plugins_picker_effective_state.py+++ b/tests/hermes_cli/test_plugins_picker_effective_state.py@@ -9,8 +9,8 @@ import pytestimport hermes_yaml as yamlfrom tests.hermes_cli.plugin_worker_support import (- plugin_world as plugin_world,- isolated_python as isolated_python,+ plugin_world as plugin_world, # noqa: PLC0414 -- the self-alias is load-bearing: it suppresses F811 for the pytest fixture parameter shadowing this import+ isolated_python as isolated_python, # noqa: PLC0414 -- the self-alias is load-bearing: it suppresses F811 for the pytest fixture parameter shadowing this import)diff --git a/tests/hermes_cli/test_update_venv_holder_retirement.py b/tests/hermes_cli/test_update_venv_holder_retirement.pyindex bcc199d9e34..a381dded21e 100644--- a/tests/hermes_cli/test_update_venv_holder_retirement.py+++ b/tests/hermes_cli/test_update_venv_holder_retirement.py@@ -9,7 +9,7 @@ from unittest.mock import Mockimport pytestfrom hermes_cli import main, update_cmd, update_cmd_windows-from tests.compat.old_updater_support import fresh_child as fresh_child, no_external_work as no_external_work+from tests.compat.old_updater_support import fresh_child as fresh_child, no_external_work as no_external_work # noqa: PLC0414 -- the self-alias is load-bearing: it suppresses F811 for the pytest fixture parameter shadowing this import@pytest.mark.real_concurrent_gatediff --git a/tests/pm/test_build_operations.py b/tests/pm/test_build_operations.pyindex f45594955d1..ae6b3a5a561 100644--- a/tests/pm/test_build_operations.py+++ b/tests/pm/test_build_operations.py@@ -12,10 +12,10 @@ from pm.package import InstallErrorfrom tests.pm._fixtures import (_run,_wheel,- build_worker as build_worker,- client as client,- isolated_python as isolated_python,- served as served,+ build_worker as build_worker, # noqa: PLC0414 -- the self-alias is load-bearing: it suppresses F811 for the pytest fixture parameter shadowing this import+ client as client, # noqa: PLC0414 -- the self-alias is load-bearing: it suppresses F811 for the pytest fixture parameter shadowing this import+ isolated_python as isolated_python, # noqa: PLC0414 -- the self-alias is load-bearing: it suppresses F811 for the pytest fixture parameter shadowing this import+ served as served, # noqa: PLC0414 -- the self-alias is load-bearing: it suppresses F811 for the pytest fixture parameter shadowing this import)diff --git a/tests/pm/test_darwin_build.py b/tests/pm/test_darwin_build.pyindex 7e0b9aa80a0..121647994bf 100644--- a/tests/pm/test_darwin_build.py+++ b/tests/pm/test_darwin_build.py@@ -9,7 +9,7 @@ import tarfileimport pytest-from tests.pm._fixtures import build_worker as build_worker, client as client, isolated_python as isolated_python+from tests.pm._fixtures import build_worker as build_worker, client as client, isolated_python as isolated_python # noqa: PLC0414 -- the self-alias is load-bearing: it suppresses F811 for the pytest fixture parameter shadowing this import@pytest.mark.platforms("macos")diff --git a/tests/pm/test_downloader.py b/tests/pm/test_downloader.pyindex a6899bc932b..e040c4d3468 100644--- a/tests/pm/test_downloader.py+++ b/tests/pm/test_downloader.py@@ -20,7 +20,7 @@ from pm.downloader import (Download, DownloadError, DownloadPaused,HashError, Source, replace_when_released)from tests.pm._range_server import RangeHandler as _Handler, url as _url-from tests.pm._range_server import dl_server as dl_server+from tests.pm._range_server import dl_server as dl_server # noqa: PLC0414 -- the self-alias is load-bearing: it suppresses F811 for the pytest fixture parameter shadowing this importdef _payload(n: int, seed: bytes = b"x") -> bytes:diff --git a/tests/pm/test_environment_build.py b/tests/pm/test_environment_build.pyindex 431636ccfb6..61b9dda2571 100644--- a/tests/pm/test_environment_build.py+++ b/tests/pm/test_environment_build.py@@ -14,9 +14,9 @@ from pm.plugin_inputs import Membersfrom tests.pm._fixtures import (_run,_wheel,- build_worker as build_worker,- client as client,- isolated_python as isolated_python,+ build_worker as build_worker, # noqa: PLC0414 -- the self-alias is load-bearing: it suppresses F811 for the pytest fixture parameter shadowing this import+ client as client, # noqa: PLC0414 -- the self-alias is load-bearing: it suppresses F811 for the pytest fixture parameter shadowing this import+ isolated_python as isolated_python, # noqa: PLC0414 -- the self-alias is load-bearing: it suppresses F811 for the pytest fixture parameter shadowing this import)diff --git a/tests/pm/test_held_entry_windows_live.py b/tests/pm/test_held_entry_windows_live.pyindex 886f808f4ab..5dcaa513dbc 100644--- a/tests/pm/test_held_entry_windows_live.py+++ b/tests/pm/test_held_entry_windows_live.py@@ -15,8 +15,8 @@ from pathlib import Pathimport pytestfrom pm.lock import Facts-from tests.pm.test_pm_core import pm_env as pm_env-from tests.pm._fixtures import served as served+from tests.pm.test_pm_core import pm_env as pm_env # noqa: PLC0414 -- the self-alias is load-bearing: it suppresses F811 for the pytest fixture parameter shadowing this import+from tests.pm._fixtures import served as served # noqa: PLC0414 -- the self-alias is load-bearing: it suppresses F811 for the pytest fixture parameter shadowing this import@pytest.mark.platforms("windows")diff --git a/tests/pm/test_pm_authority.py b/tests/pm/test_pm_authority.pyindex 3a9d42ce802..2f0d267cfea 100644--- a/tests/pm/test_pm_authority.py+++ b/tests/pm/test_pm_authority.py@@ -19,7 +19,7 @@ from pm import pathsfrom pm import registryfrom pm.lock import Facts, Lockfilefrom pm.store import Store, current_target, tree_digest-from tests.pm._fixtures import make_tar, served as served+from tests.pm._fixtures import make_tar, served as served # noqa: PLC0414 -- the self-alias is load-bearing: it suppresses F811 for the pytest fixture parameter shadowing this importfrom tests.pm.test_pm_core import FakeTool, pm_env as core_envdiff --git a/tests/pm/test_pm_core.py b/tests/pm/test_pm_core.pyindex fb5d836a2a1..9a1e073031f 100644--- a/tests/pm/test_pm_core.py+++ b/tests/pm/test_pm_core.py@@ -19,7 +19,7 @@ from pm.lock import Facts, Lockfilefrom pm.package import InstallError, compose_envfrom pm.packages import BinaryPackage, Venvfrom pm.store import Store, current_target-from tests.pm._fixtures import make_tar, served as served+from tests.pm._fixtures import make_tar, served as served # noqa: PLC0414 -- the self-alias is load-bearing: it suppresses F811 for the pytest fixture parameter shadowing this importclass FakeTool(BinaryPackage):diff --git a/tests/pm/test_restart_needed.py b/tests/pm/test_restart_needed.pyindex 06eeeaf19be..13e9eb1b67e 100644--- a/tests/pm/test_restart_needed.py+++ b/tests/pm/test_restart_needed.py@@ -2,7 +2,7 @@from __future__ import annotationsfrom tests.hermes_cli.plugin_worker_support import (- boot as boot, isolated_python as isolated_python, plugin_world as plugin_world, publish_plugins)+ boot as boot, isolated_python as isolated_python, plugin_world as plugin_world, publish_plugins) # noqa: PLC0414 -- the self-alias is load-bearing: it suppresses F811 for the pytest fixture parameter shadowing this importdef test_a_process_on_a_superseded_generation_needs_a_restart_until_it_adopts(plugin_world, boot):diff --git a/tests/pm/test_security_consumers.py b/tests/pm/test_security_consumers.pyindex cf48e9ba71c..03ca2bfb3d3 100644--- a/tests/pm/test_security_consumers.py+++ b/tests/pm/test_security_consumers.py@@ -16,7 +16,7 @@ import pytestimport pmfrom pm import pathsfrom tests.pm._range_server import RangeHandler, url-from tests.pm._range_server import dl_server as dl_server+from tests.pm._range_server import dl_server as dl_server # noqa: PLC0414 -- the self-alias is load-bearing: it suppresses F811 for the pytest fixture parameter shadowing this import@pytest.fixturediff --git a/tests/pm/test_startup_activation.py b/tests/pm/test_startup_activation.pyindex c24b9f724cd..265fbd89c27 100644--- a/tests/pm/test_startup_activation.py+++ b/tests/pm/test_startup_activation.py@@ -11,7 +11,7 @@ import pmfrom pm import paths, registryfrom pm.lock import Lockfilefrom pm.packages import BinaryPackage-from tests.pm._fixtures import make_tar, served as served+from tests.pm._fixtures import make_tar, served as served # noqa: PLC0414 -- the self-alias is load-bearing: it suppresses F811 for the pytest fixture parameter shadowing this import@pytest.fixturediff --git a/tests/pm/test_store_resume.py b/tests/pm/test_store_resume.pyindex d6562ef21fe..b867697e6f9 100644--- a/tests/pm/test_store_resume.py+++ b/tests/pm/test_store_resume.py@@ -11,7 +11,7 @@ from pm.store import Storefrom pm import pathsfrom tests.pm._range_server import RangeHandler as _Handler, url as _url-from tests.pm._range_server import dl_server as dl_server+from tests.pm._range_server import dl_server as dl_server # noqa: PLC0414 -- the self-alias is load-bearing: it suppresses F811 for the pytest fixture parameter shadowing this importdiff --git a/tests/pm/test_worker.py b/tests/pm/test_worker.pyindex c10d63086cd..2a0e696ca1a 100644--- a/tests/pm/test_worker.py+++ b/tests/pm/test_worker.py@@ -17,9 +17,9 @@ from tests.pm._range_server import RangeHandler, dl_server, urlfrom tests.pm.test_runtime_wheelhouse import locked_wheelhousefrom tests.pm._fixtures import (_wheel,- build_worker as build_worker,- client as client,- isolated_python as isolated_python,+ build_worker as build_worker, # noqa: PLC0414 -- the self-alias is load-bearing: it suppresses F811 for the pytest fixture parameter shadowing this import+ client as client, # noqa: PLC0414 -- the self-alias is load-bearing: it suppresses F811 for the pytest fixture parameter shadowing this import+ isolated_python as isolated_python, # noqa: PLC0414 -- the self-alias is load-bearing: it suppresses F811 for the pytest fixture parameter shadowing this import)# Spawns children with a home it builds itself; the parent's must stay real.diff --git a/tests/pm/test_worker_observers.py b/tests/pm/test_worker_observers.pyindex 1a86aea2a29..cc33cc7afab 100644--- a/tests/pm/test_worker_observers.py+++ b/tests/pm/test_worker_observers.py@@ -9,8 +9,8 @@ import pytestfrom pm import pathsfrom pm.lock import Facts-from tests.pm._fixtures import client as client, isolated_python as isolated_python-from tests.pm._range_server import dl_server as dl_server+from tests.pm._fixtures import client as client, isolated_python as isolated_python # noqa: PLC0414 -- the self-alias is load-bearing: it suppresses F811 for the pytest fixture parameter shadowing this import+from tests.pm._range_server import dl_server as dl_server # noqa: PLC0414 -- the self-alias is load-bearing: it suppresses F811 for the pytest fixture parameter shadowing this importfrom tests.pm.test_worker import _node_archivediff --git a/tests/pm/test_worker_stdio.py b/tests/pm/test_worker_stdio.pyindex b76a4b27341..3a9d5de9ee3 100644--- a/tests/pm/test_worker_stdio.py+++ b/tests/pm/test_worker_stdio.py@@ -9,7 +9,7 @@ import textwrapimport pytest-from tests.pm._fixtures import isolated_python as isolated_python+from tests.pm._fixtures import isolated_python as isolated_python # noqa: PLC0414 -- the self-alias is load-bearing: it suppresses F811 for the pytest fixture parameter shadowing this import@pytest.mark.parametrize("streaming", [False, True])diff --git a/tests/scripts/test_fresh_source_install.py b/tests/scripts/test_fresh_source_install.pyindex 3bd17b97578..4f4239b58f9 100644--- a/tests/scripts/test_fresh_source_install.py+++ b/tests/scripts/test_fresh_source_install.py@@ -18,7 +18,7 @@ import tomllibimport pytestfrom pm.store import current_target-from tests.pm._fixtures import _wheel, served as served+from tests.pm._fixtures import _wheel, served as served # noqa: PLC0414 -- the self-alias is load-bearing: it suppresses F811 for the pytest fixture parameter shadowing this importROOT = Path(__file__).resolve().parents[2]diff --git a/tests/tools/test_file_operations.py b/tests/tools/test_file_operations.pyindex 91945899000..9e8e29908cb 100644--- a/tests/tools/test_file_operations.py+++ b/tests/tools/test_file_operations.py@@ -578,9 +578,9 @@ class TestPatchReplacePostWriteVerification:def side_effect(command, **kwargs):# the byte-exact read (base64 over the transport) — both the initial read and the verify readif "base64 < " in command:- for path in file_contents:+ for path, contents in file_contents.items():if path in command:- return {"output": _fenced_base64_reply(command, file_contents[path].encode()),+ return {"output": _fenced_base64_reply(command, contents.encode()),"returncode": 0}return {"output": "", "returncode": 1}# mkdir for parent dir@@ -588,9 +588,9 @@ class TestPatchReplacePostWriteVerification:return {"output": "", "returncode": 0}# wc -c for byte count after writeif command.startswith("if [ -f ") or command.startswith("wc -c"):- for path in file_contents:+ for path, contents in file_contents.items():if path in command:- return {"output": str(len(file_contents[path].encode())), "returncode": 0}+ return {"output": str(len(contents.encode())), "returncode": 0}return {"output": "0", "returncode": 0}# Everything else (including the write itself) pretends to succeed# but DOESN'T update file_contents — simulates silent failurediff --git a/tests/tools/test_plugin_guard.py b/tests/tools/test_plugin_guard.pyindex 3b0730d46a1..88b1ec6c95a 100644--- a/tests/tools/test_plugin_guard.py+++ b/tests/tools/test_plugin_guard.py@@ -13,8 +13,8 @@ from pathlib import Pathimport pytestfrom tests.hermes_cli.plugin_worker_support import (- isolated_python as isolated_python,- plugin_world as plugin_world,+ isolated_python as isolated_python, # noqa: PLC0414 -- the self-alias is load-bearing: it suppresses F811 for the pytest fixture parameter shadowing this import+ plugin_world as plugin_world, # noqa: PLC0414 -- the self-alias is load-bearing: it suppresses F811 for the pytest fixture parameter shadowing this import)from tools.skills_guard import format_scan_reportfrom tools.plugin_guard import (diff --git a/tools/delegate_tool_results.py b/tools/delegate_tool_results.pyindex 640fe133294..e771e4dc1f2 100644--- a/tools/delegate_tool_results.py+++ b/tools/delegate_tool_results.py@@ -346,7 +346,7 @@ def _fire_subagent_stop_hooks(results, child_by_index, parent_agent) -> float:"""Pop the model-hidden ``_child_role`` / ``_child_cost_usd`` fields from everyentry, fire ``subagent_stop`` per child, and return the summed child cost."""try:- from hermes_cli.plugins import invoke_hook as invoke_hook+ from hermes_cli.plugins import invoke_hookexcept Exception:invoke_hook = Nonechildren_cost_total = 0.0diff --git a/website/scripts/generate-skill-docs.py b/website/scripts/generate-skill-docs.pyindex 4c6d4fdb535..bf5beaf56f7 100755--- a/website/scripts/generate-skill-docs.py+++ b/website/scripts/generate-skill-docs.py@@ -469,8 +469,8 @@ def build_catalog_md_bundled(entries: list[tuple[dict[str, Any], dict[str, Any]]if meta["source_kind"] != "bundled":continueby_cat[meta["category"]].append((meta, parsed))- for k in by_cat:- by_cat[k].sort(key=lambda e: e[0]["slug"])+ for entries in by_cat.values():+ entries.sort(key=lambda e: e[0]["slug"])lines = ["---",@@ -515,8 +515,8 @@ def build_catalog_md_optional(entries: list[tuple[dict[str, Any], dict[str, Any]if meta["source_kind"] != "optional":continueby_cat[meta["category"]].append((meta, parsed))- for k in by_cat:- by_cat[k].sort(key=lambda e: e[0]["slug"])+ for entries in by_cat.values():+ entries.sort(key=lambda e: e[0]["slug"])lines = ["---",