How alejandro-publius/blackbox-datahub works
BlackBox is an autonomous data-incident response product: an operator reports an anomaly, the agent investigates it using DataHub metadata and deterministic warehouse evidence, then pauses for repair authorization. It proposes a pipeline change, rebuilds and verifies it against invariants and baseline metrics, optionally publishes a pull request, and records the resolution in DataHub. The dashboard presents incident progress and results. Source excerpts show the evidence-gated agent/tool design and repair verification; some API, UI, and DataHub writeback connections are documented in the README rather than sampled source.
Main entry points: tools.py Evidence-gated tools · investigator.py Investigation loop · repair.py Repair and verification · api.py Backend API
Components 23
Operator interface
- Incident dashboard
frontend/src/components/Dashboard.tsx - Incident stream
frontend/src/hooks/useIncidentStream.ts
Incident orchestration
- Backend API
backend/blackbox/api.py - Investigation loop
backend/blackbox/agent/investigator.py - Evidence-gated tools
backend/blackbox/agent/tools.py - Runtime configuration
backend/blackbox/config.py
DataHub context
- Metadata client
backend/blackbox/datahub/client.py - Embedded context kit
backend/blackbox/datahub/context_kit.py - MCP bridge
backend/blackbox/datahub/mcp_bridge.py - Metadata ingest
backend/blackbox/datahub/ingest.py - Resolution writeback
backend/blackbox/datahub/writeback.py - DataHub reset
backend/blackbox/datahub/reset.py
Repair and verification
- Warehouse evidence
backend/blackbox/warehouse.py - Repair and verification
backend/blackbox/repair.py - Pipeline rebuild
pipeline/run.py - Demo source data
pipeline/generate_sources.py
Evidence and state
- Incident stages
backend/blackbox/models.py - Incident store
backend/blackbox/store.py - Run tracing
backend/blackbox/tracing.py
Other components
- Operator
- Claude model
- DataHub
- GitHub pull request
Connections 28
- Operator → Incident dashboard: reports anomaly
README.md - Incident dashboard → Backend API: submits incident
README.md - Backend API → Investigation loop: starts investigation
README.md - Investigation loop → Claude model: requests strategy
backend/blackbox/agent/investigator.py - Investigation loop → Evidence-gated tools: dispatches tools
backend/blackbox/agent/investigator.py - Evidence-gated tools → Metadata client: reads metadata
backend/blackbox/agent/tools.py - Evidence-gated tools → Warehouse evidence: gathers metrics
README.md - Metadata client → Embedded context kit: uses embedded reads
backend/blackbox/datahub/client.py - Metadata client → MCP bridge: uses MCP fallback
backend/blackbox/datahub/client.py - Embedded context kit → DataHub: queries context
README.md - MCP bridge → DataHub: queries context
README.md - Metadata ingest → DataHub: emits metadata
README.md - Evidence-gated tools → Incident store: saves incident
backend/blackbox/agent/tools.py - Investigation loop → Incident store: loads and saves
backend/blackbox/agent/investigator.py - Evidence-gated tools → Incident stages: advances stages
backend/blackbox/agent/tools.py - Investigation loop → Run tracing: records spans
backend/blackbox/agent/investigator.py - Investigation loop → Warehouse evidence: captures baseline
backend/blackbox/agent/investigator.py - Backend API → Repair and verification: authorizes repair
README.md - Evidence-gated tools → Repair and verification: runs repair
backend/blackbox/agent/tools.py - Repair and verification → Pipeline rebuild: rebuilds warehouse
README.md - Repair and verification → Warehouse evidence: verifies invariants
backend/blackbox/repair.py - Repair and verification → GitHub pull request: publishes PR
README.md - Evidence-gated tools → Resolution writeback: records resolution
backend/blackbox/agent/tools.py - Resolution writeback → DataHub: writes resolution
README.md - DataHub reset → DataHub: scrubs state
README.md - Demo source data → Pipeline rebuild: generates inputs
README.md - Incident stream → Backend API: receives updates
README.md - Incident dashboard → Incident stream: renders progress
README.md