Extract `_build_sarif` into a dedicated `SarifAdapter` (or extend `ReportAdapter`) implementing a `ReportPort.render(report, format, path)` contract. Move `_read_key_source_files`/`_prioritize_source_files` into a `SourceFileSelector` adapter or a use-case helper. Keep main.py focused on construction.
Encapsulate the injected dependencies in a `CliContext` dataclass stored on the Typer app's `obj` (via `ctx.obj`), or build the Typer app inside a factory function `build_cli(analyzer_factory, cache_provider) -> Typer` so dependencies flow in via closure rather than module globals.
Generalize `BaseAgent` to be parametric in output type (e.g., `BaseAgent[T]` with abstract `parse_result(parsed) -> T`) or split into two ABCs: `FindingProducingAgent` for specialists and `StructuredOutputAgent` for MetaPrompter/CritiqueAgent. This avoids the double-parse and the empty-tuple workaround.
Move INGEST and REPORT stages into `analyze_repository` (or a top-level `run_pipeline` use case) so main.py only constructs ports and calls a single use-case entry point. The use case should accept a `ReportPort` and call it for rendering, keeping format-branching out of the composition root.
Either store the parsed critique result on the instance during validate_output (so get_critique_result returns it without re-parsing), or extend AgentOutput with an optional critique_payload field so the contract is honored without dual entry points.
CritiqueAgent validated findings using extended thinking. 5 of 38 findings were individually confirmed.
Patterns identified by CritiqueAgent that span multiple dimensions
AI-assisted screening based on finding text. Not a substitute for professional penetration testing.
AI-estimated composite score. Consult qualified advisors for investment decisions.
Keyword-based mapping to AICPA Common Criteria (CC1–CC9). Not a formal SOC 2 audit.
Keyword-based mapping to PCI DSS 4.0 Requirement 6 (Secure Systems & Software). Not a formal PCI assessment.
Keyword-based mapping to NIST Cybersecurity Framework 2.0 (6 Functions). Not a formal NIST assessment.
Measures finding distribution across files. For contributor-based bus factor analysis, use git blame tools.
Based on $175/hr senior engineer rate and ~6 hours for equivalent manual review. Actual costs vary.