Skip to content

Scenario Simulation / What-If Planning (MVP) — new scenarios slice #221

@w7-mgfcode

Description

@w7-mgfcode

Summary

Promote the MVP scope of docs/optional-features/03-scenario-simulation-what-if-planning.md into code via a new app/features/scenarios/ vertical slice. Turns ForecastLabAI from "predict the future" into "plan possible futures": run a baseline forecast from an existing trained model, apply deterministic, transparent uplift/drag factors for future assumptions (price change, promotion, holiday, inventory, lifecycle), and return a baseline-vs-scenario comparison.

Today every forecast answers only "what happens if nothing changes?" — there is no surface that answers "what if we discount this SKU 15% next week?"

Scope (phased — each phase independently shippable)

  • Phase A — Stateless Simulation Engine (backend): deterministic adjustments.py + stateless POST /scenarios/simulate — resolves a baseline model, runs a baseline forecast, applies per-day adjustment factors, returns a ScenarioComparison. No table.
  • Phase B — Saved Scenario Plans (persistence): new scenario_plan table + Alembic migration; POST /scenarios, GET /scenarios, GET /scenarios/{id}, DELETE /scenarios/{id} CRUD.
  • Phase C — What-If Planner Page (frontend): /visualize/planner — baseline picker → assumption form → run → baseline-vs-scenario chart + delta table → save/reload/delete named plans.

Out of scope

The "Full Version" (future-feature-frame generator, exogenous-regressor model support, agent-generated scenarios, multi-scenario comparison) — explicitly deferred.

Plan of record

  • PRP: PRPs/PRP-26-scenario-simulation-what-if-planning.md
  • Feature brief: docs/optional-features/03-scenario-simulation-what-if-planning.md

Builds on already-merged slices: forecasting (PRP-5), registry (PRP-7), jobs (PRP-8), data_platform (PRP-2), dashboard (PRP-11).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions