How quantum-blade1/halluciguard works
HalluciGuard detects hallucinated and risky Python/JavaScript package imports, then presents findings and remediation in VS Code; it also exposes a Python pipeline through a dashboard/LSP runtime. The documented editor flow is scan → validate → score → offer a fix → show diagnostics and results. The graph uses the sampled src pipeline for the dashboard flow and shows the extension-to-bundled-scanner handoff documented in the README. Some extension and bundled-scanner internals were not sampled, so their links are limited to documented relationships.
Main entry points: pipeline.py Pipeline orchestrator · extension.ts Editor extension · validator.py Package validation · profiler.py Risk profiler
Components 22
VS Code experience
- Editor extension
vscode-extension/src/extension.ts - Scanner bridge
vscode-extension/src/scanner_bridge.ts - Inline diagnostics
vscode-extension/src/diagnostics.ts - Sidebar results
vscode-extension/src/results_provider.ts - Risk WebView
vscode-extension/src/webview_panel.ts
Python runtime
- Bundled scanner CLI
vscode-extension/scanner/halluciguard_scanner.py - Runtime entrypoint
src/main.py - Dashboard API
dashboard/app.py - Pipeline orchestrator
src/core/pipeline.py
Detection pipeline
- Import extraction
src/agents/sentinel.py - Package validation
src/agents/validator.py - Risk profiler
src/agents/profiler.py - AST parser
src/utils/ast_parser.py
Package intelligence
- Package bloom filter
src/data/bloom_filter.py - Registry clients
src/data/registry_client.py - Hallucination database
src/data/hallucination_db.py - Typosquat matching
src/utils/levenshtein.py - CVE lookup and cache
src/data/cve_client.py
Remediation and audit
- Safe replacements
src/agents/remediator.py - Safe-package search
src/data/chroma_manager.py - Audit logging
src/agents/auditor.py
Other components
- Developer
Connections 21
- Developer → Editor extension: edits code
README.md - Editor extension → Scanner bridge: starts scan
- Scanner bridge → Bundled scanner CLI: spawns; reads NDJSON
README.md - Bundled scanner CLI → Import extraction: runs agents
- Editor extension → Inline diagnostics: renders findings
README.md - Editor extension → Sidebar results: updates TreeView
README.md - Editor extension → Risk WebView: updates panel
README.md - Runtime entrypoint → Dashboard API: starts dashboard
src/main.py - Dashboard API → Pipeline orchestrator: calls process
dashboard/app.py - Pipeline orchestrator → Import extraction: extracts imports
src/core/pipeline.py - Pipeline orchestrator → Package validation: validates imports
src/core/pipeline.py - Pipeline orchestrator → Risk profiler: scores packages
src/core/pipeline.py - Pipeline orchestrator → Safe replacements: finds replacements
src/core/pipeline.py - Pipeline orchestrator → Audit logging: logs decisions
src/core/pipeline.py - Import extraction → AST parser: parses source
src/agents/sentinel.py - Package validation → Package bloom filter: checks names
src/agents/validator.py - Package validation → Registry clients: checks misses
src/agents/validator.py - Package validation → Hallucination database: checks names
src/agents/validator.py - Risk profiler → Typosquat matching: checks typos
src/agents/profiler.py - Risk profiler → CVE lookup and cache: checks vulnerabilities
src/agents/profiler.py - Safe replacements → Safe-package search: searches alternatives
src/agents/remediator.py