How darkerror64/ledgerlens works
LedgerLens is an analyst-facing root-cause ranking tool, not a causal-inference system. An analyst submits a metric and date through the UI or pipeline; the system detects and drills into an anomaly, gathers ticket symptoms, matches the affected cohort against recorded business changes, tests candidates with negative controls, and presents an auditable diagnosis card. Supporting layers provide typed domain models, tunable rules, and a DuckDB query registry. The README documents optional production change-source integrations; connector internals were not sampled, so those links are marked accordingly.
Main entry points: store.py Query registry · pipeline.py Diagnosis pipeline · hypothesis.py Candidate ranking · app.py Analyst UI
Components 16
Analyst interface
- Analyst UI
app.py - Diagnosis pipeline
ledgerlens/pipeline.py
Signals and ledger
- Anomaly and drill-down
ledgerlens/anomaly.py - Ticket clustering
ledgerlens/ledger/symptoms.py - Change connectors
ledgerlens/ledger/connectors.py - Demo input data
data
Candidate diagnosis
- Candidate ranking
ledgerlens/hypothesis.py - Negative controls
ledgerlens/controls.py - Learned prior
ledgerlens/learning.py - Diagnosis card
ledgerlens/narrate.py
Evidence and state
- Rules and thresholds
config.py - Domain models
ledgerlens/models.py - Query registry
ledgerlens/store.py - DuckDB state
data
Other components
- Analyst
- Business source systems
Connections 18
- Analyst → Analyst UI: submits diagnosis
app.py - Analyst UI → Diagnosis pipeline: loads diagnosis
app.py - Diagnosis pipeline → Query registry: initializes and loads
ledgerlens/pipeline.py - Diagnosis pipeline → Anomaly and drill-down: detects and attributes
ledgerlens/pipeline.py - Diagnosis pipeline → Ticket clustering: clusters tickets
ledgerlens/pipeline.py - Diagnosis pipeline → Candidate ranking: ranks candidates
ledgerlens/pipeline.py - Diagnosis pipeline → Diagnosis card: prepares card
ledgerlens/pipeline.py - Query registry → DuckDB state: queries and records
README.md - Query registry → Change connectors: loads change events
ledgerlens/store.py - Demo input data → Query registry: loads demo records
- Business source systems → Change connectors: provides change metadata
README.md - Ticket clustering → Query registry: reads ticket data
ledgerlens/ledger/symptoms.py - Anomaly and drill-down → Query registry: queries metric data
ledgerlens/anomaly.py - Candidate ranking → Negative controls: tests candidates
README.md - Candidate ranking → Learned prior: uses learned prior
README.md - Candidate ranking → Anomaly and drill-down: measures sub-slices
ledgerlens/hypothesis.py - Analyst UI → Query registry: opens query details
app.py - Diagnosis card → Analyst UI: renders diagnosis