feat: mvp-foundation architecture, ai providers, and secrets engine#1
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (20)
📝 WalkthroughWalkthroughThe pull request transitions the scanner from a single-provider Anthropic AI integration to a flexible multi-provider architecture supporting Anthropic, OpenAI, Google, and custom endpoints. It migrates framework dependencies from Next.js/NextAuth to SvelteKit and refactors the Rust scanner library to separate raw findings from AI-enriched findings, implementing working secrets detection and pluggable AI provider infrastructure. Changes
Sequence Diagram(s)sequenceDiagram
actor User
participant CLI as CLI
participant ScanEngine as Engine::run()
participant SecretEngine as secrets::run()
participant AIFactory as AI Factory
participant Provider as AI Provider
participant APIEndpoint as API Endpoint
User->>CLI: scan with --ai_provider, --ai_key, etc.
CLI->>ScanEngine: scan(config: &ScanConfig)
ScanEngine->>SecretEngine: run(config)
SecretEngine-->>ScanEngine: Vec<RawFinding>
alt ai_config present
ScanEngine->>AIFactory: create_provider(&ai_config)
AIFactory-->>ScanEngine: Box<dyn AiProvider>
loop for each RawFinding
ScanEngine->>Provider: explain(&raw_finding)
Provider->>APIEndpoint: POST /v1/chat/completions (or equiv)
APIEndpoint-->>Provider: response text
Provider-->>ScanEngine: explanation String
ScanEngine->>Provider: generate_fix(&raw_finding)
Provider->>APIEndpoint: POST /v1/chat/completions (or equiv)
APIEndpoint-->>Provider: response text
Provider-->>ScanEngine: fixed_code String
ScanEngine->>ScanEngine: raw.into_finding(explanation, fixed_code)
end
else no ai_config
loop for each RawFinding
ScanEngine->>ScanEngine: raw.into_finding("", "")
end
end
ScanEngine-->>CLI: Vec<Finding>
CLI->>CLI: filter by severity, format output
CLI-->>User: JSON or text report
Estimated code review effort🎯 4 (Complex) | ⏱️ ~65 minutes The changes span heterogeneous areas: four new AI provider implementations with HTTP error handling, significant scanner core refactoring (API signature changes, new findings model with enrichment pipeline), working secrets detection logic with regex patterns, CLI rewrite with real scan orchestration, and environment variable migration across multiple configuration points. Logic density is moderate-to-high (trait implementations, async orchestration, error handling, prompt construction), and each AI provider requires independent verification of API contract correctness. Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
CI Feedback 🧐A test triggered by this PR failed. Here is an AI-generated analysis of the failure:
|
Summary by CodeRabbit
Release Notes
New Features
Chores
Documentation