Skip to content

fix(ui): model_exogenous scenario path is unreachable from the What-If Planner #229

@w7-mgfcode

Description

@w7-mgfcode

Summary

The headline PRP-27 capability — a genuine model-driven re-forecast (method="model_exogenous", regression baseline through a leakage-safe future feature frame) — cannot be triggered from the /visualize/planner UI. From the browser a user can only ever reach the heuristic post-forecast multiplier path.

Root cause

The planner's Pick a baseline step uses JobPicker (jobType="predict", status="completed") and reads job.params.run_id as the baseline (planner.tsx:75-77). But:

  • POST /forecasting/predict (and therefore predict jobs) explicitly reject regression models:

    Regression models forecast through POST /scenarios/simulate, which supplies the exogenous feature frame. POST /forecasting/predict does not support model_type='regression'.

  • So no completed predict job can ever exist for a regression run, and the JobPicker can never surface one.

POST /scenarios/simulate does route a regression run_id down _simulate_model_exogenous, but the planner has no way to feed it a regression run_id. The path is reachable only via the raw API or the agent propose_scenario / save_scenario tools.

Suggested fix (pick one)

  1. Add a registry run picker to the planner (pick a success run directly), in addition to / instead of the predict-job picker — a regression run would then be selectable and route to model_exogenous.
  2. Allow regression predict jobs to complete (a thin predict job that delegates to the simulate/feature-frame path), so they appear in the JobPicker.

Option 1 is the smaller change and matches scenarios/service.py which already resolves the model bundle straight from run_id.

Found by

Real-browser dogfood of PRP-27 (/visualize/planner) on dev after PR #227. The model_exogenous mechanism itself is correct and proven via the API — this is purely a UI-reachability gap.

Metadata

Metadata

Assignees

No one assigned

    Labels

    fixBug fixpriority:p1Should-fix soonscope:uiTouches the ui area (commit-format scope)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions