Skip to content

The agent that grows with you

refactor(tools): pack flat argument lists (AST-verified)

Tekniume674ab9b013f
diff --git a/tools/plugin_guard.py b/tools/plugin_guard.py
index e49ae1ab468..38ce05fce2c 100644
--- a/tools/plugin_guard.py
+++ b/tools/plugin_guard.py
@@ -17,11 +17,7 @@ from pathlib import Path
from typing import Iterator, List, Optional, Tuple
from tools.skills_guard import (
- Finding,
- ScanResult,
- SUSPICIOUS_BINARY_EXTENSIONS,
- _determine_verdict,
- format_scan_report,
+ Finding, ScanResult, SUSPICIOUS_BINARY_EXTENSIONS, _determine_verdict, format_scan_report,
scan_file,
)
@@ -171,12 +167,8 @@ def scan_plugin(plugin_dir: Path, source: str = "") -> ScanResult:
else:
summary = f"{plugin_dir.name}: clean scan, no threats detected"
result = ScanResult(
- skill_name=plugin_dir.name,
- source=source or plugin_dir.name,
- trust_level="community",
- verdict=verdict,
- findings=all_findings,
- scanned_at=datetime.now(timezone.utc).isoformat(),
+ skill_name=plugin_dir.name, source=source or plugin_dir.name, trust_level="community",
+ verdict=verdict, findings=all_findings, scanned_at=datetime.now(timezone.utc).isoformat(),
summary=summary,
)
result.scan_provenance = {
diff --git a/tools/registry.py b/tools/registry.py
index 6b6b37aad80..95863f04e99 100644
--- a/tools/registry.py
+++ b/tools/registry.py
@@ -825,11 +825,7 @@ class ToolRegistry:
logger.debug("Deregistered tool: %s", name)
def restore_registration(
- self,
- name: str,
- current: ToolEntry,
- previous: Optional[ToolEntry],
- *,
+ self, name: str, current: ToolEntry, previous: Optional[ToolEntry], *,
scope: Optional[str] = None,
) -> bool:
"""Restore a host-owned registration if it is still current (plugin ownership ledger).
diff --git a/tools/self_repo_guard.py b/tools/self_repo_guard.py
index 1948779834f..84a579a62bb 100644
--- a/tools/self_repo_guard.py
+++ b/tools/self_repo_guard.py
@@ -458,11 +458,7 @@ def _read_git_alias(executable: str, target: Path, alias: str) -> str | None:
def _inspect_git(
- executable: str,
- args: list[str],
- current_dir: Path,
- env: dict[str, str],
- root: Path,
+ executable: str, args: list[str], current_dir: Path, env: dict[str, str], root: Path,
depth: int,
) -> str | None:
target, subcommand, sub_args, inline_aliases = _git_target_and_subcommand(
@@ -495,11 +491,7 @@ def _inspect_git(
def _inspect_github_cli(
- executable: str,
- args: list[str],
- current_dir: Path,
- env: dict[str, str],
- root: Path,
+ executable: str, args: list[str], current_dir: Path, env: dict[str, str], root: Path,
depth: int,
) -> str | None:
if not _is_within(current_dir, root):
@@ -511,11 +503,7 @@ def _inspect_github_cli(
def _inspect_shell(
- executable: str,
- args: list[str],
- current_dir: Path,
- env: dict[str, str],
- root: Path,
+ executable: str, args: list[str], current_dir: Path, env: dict[str, str], root: Path,
depth: int,
) -> str | None:
script = _shell_script_arg(args)