How gulmezeren2-byte/erp-report-engine works
erp-report-engine is a read-only ERP analytics product with two principal use cases: scheduled weekly reporting and guarded AI-agent access. The report workflow maps ERP schemas to canonical entities, reads and checks source data, computes operational measures and signals, then renders and optionally delivers results. A Power BI export is another documented output. The graph follows README-described flows and sampled module responsibilities; several internal call details and unsampled subsystem wiring are not established by the excerpts, so uncertain links are omitted.
Main entry points: runner.py Run orchestrator · cli.py CLI · extract.py Canonical extraction · mcp_server.py Guarded MCP server
Components 22
Entry and configuration
- CLI
erp_report_engine/cli.py - Run orchestrator
erp_report_engine/runner.py - Configuration
erp_report_engine/config.py - ERP profiles
erp_report_engine/profiles
Safe data access
- Database connection
erp_report_engine/connect.py - Read-only guard
erp_report_engine/guard.py - Canonical extraction
erp_report_engine/extract.py - Quality and reconciliation
erp_report_engine/contracts.py
Report analytics
- KPI computation
erp_report_engine/kpi.py - Control signals
erp_report_engine/spc.py - Findings and drivers
erp_report_engine/insights.py - Report narration
erp_report_engine/narrate.py - Run memory
erp_report_engine/state.py
Reporting outputs
- HTML reports
erp_report_engine/render.py - Command Center
erp_report_engine/render_dashboard.py - Report delivery
erp_report_engine/delivery.py - Power BI export
erp_report_engine/export_powerbi.py - Power BI model
powerbi/ERP Command Center.SemanticModel
Agent access
- Guarded MCP server
erp_report_engine/mcp_server.py
Other components
- Operator
- ERP SQL database
- AI agent
Connections 22
- Operator → CLI: invokes
- CLI → Run orchestrator: runs report
- Run orchestrator → Configuration: loads settings
- Configuration → ERP profiles: selects profile
- Run orchestrator → Canonical extraction: requests extraction
- Canonical extraction → Database connection: queries through
- Database connection → ERP SQL database: opens read-only session
- Canonical extraction → Read-only guard: checks SQL
- Canonical extraction → Quality and reconciliation: reconciles and flags
- Run orchestrator → KPI computation: computes measures
- Run orchestrator → Control signals: evaluates signals
- Run orchestrator → Findings and drivers: builds findings
- Run orchestrator → Report narration: prepares report text
- Run orchestrator → Run memory: updates run memory
- Run orchestrator → HTML reports: renders report
- Run orchestrator → Command Center: renders dashboard
- CLI → Report delivery: optionally sends
- CLI → Power BI export: exports data
- Power BI export → Power BI model: writes model data
- AI agent → Guarded MCP server: requests tools
- Guarded MCP server → Read-only guard: guards queries
- Guarded MCP server → ERP SQL database: reads canonical data