mirror of
https://github.com/reconurge/flowsint.git
synced 2026-11-08 14:35:41 -06:00
Enrichers declare InputType/OutputType as plain class attributes (NotImplemented on the base, overridden per subclass) and use them in annotations like List[InputType] and self.data.domain — the documented, intentional API (see flowsint-enricher-builder skill), not something to individually silence. mypy structurally can't verify a class attribute doubling as a type alias without making Enricher generic, which would mean touching every enricher's class declaration. Narrows the specific checks that pattern trips (valid-type, attr-defined, name-defined) via per-module overrides in flowsint-enrichers and flowsint-core's tests (MockEnricher fixtures use the same pattern). Separately, fixes real gaps in orchestrator.py surfaced once the noise cleared: several dict literals (step_result, log_entry, results, results_mapping, branch_results) were inferred as narrower types than what the code actually assigns into them; execution_log_file and the enrichers map were missing their real (Optional) types; _create_execution_log used self.execution_log_file across an assignment mypy couldn't narrow, fixed via a local variable. update_results_mapping's outputs param is typed to match what it can actually receive (dict or list, per the isinstance check upstream) with a comment on the pre-existing dict-only assumption in its body — not silently "fixed" since that would change behavior for list-shaped enricher outputs, unverified here. scan()'s Liskov-incompatible override (sync, single-dict vs the base's async/ list-of-dicts contract) is documented and suppressed, not changed — that's a behavioral call about how FlowOrchestrator is actually invoked. graph_edge_to_neo4j_dict/serializer.py's from_obj/to_obj were typed as generic BaseModel while the body only ever handles FlowsintType or GraphNode — narrowed to that Union. And prepare_enricher_inputs, which has no callers anywhere, is typed Any rather than guessing at intended behavior for dead code whose two return branches already disagree. Verified: flowsint-core's 397 tests pass unchanged.
flowsint-api
Installation
- Install Python dependencies:
uv sync
Run
# dev
uv run uvicorn app.main:app --host 0.0.0.0 --port 5001 --reload
# prod
uv run uvicorn app.main:app --host 0.0.0.0 --port 5001