fix(lint): resolve PLC0415 violations blocking kilo-gsd (refs #97) #98
No reviewers
Labels
No labels
agentic-osint
audit
blocked:commit-ready-failed
blocked:gate-fetch
blocked:gate-fetch
blocked:gate-lint
blocked:gate-plan
blocked:gate-research
blocked:needs-decision
blocked:needs-human
blocked:no-changes
blocked:preflight
blocked:verify-failed
bug
chore
deferred
enhancement
feature-request
in-progress
lint-baseline
lint-cleanup
needs-decompose
needs-triage
performance
quickfix
security/medium
triage-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/osint-hub!98
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/lint-plc0415"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Resolve all ruff lint errors so
ruff check .exits 0 againstMark/osint-hub, unblocking kilo-gsd's preflight gate (refs #97). kilo-gsd's preflight truncates ruff output to 1500 chars, so #97 only listed 5 violations — the repo actually had 219 ruff errors across 50 files. This PR clears all of them.Changes
Pure import relocations plus a small set of non-PLC lint fixes. No behavior changes.
PLC0415 (import at top-level) — hoisted to top: safe stdlib/local imports across modules, routers, services, and tasks (json, re, logging, io, base64, hashlib, ipaddress, subprocess, tempfile, Path, shutil, Decimal, SequenceMatcher, sqlmodel/sqlalchemy sessions,
from ..settings import settings,from ..models/..db/..taskswhere circular-safe).PLC0415 — kept lazy with justified
# noqacomments (hoisting would change behavior):entity_dispatcher.py(orchestrator_enhanced),scheduler.py(queue_manager),tasks.py(queue_manager).queue_manager.pykeepsfrom app.db import enginelazy becausetest_process_queue_batchpatchesapp.db.engine; hoisting would bind the real engine at import time and break the test.gather.py.registry.py: file-level# ruff: noqa: PLC0415with a docstring note —register_all_modules()deliberately imports each optional module in a guarded try/except so a missing optional dep skips that module instead of crashing registration.Non-PLC fixes:
services/execution.py+entity_module_map.py:str, Enum→StrEnum(UP042).retry_handler.py+llm/parsing.py: PEP 695 type-parameter syntax (UP047).test_module_benchmarks.py: justified# noqa: PT028(default arg substitutes for parametrize).alembic.op/sqlalchemyimports,typing.Sequence/Union→collections.abc.Sequence+X | Yannotations (UP035/UP007/I001/F401). Revision ids unchanged.llm/tools/evidence_extraction.py: fixed a latent broken relative import (from ...models→from ....models; the original lazy import resolved to nonexistentapp.services.modelsand would have failed at call time).Changed files
backend/alembic/versions/a25b7f06b9f1_merge_organization_fields_and_priority_.pybackend/app/change_detector.pybackend/app/main.pybackend/app/modules/abuseipdb.pybackend/app/modules/dark_web_monitor.pybackend/app/modules/dashboard_summary.pybackend/app/modules/employee_scraper.pybackend/app/modules/entity_linker.pybackend/app/modules/exif_extractor.pybackend/app/modules/google_dorks.pybackend/app/modules/local_deep_research.pybackend/app/modules/ocr_extractor.pybackend/app/modules/osint_playbook.pybackend/app/modules/pdf_analyzer.pybackend/app/modules/pdf_report.pybackend/app/modules/registry.pybackend/app/modules/reverse_image_search.pybackend/app/modules/search_aggregator.pybackend/app/modules/shodan.pybackend/app/modules/video_frame_extractor.pybackend/app/modules/video_metadata.pybackend/app/modules/virustotal.pybackend/app/monitoring.pybackend/app/routers/enrichment.pybackend/app/routers/evidence.pybackend/app/routers/gather.pybackend/app/routers/investigations.pybackend/app/routers/reports.pybackend/app/services/browser_tools.pybackend/app/services/enrichment_pipeline/runner.pybackend/app/services/execution.pybackend/app/services/investigations/async_executor.pybackend/app/services/investigations/entity_dispatcher.pybackend/app/services/investigations/entity_module_map.pybackend/app/services/investigations/evidence_dispatcher.pybackend/app/services/investigations/llm_entity_extraction.pybackend/app/services/investigations/orchestrator.pybackend/app/services/investigations/orchestrator_enhanced.pybackend/app/services/investigations/orchestrator_v3_llm.pybackend/app/services/investigations/queue_manager.pybackend/app/services/investigations/retry_handler.pybackend/app/services/investigations/runbooks.pybackend/app/services/investigations/scheduler.pybackend/app/services/llm/parsing.pybackend/app/services/llm/tools/evidence_extraction.pybackend/app/services/semantic_retrieval.pybackend/app/tasks.pybackend/scripts/scraper_poc.pybackend/test_entity_investigation.pybackend/tests/unit/test_module_benchmarks.pyVerification
ruff check .→ exit 0, All checks passed!ruff check backend/→ exit 0, All checks passed!ruff check backend/app/→ exit 0, All checks passed! (CI lint scope)pytest tests/unit→ 945 passed, 1 skippedapp.main,app.tasks,app.monitoring, all routers, and all 35 touched modules import cleanly — no circular imports introduced.Pull request closed