feat(system): chore(lint): ruff auto-fix sweep — 303 errors across 178 files (F401 unused imports + F541 f-string placeholders + F811 redefined); restored report_error re-export + added logger call in errors.py (#333)

* feat(system): fix(windows-ci): combine pip bootstrap fix + venv activation in Verify step

Combines both fixes needed to get windows-test.yml actually passing:

1. setup.sh: stop swallowing ensurepip errors (quiet + 2>/dev/null + || true was
   hiding real failures — pip was silently not installed). Add get-pip.py fallback
   and hard pip verification.

2. windows-test.yml: add 'source .venv/Scripts/activate' to Verify step. Each CI
   step gets a fresh shell — setup.sh's venv activation doesn't carry over, so
   drone wasn't on PATH in the subsequent step.

Together, these should take Windows CI from the 'silent failure every run since
creation' state to actually green. Supersedes PRs #330 and #331 which had the
fixes on separate branches (neither green alone).

Co-Authored-By: @devpulse <devpulse@aipass>

* feat(system): chore(lint): ruff auto-fix sweep — 303 errors across 178 files (F401 unused imports + F541 f-string placeholders + F811 redefined); restored report_error re-export + added logger call in errors.py

Co-Authored-By: @devpulse <devpulse@aipass>

---------

Co-authored-by: @devpulse <devpulse@aipass>
This commit is contained in:
AIPass
2026-04-16 12:58:53 -07:00
committed by GitHub
co-authored by @devpulse
parent bf1f37bf41
commit e2c868084a
180 changed files with 105 additions and 282 deletions
+3 -4
View File
@@ -22,7 +22,6 @@ Architecture: Module orchestrates, error_registry handler manages data
import json
import sys
import time
from pathlib import Path
from typing import Optional
@@ -33,7 +32,7 @@ from aipass.trigger.apps.handlers.error_registry import (
get_circuit_breaker_status, circuit_breaker_reset,
update_source_fix_status,
)
from aipass.trigger.apps.handlers.error_reporter import (
from aipass.trigger.apps.handlers.error_reporter import ( # noqa: F401
report_error,
send_source_fix_email as _send_source_fix_email,
)
@@ -245,6 +244,7 @@ def _cmd_detail(console, args: list) -> bool:
try:
entry = _find_by_id_or_fp(args[0])
except (json.JSONDecodeError, TypeError, KeyError) as exc:
logger.warning("Failed to read error registry for '%s': %s", args[0], exc)
error(f"Failed to read error registry: {exc}", suggestion="Registry may be corrupted — try 'drone @trigger errors list' first")
return True
@@ -308,7 +308,7 @@ def _cmd_suppress(console, args: list) -> bool:
console.print(f" [cyan]Source fix email sent to @{updated_entry.get('component', '?').lower()}[/cyan]")
else:
update_source_fix_status(fp, "pending_fix")
console.print(f" [dim]Source fix email could not be sent (status: pending_fix)[/dim]")
console.print(" [dim]Source fix email could not be sent (status: pending_fix)[/dim]")
else:
console.print(f"[red]Failed to suppress error[/red] {args[0]}")
return True
@@ -421,7 +421,6 @@ def _cmd_circuit_breaker(console, args: list) -> bool:
if __name__ == "__main__":
from aipass.cli.apps.modules import console
if len(sys.argv) == 1 or sys.argv[1] in ['--help', '-h', 'help']:
print_help()