Lightweight, production-oriented micro-framework for forecast quality monitoring and statistical drift detection.
FGDM evaluates canonical forecast outputs and produces deterministic governance reports for validation, auditing, and CI/CD gating.
Forecasting systems rarely fail in dramatic ways. They degrade quietly, drift statistically, and then ruin decisions with the calm confidence of a broken compass.
FGDM exists to monitor that behaviour explicitly.
It provides:
- forecast error metrics
- rolling degradation detection
- statistical drift diagnostics
- dataset validation rules
- governance severity signals
- deterministic JSON and Markdown reporting
- CI-friendly exit codes
FGDM expects long-format forecast outputs with the following columns:
cd_key | ds | y | y_hat
Where:
cd_key= entity identifierds= datey= actual valuey_hat= predicted value
Supported formats:
.csv.parquet
- MAE
- RMSE
- MAPE
- KS test
- PSI
- rolling window degradation
- baseline vs current comparison
- top offenders by
cd_key - per-key quality breakdown
- validation summary
- rule breaches
- quality / drift / overall severity
- fail-on-severity CLI gating
FGDM follows a lightweight Clean Architecture approach.
domain→ pure computations and typed modelsapplication→ orchestration and use-casesinfrastructure→ CLI, loaders, reporters
See docs/architecture.md.
pip install -e .For development:
pip install -e ".[dev]"Generate demo data:
fgdm-demo-data --output-dir demo_dataRun monitoring:
fgdm --input demo_data/forecast_demo.csv --output-dir demo_output --run-id demo_csvFor a full walkthrough, see docs/demo.md.
If you use make:
make install-dev
make ci
make demo
make demo-runFGDM supports reproducible timestamps via:
--generated-atSOURCE_DATE_EPOCH
Example:
fgdm --input demo_data/forecast_demo.csv --output-dir demo_output --run-id deterministic_demo --generated-at 2026-03-03T00:00:00+00:00Fail the process when severity reaches a threshold:
fgdm --input demo_data/forecast_demo.csv --output-dir demo_output --run-id gated_demo --fail-on-severity warnExit codes:
0→ success2→ FGDM domain error3→ unexpected runtime error4→ governance gate triggered
FGDM generates:
- JSON report for automation
- Markdown report for humans
Reports include:
- overall metrics
- baseline vs current metrics
- rolling performance windows
- drift results
- degradation events
- top offenders
- per-key quality
- validation summary
- rule breaches
pytestSee CHANGELOG.md and docs/release-checklist.md.
GNU Affero General Public License v3.0
See the LICENSE file.