feat: smart integration detection with package classifier

- Add PackageClassifier with built-in dictionary (~200 popular packages)
- Hardcode Python 3.10+ stdlib list to filter out standard library imports
- Add PyPI API lookup for unknown packages (online mode, 3s timeout)
- Cache PyPI results in .wtismycode/cache/pypi.json
- Add --offline flag to skip PyPI lookups
- Classify packages into: HTTP, Database, Queue, Storage, AI/ML, Auth, Testing, Logging, Internal, Third-party
- User config integration_patterns override auto-detection
- Update renderer to show integrations grouped by category
- Update ARCHITECTURE.md template with new integration format
This commit is contained in:
2026-02-15 12:45:56 +03:00
parent f4f8b8fa34
commit b3eb591809
13 changed files with 800 additions and 192 deletions

View File

@@ -33,9 +33,11 @@ fn test_project_analysis() {
// Check that we found calls
assert!(!core_module.calls.is_empty());
// Check that integrations are detected
let db_integration_found = core_module.symbols.iter().any(|s| s.integrations_flags.db);
let http_integration_found = core_module.symbols.iter().any(|s| s.integrations_flags.http);
// Integration flags are now set during resolve_symbols, not parse_module
// So we resolve and check there
let project_model = analyzer.resolve_symbols(&[core_module.clone()]).unwrap();
let db_integration_found = project_model.symbols.values().any(|s| s.integrations_flags.db);
let http_integration_found = project_model.symbols.values().any(|s| s.integrations_flags.http);
assert!(db_integration_found, "Database integration should be detected");
assert!(http_integration_found, "HTTP integration should be detected");