5 Commits
Author SHA1 Message Date
dextmorgn 441de48264 fix(mypy): finish the ratchet backlog — permissions, dockertool, alembic
Last batch of real fixes plus one more scoped override:

- DockerTool.get_image() read cls.image as a class attribute, but
  __init__ only ever sets it on the instance (self.image = ...) — real
  bug (would AttributeError if get_image() were ever called before an
  instance existed with a subclass not also declaring image at class
  level). Declared `image: str` on the base to document what's
  actually relied on: subclasses set it as a class attribute, __init__
  shadows it per-instance with the tagged form.
- ReconCrawlTool.version() was declared -> str but its body was a bare
  `pass` (returns None) — no callers exist, so raises NotImplementedError
  with a comment instead of guessing a fake version string.
- ReconCrawlTool.launch()'s args param defaulted to None but the body
  calls args.get(...) unconditionally — real crash risk if ever called
  without args (never observed since the one caller always passes a
  dict), guarded with `args = args or {}`.
- Extended flowsint-core's tests.* override (assignment, override) for
  the same InputType/OutputType-pattern reason as the existing entries:
  MockEnricher/ResolveEnricher fixtures reassign InputType/OutputType
  and vary scan()/postprocess() signatures per the documented pattern,
  same as production enrichers.
- permissions.py, alembic/env.py, and one alembic migration's untyped
  params/standard-boilerplate arg-type gaps.

Ratchet is now clean except the accepted import-untyped debt (86
errors — cross-package imports needing py.typed markers project-wide,
deliberately out of scope: adding them earlier in this branch
ballooned the count from 478 to 1423 by unmasking the full ~2200
pre-existing backlog instead of shrinking it).

Verified: all 4 packages' test suites pass (397 + 32 + 6 + 54).
2026-08-25 09:33:36 +02:00
dextmorgn cf69a7e088 fix(ci): make isort's first-party grouping invocation-independent
Without known_first_party, isort's own-package detection depends on
which files it's given: sorted alone, a file inside flowsint_enrichers
gets flowsint_enrichers imports grouped separately from flowsint_core/
flowsint_types; sorted together with the rest of the workspace (as
`make lint` and CI do), they collapse into one group. lint-staged only
ever passes the staged subset, so a commit could pass the pre-commit
hook locally and still fail `make lint` in CI — silently, since both
are "isort says it's fine," just about different file sets.

Pin the four packages as known_first_party in all four pyproject.toml
so grouping is the same regardless of invocation scope. The rest of
the diff is isort re-normalizing ~100 files to the now-consistent
order — import statements only, verified against the diff.
2026-08-25 09:33:33 +02:00
dextmorgn 24e1e276c8 fix(python): correctness fixes surfaced by turning flake8 on
Each is a real defect, not style — flake8 just never ran before to
catch them:

- logger.py: bare `except:` around a queue drain swallowed everything
  including KeyboardInterrupt/SystemExit instead of just queue.Empty
- dockertool.py: bare `except:` narrowed to Exception
- permissions.py: duplicate `HTTPException` import, dead code
- test_registry.py: `test_get_by_lower_key` was defined twice — the
  second definition silently shadowed the first, so only one ever ran
- to_ports.py / test_investigation_repository.py: assigned-but-unused
  local variables, dead code
- to_whois.py / to_infos.py: documented pyflakes false positive
  (OutputType is a class attr, resolves fine at def-time) — noqa'd
  with an explanation instead of restructuring working code
- E712 (`== True`/`== False` → `is True`/`is False`) across 7 test
  files, F541 (f-strings with no placeholders) across 5 enrichers,
  E402 (import order) noqa'd in 2 files where the order is deliberate
  (env vars set before import; documented circular-import workaround)
2026-08-25 09:33:33 +02:00
dextmorgn 5977832a1a feat(api): refactor to use nodeLabel, and proper usage of graphService 2026-01-21 17:19:24 +01:00
dextmorgn 295d9ade8a feat: permission 2025-09-18 13:47:14 +02:00