How moh-a-abde/financial-spreading-pipeline works
This repository implements an in-memory financial spreading workflow for reconciling two pre-extracted income-statement datasets, mapping the resolved lines to accounts, checking mathematical rules, and preserving source-level provenance. Its optional local visualizer lets an analyst inspect source evidence, mappings, rule results, and audit chains while adjusting run policy. The README documents the domain workflow; the sampled pipeline and server excerpts support the stage and integration links shown here. The frontend’s full request wiring was not sampled, so uncertain interactions are omitted.
Main entry points: serve.py Local API Server · app.js Analyst Interface · index.html Visualizer Page · source_a_llm.json LLM Extraction
Components 15
Spreading Inputs
- LLM Extraction
data/source_a_llm.json - OCR Extraction
data/source_b_ocr.json - Account Taxonomy
data/taxonomy.json - Validation Rules
data/validation_rules.json
Spreading Pipeline
- Reconcile Lines
pipeline.py - Map Accounts
pipeline.py - Validate Totals
pipeline.py
Review and Audit
- Build Provenance
pipeline.py - Identify Unbooked
pipeline.py
Local Visualizer
- Local API Server
viz/serve.py - Analyst Interface
viz/app.js - Visualizer Page
viz/index.html
Other components
- LLM Extractor
- OCR Pipeline
- Financial Analyst
Connections 16
- LLM Extractor → LLM Extraction: writes extractions
- OCR Pipeline → OCR Extraction: writes extractions
- Financial Analyst → Local API Server: requests runs
- Local API Server → LLM Extraction: loads
- Local API Server → OCR Extraction: loads
- Local API Server → Account Taxonomy: loads
- Local API Server → Validation Rules: loads
- Local API Server → Reconcile Lines: invokes
- Local API Server → Map Accounts: invokes
- Local API Server → Validate Totals: invokes
- Local API Server → Identify Unbooked: invokes
- Local API Server → Build Provenance: invokes
- Financial Analyst → Analyst Interface: uses
- Visualizer Page → Analyst Interface: loads script
- Local API Server → Visualizer Page: serves
- Analyst Interface → Local API Server: calls API