F841 Local variable `state_dict` is assigned to but never used --> dev-env/starter/podcast/dia_starter.py:55:5 | 54 | weight_path = _download_weight(MODEL_ID, MODEL_FILE, REVISION, EXPECTED_SHA256) 55 | state_dict = torch.load(weight_path, map_location="cpu", weights_only=True) | ^^^^^^^^^^ 56 | 57 | print(f"Model Dia-1.6B načten (weights_only=True), váhy: {weight_path}") | help: Remove assignment to unused variable `state_dict` | 54 | weight_path = _download_weight(MODEL_ID, MODEL_FILE, REVISION, EXPECTED_SHA256) - state_dict = torch.load(weight_path, map_location="cpu", weights_only=True) 55 + torch.load(weight_path, map_location="cpu", weights_only=True) 56 | | note: This is an unsafe fix and may change runtime behavior F401 [*] `sys` imported but unused --> dev-env/starter/scripts/ai_ml_starter.py:6:8 | 5 | import os 6 | import sys | ^^^ 7 | 8 | import torch | help: Remove unused import: `sys` | 5 | import os - import sys 6 | | F401 [*] `soundfile` imported but unused --> dev-env/starter/tts/kokoro_starter.py:50:25 | 49 | def synthesize(text: str, output_path: str = "output.wav") -> None: 50 | import soundfile as sf | ^^ 51 | 52 | weight_path = _download_weight(MODEL_ID, MODEL_FILE, REVISION, EXPECTED_SHA256) | help: Remove unused import: `soundfile` | 49 | def synthesize(text: str, output_path: str = "output.wav") -> None: - import soundfile as sf 50 | | F841 Local variable `state_dict` is assigned to but never used --> dev-env/starter/tts/kokoro_starter.py:53:5 | 52 | weight_path = _download_weight(MODEL_ID, MODEL_FILE, REVISION, EXPECTED_SHA256) 53 | state_dict = torch.load(weight_path, map_location="cpu", weights_only=True) | ^^^^^^^^^^ 54 | 55 | # Placeholder pro inicializaci Kokoro modelu — konkrétní API závisí na balíčku | help: Remove assignment to unused variable `state_dict` | 52 | weight_path = _download_weight(MODEL_ID, MODEL_FILE, REVISION, EXPECTED_SHA256) - state_dict = torch.load(weight_path, map_location="cpu", weights_only=True) 53 + torch.load(weight_path, map_location="cpu", weights_only=True) 54 | | note: This is an unsafe fix and may change runtime behavior F841 Local variable `state_dict` is assigned to but never used --> dev-env/starter/video/wan21_starter.py:66:5 | 65 | # Načtení modelu s weights_only=True (žádné pickle exécutující kód) 66 | state_dict = torch.load(weight_path, map_location="cpu", weights_only=True) | ^^^^^^^^^^ 67 | 68 | pipeline = WanPipeline.from_pretrained( | help: Remove assignment to unused variable `state_dict` | 65 | # Načtení modelu s weights_only=True (žádné pickle exécutující kód) - state_dict = torch.load(weight_path, map_location="cpu", weights_only=True) 66 + torch.load(weight_path, map_location="cpu", weights_only=True) 67 | | note: This is an unsafe fix and may change runtime behavior I001 [*] Import block is un-sorted or un-formatted --> docs/archive_unused_20260729/memory.py:1:1 | 1 | / import chromadb 2 | | from chromadb.config import Settings 3 | | from datetime import datetime 4 | | import uuid | |___________^ 5 | 6 | class MemoryManager: | help: Organize imports | 1 + import uuid 2 + from datetime import datetime 3 + 4 | import chromadb 5 | from chromadb.config import Settings - from datetime import datetime - import uuid 6 | 7 + 8 | class MemoryManager: | F401 [*] `chromadb.config.Settings` imported but unused --> docs/archive_unused_20260729/memory.py:2:29 | 1 | import chromadb 2 | from chromadb.config import Settings | ^^^^^^^^ 3 | from datetime import datetime 4 | import uuid | help: Remove unused import: `chromadb.config.Settings` | 1 | import chromadb - from chromadb.config import Settings 2 | from datetime import datetime | RUF013 PEP 484 prohibits implicit `Optional` --> docs/archive_unused_20260729/memory.py:19:68 | 17 | } 18 | 19 | def add_memory(self, memory_type: str, content: str, metadata: dict = None): | ^^^^ 20 | """ 21 | Uloží novou vzpomínku do daného typu paměti. | help: Convert to `T | None` | 18 | - def add_memory(self, memory_type: str, content: str, metadata: dict = None): 19 + def add_memory(self, memory_type: str, content: str, metadata: dict | None = None): 20 | """ | note: This is an unsafe fix and may change runtime behavior RUF013 PEP 484 prohibits implicit `Optional` --> docs/archive_unused_20260729/memory.py:39:58 | 37 | print(f"✅ Uloženo do paměti [{memory_type}]") 38 | 39 | def retrieve_memories(self, query: str, memory_type: str = None, limit: int = 5): | ^^^ 40 | """ 41 | Vyhledá relevantní vzpomínky podle dotazu. | help: Convert to `T | None` | 38 | - def retrieve_memories(self, query: str, memory_type: str = None, limit: int = 5): 39 + def retrieve_memories(self, query: str, memory_type: str | None = None, limit: int = 5): 40 | """ | note: This is an unsafe fix and may change runtime behavior RUF013 PEP 484 prohibits implicit `Optional` --> docs/archive_unused_20260729/memory.py:69:45 | 67 | return results[:limit] 68 | 69 | def get_all_memories(self, memory_type: str = None): | ^^^ 70 | """Vrátí všechny vzpomínky daného typu (pro debug).""" 71 | if memory_type: | help: Convert to `T | None` | 68 | - def get_all_memories(self, memory_type: str = None): 69 + def get_all_memories(self, memory_type: str | None = None): 70 | """Vrátí všechny vzpomínky daného typu (pro debug).""" | note: This is an unsafe fix and may change runtime behavior RUF013 PEP 484 prohibits implicit `Optional` --> docs/archive_unused_20260729/memory.py:79:59 | 77 | return all_data 78 | 79 | def save_memory(memory_type: str, content: str, metadata: dict = None): | ^^^^ 80 | """ 81 | Uloží novou vzpomínku. Tuto funkci může volat model. | help: Convert to `T | None` | 78 | - def save_memory(memory_type: str, content: str, metadata: dict = None): 79 + def save_memory(memory_type: str, content: str, metadata: dict | None = None): 80 | """ | note: This is an unsafe fix and may change runtime behavior I001 [*] Import block is un-sorted or un-formatted --> scripts/cb26_agent_runtime.py:2:1 | 1 | #!/usr/bin/env python3 2 | / from __future__ import annotations 3 | | import ast, asyncio, json, logging, os, re, shlex, sqlite3, subprocess, time, uuid 4 | | from datetime import datetime, timezone 5 | | from pathlib import Path 6 | | from typing import Any, Optional 7 | | from urllib.parse import urlparse 8 | | import httpx | |____________^ 9 | 10 | try: | help: Organize imports | 2 | from __future__ import annotations - import ast, asyncio, json, logging, os, re, shlex, sqlite3, subprocess, time, uuid 3 + 4 + import ast 5 + import asyncio 6 + import json 7 + import logging 8 + import os 9 + import re 10 + import shlex 11 + import sqlite3 12 + import subprocess 13 + import time 14 + import uuid 15 | from datetime import datetime, timezone 16 | from pathlib import Path 17 | from typing import Any, Optional 18 | from urllib.parse import urlparse 19 + 20 | import httpx | E401 [*] Multiple imports on one line --> scripts/cb26_agent_runtime.py:3:1 | 1 | #!/usr/bin/env python3 2 | from __future__ import annotations 3 | import ast, asyncio, json, logging, os, re, shlex, sqlite3, subprocess, time, uuid | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 4 | from datetime import datetime, timezone 5 | from pathlib import Path | help: Split imports | 2 | from __future__ import annotations - import ast, asyncio, json, logging, os, re, shlex, sqlite3, subprocess, time, uuid 3 + import ast 4 + import asyncio 5 + import json 6 + import logging 7 + import os 8 + import re 9 + import shlex 10 + import sqlite3 11 + import subprocess 12 + import time 13 + import uuid 14 | from datetime import datetime, timezone | F401 [*] `ast` imported but unused --> scripts/cb26_agent_runtime.py:3:8 | 1 | #!/usr/bin/env python3 2 | from __future__ import annotations 3 | import ast, asyncio, json, logging, os, re, shlex, sqlite3, subprocess, time, uuid | ^^^ 4 | from datetime import datetime, timezone 5 | from pathlib import Path | help: Remove unused import | 2 | from __future__ import annotations - import ast, asyncio, json, logging, os, re, shlex, sqlite3, subprocess, time, uuid 3 + import json, logging, os, re, shlex, sqlite3, subprocess, time, uuid 4 | from datetime import datetime, timezone | F401 [*] `asyncio` imported but unused --> scripts/cb26_agent_runtime.py:3:13 | 1 | #!/usr/bin/env python3 2 | from __future__ import annotations 3 | import ast, asyncio, json, logging, os, re, shlex, sqlite3, subprocess, time, uuid | ^^^^^^^ 4 | from datetime import datetime, timezone 5 | from pathlib import Path | help: Remove unused import | 2 | from __future__ import annotations - import ast, asyncio, json, logging, os, re, shlex, sqlite3, subprocess, time, uuid 3 + import json, logging, os, re, shlex, sqlite3, subprocess, time, uuid 4 | from datetime import datetime, timezone | F401 [*] `typing.Any` imported but unused --> scripts/cb26_agent_runtime.py:6:20 | 4 | from datetime import datetime, timezone 5 | from pathlib import Path 6 | from typing import Any, Optional | ^^^ 7 | from urllib.parse import urlparse 8 | import httpx | help: Remove unused import | 5 | from pathlib import Path - from typing import Any, Optional 6 | from urllib.parse import urlparse | F401 [*] `typing.Optional` imported but unused --> scripts/cb26_agent_runtime.py:6:25 | 4 | from datetime import datetime, timezone 5 | from pathlib import Path 6 | from typing import Any, Optional | ^^^^^^^^ 7 | from urllib.parse import urlparse 8 | import httpx | help: Remove unused import | 5 | from pathlib import Path - from typing import Any, Optional 6 | from urllib.parse import urlparse | UP017 [*] Use `datetime.UTC` alias --> scripts/cb26_agent_runtime.py:117:36 | 115 | SENSITIVE_RE = re.compile(r"(sk-[A-Za-z0-9_-]{12,}|ghp_[A-Za-z0-9]{20,}|xox[baprs]-[A-Za-z0-9-]{10,}|AIza[0-9A-Za-z_-]{20,}|-----BEGI… 116 | 117 | def now_iso(): return datetime.now(timezone.utc).isoformat() | ^^^^^^^^^^^^ 118 | def redact(s): return SENSITIVE_RE.sub("[REDACTED_SECRET]", s or "") | help: Convert to `datetime.UTC` alias | 3 | import ast, asyncio, json, logging, os, re, shlex, sqlite3, subprocess, time, uuid - from datetime import datetime, timezone 4 + from datetime import datetime, timezone, UTC 5 | from pathlib import Path -------------------------------------------------------------------------------- 116 | - def now_iso(): return datetime.now(timezone.utc).isoformat() 117 + def now_iso(): return datetime.now(UTC).isoformat() 118 | def redact(s): return SENSITIVE_RE.sub("[REDACTED_SECRET]", s or "") | E701 Multiple statements on one line (colon) --> scripts/cb26_agent_runtime.py:141:19 | 139 | def load_run(self, run_id): 140 | row = self.conn.execute("SELECT * FROM runs WHERE run_id=?", (run_id,)).fetchone() 141 | if not row: return None | ^ 142 | d = dict(row) 143 | try: d["state"] = json.loads(d.pop("state_json")) | E701 Multiple statements on one line (colon) --> scripts/cb26_agent_runtime.py:143:12 | 141 | if not row: return None 142 | d = dict(row) 143 | try: d["state"] = json.loads(d.pop("state_json")) | ^ 144 | except: d["state"] = {"messages": []} 145 | return d | E722 Do not use bare `except` --> scripts/cb26_agent_runtime.py:144:9 | 142 | d = dict(row) 143 | try: d["state"] = json.loads(d.pop("state_json")) 144 | except: d["state"] = {"messages": []} | ^^^^^^ 145 | return d | E701 Multiple statements on one line (colon) --> scripts/cb26_agent_runtime.py:144:15 | 142 | d = dict(row) 143 | try: d["state"] = json.loads(d.pop("state_json")) 144 | except: d["state"] = {"messages": []} | ^ 145 | return d | E701 Multiple statements on one line (colon) --> scripts/cb26_agent_runtime.py:155:19 | 153 | def get_approval(self, aid): 154 | row = self.conn.execute("SELECT * FROM approvals WHERE approval_id=?", (aid,)).fetchone() 155 | if not row: return None | ^ 156 | d = dict(row) 157 | d["arguments"] = json.loads(d.pop("arguments_json")) | E701 Multiple statements on one line (colon) --> scripts/cb26_agent_runtime.py:158:32 | 156 | d = dict(row) 157 | d["arguments"] = json.loads(d.pop("arguments_json")) 158 | if d.get("result_json"): d["result"] = json.loads(d.pop("result_json")) | ^ 159 | return d | E701 Multiple statements on one line (colon) --> scripts/cb26_agent_runtime.py:181:19 | 179 | def policy(command): 180 | command = command.strip() 181 | if not command: return {"allowed": False, "approval": False, "category": "deny", "reason": "Prázdný příkaz."} | ^ 182 | if any(x in command for x in SHELL_META): return {"allowed": True, "approval": True, "category": "shell-complex", "reason": "Shel… 183 | try: parts = shlex.split(command) | E701 Multiple statements on one line (colon) --> scripts/cb26_agent_runtime.py:182:45 | 180 | command = command.strip() 181 | if not command: return {"allowed": False, "approval": False, "category": "deny", "reason": "Prázdný příkaz."} 182 | if any(x in command for x in SHELL_META): return {"allowed": True, "approval": True, "category": "shell-complex", "reason": "Shel… | ^ 183 | try: parts = shlex.split(command) 184 | except ValueError as exc: return {"allowed": False, "approval": False, "category": "deny", "reason": f"Neplatná shell syntaxe: {e… | E701 Multiple statements on one line (colon) --> scripts/cb26_agent_runtime.py:183:8 | 181 | if not command: return {"allowed": False, "approval": False, "category": "deny", "reason": "Prázdný příkaz."} 182 | if any(x in command for x in SHELL_META): return {"allowed": True, "approval": True, "category": "shell-complex", "reason": "Shel… 183 | try: parts = shlex.split(command) | ^ 184 | except ValueError as exc: return {"allowed": False, "approval": False, "category": "deny", "reason": f"Neplatná shell syntaxe: {e… 185 | base = Path(parts[0]).name if parts else "" | E701 Multiple statements on one line (colon) --> scripts/cb26_agent_runtime.py:184:29 | 182 | if any(x in command for x in SHELL_META): return {"allowed": True, "approval": True, "category": "shell-complex", "reason": "Shel… 183 | try: parts = shlex.split(command) 184 | except ValueError as exc: return {"allowed": False, "approval": False, "category": "deny", "reason": f"Neplatná shell syntaxe: {e… | ^ 185 | base = Path(parts[0]).name if parts else "" 186 | if base == "sudo": return {"allowed": True, "approval": True, "category": "sudo", "reason": "Příkaz vyžaduje administrátorská prá… | E701 Multiple statements on one line (colon) --> scripts/cb26_agent_runtime.py:186:22 | 184 | except ValueError as exc: return {"allowed": False, "approval": False, "category": "deny", "reason": f"Neplatná shell syntaxe: {e… 185 | base = Path(parts[0]).name if parts else "" 186 | if base == "sudo": return {"allowed": True, "approval": True, "category": "sudo", "reason": "Příkaz vyžaduje administrátorská prá… | ^ 187 | if base in ALWAYS_APPROVAL_COMMANDS: return {"allowed": True, "approval": True, "category": "high", "reason": f"Příkaz {base} měn… 188 | if base in ALLOWED_COMMANDS: | E701 Multiple statements on one line (colon) --> scripts/cb26_agent_runtime.py:187:40 | 185 | base = Path(parts[0]).name if parts else "" 186 | if base == "sudo": return {"allowed": True, "approval": True, "category": "sudo", "reason": "Příkaz vyžaduje administrátorská prá… 187 | if base in ALWAYS_APPROVAL_COMMANDS: return {"allowed": True, "approval": True, "category": "high", "reason": f"Příkaz {base} měn… | ^ 188 | if base in ALLOWED_COMMANDS: 189 | is_read_only = base in READ_ONLY_COMMANDS | E701 Multiple statements on one line (colon) --> scripts/cb26_agent_runtime.py:204:27 | 202 | def safe_cwd(cwd): 203 | p = Path(cwd or ROOT).expanduser() 204 | if not p.is_absolute(): p = ROOT / p | ^ 205 | return p.resolve() | E701 Multiple statements on one line (colon) --> scripts/cb26_agent_runtime.py:209:31 | 207 | def limit_text(text): 208 | text = redact(text or "") 209 | if len(text) <= MAX_OUTPUT: return text | ^ 210 | return text[:MAX_OUTPUT] + f"\n...[TRUNCATED {len(text)-MAX_OUTPUT} chars]" | E701 Multiple statements on one line (colon) --> scripts/cb26_agent_runtime.py:217:26 | 215 | timeout = min(max(int(args.get("timeout", COMMAND_TIMEOUT)), 1), 180) 216 | pol = policy(command) 217 | if not pol["allowed"]: return {"status": "blocked", "exit_code": None, "stdout": "", "stderr": pol["reason"], "policy": pol} | ^ 218 | if not cwd.exists() or not cwd.is_dir(): return {"status": "failed", "exit_code": None, "stdout": "", "stderr": f"cwd does not ex… 219 | started = time.monotonic() | E701 Multiple statements on one line (colon) --> scripts/cb26_agent_runtime.py:218:44 | 216 | pol = policy(command) 217 | if not pol["allowed"]: return {"status": "blocked", "exit_code": None, "stdout": "", "stderr": pol["reason"], "policy": pol} 218 | if not cwd.exists() or not cwd.is_dir(): return {"status": "failed", "exit_code": None, "stdout": "", "stderr": f"cwd does not ex… | ^ 219 | started = time.monotonic() 220 | try: | S602 `subprocess` call with `shell=True` identified, security issue --> scripts/cb26_agent_runtime.py:222:14 | 220 | try: 221 | filtered_env = {k: v for k, v in os.environ.items() if not any(k.endswith(s) for s in ("_API_KEY", "_TOKEN", "_SECRET"))} 222 | cp = subprocess.run(command, cwd=str(cwd), shell=True, executable="/bin/bash", capture_output=True, text=True, timeout=timeou… | ^^^^^^^^^^^^^^ 223 | status = "success" if cp.returncode == 0 else "failed" 224 | return {"status": status, "exit_code": cp.returncode, "stdout": limit_text(cp.stdout), "stderr": limit_text(cp.stderr), "cwd"… | BLE001 Do not catch blind exception: `Exception` --> scripts/cb26_agent_runtime.py:227:12 | 225 | except subprocess.TimeoutExpired as exc: 226 | return {"status": "timeout", "exit_code": None, "stdout": limit_text(exc.stdout or ""), "stderr": limit_text((exc.stderr or "… 227 | except Exception as exc: | ^^^^^^^^^ 228 | return {"status": "error", "exit_code": None, "stdout": "", "stderr": str(exc), "cwd": str(cwd), "policy": pol} | E701 Multiple statements on one line (colon) --> scripts/cb26_agent_runtime.py:231:20 | 230 | def web_search(args): 231 | if DDGS is None: return {"status": "error", "error": "ddgs not installed."} | ^ 232 | query = str(args.get("query", "")).strip() 233 | if not query: return {"status": "error", "error": "query required"} | E701 Multiple statements on one line (colon) --> scripts/cb26_agent_runtime.py:233:17 | 231 | if DDGS is None: return {"status": "error", "error": "ddgs not installed."} 232 | query = str(args.get("query", "")).strip() 233 | if not query: return {"status": "error", "error": "query required"} | ^ 234 | max_results = min(max(int(args.get("max_results", SEARCH_RESULTS)), 1), 10) 235 | try: | BLE001 Do not catch blind exception: `Exception` --> scripts/cb26_agent_runtime.py:239:12 | 237 | cleaned = [{"title": str(r.get("title",""))[:300], "url": str(r.get("href", r.get("url","")))[:2000], "snippet": str(r.get("b… 238 | return {"status": "success", "query": query, "results": cleaned} 239 | except Exception as exc: return {"status": "error", "error": str(exc)[:1000]} | ^^^^^^^^^ 240 | 241 | def fetch_url(args): | E701 Multiple statements on one line (colon) --> scripts/cb26_agent_runtime.py:239:28 | 237 | cleaned = [{"title": str(r.get("title",""))[:300], "url": str(r.get("href", r.get("url","")))[:2000], "snippet": str(r.get("b… 238 | return {"status": "success", "query": query, "results": cleaned} 239 | except Exception as exc: return {"status": "error", "error": str(exc)[:1000]} | ^ 240 | 241 | def fetch_url(args): | E701 Multiple statements on one line (colon) --> scripts/cb26_agent_runtime.py:244:57 | 242 | url = str(args.get("url", "")).strip() 243 | p = urlparse(url) 244 | if p.scheme not in {"http", "https"} or not p.netloc: return {"status": "error", "error": "Only http/https allowed."} | ^ 245 | try: 246 | with httpx.Client(timeout=12, follow_redirects=True) as c: | BLE001 Do not catch blind exception: `Exception` --> scripts/cb26_agent_runtime.py:250:12 | 248 | r.raise_for_status() 249 | return {"status": "success", "url": str(r.url), "content": limit_text(r.text)} 250 | except Exception as exc: return {"status": "error", "error": str(exc)[:1000]} | ^^^^^^^^^ 251 | 252 | def normalize_message_item(m): | E701 Multiple statements on one line (colon) --> scripts/cb26_agent_runtime.py:250:28 | 248 | r.raise_for_status() 249 | return {"status": "success", "url": str(r.url), "content": limit_text(r.text)} 250 | except Exception as exc: return {"status": "error", "error": str(exc)[:1000]} | ^ 251 | 252 | def normalize_message_item(m): | E701 Multiple statements on one line (colon) --> scripts/cb26_agent_runtime.py:255:18 | 253 | out = {} 254 | for k in ("role", "content", "tool_calls", "tool_call_id", "name"): 255 | if k in m: out[k] = m[k] | ^ 256 | return out | E701 Multiple statements on one line (colon) --> scripts/cb26_agent_runtime.py:265:12 | 263 | name = fn.get("name") 264 | raw = fn.get("arguments", "{}") 265 | try: args = json.loads(raw) if isinstance(raw, str) else raw | ^ 266 | except: args = {} 267 | if name: | E722 Do not use bare `except` --> scripts/cb26_agent_runtime.py:266:9 | 264 | raw = fn.get("arguments", "{}") 265 | try: args = json.loads(raw) if isinstance(raw, str) else raw 266 | except: args = {} | ^^^^^^ 267 | if name: 268 | parsed.append({"id": c.get("id") or f"call_{uuid.uuid4().hex}", "name": name, "arguments": args}) | E701 Multiple statements on one line (colon) --> scripts/cb26_agent_runtime.py:266:15 | 264 | raw = fn.get("arguments", "{}") 265 | try: args = json.loads(raw) if isinstance(raw, str) else raw 266 | except: args = {} | ^ 267 | if name: 268 | parsed.append({"id": c.get("id") or f"call_{uuid.uuid4().hex}", "name": name, "arguments": args}) | E701 Multiple statements on one line (colon) --> scripts/cb26_agent_runtime.py:272:19 | 271 | def fallback_json_action(content): 272 | if not content: return None | ^ 273 | 274 | # JSON detekce | E722 Do not use bare `except` --> scripts/cb26_agent_runtime.py:281:9 | 279 | try: 280 | obj = json.loads(raw) 281 | except: continue | ^^^^^^ 282 | if obj.get("action") == "tool" and obj.get("tool"): 283 | return {"id": "fallback_" + uuid.uuid4().hex, "name": obj["tool"], "arguments": obj.get("arguments", {})} | S112 `try`-`except`-`continue` detected, consider logging the exception --> scripts/cb26_agent_runtime.py:281:9 | 279 | try: 280 | obj = json.loads(raw) 281 | except: continue | ^^^^^^^^^^^^^^^^ 282 | if obj.get("action") == "tool" and obj.get("tool"): 283 | return {"id": "fallback_" + uuid.uuid4().hex, "name": obj["tool"], "arguments": obj.get("arguments", {})} | E701 Multiple statements on one line (colon) --> scripts/cb26_agent_runtime.py:281:15 | 279 | try: 280 | obj = json.loads(raw) 281 | except: continue | ^ 282 | if obj.get("action") == "tool" and obj.get("tool"): 283 | return {"id": "fallback_" + uuid.uuid4().hex, "name": obj["tool"], "arguments": obj.get("arguments", {})} | E701 Multiple statements on one line (colon) --> scripts/cb26_agent_runtime.py:290:25 | 288 | for line in lines: 289 | line = line.strip() 290 | if len(line) < 3: continue | ^ 291 | 292 | # Ignorujeme české věty | E701 Multiple statements on one line (colon) --> scripts/cb26_agent_runtime.py:335:32 | 333 | … raise RuntimeError(f"LiteLLM HTTP {r.status_code}: {r.text[:1200]} | fallback HTTP {r2.status_code}: {r2.text[:1200]}") 334 | … r = r2 335 | … if r.status_code != 200: raise RuntimeError(f"LiteLLM HTTP {r.status_code}: {r.text[:1500]}") | ^ 336 | … data = r.json() 337 | … choices = data.get("choices") or [] | E701 Multiple statements on one line (colon) --> scripts/cb26_agent_runtime.py:338:23 | 336 | data = r.json() 337 | choices = data.get("choices") or [] 338 | if not choices: raise RuntimeError(f"No choices in response: {data}") | ^ 339 | return choices[0]["message"] | E722 Do not use bare `except` --> scripts/cb26_agent_runtime.py:345:5 | 343 | from memory_core import retrieve_active_context 344 | return retrieve_active_context(query=query, limit=MEMORY_LIMIT) 345 | except: return [] | ^^^^^^ 346 | 347 | def resolve_model(model): return MODEL_ALIASES.get(model, LEGACY_SAFE_OI_MODELS.get(model, model)) | E701 Multiple statements on one line (colon) --> scripts/cb26_agent_runtime.py:345:11 | 343 | from memory_core import retrieve_active_context 344 | return retrieve_active_context(query=query, limit=MEMORY_LIMIT) 345 | except: return [] | ^ 346 | 347 | def resolve_model(model): return MODEL_ALIASES.get(model, LEGACY_SAFE_OI_MODELS.get(model, model)) | E722 Do not use bare `except` --> scripts/cb26_agent_runtime.py:356:5 | 354 | mem = memory_context(user_text) 355 | memory_text = "\n".join(f"- {x.get('content','')}" for x in mem if isinstance(x, dict)) 356 | except: memory_text = "" | ^^^^^^ 357 | sys_content = SYSTEM_PROMPT 358 | if memory_text: sys_content += "\n\nPaměť:\n" + memory_text | E701 Multiple statements on one line (colon) --> scripts/cb26_agent_runtime.py:356:11 | 354 | mem = memory_context(user_text) 355 | memory_text = "\n".join(f"- {x.get('content','')}" for x in mem if isinstance(x, dict)) 356 | except: memory_text = "" | ^ 357 | sys_content = SYSTEM_PROMPT 358 | if memory_text: sys_content += "\n\nPaměť:\n" + memory_text | E701 Multiple statements on one line (colon) --> scripts/cb26_agent_runtime.py:358:19 | 356 | except: memory_text = "" 357 | sys_content = SYSTEM_PROMPT 358 | if memory_text: sys_content += "\n\nPaměť:\n" + memory_text | ^ 359 | run = {"run_id": run_id, "thread_id": tid, "status": STATUS_RUNNING, "model": model, "mode": mode, "step": 0, "failure_count": 0,… 360 | STORE.save_run(run) | E701 Multiple statements on one line (colon) --> scripts/cb26_agent_runtime.py:368:15 | 366 | def run_until_pause_or_done(run_id): 367 | run = STORE.load_run(run_id) 368 | if not run: raise RuntimeError("run not found") | ^ 369 | while run["step"] < MAX_STEPS: 370 | pending = STORE.pending_for_run(run_id) | BLE001 Do not catch blind exception: `Exception` --> scripts/cb26_agent_runtime.py:381:16 | 379 | try: 380 | msg = call_llm(run["model"], build_messages(run)) 381 | except Exception as exc: | ^^^^^^^^^ 382 | run["status"] = STATUS_FAILED 383 | STORE.save_run(run) | E701 Multiple statements on one line (colon) --> scripts/cb26_agent_runtime.py:491:32 | 489 | STORE.add_event(run_id, "run.failed", {"error": "Max tool failures"}) 490 | return serialize_run(run) 491 | if needs_approval_pause: return serialize_run(run) | ^ 492 | run["state"]["pending_approval_id"] = None 493 | run["status"] = STATUS_RUNNING | E701 Multiple statements on one line (colon) --> scripts/cb26_agent_runtime.py:502:20 | 500 | def resume_approval(approval_id, action, edited_arguments=None): 501 | approval = STORE.get_approval(approval_id) 502 | if not approval: raise KeyError("approval not found") | ^ 503 | if approval["status"] != "pending": raise ValueError(f"approval is {approval['status']}") 504 | run = STORE.load_run(approval["run_id"]) | E701 Multiple statements on one line (colon) --> scripts/cb26_agent_runtime.py:503:39 | 501 | approval = STORE.get_approval(approval_id) 502 | if not approval: raise KeyError("approval not found") 503 | if approval["status"] != "pending": raise ValueError(f"approval is {approval['status']}") | ^ 504 | run = STORE.load_run(approval["run_id"]) 505 | if not run: raise RuntimeError("run not found") | E701 Multiple statements on one line (colon) --> scripts/cb26_agent_runtime.py:505:15 | 503 | if approval["status"] != "pending": raise ValueError(f"approval is {approval['status']}") 504 | run = STORE.load_run(approval["run_id"]) 505 | if not run: raise RuntimeError("run not found") | ^ 506 | args = edited_arguments if isinstance(edited_arguments, dict) else approval["arguments"] 507 | if action == "deny": | E701 Multiple statements on one line (colon) --> scripts/cb26_agent_runtime.py:513:44 | 511 | STORE.add_event(run["run_id"], "approval.denied", {"approval_id": approval_id, "result": result}) 512 | else: 513 | if approval["tool_name"] != "shell": raise ValueError("Only shell is approval-gated") | ^ 514 | result = execute_shell(args) 515 | STORE.decide_approval(approval_id, "approved", result) | BLE001 Do not catch blind exception: `Exception` --> scripts/cb26_agent_runtime.py:543:12 | 541 | models = [m.get("id") for m in r.json().get("data", [])] if ok else [] 542 | return {"ok": ok, "proxy": PROXY_URL, "models": models} 543 | except Exception as exc: | ^^^^^^^^^ 544 | return {"ok": False, "proxy": PROXY_URL, "error": str(exc)} | I001 [*] Import block is un-sorted or un-formatted --> scripts/check_litellm_proxy.py:1:1 | 1 | / import os 2 | | from openai import OpenAI | |_________________________^ 3 | 4 | # Inicializace klienta pro LiteLLM Proxy | help: Organize imports | 1 | import os 2 + 3 | from openai import OpenAI | BLE001 Do not catch blind exception: `Exception` --> scripts/check_litellm_proxy.py:17:8 | 15 | ) 16 | print("Odpověď z API:", response.choices[0].message.content) 17 | except Exception as e: | ^^^^^^^^^ 18 | print("Chyba při volání API:", e) | BLE001 Do not catch blind exception: `Exception` --> scripts/clean_stale_memory.py:35:16 | 33 | try: 34 | collection = client.get_collection(name) 35 | except Exception as exc: | ^^^^^^^^^ 36 | print(f"[WARN] Kolekce '{name}' není dostupná: {exc}") 37 | matches[name] = [] | RUF001 String contains ambiguous `–` (EN DASH). Did you mean `-` (HYPHEN-MINUS)? --> scripts/clean_stale_memory.py:111:25 | 110 | def main() -> int: 111 | print("CyberBrain26 – cleanup zastaralé testovací paměti") | ^ 112 | print(f"[INFO] Projekt: {PROJECT_ROOT}") 113 | print(f"[INFO] ChromaDB: {DB_PATH}") | I001 [*] Import block is un-sorted or un-formatted --> scripts/cyberbrain_memory.py:1:1 | 1 | / import os 2 | | import datetime 3 | | import chromadb | |_______________^ 4 | 5 | DEFAULT_DB_PATH = os.path.expanduser( | help: Organize imports | 1 + import datetime 2 | import os - import datetime 3 + 4 | import chromadb | BLE001 Do not catch blind exception: `Exception` --> scripts/cyberbrain_memory.py:35:16 | 33 | try: 34 | return self.client.get_collection(name) 35 | except Exception: | ^^^^^^^^^ 36 | return self.client.create_collection(name=name) | S110 `try`-`except`-`pass` detected, consider logging the exception --> scripts/cyberbrain_memory.py:128:9 | 126 | if identity and identity.get("documents"): 127 | parts.append("IDENTITA:\n" + identity["documents"][0]) 128 | / except Exception: 129 | | # když ještě nic není, prostě pokračujeme 130 | | pass | |________________^ 131 | 132 | # 2) Preference – vezmeme pár posledních | BLE001 Do not catch blind exception: `Exception` --> scripts/cyberbrain_memory.py:128:16 | 126 | if identity and identity.get("documents"): 127 | parts.append("IDENTITA:\n" + identity["documents"][0]) 128 | except Exception: | ^^^^^^^^^ 129 | # když ještě nic není, prostě pokračujeme 130 | pass | RUF003 Comment contains ambiguous `–` (EN DASH). Did you mean `-` (HYPHEN-MINUS)? --> scripts/cyberbrain_memory.py:132:25 | 130 | pass 131 | 132 | # 2) Preference – vezmeme pár posledních | ^ 133 | try: 134 | prefs = self.preferences.get(limit=3) | S110 `try`-`except`-`pass` detected, consider logging the exception --> scripts/cyberbrain_memory.py:139:9 | 137 | text = "\n".join(docs) 138 | parts.append("PREFERENCE:\n" + text) 139 | / except Exception: 140 | | pass | |________________^ 141 | 142 | # 3) Pravidla – mimo identity vezmeme pár posledních | BLE001 Do not catch blind exception: `Exception` --> scripts/cyberbrain_memory.py:139:16 | 137 | text = "\n".join(docs) 138 | parts.append("PREFERENCE:\n" + text) 139 | except Exception: | ^^^^^^^^^ 140 | pass | RUF003 Comment contains ambiguous `–` (EN DASH). Did you mean `-` (HYPHEN-MINUS)? --> scripts/cyberbrain_memory.py:142:23 | 140 | pass 141 | 142 | # 3) Pravidla – mimo identity vezmeme pár posledních | ^ 143 | try: 144 | rules = self.rules.get(limit=5) | S110 `try`-`except`-`pass` detected, consider logging the exception --> scripts/cyberbrain_memory.py:152:9 | 150 | text = "\n".join(other_rules) 151 | parts.append("PRAVIDLA:\n" + text) 152 | / except Exception: 153 | | pass | |________________^ 154 | 155 | # 4) Relevantní konverzace podle dotazu | BLE001 Do not catch blind exception: `Exception` --> scripts/cyberbrain_memory.py:152:16 | 150 | text = "\n".join(other_rules) 151 | parts.append("PRAVIDLA:\n" + text) 152 | except Exception: | ^^^^^^^^^ 153 | pass | S110 `try`-`except`-`pass` detected, consider logging the exception --> scripts/cyberbrain_memory.py:168:9 | 166 | text = "\n---\n".join(flat) 167 | parts.append("RELEVANTNÍ KONVERZACE:\n" + text) 168 | / except Exception: 169 | | pass | |________________^ 170 | 171 | if not parts: | BLE001 Do not catch blind exception: `Exception` --> scripts/cyberbrain_memory.py:168:16 | 166 | text = "\n---\n".join(flat) 167 | parts.append("RELEVANTNÍ KONVERZACE:\n" + text) 168 | except Exception: | ^^^^^^^^^ 169 | pass | I001 [*] Import block is un-sorted or un-formatted --> scripts/execution_policy.py:6:1 | 4 | """ 5 | 6 | / import re 7 | | from typing import Tuple, List | |______________________________^ 8 | 9 | ActionCategory = str | help: Organize imports | 6 | import re - from typing import Tuple, List 7 + from typing import List, Tuple 8 | | UP035 `typing.Tuple` is deprecated, use `tuple` instead --> scripts/execution_policy.py:7:1 | 6 | import re 7 | from typing import Tuple, List | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 8 | 9 | ActionCategory = str | UP035 `typing.List` is deprecated, use `list` instead --> scripts/execution_policy.py:7:1 | 6 | import re 7 | from typing import Tuple, List | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 8 | 9 | ActionCategory = str | UP006 [*] Use `tuple` instead of `Tuple` for type annotation --> scripts/execution_policy.py:74:50 | 72 | return "unknown" 73 | 74 | def classify_action(code: str, language: str) -> Tuple[ActionCategory, List[str]]: | ^^^^^ 75 | lang = (language or "").strip().lower() 76 | if lang in ("python", "py"): | help: Replace with `tuple` | 73 | - def classify_action(code: str, language: str) -> Tuple[ActionCategory, List[str]]: 74 + def classify_action(code: str, language: str) -> tuple[ActionCategory, List[str]]: 75 | lang = (language or "").strip().lower() | UP006 [*] Use `list` instead of `List` for type annotation --> scripts/execution_policy.py:74:72 | 72 | return "unknown" 73 | 74 | def classify_action(code: str, language: str) -> Tuple[ActionCategory, List[str]]: | ^^^^ 75 | lang = (language or "").strip().lower() 76 | if lang in ("python", "py"): | help: Replace with `list` | 73 | - def classify_action(code: str, language: str) -> Tuple[ActionCategory, List[str]]: 74 + def classify_action(code: str, language: str) -> Tuple[ActionCategory, list[str]]: 75 | lang = (language or "").strip().lower() | I001 [*] Import block is un-sorted or un-formatted --> scripts/legacy/frontend_smoke_test.py:4:1 | 2 | """Frontend smoke test pro CyberBrain26 GUI (Fáze 7).""" 3 | 4 | import sys | ^^^^^^^^^^ 5 | try: 6 | from playwright.sync_api import sync_playwright | help: Organize imports | 4 | import sys 5 + 6 | try: | F541 [*] f-string without any placeholders --> scripts/legacy/frontend_smoke_test.py:52:23 | 50 | # Zkontrolujeme JS chyby 51 | if js_errors: 52 | print(f"❌ Nalezeny JS chyby:") | ^^^^^^^^^^^^^^^^^^^^^^^^ 53 | for err in js_errors[:10]: 54 | print(f" - {err}") | help: Remove extraneous `f` prefix | 51 | if js_errors: - print(f"❌ Nalezeny JS chyby:") 52 + print("❌ Nalezeny JS chyby:") 53 | for err in js_errors[:10]: | BLE001 Do not catch blind exception: `Exception` --> scripts/legacy/frontend_smoke_test.py:62:16 | 60 | return 0 61 | 62 | except Exception as e: | ^^^^^^^^^ 63 | print(f"❌ Chyba při testu: {e}") 64 | return 1 | I001 [*] Import block is un-sorted or un-formatted --> scripts/legacy/smoke_test.py:4:1 | 2 | """Smoke testy pro CyberBrain26 API (Fáze 7).""" 3 | 4 | / import httpx 5 | | import sys | |__________^ 6 | 7 | BASE_URL = "http://localhost:8080" | help: Organize imports | 3 | - import httpx 4 | import sys 5 | 6 + import httpx 7 + 8 | BASE_URL = "http://localhost:8080" | BLE001 Do not catch blind exception: `Exception` --> scripts/legacy/smoke_test.py:105:12 | 103 | print(f"\n❌ HTTP chyba: {e}") 104 | return 1 105 | except Exception as e: | ^^^^^^^^^ 106 | print(f"\n❌ Neočekávaná chyba: {e}") 107 | return 1 | I001 [*] Import block is un-sorted or un-formatted --> scripts/legacy/test_agent_v2.py:2:1 | 1 | #!/usr/bin/env python3 2 | / import json 3 | | import tempfile 4 | | from pathlib import Path 5 | | import sys | |__________^ 6 | 7 | ROOT = Path(__file__).resolve().parents[1] | help: Organize imports | 2 | import json 3 + import sys 4 | import tempfile 5 | from pathlib import Path - import sys 6 | | F401 [*] `json` imported but unused --> scripts/legacy/test_agent_v2.py:2:8 | 1 | #!/usr/bin/env python3 2 | import json | ^^^^ 3 | import tempfile 4 | from pathlib import Path | help: Remove unused import: `json` | 1 | #!/usr/bin/env python3 - import json 2 | import tempfile | E402 Module level import not at top of file --> scripts/legacy/test_agent_v2.py:10:1 | 8 | sys.path.insert(0, str(ROOT / "scripts")) 9 | 10 | import cb26_agent_runtime as rt | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 11 | 12 | def test_policy(): | help: Move module level imports to top of file I001 [*] Import block is un-sorted or un-formatted --> scripts/legacy/test_agent_v2.py:10:1 | 8 | sys.path.insert(0, str(ROOT / "scripts")) 9 | 10 | import cb26_agent_runtime as rt | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 11 | 12 | def test_policy(): | help: Organize imports | 11 | 12 + 13 | def test_policy(): | RUF019 [*] Unnecessary key check before dictionary access --> scripts/legacy/test_agent_v2.py:45:12 | 43 | assert "run_id" in data 44 | assert data.get("status") in ("running", "waiting_approval", "completed") 45 | if "reply" in data and data["reply"]: | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 46 | assert len(data["reply"]) > 0 47 | except Exception as e: | help: Replace with `dict.get` | 44 | assert data.get("status") in ("running", "waiting_approval", "completed") - if "reply" in data and data["reply"]: 45 + if data.get("reply"): 46 | assert len(data["reply"]) > 0 | BLE001 Do not catch blind exception: `Exception` --> scripts/legacy/test_agent_v2.py:47:12 | 45 | if "reply" in data and data["reply"]: 46 | assert len(data["reply"]) > 0 47 | except Exception as e: | ^^^^^^^^^ 48 | print(f"WARNING: chat smoketest failed: {e}") | E402 Module level import not at top of file --> scripts/legacy/test_agents.py:11:1 | 9 | sys.path.insert(0, str(PROJECT_ROOT)) 10 | 11 | / from agent_profiles import ( 12 | | get_profile, 13 | | list_profiles, 14 | | validate_action, 15 | | FilesystemAccess, 16 | | NetworkAccess 17 | | ) | |_^ help: Move module level imports to top of file I001 [*] Import block is un-sorted or un-formatted --> scripts/legacy/test_agents.py:11:1 | 9 | sys.path.insert(0, str(PROJECT_ROOT)) 10 | 11 | / from agent_profiles import ( 12 | | get_profile, 13 | | list_profiles, 14 | | validate_action, 15 | | FilesystemAccess, 16 | | NetworkAccess 17 | | ) | |_^ help: Organize imports | 11 | from agent_profiles import ( 12 + FilesystemAccess, 13 + NetworkAccess, 14 | get_profile, 15 | list_profiles, 16 | validate_action, - FilesystemAccess, - NetworkAccess 17 | ) | E712 Avoid equality comparisons to `True`; use `coder.approval_required:` for truth checks --> scripts/legacy/test_agents.py:46:10 | 44 | (coder.filesystem_access == FilesystemAccess.WORKSPACE, 'filesystem'), 45 | (coder.network_access == NetworkAccess.PROXY, 'network'), 46 | (coder.approval_required == True, 'approval'), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 47 | ] | help: Replace with `coder.approval_required` | 45 | (coder.network_access == NetworkAccess.PROXY, 'network'), - (coder.approval_required == True, 'approval'), 46 + (coder.approval_required, 'approval'), 47 | ] | note: This is an unsafe fix and may change runtime behavior F541 [*] f-string without any placeholders --> scripts/legacy/test_agents.py:86:15 | 85 | if len(profiles) == 4: 86 | print(f" ✓ 4 profiles listed") | ^^^^^^^^^^^^^^^^^^^^^^^^^ 87 | return True 88 | else: | help: Remove extraneous `f` prefix | 85 | if len(profiles) == 4: - print(f" ✓ 4 profiles listed") 86 + print(" ✓ 4 profiles listed") 87 | return True | BLE001 Do not catch blind exception: `Exception` --> scripts/legacy/test_agents.py:109:16 | 107 | try: 108 | results.append(test()) 109 | except Exception as e: | ^^^^^^^^^ 110 | print(f"ERROR: {e}") 111 | import traceback | E402 Module level import not at top of file --> scripts/legacy/test_llm_router.py:9:1 | 7 | sys.path.insert(0, str(PROJECT_ROOT)) 8 | 9 | from llm_router import LLMRouter | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10 | 11 | def test_load_config(): | help: Move module level imports to top of file I001 [*] Import block is un-sorted or un-formatted --> scripts/legacy/test_llm_router.py:9:1 | 7 | sys.path.insert(0, str(PROJECT_ROOT)) 8 | 9 | from llm_router import LLMRouter | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 10 | 11 | def test_load_config(): | help: Organize imports | 10 | 11 + 12 | def test_load_config(): | I001 [*] Import block is un-sorted or un-formatted --> scripts/legacy/test_memory_v2.py:5:1 | 3 | """ 4 | 5 | / import sys 6 | | import os 7 | | import json 8 | | import tempfile 9 | | from pathlib import Path 10 | | from datetime import datetime, timezone, timedelta | |__________________________________________________^ 11 | 12 | PROJECT_ROOT = Path(__file__).resolve().parent.parent | help: Organize imports | 4 | - import sys 5 + import json 6 | import os - import json 7 + import sys 8 | import tempfile 9 + from datetime import datetime, timedelta, timezone 10 | from pathlib import Path - from datetime import datetime, timezone, timedelta 11 | | F401 [*] `json` imported but unused --> scripts/legacy/test_memory_v2.py:7:8 | 5 | import sys 6 | import os 7 | import json | ^^^^ 8 | import tempfile 9 | from pathlib import Path | help: Remove unused import: `json` | 6 | import os - import json 7 | import tempfile | E402 Module level import not at top of file --> scripts/legacy/test_memory_v2.py:15:1 | 13 | sys.path.insert(0, str(PROJECT_ROOT)) 14 | 15 | from memory_core import MemoryCore | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: Move module level imports to top of file F841 Local variable `new_record` is assigned to but never used --> scripts/legacy/test_memory_v2.py:90:5 | 89 | old_record = core.get_memory(old['id']) 90 | new_record = core.get_memory(new['id']) | ^^^^^^^^^^ 91 | 92 | old_in_active = any(r['id'] == old['id'] for r in active) | help: Remove assignment to unused variable `new_record` | 89 | old_record = core.get_memory(old['id']) - new_record = core.get_memory(new['id']) 90 + core.get_memory(new['id']) 91 | | note: This is an unsafe fix and may change runtime behavior UP017 [*] Use `datetime.UTC` alias --> scripts/legacy/test_memory_v2.py:108:34 | 106 | core = create_test_db() 107 | 108 | expired_time = (datetime.now(timezone.utc) - timedelta(days=1)).isoformat() | ^^^^^^^^^^^^ 109 | record = core.save_memory( 110 | content="Expired fact", | help: Convert to `datetime.UTC` alias | 9 | from pathlib import Path - from datetime import datetime, timezone, timedelta 10 + from datetime import datetime, timezone, timedelta, UTC 11 | -------------------------------------------------------------------------------- 107 | - expired_time = (datetime.now(timezone.utc) - timedelta(days=1)).isoformat() 108 + expired_time = (datetime.now(UTC) - timedelta(days=1)).isoformat() 109 | record = core.save_memory( | BLE001 Do not catch blind exception: `Exception` --> scripts/legacy/test_memory_v2.py:224:16 | 222 | result = test() 223 | results.append(result) 224 | except Exception as e: | ^^^^^^^^^ 225 | print(f"ERROR in {test.__name__}: {e}") 226 | import traceback | I001 [*] Import block is un-sorted or un-formatted --> scripts/legacy/test_plan_consistency.py:2:1 | 1 | #!/usr/bin/env python3 2 | / from __future__ import annotations 3 | | import os, socket, sys 4 | | from pathlib import Path | |________________________^ 5 | 6 | LAB_ROOT = Path(os.getenv("CB26_LAB_ROOT", "/home/oem/CyberBrain26-lab")).resolve() | help: Organize imports | 2 | from __future__ import annotations - import os, socket, sys 3 + 4 + import os 5 + import socket 6 + import sys 7 | from pathlib import Path | E401 [*] Multiple imports on one line --> scripts/legacy/test_plan_consistency.py:3:1 | 1 | #!/usr/bin/env python3 2 | from __future__ import annotations 3 | import os, socket, sys | ^^^^^^^^^^^^^^^^^^^^^^ 4 | from pathlib import Path | help: Split imports | 2 | from __future__ import annotations - import os, socket, sys 3 + import os 4 + import socket 5 + import sys 6 | from pathlib import Path | F401 [*] `socket` imported but unused --> scripts/legacy/test_plan_consistency.py:3:12 | 1 | #!/usr/bin/env python3 2 | from __future__ import annotations 3 | import os, socket, sys | ^^^^^^ 4 | from pathlib import Path | help: Remove unused import: `socket` | 2 | from __future__ import annotations - import os, socket, sys 3 + import os, sys 4 | from pathlib import Path | E701 Multiple statements on one line (colon) --> scripts/legacy/test_plan_consistency.py:30:22 | 28 | def classify(path, expected): 29 | e = path.exists() 30 | if expected and e: return "ok" | ^ 31 | if expected and not e: return "missing" 32 | if not expected and not e: return "expected_missing" | E701 Multiple statements on one line (colon) --> scripts/legacy/test_plan_consistency.py:31:26 | 29 | e = path.exists() 30 | if expected and e: return "ok" 31 | if expected and not e: return "missing" | ^ 32 | if not expected and not e: return "expected_missing" 33 | return "extra" | E701 Multiple statements on one line (colon) --> scripts/legacy/test_plan_consistency.py:32:30 | 30 | if expected and e: return "ok" 31 | if expected and not e: return "missing" 32 | if not expected and not e: return "expected_missing" | ^ 33 | return "extra" | F401 [*] `webapp` imported but unused --> scripts/legacy/test_webapp.py:13:16 | 11 | print("\n=== Test: webapp import ===") 12 | try: 13 | import webapp | ^^^^^^ 14 | print("PASS: webapp imported successfully") 15 | return True | help: Remove unused import: `webapp` | 12 | try: - import webapp 13 | print("PASS: webapp imported successfully") | BLE001 Do not catch blind exception: `Exception` --> scripts/legacy/test_webapp.py:16:12 | 14 | print("PASS: webapp imported successfully") 15 | return True 16 | except Exception as e: | ^^^^^^^^^ 17 | print(f"FAIL: {e}") 18 | return False | BLE001 Do not catch blind exception: `Exception` --> scripts/legacy/test_webapp.py:30:12 | 28 | print("FAIL: No models loaded") 29 | return False 30 | except Exception as e: | ^^^^^^^^^ 31 | print(f"FAIL: {e}") 32 | return False | BLE001 Do not catch blind exception: `Exception` --> scripts/legacy/test_webapp.py:44:12 | 42 | print("FAIL: HTML template too short") 43 | return False 44 | except Exception as e: | ^^^^^^^^^ 45 | print(f"FAIL: {e}") 46 | return False | BLE001 Do not catch blind exception: `Exception` --> scripts/legacy/test_webapp.py:59:16 | 57 | try: 58 | results.append(test()) 59 | except Exception as e: | ^^^^^^^^^ 60 | print(f"ERROR: {e}") 61 | results.append(False) | BLE001 Do not catch blind exception: `Exception` --> scripts/migrate_conversations.py:21:12 | 19 | from cyberbrain26.paths import conversations_dir 20 | return conversations_dir() 21 | except Exception: | ^^^^^^^^^ 22 | return Path.cwd() / "data" / "conversations" | BLE001 Do not catch blind exception: `Exception` --> scripts/migrate_conversations.py:36:12 | 34 | try: 35 | data = json.loads(path.read_text(encoding="utf-8")) 36 | except Exception as e: | ^^^^^^^^^ 37 | print(f" [SKIP] {path.name}: {e}") 38 | return "skip" | UP017 [*] Use `datetime.UTC` alias --> scripts/migrate_conversations.py:48:24 | 46 | new_title = coerce_title(raw) 47 | data["title"] = new_title 48 | now = datetime.now(timezone.utc).isoformat() | ^^^^^^^^^^^^ 49 | data.setdefault("created_at", now) 50 | data.setdefault("updated_at", now) | help: Convert to `datetime.UTC` alias | 9 | import sys - from datetime import datetime, timezone 10 + from datetime import datetime, timezone, UTC 11 | from pathlib import Path -------------------------------------------------------------------------------- 47 | data["title"] = new_title - now = datetime.now(timezone.utc).isoformat() 48 + now = datetime.now(UTC).isoformat() 49 | data.setdefault("created_at", now) | RUF002 Docstring contains ambiguous `–` (EN DASH). Did you mean `-` (HYPHEN-MINUS)? --> scripts/safe_oi_api.py:3:36 | 1 | #!/usr/bin/env python3 2 | """ 3 | CyberBrain26 SAFE-OI / FULL-OI API – LiteLLM Phase 1. | ^ 4 | 5 | Běžná konverzace jde přímo přes LiteLLM, nikoli přes Open Interpreter. | I001 [*] Import block is un-sorted or un-formatted --> scripts/safe_oi_api.py:9:1 | 7 | """ 8 | 9 | / import os 10 | | import sys 11 | | import uuid 12 | | import logging 13 | | import re 14 | | from datetime import datetime 15 | | from pathlib import Path 16 | | from typing import Any, Dict, List, Optional 17 | | import sys 18 | | from pathlib import Path | |________________________^ 19 | 20 | # Přidáme adresář scripts do sys.path, abychom mohli importovat safe_runner | help: Organize imports | 8 | 9 + import logging 10 | import os 11 + import re 12 | import sys 13 | import uuid - import logging - import re 14 | from datetime import datetime 15 | from pathlib import Path 16 | from typing import Any, Dict, List, Optional - import sys - from pathlib import Path 17 | | UP035 `typing.Dict` is deprecated, use `dict` instead --> scripts/safe_oi_api.py:16:1 | 14 | from datetime import datetime 15 | from pathlib import Path 16 | from typing import Any, Dict, List, Optional | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 17 | import sys 18 | from pathlib import Path | UP035 `typing.List` is deprecated, use `list` instead --> scripts/safe_oi_api.py:16:1 | 14 | from datetime import datetime 15 | from pathlib import Path 16 | from typing import Any, Dict, List, Optional | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 17 | import sys 18 | from pathlib import Path | F401 [*] `typing.Any` imported but unused --> scripts/safe_oi_api.py:16:20 | 14 | from datetime import datetime 15 | from pathlib import Path 16 | from typing import Any, Dict, List, Optional | ^^^ 17 | import sys 18 | from pathlib import Path | help: Remove unused import: `typing.Any` | 15 | from pathlib import Path - from typing import Any, Dict, List, Optional 16 + from typing import Dict, List, Optional 17 | import sys | F811 [*] Redefinition of unused `sys` from line 10 --> scripts/safe_oi_api.py:17:8 | 15 | from pathlib import Path 16 | from typing import Any, Dict, List, Optional 17 | import sys | ^^^ `sys` redefined here 18 | from pathlib import Path | ::: scripts/safe_oi_api.py:10:8 | 9 | import os 10 | import sys | --- previous definition of `sys` here 11 | import uuid 12 | import logging | help: Remove definition: `sys` | 16 | from typing import Any, Dict, List, Optional - import sys 17 | from pathlib import Path | F811 [*] Redefinition of unused `Path` from line 15 --> scripts/safe_oi_api.py:18:21 | 13 | import re 14 | from datetime import datetime 15 | from pathlib import Path | ---- previous definition of `Path` here 16 | from typing import Any, Dict, List, Optional 17 | import sys 18 | from pathlib import Path | ^^^^ `Path` redefined here 19 | 20 | # Přidáme adresář scripts do sys.path, abychom mohli importovat safe_runner | help: Remove definition: `Path` | 17 | import sys - from pathlib import Path 18 | | E402 Module level import not at top of file --> scripts/safe_oi_api.py:25:1 | 23 | sys.path.insert(0, str(_scripts_dir)) 24 | 25 | import safe_runner | ^^^^^^^^^^^^^^^^^^ 26 | 27 | import httpx | help: Move module level imports to top of file I001 [*] Import block is un-sorted or un-formatted --> scripts/safe_oi_api.py:25:1 | 23 | sys.path.insert(0, str(_scripts_dir)) 24 | 25 | / import safe_runner 26 | | 27 | | import httpx 28 | | from fastapi import FastAPI, HTTPException 29 | | from fastapi.middleware.cors import CORSMiddleware 30 | | from pydantic import BaseModel 31 | | import uvicorn | |______________^ 32 | 33 | PROJECT_ROOT = Path(__file__).resolve().parent.parent | help: Organize imports | 24 | - import safe_runner - 25 | import httpx 26 + import safe_runner 27 + import uvicorn 28 | from fastapi import FastAPI, HTTPException 29 | from fastapi.middleware.cors import CORSMiddleware 30 | from pydantic import BaseModel - import uvicorn 31 | | E402 Module level import not at top of file --> scripts/safe_oi_api.py:27:1 | 25 | import safe_runner 26 | 27 | import httpx | ^^^^^^^^^^^^ 28 | from fastapi import FastAPI, HTTPException 29 | from fastapi.middleware.cors import CORSMiddleware | help: Move module level imports to top of file E402 Module level import not at top of file --> scripts/safe_oi_api.py:28:1 | 27 | import httpx 28 | from fastapi import FastAPI, HTTPException | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 29 | from fastapi.middleware.cors import CORSMiddleware 30 | from pydantic import BaseModel | help: Move module level imports to top of file E402 Module level import not at top of file --> scripts/safe_oi_api.py:29:1 | 27 | import httpx 28 | from fastapi import FastAPI, HTTPException 29 | from fastapi.middleware.cors import CORSMiddleware | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 30 | from pydantic import BaseModel 31 | import uvicorn | help: Move module level imports to top of file E402 Module level import not at top of file --> scripts/safe_oi_api.py:30:1 | 28 | from fastapi import FastAPI, HTTPException 29 | from fastapi.middleware.cors import CORSMiddleware 30 | from pydantic import BaseModel | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 31 | import uvicorn | help: Move module level imports to top of file E402 Module level import not at top of file --> scripts/safe_oi_api.py:31:1 | 29 | from fastapi.middleware.cors import CORSMiddleware 30 | from pydantic import BaseModel 31 | import uvicorn | ^^^^^^^^^^^^^^ 32 | 33 | PROJECT_ROOT = Path(__file__).resolve().parent.parent | help: Move module level imports to top of file E402 Module level import not at top of file --> scripts/safe_oi_api.py:37:1 | 35 | sys.path.insert(0, str(PROJECT_ROOT)) 36 | 37 | from auto_memory import remember_if_relevant | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 38 | from memory_core import remember, retrieve_active_context | help: Move module level imports to top of file E402 Module level import not at top of file --> scripts/safe_oi_api.py:38:1 | 37 | from auto_memory import remember_if_relevant 38 | from memory_core import remember, retrieve_active_context | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 39 | 40 | logging.basicConfig( | help: Move module level imports to top of file UP006 [*] Use `dict` instead of `Dict` for type annotation --> scripts/safe_oi_api.py:83:11 | 81 | ) 82 | 83 | sessions: Dict[str, dict] = {} | ^^^^ 84 | pending_approvals: Dict[str, dict] = {} 85 | executed_approvals: Dict[str, dict] = {} | help: Replace with `dict` | 82 | - sessions: Dict[str, dict] = {} 83 + sessions: dict[str, dict] = {} 84 | pending_approvals: Dict[str, dict] = {} | UP006 [*] Use `dict` instead of `Dict` for type annotation --> scripts/safe_oi_api.py:84:20 | 83 | sessions: Dict[str, dict] = {} 84 | pending_approvals: Dict[str, dict] = {} | ^^^^ 85 | executed_approvals: Dict[str, dict] = {} | help: Replace with `dict` | 83 | sessions: Dict[str, dict] = {} - pending_approvals: Dict[str, dict] = {} 84 + pending_approvals: dict[str, dict] = {} 85 | executed_approvals: Dict[str, dict] = {} | UP006 [*] Use `dict` instead of `Dict` for type annotation --> scripts/safe_oi_api.py:85:21 | 83 | sessions: Dict[str, dict] = {} 84 | pending_approvals: Dict[str, dict] = {} 85 | executed_approvals: Dict[str, dict] = {} | ^^^^ help: Replace with `dict` | 84 | pending_approvals: Dict[str, dict] = {} - executed_approvals: Dict[str, dict] = {} 85 + executed_approvals: dict[str, dict] = {} 86 | | UP045 [*] Use `X | None` for type annotations --> scripts/safe_oi_api.py:89:16 | 88 | class ChatRequest(BaseModel): 89 | thread_id: Optional[str] = None | ^^^^^^^^^^^^^ 90 | message: str 91 | model: str = DEFAULT_MODEL | help: Convert to `X | None` | 88 | class ChatRequest(BaseModel): - thread_id: Optional[str] = None 89 + thread_id: str | None = None 90 | message: str | UP045 [*] Use `X | None` for type annotations --> scripts/safe_oi_api.py:105:38 | 105 | def get_or_create_session(thread_id: Optional[str], model: str, mode: str) -> str: | ^^^^^^^^^^^^^ 106 | if not thread_id or thread_id not in sessions: 107 | thread_id = thread_id or str(uuid.uuid4()) | help: Convert to `X | None` | 104 | - def get_or_create_session(thread_id: Optional[str], model: str, mode: str) -> str: 105 + def get_or_create_session(thread_id: str | None, model: str, mode: str) -> str: 106 | if not thread_id or thread_id not in sessions: | UP045 [*] Use `X | None` for type annotations --> scripts/safe_oi_api.py:172:52 | 172 | def extract_code_from_response(text: str) -> tuple[Optional[str], Optional[str], list]: | ^^^^^^^^^^^^^ 173 | code_blocks = re.findall(r"```(\w+)?\n(.*?)```", text, re.DOTALL) 174 | if not code_blocks: | help: Convert to `X | None` | 171 | - def extract_code_from_response(text: str) -> tuple[Optional[str], Optional[str], list]: 172 + def extract_code_from_response(text: str) -> tuple[str | None, Optional[str], list]: 173 | code_blocks = re.findall(r"```(\w+)?\n(.*?)```", text, re.DOTALL) | UP045 [*] Use `X | None` for type annotations --> scripts/safe_oi_api.py:172:67 | 172 | def extract_code_from_response(text: str) -> tuple[Optional[str], Optional[str], list]: | ^^^^^^^^^^^^^ 173 | code_blocks = re.findall(r"```(\w+)?\n(.*?)```", text, re.DOTALL) 174 | if not code_blocks: | help: Convert to `X | None` | 171 | - def extract_code_from_response(text: str) -> tuple[Optional[str], Optional[str], list]: 172 + def extract_code_from_response(text: str) -> tuple[Optional[str], str | None, list]: 173 | code_blocks = re.findall(r"```(\w+)?\n(.*?)```", text, re.DOTALL) | UP006 [*] Use `list` instead of `List` for type annotation --> scripts/safe_oi_api.py:274:86 | 274 | def build_messages(session: dict, normalized_message: str, mode: str, depth: str) -> List[dict]: | ^^^^ 275 | messages: List[dict] = [{"role": "system", "content": mode_instruction(mode)}] | help: Replace with `list` | 273 | - def build_messages(session: dict, normalized_message: str, mode: str, depth: str) -> List[dict]: 274 + def build_messages(session: dict, normalized_message: str, mode: str, depth: str) -> list[dict]: 275 | messages: List[dict] = [{"role": "system", "content": mode_instruction(mode)}] | UP006 [*] Use `list` instead of `List` for type annotation --> scripts/safe_oi_api.py:275:15 | 274 | def build_messages(session: dict, normalized_message: str, mode: str, depth: str) -> List[dict]: 275 | messages: List[dict] = [{"role": "system", "content": mode_instruction(mode)}] | ^^^^ 276 | 277 | try: | help: Replace with `list` | 274 | def build_messages(session: dict, normalized_message: str, mode: str, depth: str) -> List[dict]: - messages: List[dict] = [{"role": "system", "content": mode_instruction(mode)}] 275 + messages: list[dict] = [{"role": "system", "content": mode_instruction(mode)}] 276 | | BLE001 Do not catch blind exception: `Exception` --> scripts/safe_oi_api.py:289:12 | 287 | ), 288 | }) 289 | except Exception as exc: | ^^^^^^^^^ 290 | logger.warning("Nelze načíst paměť: %s", exc) | UP006 [*] Use `list` instead of `List` for type annotation --> scripts/safe_oi_api.py:303:38 | 303 | def call_proxy(model: str, messages: List[dict]) -> str: | ^^^^ 304 | try: 305 | with httpx.Client(timeout=REQUEST_TIMEOUT) as client: | help: Replace with `list` | 302 | - def call_proxy(model: str, messages: List[dict]) -> str: 303 + def call_proxy(model: str, messages: list[dict]) -> str: 304 | try: | BLE001 Do not catch blind exception: `Exception` --> scripts/safe_oi_api.py:402:16 | 400 | source=f"{mode.lower()}-oi-auto", 401 | ) 402 | except Exception as exc: | ^^^^^^^^^ 403 | logger.warning("Automatické uložení paměti selhalo: %s", exc) | BLE001 Do not catch blind exception: `Exception` --> scripts/safe_oi_api.py:446:20 | 444 | }) 445 | 446 | except Exception as exc: | ^^^^^^^^^ 447 | reply += ( 448 | "\n\n---\n" | BLE001 Do not catch blind exception: `Exception` --> scripts/safe_oi_api.py:577:12 | 575 | result_text += f"STDERR:\n{run_result['stderr']}\n" 576 | 577 | except Exception as exc: | ^^^^^^^^^ 578 | final_status = "failed" 579 | result_text = f"Chyba při provádění: {type(exc).__name__}: {exc}" | RUF002 Docstring contains ambiguous `–` (EN DASH). Did you mean `-` (HYPHEN-MINUS)? --> scripts/safe_oi_api_litellm_phase1.py:3:36 | 1 | #!/usr/bin/env python3 2 | """ 3 | CyberBrain26 SAFE-OI / FULL-OI API – LiteLLM Phase 1. | ^ 4 | 5 | Běžná konverzace jde přímo přes LiteLLM, nikoli přes Open Interpreter. | I001 [*] Import block is un-sorted or un-formatted --> scripts/safe_oi_api_litellm_phase1.py:9:1 | 7 | """ 8 | 9 | / import os 10 | | import sys 11 | | import uuid 12 | | import logging 13 | | import re 14 | | from datetime import datetime 15 | | from pathlib import Path 16 | | from typing import Any, Dict, List, Optional 17 | | 18 | | import httpx 19 | | from fastapi import FastAPI, HTTPException 20 | | from fastapi.middleware.cors import CORSMiddleware 21 | | from pydantic import BaseModel 22 | | import uvicorn | |______________^ 23 | 24 | PROJECT_ROOT = Path(__file__).resolve().parent.parent | help: Organize imports | 8 | 9 + import logging 10 | import os 11 + import re 12 | import sys 13 | import uuid - import logging - import re 14 | from datetime import datetime -------------------------------------------------------------------------------- 18 | import httpx 19 + import uvicorn 20 | from fastapi import FastAPI, HTTPException 21 | from fastapi.middleware.cors import CORSMiddleware 22 | from pydantic import BaseModel - import uvicorn 23 | | UP035 `typing.Dict` is deprecated, use `dict` instead --> scripts/safe_oi_api_litellm_phase1.py:16:1 | 14 | from datetime import datetime 15 | from pathlib import Path 16 | from typing import Any, Dict, List, Optional | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 17 | 18 | import httpx | UP035 `typing.List` is deprecated, use `list` instead --> scripts/safe_oi_api_litellm_phase1.py:16:1 | 14 | from datetime import datetime 15 | from pathlib import Path 16 | from typing import Any, Dict, List, Optional | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 17 | 18 | import httpx | F401 [*] `typing.Any` imported but unused --> scripts/safe_oi_api_litellm_phase1.py:16:20 | 14 | from datetime import datetime 15 | from pathlib import Path 16 | from typing import Any, Dict, List, Optional | ^^^ 17 | 18 | import httpx | help: Remove unused import: `typing.Any` | 15 | from pathlib import Path - from typing import Any, Dict, List, Optional 16 + from typing import Dict, List, Optional 17 | | E402 Module level import not at top of file --> scripts/safe_oi_api_litellm_phase1.py:28:1 | 26 | sys.path.insert(0, str(PROJECT_ROOT)) 27 | 28 | from auto_memory import remember_if_relevant | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 29 | from memory_core import remember, retrieve_active_context | help: Move module level imports to top of file E402 Module level import not at top of file --> scripts/safe_oi_api_litellm_phase1.py:29:1 | 28 | from auto_memory import remember_if_relevant 29 | from memory_core import remember, retrieve_active_context | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 30 | 31 | logging.basicConfig( | help: Move module level imports to top of file UP006 [*] Use `dict` instead of `Dict` for type annotation --> scripts/safe_oi_api_litellm_phase1.py:74:11 | 72 | ) 73 | 74 | sessions: Dict[str, dict] = {} | ^^^^ 75 | pending_approvals: Dict[str, dict] = {} 76 | executed_approvals: Dict[str, dict] = {} | help: Replace with `dict` | 73 | - sessions: Dict[str, dict] = {} 74 + sessions: dict[str, dict] = {} 75 | pending_approvals: Dict[str, dict] = {} | UP006 [*] Use `dict` instead of `Dict` for type annotation --> scripts/safe_oi_api_litellm_phase1.py:75:20 | 74 | sessions: Dict[str, dict] = {} 75 | pending_approvals: Dict[str, dict] = {} | ^^^^ 76 | executed_approvals: Dict[str, dict] = {} | help: Replace with `dict` | 74 | sessions: Dict[str, dict] = {} - pending_approvals: Dict[str, dict] = {} 75 + pending_approvals: dict[str, dict] = {} 76 | executed_approvals: Dict[str, dict] = {} | UP006 [*] Use `dict` instead of `Dict` for type annotation --> scripts/safe_oi_api_litellm_phase1.py:76:21 | 74 | sessions: Dict[str, dict] = {} 75 | pending_approvals: Dict[str, dict] = {} 76 | executed_approvals: Dict[str, dict] = {} | ^^^^ help: Replace with `dict` | 75 | pending_approvals: Dict[str, dict] = {} - executed_approvals: Dict[str, dict] = {} 76 + executed_approvals: dict[str, dict] = {} 77 | | UP045 [*] Use `X | None` for type annotations --> scripts/safe_oi_api_litellm_phase1.py:80:16 | 79 | class ChatRequest(BaseModel): 80 | thread_id: Optional[str] = None | ^^^^^^^^^^^^^ 81 | message: str 82 | model: str = DEFAULT_MODEL | help: Convert to `X | None` | 79 | class ChatRequest(BaseModel): - thread_id: Optional[str] = None 80 + thread_id: str | None = None 81 | message: str | UP045 [*] Use `X | None` for type annotations --> scripts/safe_oi_api_litellm_phase1.py:96:38 | 96 | def get_or_create_session(thread_id: Optional[str], model: str, mode: str) -> str: | ^^^^^^^^^^^^^ 97 | if not thread_id or thread_id not in sessions: 98 | thread_id = thread_id or str(uuid.uuid4()) | help: Convert to `X | None` | 95 | - def get_or_create_session(thread_id: Optional[str], model: str, mode: str) -> str: 96 + def get_or_create_session(thread_id: str | None, model: str, mode: str) -> str: 97 | if not thread_id or thread_id not in sessions: | UP045 [*] Use `X | None` for type annotations --> scripts/safe_oi_api_litellm_phase1.py:138:52 | 138 | def extract_code_from_response(text: str) -> tuple[Optional[str], Optional[str], list]: | ^^^^^^^^^^^^^ 139 | code_blocks = re.findall(r"```(\w+)?\n(.*?)```", text, re.DOTALL) 140 | if not code_blocks: | help: Convert to `X | None` | 137 | - def extract_code_from_response(text: str) -> tuple[Optional[str], Optional[str], list]: 138 + def extract_code_from_response(text: str) -> tuple[str | None, Optional[str], list]: 139 | code_blocks = re.findall(r"```(\w+)?\n(.*?)```", text, re.DOTALL) | UP045 [*] Use `X | None` for type annotations --> scripts/safe_oi_api_litellm_phase1.py:138:67 | 138 | def extract_code_from_response(text: str) -> tuple[Optional[str], Optional[str], list]: | ^^^^^^^^^^^^^ 139 | code_blocks = re.findall(r"```(\w+)?\n(.*?)```", text, re.DOTALL) 140 | if not code_blocks: | help: Convert to `X | None` | 137 | - def extract_code_from_response(text: str) -> tuple[Optional[str], Optional[str], list]: 138 + def extract_code_from_response(text: str) -> tuple[Optional[str], str | None, list]: 139 | code_blocks = re.findall(r"```(\w+)?\n(.*?)```", text, re.DOTALL) | UP006 [*] Use `list` instead of `List` for type annotation --> scripts/safe_oi_api_litellm_phase1.py:163:86 | 163 | def build_messages(session: dict, normalized_message: str, mode: str, depth: str) -> List[dict]: | ^^^^ 164 | messages: List[dict] = [{"role": "system", "content": mode_instruction(mode)}] | help: Replace with `list` | 162 | - def build_messages(session: dict, normalized_message: str, mode: str, depth: str) -> List[dict]: 163 + def build_messages(session: dict, normalized_message: str, mode: str, depth: str) -> list[dict]: 164 | messages: List[dict] = [{"role": "system", "content": mode_instruction(mode)}] | UP006 [*] Use `list` instead of `List` for type annotation --> scripts/safe_oi_api_litellm_phase1.py:164:15 | 163 | def build_messages(session: dict, normalized_message: str, mode: str, depth: str) -> List[dict]: 164 | messages: List[dict] = [{"role": "system", "content": mode_instruction(mode)}] | ^^^^ 165 | 166 | try: | help: Replace with `list` | 163 | def build_messages(session: dict, normalized_message: str, mode: str, depth: str) -> List[dict]: - messages: List[dict] = [{"role": "system", "content": mode_instruction(mode)}] 164 + messages: list[dict] = [{"role": "system", "content": mode_instruction(mode)}] 165 | | BLE001 Do not catch blind exception: `Exception` --> scripts/safe_oi_api_litellm_phase1.py:178:12 | 176 | ), 177 | }) 178 | except Exception as exc: | ^^^^^^^^^ 179 | logger.warning("Nelze načíst paměť: %s", exc) | UP006 [*] Use `list` instead of `List` for type annotation --> scripts/safe_oi_api_litellm_phase1.py:192:38 | 192 | def call_proxy(model: str, messages: List[dict]) -> str: | ^^^^ 193 | try: 194 | with httpx.Client(timeout=REQUEST_TIMEOUT) as client: | help: Replace with `list` | 191 | - def call_proxy(model: str, messages: List[dict]) -> str: 192 + def call_proxy(model: str, messages: list[dict]) -> str: 193 | try: | BLE001 Do not catch blind exception: `Exception` --> scripts/safe_oi_api_litellm_phase1.py:291:16 | 289 | source=f"{mode.lower()}-oi-auto", 290 | ) 291 | except Exception as exc: | ^^^^^^^^^ 292 | logger.warning("Automatické uložení paměti selhalo: %s", exc) | I001 [*] Import block is un-sorted or un-formatted --> scripts/safe_oi_api_v02.py:10:1 | 8 | """ 9 | 10 | / import os 11 | | import sys 12 | | import uuid 13 | | import json 14 | | import logging 15 | | from typing import Dict, Optional 16 | | from pathlib import Path 17 | | 18 | | import httpx 19 | | from fastapi import FastAPI, HTTPException 20 | | from fastapi.responses import StreamingResponse 21 | | from fastapi.middleware.cors import CORSMiddleware 22 | | from pydantic import BaseModel 23 | | import uvicorn | |______________^ 24 | 25 | # --- Logging --- | help: Organize imports | 9 | 10 + import json 11 + import logging 12 | import os 13 | import sys 14 | import uuid - import json - import logging 15 + from pathlib import Path 16 | from typing import Dict, Optional - from pathlib import Path 17 | 18 | import httpx 19 + import uvicorn 20 | from fastapi import FastAPI, HTTPException - from fastapi.responses import StreamingResponse 21 | from fastapi.middleware.cors import CORSMiddleware 22 + from fastapi.responses import StreamingResponse 23 | from pydantic import BaseModel - import uvicorn 24 | | F401 [*] `sys` imported but unused --> scripts/safe_oi_api_v02.py:11:8 | 10 | import os 11 | import sys | ^^^ 12 | import uuid 13 | import json | help: Remove unused import: `sys` | 10 | import os - import sys 11 | import uuid | F401 [*] `json` imported but unused --> scripts/safe_oi_api_v02.py:13:8 | 11 | import sys 12 | import uuid 13 | import json | ^^^^ 14 | import logging 15 | from typing import Dict, Optional | help: Remove unused import: `json` | 12 | import uuid - import json 13 | import logging | UP035 `typing.Dict` is deprecated, use `dict` instead --> scripts/safe_oi_api_v02.py:15:1 | 13 | import json 14 | import logging 15 | from typing import Dict, Optional | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 16 | from pathlib import Path | F401 [*] `pathlib.Path` imported but unused --> scripts/safe_oi_api_v02.py:16:21 | 14 | import logging 15 | from typing import Dict, Optional 16 | from pathlib import Path | ^^^^ 17 | 18 | import httpx | help: Remove unused import: `pathlib.Path` | 15 | from typing import Dict, Optional - from pathlib import Path 16 | | F401 [*] `httpx` imported but unused --> scripts/safe_oi_api_v02.py:18:8 | 16 | from pathlib import Path 17 | 18 | import httpx | ^^^^^ 19 | from fastapi import FastAPI, HTTPException 20 | from fastapi.responses import StreamingResponse | help: Remove unused import: `httpx` | 17 | - import httpx 18 | from fastapi import FastAPI, HTTPException | F401 [*] `fastapi.responses.StreamingResponse` imported but unused --> scripts/safe_oi_api_v02.py:20:31 | 18 | import httpx 19 | from fastapi import FastAPI, HTTPException 20 | from fastapi.responses import StreamingResponse | ^^^^^^^^^^^^^^^^^ 21 | from fastapi.middleware.cors import CORSMiddleware 22 | from pydantic import BaseModel | help: Remove unused import: `fastapi.responses.StreamingResponse` | 19 | from fastapi import FastAPI, HTTPException - from fastapi.responses import StreamingResponse 20 | from fastapi.middleware.cors import CORSMiddleware | UP006 [*] Use `dict` instead of `Dict` for type annotation --> scripts/safe_oi_api_v02.py:54:11 | 53 | # Session storage 54 | sessions: Dict[str, dict] = {} | ^^^^ help: Replace with `dict` | 53 | # Session storage - sessions: Dict[str, dict] = {} 54 + sessions: dict[str, dict] = {} 55 | | UP045 [*] Use `X | None` for type annotations --> scripts/safe_oi_api_v02.py:58:16 | 57 | class ChatRequest(BaseModel): 58 | thread_id: Optional[str] = None | ^^^^^^^^^^^^^ 59 | message: str 60 | model: str = DEFAULT_MODEL | help: Convert to `X | None` | 57 | class ChatRequest(BaseModel): - thread_id: Optional[str] = None 58 + thread_id: str | None = None 59 | message: str | UP045 [*] Use `X | None` for type annotations --> scripts/safe_oi_api_v02.py:66:38 | 66 | def get_or_create_session(thread_id: Optional[str], model: str, mode: str) -> str: | ^^^^^^^^^^^^^ 67 | if not thread_id or thread_id not in sessions: 68 | thread_id = thread_id or str(uuid.uuid4()) | help: Convert to `X | None` | 65 | - def get_or_create_session(thread_id: Optional[str], model: str, mode: str) -> str: 66 + def get_or_create_session(thread_id: str | None, model: str, mode: str) -> str: 67 | if not thread_id or thread_id not in sessions: | BLE001 Do not catch blind exception: `Exception` --> scripts/safe_oi_api_v02.py:98:12 | 96 | logger.info(f"Interpreter vytvořen | model={model} | auto_run={auto_run}") 97 | return oi 98 | except Exception as e: | ^^^^^^^^^ 99 | logger.error(f"Nepodařilo se vytvořit interpreter: {e}") 100 | raise HTTPException(status_code=500, detail=f"Chyba při inicializaci Open Interpreter: {e}") | B904 Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling --> scripts/safe_oi_api_v02.py:100:9 | 98 | except Exception as e: 99 | logger.error(f"Nepodařilo se vytvořit interpreter: {e}") 100 | raise HTTPException(status_code=500, detail=f"Chyba při inicializaci Open Interpreter: {e}") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ B904 Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling --> scripts/safe_oi_api_v02.py:184:9 | 182 | except Exception as e: 183 | logger.exception(f"Chyba v /chat: {e}") 184 | raise HTTPException(status_code=500, detail=str(e)) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ S110 `try`-`except`-`pass` detected, consider logging the exception --> scripts/safe_oi_api_v02.py:210:9 | 208 | if interp: 209 | pass 210 | / except Exception: 211 | | pass | |________________^ 212 | del sessions[thread_id] 213 | logger.info(f"Session smazána: {thread_id}") | BLE001 Do not catch blind exception: `Exception` --> scripts/safe_oi_api_v02.py:210:16 | 208 | if interp: 209 | pass 210 | except Exception: | ^^^^^^^^^ 211 | pass 212 | del sessions[thread_id] | I001 [*] Import block is un-sorted or un-formatted --> scripts/safe_oi_runner.py:1:1 | 1 | / import os 2 | | import sys 3 | | import subprocess 4 | | import atexit 5 | | from prompt_toolkit import PromptSession 6 | | from prompt_toolkit.key_binding import KeyBindings | |__________________________________________________^ 7 | 8 | PROJECT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | help: Organize imports | 1 + import atexit 2 | import os - import sys 3 | import subprocess - import atexit 4 + import sys 5 + 6 | from prompt_toolkit import PromptSession | F401 [*] `atexit` imported but unused --> scripts/safe_oi_runner.py:4:8 | 2 | import sys 3 | import subprocess 4 | import atexit | ^^^^^^ 5 | from prompt_toolkit import PromptSession 6 | from prompt_toolkit.key_binding import KeyBindings | help: Remove unused import: `atexit` | 3 | import subprocess - import atexit 4 | from prompt_toolkit import PromptSession | E402 Module level import not at top of file --> scripts/safe_oi_runner.py:16:1 | 14 | sys.path.insert(0, TOOLS_DIR) 15 | 16 | from memory_core import save_memory, retrieve_active_context | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 17 | from interpreter import interpreter | help: Move module level imports to top of file I001 [*] Import block is un-sorted or un-formatted --> scripts/safe_oi_runner.py:16:1 | 14 | sys.path.insert(0, TOOLS_DIR) 15 | 16 | / from memory_core import save_memory, retrieve_active_context 17 | | from interpreter import interpreter | |___________________________________^ 18 | 19 | # Git tools | help: Organize imports | 15 | - from memory_core import save_memory, retrieve_active_context 16 | from interpreter import interpreter 17 + from memory_core import retrieve_active_context, save_memory 18 + 19 | | E402 Module level import not at top of file --> scripts/safe_oi_runner.py:17:1 | 16 | from memory_core import save_memory, retrieve_active_context 17 | from interpreter import interpreter | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 18 | 19 | # Git tools | help: Move module level imports to top of file S607 Starting a process with a partial executable path --> scripts/safe_oi_runner.py:22:33 | 20 | def git_status(): 21 | try: 22 | result = subprocess.run(["git", "status", "--short"], capture_output=True, text=True, cwd=PROJECT_DIR) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 23 | return result.stdout if result.returncode == 0 else f"Git error: {result.stderr}" 24 | except Exception as e: | BLE001 Do not catch blind exception: `Exception` --> scripts/safe_oi_runner.py:24:12 | 22 | result = subprocess.run(["git", "status", "--short"], capture_output=True, text=True, cwd=PROJECT_DIR) 23 | return result.stdout if result.returncode == 0 else f"Git error: {result.stderr}" 24 | except Exception as e: | ^^^^^^^^^ 25 | return f"Git status failed: {e}" | S607 Starting a process with a partial executable path --> scripts/safe_oi_runner.py:29:33 | 27 | def git_diff(): 28 | try: 29 | result = subprocess.run(["git", "diff"], capture_output=True, text=True, cwd=PROJECT_DIR) | ^^^^^^^^^^^^^^^ 30 | return result.stdout if result.returncode == 0 else f"Git error: {result.stderr}" 31 | except Exception as e: | BLE001 Do not catch blind exception: `Exception` --> scripts/safe_oi_runner.py:31:12 | 29 | result = subprocess.run(["git", "diff"], capture_output=True, text=True, cwd=PROJECT_DIR) 30 | return result.stdout if result.returncode == 0 else f"Git error: {result.stderr}" 31 | except Exception as e: | ^^^^^^^^^ 32 | return f"Git diff failed: {e}" | S607 Starting a process with a partial executable path --> scripts/safe_oi_runner.py:36:33 | 34 | def git_log(limit=5): 35 | try: 36 | result = subprocess.run(["git", "log", f"-{limit}", "--oneline"], capture_output=True, text=True, cwd=PROJECT_DIR) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 37 | return result.stdout if result.returncode == 0 else f"Git error: {result.stderr}" 38 | except Exception as e: | BLE001 Do not catch blind exception: `Exception` --> scripts/safe_oi_runner.py:38:12 | 36 | result = subprocess.run(["git", "log", f"-{limit}", "--oneline"], capture_output=True, text=True, cwd=PROJECT_DIR) 37 | return result.stdout if result.returncode == 0 else f"Git error: {result.stderr}" 38 | except Exception as e: | ^^^^^^^^^ 39 | return f"Git log failed: {e}" | BLE001 Do not catch blind exception: `Exception` --> scripts/safe_oi_runner.py:47:12 | 45 | files = os.listdir(full_path) 46 | return "\n".join(sorted(files)) 47 | except Exception as e: | ^^^^^^^^^ 48 | return f"List failed: {e}" | UP015 [*] Unnecessary mode argument --> scripts/safe_oi_runner.py:53:30 | 51 | try: 52 | full_path = os.path.join(PROJECT_DIR, path) 53 | with open(full_path, "r") as f: | ^^^ 54 | return f.read() 55 | except Exception as e: | help: Remove mode argument | 52 | full_path = os.path.join(PROJECT_DIR, path) - with open(full_path, "r") as f: 53 + with open(full_path) as f: 54 | return f.read() | BLE001 Do not catch blind exception: `Exception` --> scripts/safe_oi_runner.py:55:12 | 53 | with open(full_path, "r") as f: 54 | return f.read() 55 | except Exception as e: | ^^^^^^^^^ 56 | return f"Read failed: {e}" | BLE001 Do not catch blind exception: `Exception` --> scripts/safe_oi_runner.py:65:12 | 63 | return "Žádné výsledky v memory." 64 | return "\n\n".join([f"[{r.get('metadata', {}).get('kind', 'unknown')}] {r.get('content', '')}" for r in results]) 65 | except Exception as e: | ^^^^^^^^^ 66 | return f"Memory search failed: {e}" | BLE001 Do not catch blind exception: `Exception` --> scripts/safe_oi_runner.py:72:12 | 70 | save_memory(content, kind=kind, status="active") 71 | return f"💾 Uloženo ({kind})" 72 | except Exception as e: | ^^^^^^^^^ 73 | return f"Save failed: {e}" | BLE001 Do not catch blind exception: `Exception` --> scripts/safe_oi_runner.py:148:12 | 146 | print("\n\n👋 Ukončeno") 147 | break 148 | except Exception as e: | ^^^^^^^^^ 149 | print(f"\n❌ Chyba: {e}") 150 | import traceback | F401 [*] `hashlib` imported but unused --> src/cyberbrain26/execution_plane/execution_backends.py:14:8 | 13 | import asyncio 14 | import hashlib | ^^^^^^^ 15 | import json 16 | import logging | help: Remove unused import: `hashlib` | 13 | import asyncio - import hashlib 14 | import json | F401 [*] `json` imported but unused --> src/cyberbrain26/execution_plane/execution_backends.py:15:8 | 13 | import asyncio 14 | import hashlib 15 | import json | ^^^^ 16 | import logging 17 | import os | help: Remove unused import: `json` | 14 | import hashlib - import json 15 | import logging | F401 [*] `subprocess` imported but unused --> src/cyberbrain26/execution_plane/execution_backends.py:19:8 | 17 | import os 18 | import shutil 19 | import subprocess | ^^^^^^^^^^ 20 | import time 21 | from pathlib import Path | help: Remove unused import: `subprocess` | 18 | import shutil - import subprocess 19 | import time | F401 [*] `time` imported but unused --> src/cyberbrain26/execution_plane/execution_backends.py:20:8 | 18 | import shutil 19 | import subprocess 20 | import time | ^^^^ 21 | from pathlib import Path 22 | from typing import Any | help: Remove unused import: `time` | 19 | import subprocess - import time 20 | from pathlib import Path | RUF100 [*] Unused `noqa` directive (unused: `BLE001`) --> src/cyberbrain26/execution_plane/execution_backends.py:111:35 | 109 | "data": result_data, 110 | } 111 | except Exception as exc: # noqa: BLE001 - capture all browser errors | ^^^^^^^^^^^^^^ 112 | logger.exception("Browser automation failed for %s", url) 113 | return { | help: Remove unused `noqa` directive | 110 | } - except Exception as exc: # noqa: BLE001 - capture all browser errors 111 + except Exception as exc: 112 | logger.exception("Browser automation failed for %s", url) | RUF022 [*] `__all__` is not sorted --> src/cyberbrain26/execution_plane/execution_backends.py:501:11 | 501 | __all__ = [ | ___________^ 502 | | "BrowserAutomationProvider", 503 | | "GitToolingProvider", 504 | | "DockerPodmanProvider", 505 | | "MCPExecutionProvider", 506 | | "OpenInterpreterBridge", 507 | | ] | |_^ help: Apply an isort-style sorting to `__all__` | 502 | "BrowserAutomationProvider", 503 + "DockerPodmanProvider", 504 | "GitToolingProvider", - "DockerPodmanProvider", 505 | "MCPExecutionProvider", | F401 [*] `dataclasses.field` imported but unused --> src/cyberbrain26/knowledge_plane/batch_processor.py:27:36 | 25 | import random 26 | import time 27 | from dataclasses import dataclass, field | ^^^^^ 28 | from pathlib import Path 29 | from typing import Any, Callable | help: Remove unused import: `dataclasses.field` | 26 | import time - from dataclasses import dataclass, field 27 + from dataclasses import dataclass 28 | from pathlib import Path | UP035 [*] Import from `collections.abc` instead: `Callable` --> src/cyberbrain26/knowledge_plane/batch_processor.py:29:1 | 27 | from dataclasses import dataclass, field 28 | from pathlib import Path 29 | from typing import Any, Callable | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 30 | 31 | import httpx | help: Import from `collections.abc` | 28 | from pathlib import Path - from typing import Any, Callable 29 + from typing import Any 30 + from collections.abc import Callable 31 | | F401 [*] `typing.Callable` imported but unused --> src/cyberbrain26/knowledge_plane/batch_processor.py:29:25 | 27 | from dataclasses import dataclass, field 28 | from pathlib import Path 29 | from typing import Any, Callable | ^^^^^^^^ 30 | 31 | import httpx | help: Remove unused import: `typing.Callable` | 28 | from pathlib import Path - from typing import Any, Callable 29 + from typing import Any 30 | | S311 Standard pseudo-random generators are not suitable for cryptographic purposes --> src/cyberbrain26/knowledge_plane/batch_processor.py:130:16 | 128 | return min(retry_after, self.max_delay) 129 | capped = min(self.base_delay * (2**attempt), self.max_delay) 130 | return random.uniform(0.0, capped) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 131 | 132 | def should_retry(self, attempt: int, exc: BaseException) -> bool: | RUF002 Docstring contains ambiguous `’` (RIGHT SINGLE QUOTATION MARK). Did you mean ``` (GRAVE ACCENT)? --> src/cyberbrain26/knowledge_plane/batch_processor.py:190:21 | 188 | Postup: 189 | 1. Producer čte soubory a rozdělí na chunky → fronta 190 | 2. Consumery’embedu chunky (batch_size textů / volání) → vektorový store | ^ 191 | 3. Dead-letter queue pro položky po vyčerpání retry 192 | 4. Souhrn statistik | F841 Local variable `sha256` is assigned to but never used --> src/cyberbrain26/knowledge_plane/batch_processor.py:203:17 | 201 | content = path.read_bytes() 202 | text = content.decode("utf-8", errors="replace") 203 | sha256 = hashlib.sha256(content).hexdigest() | ^^^^^^ 204 | # Jednoduchý chunking: jeden chunk na soubor (pro počáteční verzi) 205 | items.append( | help: Remove assignment to unused variable `sha256` | 202 | text = content.decode("utf-8", errors="replace") - sha256 = hashlib.sha256(content).hexdigest() 203 + hashlib.sha256(content).hexdigest() 204 | # Jednoduchý chunking: jeden chunk na soubor (pro počáteční verzi) | note: This is an unsafe fix and may change runtime behavior RUF022 [*] `__all__` is not sorted --> src/cyberbrain26/knowledge_plane/batch_processor.py:398:11 | 398 | __all__ = [ | ___________^ 399 | | "BatchProcessor", 400 | | "BatchResult", 401 | | "BatchSummary", 402 | | "DeadLetterEntry", 403 | | "EmbeddingRetryPolicy", 404 | | "DEFAULT_MAX_CONCURRENT", 405 | | "DEFAULT_BATCH_SIZE", 406 | | ] | |_^ help: Apply an isort-style sorting to `__all__` | 398 | __all__ = [ 399 + "DEFAULT_BATCH_SIZE", 400 + "DEFAULT_MAX_CONCURRENT", 401 | "BatchProcessor", -------------------------------------------------------------------------------- 405 | "EmbeddingRetryPolicy", - "DEFAULT_MAX_CONCURRENT", - "DEFAULT_BATCH_SIZE", 406 | ] | F401 [*] `dataclasses.field` imported but unused --> src/cyberbrain26/knowledge_plane/caching.py:33:36 | 31 | import time 32 | from collections import OrderedDict 33 | from dataclasses import dataclass, field | ^^^^^ 34 | from pathlib import Path 35 | from typing import Any | help: Remove unused import: `dataclasses.field` | 32 | from collections import OrderedDict - from dataclasses import dataclass, field 33 + from dataclasses import dataclass 34 | from pathlib import Path | RUF059 Unpacked variable `last_hit_at` is never used --> src/cyberbrain26/knowledge_plane/caching.py:118:49 | 116 | if row is None: 117 | return None 118 | vector_json, stored_dim, hit_count, last_hit_at = row | ^^^^^^^^^^^ 119 | if stored_dim != vector_dim: 120 | # Rozdílná dimenze — cache miss (model se změnil) | help: Prefix it with an underscore or any other dummy variable pattern | 117 | return None - vector_json, stored_dim, hit_count, last_hit_at = row 118 + vector_json, stored_dim, hit_count, _last_hit_at = row 119 | if stored_dim != vector_dim: | note: This is an unsafe fix and may change runtime behavior S112 `try`-`except`-`continue` detected, consider logging the exception --> src/cyberbrain26/knowledge_plane/markdown_store.py:198:13 | 196 | if doc_meta and doc_meta.get("sha256") == h: 197 | return False # duplicate hash found 198 | / except Exception: # noqa: BLE001 199 | | continue | |________________________^ 200 | return True | F401 [*] `typing.Optional` imported but unused --> src/cyberbrain26/memory/core.py:18:25 | 16 | from datetime import UTC, datetime 17 | from pathlib import Path 18 | from typing import Any, Optional | ^^^^^^^^ 19 | 20 | try: | help: Remove unused import: `typing.Optional` | 17 | from pathlib import Path - from typing import Any, Optional 18 + from typing import Any 19 | | RUF022 [*] `__all__` is not sorted --> src/cyberbrain26/model_layer/__init__.py:38:11 | 36 | ) 37 | 38 | __all__ = [ | ___________^ 39 | | "DiscoveryCategory", 40 | | "LiteLLMClient", 41 | | "LiteLLMConfig", 42 | | "LlamaCppClient", 43 | | "LlamaCppConfig", 44 | | "ModelCapabilities", 45 | | "ModelDiscoveryConfig", 46 | | "ModelFreeStatus", 47 | | "ModelIntelligence", 48 | | "ModelRecord", 49 | | "ModelRegistry", 50 | | "ModelRouter", 51 | | "ModelRouterError", 52 | | "ModelStatus", 53 | | "ModelTrust", 54 | | "ModelType", 55 | | "OllamaClient", 56 | | "OllamaConfig", 57 | | "ProviderABC", 58 | | "ProviderFreeScore", 59 | | "ProviderRecord", 60 | | "ProviderRegistry", 61 | | "ProviderStatus", 62 | | "ProviderTrust", 63 | | "ProviderProtocol", 64 | | "RouteResult", 65 | | "RouteStrategy", 66 | | "RouterConfig", 67 | | ] | |_^ help: Apply an isort-style sorting to `__all__` | 58 | "ProviderFreeScore", 59 + "ProviderProtocol", 60 | "ProviderRecord", 61 | "ProviderRegistry", 62 | "ProviderStatus", 63 | "ProviderTrust", - "ProviderProtocol", 64 | "RouteResult", | I001 [*] Import block is un-sorted or un-formatted --> src/cyberbrain26/model_layer/litellm_client.py:3:1 | 1 | """LiteLLM integration — unified API for multiple LLM providers.""" 2 | 3 | / from __future__ import annotations 4 | | 5 | | import logging 6 | | from collections.abc import AsyncIterator, Iterator 7 | | from dataclasses import dataclass 8 | | from typing import Any 9 | | from cyberbrain26.model_layer.provider_interface import ProviderABC, ProviderProtocol | |_____________________________________________________________________________________^ 10 | 11 | logger = logging.getLogger(__name__) | help: Organize imports | 8 | from typing import Any 9 + 10 | from cyberbrain26.model_layer.provider_interface import ProviderABC, ProviderProtocol | F401 [*] `cyberbrain26.model_layer.provider_interface.ProviderProtocol` imported but unused --> src/cyberbrain26/model_layer/litellm_client.py:9:70 | 7 | from dataclasses import dataclass 8 | from typing import Any 9 | from cyberbrain26.model_layer.provider_interface import ProviderABC, ProviderProtocol | ^^^^^^^^^^^^^^^^ 10 | 11 | logger = logging.getLogger(__name__) | help: Remove unused import: `cyberbrain26.model_layer.provider_interface.ProviderProtocol` | 8 | from typing import Any - from cyberbrain26.model_layer.provider_interface import ProviderABC, ProviderProtocol 9 + from cyberbrain26.model_layer.provider_interface import ProviderABC 10 | | I001 [*] Import block is un-sorted or un-formatted --> src/cyberbrain26/model_layer/llama_cpp_client.py:3:1 | 1 | """llama.cpp integration — local inference via llama.cpp server or library.""" 2 | 3 | / from __future__ import annotations 4 | | 5 | | import logging 6 | | from collections.abc import AsyncIterator, Iterator 7 | | from dataclasses import dataclass 8 | | from typing import Any 9 | | 10 | | import httpx 11 | | from cyberbrain26.model_layer.provider_interface import ProviderABC, ProviderProtocol | |_____________________________________________________________________________________^ 12 | 13 | logger = logging.getLogger(__name__) | help: Organize imports | 10 | import httpx 11 + 12 | from cyberbrain26.model_layer.provider_interface import ProviderABC, ProviderProtocol | F401 [*] `cyberbrain26.model_layer.provider_interface.ProviderProtocol` imported but unused --> src/cyberbrain26/model_layer/llama_cpp_client.py:11:70 | 10 | import httpx 11 | from cyberbrain26.model_layer.provider_interface import ProviderABC, ProviderProtocol | ^^^^^^^^^^^^^^^^ 12 | 13 | logger = logging.getLogger(__name__) | help: Remove unused import: `cyberbrain26.model_layer.provider_interface.ProviderProtocol` | 10 | import httpx - from cyberbrain26.model_layer.provider_interface import ProviderABC, ProviderProtocol 11 + from cyberbrain26.model_layer.provider_interface import ProviderABC 12 | | I001 [*] Import block is un-sorted or un-formatted --> src/cyberbrain26/model_layer/ollama_client.py:3:1 | 1 | """Ollama integration — local model serving via Ollama API.""" 2 | 3 | / from __future__ import annotations 4 | | 5 | | import json 6 | | import logging 7 | | from collections.abc import AsyncIterator, Iterator 8 | | from dataclasses import dataclass 9 | | from typing import Any 10 | | 11 | | from cyberbrain26.model_layer.provider_interface import ProviderABC, ProviderProtocol 12 | | import httpx | |____________^ 13 | 14 | logger = logging.getLogger(__name__) | help: Organize imports | 10 | - from cyberbrain26.model_layer.provider_interface import ProviderABC, ProviderProtocol 11 | import httpx 12 | 13 + from cyberbrain26.model_layer.provider_interface import ProviderABC, ProviderProtocol 14 + 15 | logger = logging.getLogger(__name__) | F401 [*] `cyberbrain26.model_layer.provider_interface.ProviderProtocol` imported but unused --> src/cyberbrain26/model_layer/ollama_client.py:11:70 | 9 | from typing import Any 10 | 11 | from cyberbrain26.model_layer.provider_interface import ProviderABC, ProviderProtocol | ^^^^^^^^^^^^^^^^ 12 | import httpx | help: Remove unused import: `cyberbrain26.model_layer.provider_interface.ProviderProtocol` | 10 | - from cyberbrain26.model_layer.provider_interface import ProviderABC, ProviderProtocol 11 + from cyberbrain26.model_layer.provider_interface import ProviderABC 12 | import httpx | I001 [*] Import block is un-sorted or un-formatted --> src/cyberbrain26/orchestration/langgraph_orchestrator.py:8:1 | 6 | """ 7 | 8 | / from __future__ import annotations 9 | | 10 | | import asyncio 11 | | import logging 12 | | from typing import Any 13 | | 14 | | from langgraph.graph import StateGraph, END 15 | | from langgraph.graph.state import CompiledStateGraph 16 | | 17 | | from cyberbrain26.agents.orchestrator import BaseAgent, AgentResult 18 | | from cyberbrain26.control_plane import AsyncEventBus, MemoryTaskQueue 19 | | from cyberbrain26.security_plane.identity import AgentIdentity 20 | | from cyberbrain26.security_plane.permission import PermissionGateway | |____________________________________________________________________^ 21 | 22 | logger = logging.getLogger(__name__) | help: Organize imports | 13 | - from langgraph.graph import StateGraph, END 14 + from langgraph.graph import END, StateGraph 15 | from langgraph.graph.state import CompiledStateGraph 16 | - from cyberbrain26.agents.orchestrator import BaseAgent, AgentResult 17 + from cyberbrain26.agents.orchestrator import AgentResult, BaseAgent 18 | from cyberbrain26.control_plane import AsyncEventBus, MemoryTaskQueue | F401 [*] `asyncio` imported but unused --> src/cyberbrain26/orchestration/langgraph_orchestrator.py:10:8 | 8 | from __future__ import annotations 9 | 10 | import asyncio | ^^^^^^^ 11 | import logging 12 | from typing import Any | help: Remove unused import: `asyncio` | 9 | - import asyncio 10 | import logging | F401 [*] `cyberbrain26.agents.orchestrator.AgentResult` imported but unused --> src/cyberbrain26/orchestration/langgraph_orchestrator.py:17:57 | 15 | from langgraph.graph.state import CompiledStateGraph 16 | 17 | from cyberbrain26.agents.orchestrator import BaseAgent, AgentResult | ^^^^^^^^^^^ 18 | from cyberbrain26.control_plane import AsyncEventBus, MemoryTaskQueue 19 | from cyberbrain26.security_plane.identity import AgentIdentity | help: Remove unused import: `cyberbrain26.agents.orchestrator.AgentResult` | 16 | - from cyberbrain26.agents.orchestrator import BaseAgent, AgentResult 17 + from cyberbrain26.agents.orchestrator import BaseAgent 18 | from cyberbrain26.control_plane import AsyncEventBus, MemoryTaskQueue | F841 Local variable `task_id` is assigned to but never used --> src/cyberbrain26/orchestration/langgraph_orchestrator.py:78:13 | 76 | """Supervisor analyzes state and routes to appropriate worker.""" 77 | goal = state.get("goal", "") 78 | task_id = state.get("task_id", "") | ^^^^^^^ 79 | 80 | # Security check: verify supervisor may dispatch | help: Remove assignment to unused variable `task_id` | 77 | goal = state.get("goal", "") - task_id = state.get("task_id", "") 78 + state.get("task_id", "") 79 | | note: This is an unsafe fix and may change runtime behavior RUF022 [*] `__all__` is not sorted --> src/cyberbrain26/orchestration/langgraph_orchestrator.py:184:11 | 184 | __all__ = ["LangGraphOrchestrator", "AgentState"] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: Apply an isort-style sorting to `__all__` | 183 | - __all__ = ["LangGraphOrchestrator", "AgentState"] 184 + __all__ = ["AgentState", "LangGraphOrchestrator"] | F821 Undefined name `Any` --> src/cyberbrain26/services/safe_oi/app.py:428:27 | 427 | @app.get("/health") 428 | def health() -> dict[str, Any]: | ^^^ 429 | return { 430 | "status": "ok", | F821 Undefined name `Any` --> src/cyberbrain26/services/safe_oi/app.py:479:56 | 479 | def _dispatch_tool(name: str, args: dict) -> dict[str, Any]: | ^^^ 480 | try: 481 | if name == "web_search": | I001 [*] Import block is un-sorted or un-formatted --> tests/test_independent_memory.py:13:1 | 11 | """ 12 | 13 | / from __future__ import annotations 14 | | 15 | | import hashlib 16 | | from pathlib import Path 17 | | 18 | | import pytest 19 | | 20 | | from cyberbrain26.data_plane.sqlite_store import SQLiteDatabase 21 | | from cyberbrain26.knowledge_plane import ( 22 | | DeduplicationEngine, 23 | | DocumentRegistration, 24 | | DocumentStatus, 25 | | DocumentTrust, 26 | | EmbeddingConfig, 27 | | KnowledgeDocument, 28 | | KnowledgeNavigator, 29 | | KnowledgeSource, 30 | | Sensitivity, 31 | | SQLiteKnowledgeRepository, 32 | | TextChunker, 33 | | ) | |_^ help: Organize imports | 34 | - 35 | # --------------------------------------------------------------------------- | I001 [*] Import block is un-sorted or un-formatted --> tests/test_knowledge_benchmark.py:24:1 | 22 | """ 23 | 24 | / from __future__ import annotations 25 | | 26 | | import time 27 | | from typing import Any 28 | | 29 | | import pytest 30 | | 31 | | from cyberbrain26.knowledge_plane.batch_processor import ( 32 | | BatchProcessor, 33 | | EmbeddingRetryPolicy, 34 | | ) 35 | | from cyberbrain26.knowledge_plane.caching import ( 36 | | DocumentFingerprint, 37 | | EmbeddingCache, 38 | | SearchResultCache, 39 | | ) 40 | | from cyberbrain26.knowledge_plane.contracts import KnowledgeDocument 41 | | from cyberbrain26.knowledge_plane.embedding_config import EmbeddingConfig 42 | | from cyberbrain26.knowledge_plane.embedding_service import EmbeddingService 43 | | from cyberbrain26.knowledge_plane.navigation import KnowledgeNavigator 44 | | from cyberbrain26.knowledge_plane.vector_store import KnowledgeVectorStore | |__________________________________________________________________________^ help: Organize imports | 45 | - 46 | # --------------------------------------------------------------------------- | F401 [*] `cyberbrain26.knowledge_plane.batch_processor.BatchProcessor` imported but unused --> tests/test_knowledge_benchmark.py:32:5 | 31 | from cyberbrain26.knowledge_plane.batch_processor import ( 32 | BatchProcessor, | ^^^^^^^^^^^^^^ 33 | EmbeddingRetryPolicy, 34 | ) | help: Remove unused import | 30 | - from cyberbrain26.knowledge_plane.batch_processor import ( - BatchProcessor, - EmbeddingRetryPolicy, - ) 31 | from cyberbrain26.knowledge_plane.caching import ( | F401 [*] `cyberbrain26.knowledge_plane.batch_processor.EmbeddingRetryPolicy` imported but unused --> tests/test_knowledge_benchmark.py:33:5 | 31 | from cyberbrain26.knowledge_plane.batch_processor import ( 32 | BatchProcessor, 33 | EmbeddingRetryPolicy, | ^^^^^^^^^^^^^^^^^^^^ 34 | ) 35 | from cyberbrain26.knowledge_plane.caching import ( | help: Remove unused import | 30 | - from cyberbrain26.knowledge_plane.batch_processor import ( - BatchProcessor, - EmbeddingRetryPolicy, - ) 31 | from cyberbrain26.knowledge_plane.caching import ( | RUF002 Docstring contains ambiguous `×` (MULTIPLICATION SIGN). Did you mean `x` (LATIN SMALL LETTER X)? --> tests/test_knowledge_benchmark.py:90:15 | 89 | Research: batch size 32 je sweet spot (ishwarj.com). Single embedding 90 | je ~32× slower than batch for same tokens. | ^ 91 | """ 92 | texts = [f"Benchmark document {i}" for i in range(32)] | F841 Local variable `neighbors` is assigned to but never used --> tests/test_knowledge_benchmark.py:266:9 | 265 | start = time.monotonic() 266 | neighbors = navigator.get_entity_neighbors("entity-25") | ^^^^^^^^^ 267 | elapsed_ms = (time.monotonic() - start) * 1000.0 268 | # Traversal should be < 10ms for small graphs | help: Remove assignment to unused variable `neighbors` | 265 | start = time.monotonic() - neighbors = navigator.get_entity_neighbors("entity-25") 266 + navigator.get_entity_neighbors("entity-25") 267 | elapsed_ms = (time.monotonic() - start) * 1000.0 | note: This is an unsafe fix and may change runtime behavior I001 [*] Import block is un-sorted or un-formatted --> tests/test_knowledge_graph_search.py:7:1 | 5 | """ 6 | 7 | / import os 8 | | from pathlib import Path 9 | | import time 10 | | 11 | | import pytest 12 | | 13 | | from cyberbrain26.data_plane.sqlite_store import SQLiteDatabase 14 | | from cyberbrain26.knowledge_plane.contracts import ( 15 | | KnowledgeDocument, 16 | | DocumentStatus, 17 | | ) 18 | | from cyberbrain26.knowledge_plane.memory_service import MemoryService 19 | | from cyberbrain26.knowledge_plane.navigation import KnowledgeNavigator | |______________________________________________________________________^ help: Organize imports | 7 | import os 8 + import time 9 | from pathlib import Path - import time 10 | -------------------------------------------------------------------------------- 14 | from cyberbrain26.knowledge_plane.contracts import ( 15 + DocumentStatus, 16 | KnowledgeDocument, - DocumentStatus, 17 | ) | RUF059 Unpacked variable `doc1` is never used --> tests/test_knowledge_graph_search.py:44:5 | 42 | def test_memory_service_graph_search_basic(ms: MemoryService): 43 | """Test that MemoryService.graph_search finds documents via entity traversal.""" 44 | doc1, _ = ms.register_text( | ^^^^ 45 | content=b"Apple develops iPhone technology", 46 | source_uri="memory://doc1", | help: Prefix it with an underscore or any other dummy variable pattern | 43 | """Test that MemoryService.graph_search finds documents via entity traversal.""" - doc1, _ = ms.register_text( 44 + _doc1, _ = ms.register_text( 45 | content=b"Apple develops iPhone technology", | note: This is an unsafe fix and may change runtime behavior RUF059 Unpacked variable `doc2` is never used --> tests/test_knowledge_graph_search.py:53:5 | 51 | ) 52 | 53 | doc2, _ = ms.register_text( | ^^^^ 54 | content=b"Microsoft releases Windows OS", 55 | source_uri="memory://doc2", | help: Prefix it with an underscore or any other dummy variable pattern | 52 | - doc2, _ = ms.register_text( 53 + _doc2, _ = ms.register_text( 54 | content=b"Microsoft releases Windows OS", | note: This is an unsafe fix and may change runtime behavior RUF059 Unpacked variable `doc3` is never used --> tests/test_knowledge_graph_search.py:62:5 | 60 | ) 61 | 62 | doc3, _ = ms.register_text( | ^^^^ 63 | content=b"Google search engine AI", 64 | source_uri="memory://doc3", | help: Prefix it with an underscore or any other dummy variable pattern | 61 | - doc3, _ = ms.register_text( 62 + _doc3, _ = ms.register_text( 63 | content=b"Google search engine AI", | note: This is an unsafe fix and may change runtime behavior RUF059 Unpacked variable `doc1` is never used --> tests/test_knowledge_graph_search.py:87:5 | 85 | def test_memory_service_graph_search_depth_control(ms: MemoryService): 86 | """Test that graph_search depth parameter controls traversal breadth.""" 87 | doc1, _ = ms.register_text( | ^^^^ 88 | content=b"Apple Microsoft partnership AI research", 89 | source_uri="memory://doc1", | help: Prefix it with an underscore or any other dummy variable pattern | 86 | """Test that graph_search depth parameter controls traversal breadth.""" - doc1, _ = ms.register_text( 87 + _doc1, _ = ms.register_text( 88 | content=b"Apple Microsoft partnership AI research", | note: This is an unsafe fix and may change runtime behavior RUF059 Unpacked variable `doc1` is never used --> tests/test_knowledge_graph_search.py:178:5 | 176 | def test_memory_service_graph_search_with_relationship_type(ms: MemoryService): 177 | """Test graph_search with optional relationship_type filter.""" 178 | doc1, _ = ms.register_text( | ^^^^ 179 | content=b"Apple and Microsoft partnership 2024", 180 | source_uri="memory://doc1", | help: Prefix it with an underscore or any other dummy variable pattern | 177 | """Test graph_search with optional relationship_type filter.""" - doc1, _ = ms.register_text( 178 + _doc1, _ = ms.register_text( 179 | content=b"Apple and Microsoft partnership 2024", | note: This is an unsafe fix and may change runtime behavior F401 [*] `unittest.mock.patch` imported but unused --> tests/test_knowledge_hybrid_search.py:8:44 | 6 | """ 7 | 8 | from unittest.mock import MagicMock, Mock, patch | ^^^^^ 9 | 10 | import pytest | help: Remove unused import: `unittest.mock.patch` | 7 | - from unittest.mock import MagicMock, Mock, patch 8 + from unittest.mock import MagicMock, Mock 9 | | F841 Local variable `results` is assigned to but never used --> tests/test_knowledge_hybrid_search.py:213:5 | 212 | # With topic filter, semantic search should receive it 213 | results = service.hybrid_search("test", topic="ai", limit=10) | ^^^^^^^ 214 | 215 | # Both mock methods should have been called | help: Remove assignment to unused variable `results` | 212 | # With topic filter, semantic search should receive it - results = service.hybrid_search("test", topic="ai", limit=10) 213 + service.hybrid_search("test", topic="ai", limit=10) 214 | | note: This is an unsafe fix and may change runtime behavior I001 [*] Import block is un-sorted or un-formatted --> tests/test_knowledge_temporal.py:7:1 | 5 | """ 6 | 7 | / import time 8 | | from unittest.mock import MagicMock 9 | | 10 | | import pytest 11 | | 12 | | from cyberbrain26.data_plane.sqlite_store import SQLiteDatabase 13 | | from cyberbrain26.knowledge_plane.contracts import KnowledgeDocument, DocumentStatus 14 | | from cyberbrain26.knowledge_plane.memory_service import MemoryService 15 | | from cyberbrain26.knowledge_plane.navigation import KnowledgeNavigator | |______________________________________________________________________^ help: Organize imports | 12 | from cyberbrain26.data_plane.sqlite_store import SQLiteDatabase - from cyberbrain26.knowledge_plane.contracts import KnowledgeDocument, DocumentStatus 13 + from cyberbrain26.knowledge_plane.contracts import DocumentStatus, KnowledgeDocument 14 | from cyberbrain26.knowledge_plane.memory_service import MemoryService | F401 [*] `unittest.mock.MagicMock` imported but unused --> tests/test_knowledge_temporal.py:8:27 | 7 | import time 8 | from unittest.mock import MagicMock | ^^^^^^^^^ 9 | 10 | import pytest | help: Remove unused import: `unittest.mock.MagicMock` | 7 | import time - from unittest.mock import MagicMock 8 | | F401 [*] `cyberbrain26.data_plane.sqlite_store.SQLiteDatabase` imported but unused --> tests/test_knowledge_temporal.py:12:50 | 10 | import pytest 11 | 12 | from cyberbrain26.data_plane.sqlite_store import SQLiteDatabase | ^^^^^^^^^^^^^^ 13 | from cyberbrain26.knowledge_plane.contracts import KnowledgeDocument, DocumentStatus 14 | from cyberbrain26.knowledge_plane.memory_service import MemoryService | help: Remove unused import: `cyberbrain26.data_plane.sqlite_store.SQLiteDatabase` | 11 | - from cyberbrain26.data_plane.sqlite_store import SQLiteDatabase 12 | from cyberbrain26.knowledge_plane.contracts import KnowledgeDocument, DocumentStatus | F811 [*] Redefinition of unused `MagicMock` from line 8 --> tests/test_knowledge_temporal.py:148:31 | 146 | def test_memory_service_temporal_filter_direct(): 147 | """Test that MemoryService temporal filtering works via navigator.""" 148 | from unittest.mock import MagicMock | ^^^^^^^^^ `MagicMock` redefined here 149 | 150 | from cyberbrain26.data_plane.sqlite_store import SQLiteDatabase | ::: tests/test_knowledge_temporal.py:8:27 | 7 | import time 8 | from unittest.mock import MagicMock | --------- previous definition of `MagicMock` here 9 | 10 | import pytest | help: Remove definition: `MagicMock` | 147 | """Test that MemoryService temporal filtering works via navigator.""" - from unittest.mock import MagicMock 148 | | F811 [*] Redefinition of unused `SQLiteDatabase` from line 12 --> tests/test_knowledge_temporal.py:150:54 | 148 | from unittest.mock import MagicMock 149 | 150 | from cyberbrain26.data_plane.sqlite_store import SQLiteDatabase | ^^^^^^^^^^^^^^ `SQLiteDatabase` redefined here 151 | 152 | mock_db = MagicMock(spec=SQLiteDatabase) | ::: tests/test_knowledge_temporal.py:12:50 | 10 | import pytest 11 | 12 | from cyberbrain26.data_plane.sqlite_store import SQLiteDatabase | -------------- previous definition of `SQLiteDatabase` here 13 | from cyberbrain26.knowledge_plane.contracts import KnowledgeDocument, DocumentStatus 14 | from cyberbrain26.knowledge_plane.memory_service import MemoryService | help: Remove definition: `SQLiteDatabase` | 149 | - from cyberbrain26.data_plane.sqlite_store import SQLiteDatabase 150 | | Found 257 errors. [*] 108 fixable with `--fix` (19 unsafe fixes available with `--fix --unsafe-fixes`).