Skip to content

feat(ui): add interactive forecast intelligence UI (PRP-37) (#305)#306

Merged
w7-mgfcode merged 1 commit into
devfrom
feat/forecast-interactive-ui
May 26, 2026
Merged

feat(ui): add interactive forecast intelligence UI (PRP-37) (#305)#306
w7-mgfcode merged 1 commit into
devfrom
feat/forecast-interactive-ui

Conversation

@w7-mgfcode
Copy link
Copy Markdown
Owner

Summary

PRP-37 — Forecast Intelligence Slice C. Operator-facing UI surface for the
PRP-35 V2 feature contract and the PRP-36 model zoo / per-horizon-bucket
metrics / V-aware ops fields. Backend untouched per PRP-37 — every
visible value reads an existing backend response.

Closes #305 · Parent epic #295 · Slice A #299 · Slice B #302

What lands

New surfaces

Page Affordance
/visualize/forecast New Train a new model card — segmented family Tabs → model-type Select → V1/V2 Select → conditional feature-pack toggles + train submission.
/visualize/backtest RMSE tile (when present), Per-horizon-bucket card (table + chart, metric switcher), Baseline vs feature-aware comparison table. Existing model picker switched to family + filtered model.
/visualize/planner Scenario method badge (model-driven re-forecast vs heuristic adjustment).
/visualize/batch Sweep preset Select (5 presets) + multi-model × V1/V2 Sweep matrix picker.
/explorer/run-detail Feature frame panel — V1/V2 chip + per-group collapsible columns + per-column safety chips. Empty state for pre-PRP-35 runs.
/explorer/run-compare Champion compatibility badge (comparable-run rule) + Feature frame version row in metrics diff.
/ops Stale-alias card with reason chips (new V mismatch reason), Model Health table with Prev WAPE + Staleness columns, safer Promote dialog — artifact verify + worse-WAPE ack + V-mismatch ack gates.

New files

  • frontend/src/lib/feature-frame-utils.ts + test
  • frontend/src/lib/horizon-bucket-utils.ts + test
  • frontend/src/components/forecast-intelligence/
    • model-family-tabs.tsx + test
    • model-type-select.tsx (+ model-type-utils.ts) + test
    • feature-frame-select.tsx + test
    • feature-groups-toggle.tsx + test
    • horizon-bucket-table.tsx + test
    • feature-frame-panel.tsx + test
    • champion-compatibility-badge.tsx (+ champion-compatibility-utils.ts) + test
    • promote-confirmation-dialog.tsx + test
    • batch-preset-select.tsx (+ batch-preset-utils.ts) + test
    • batch-matrix-picker.tsx + test
  • frontend/src/components/charts/backtest-horizon-buckets-chart.tsx + test

Modified files

  • frontend/src/types/api.ts — additive PRP-35 / PRP-36 types
    (FeatureFrameVersion, FeatureGroup, FEATURE_GROUP_VALUES,
    FeatureSafetyClass, TrainRequest, BacktestResponse, FoldResult,
    ModelBacktestResult, StaleReason; ModelRun/FeatureMetadataResponse/
    BatchModelConfig/AliasHealth/ModelHealthEntry extended)
  • frontend/src/hooks/use-runs.ts — optional featureFrameVersion param
    (cached in query key only; not forwarded to backend)
  • Seven page files: pages/visualize/{forecast,backtest,planner,batch}.tsx,
    pages/explorer/{run-detail,run-compare}.tsx, pages/ops.tsx
  • docs/user-guide/dashboard-guide.md — references new affordances on
    every touched page
  • docs/user-guide/advanced-forecasting-guide.mdnew RAG-indexable
    guide covering families, V1 vs V2, feature packs, horizon buckets,
    champion compatibility, stale aliases, safer Promote, batch presets

Validation

  • pnpm tsc --noEmit — clean
  • pnpm lint — clean (1 pre-existing warning in data-table.tsx,
    unrelated to PRP-37)
  • pnpm test --run202 tests pass across 27 files
  • Backend regression (forecasting + backtesting + registry + ops,
    not integration) — 518 pass
  • git diff app/ alembic/ — empty (backend untouched)
  • grep -rn "from 'radix-ui'" src — empty (no barrel imports)

Out of scope / deferred

  • V2 backtesting dispatch — deferred to feat(forecast): add feature frame v2 (PRP-35) #299
  • Known-future-input pill — dropped per Drift ci: add GitHub Actions workflows for phase-1 readiness #3 in the contract probe
    report (no backend is_known_future field exists on any assumption
    schema)
  • Dogfood (Task 26) — not run in this PR; requires the local alembic
    stale-revision reset + at least one V2 SUCCESS run seeded, both noted
    in the HANDOFF carry-forwards. The PR is mergeable on CI green; the
    dogfood is a manual smoke-test the next maintainer can run.
  • New agent tool / agent_require_approval — unchanged

Test plan

  • CI green on dev-target PR (Lint & Format, Type Check, Test, Migration Check)
  • After merge — manual dogfood per PRPs/PRP-37-forecast-intelligence-C-interactive-ui.md#Task-26 (train a V2 run + open run-detail / run-compare / ops / batch in the browser)

PRP-37 — Forecast Intelligence Slice C. Operator-facing surface for the
PRP-35 V2 feature contract and the PRP-36 model zoo, backtest buckets,
and V-aware ops fields. Backend untouched (per PRP-37); every visible
value is read from an existing backend response.

Surfaces:
- /visualize/forecast: family Tabs + model-type Select + V1/V2 Select +
  conditional feature-pack toggles + train submission.
- /visualize/backtest: per-horizon-bucket table + chart, RMSE tile,
  baseline-vs-feature-aware comparison table.
- /visualize/planner: scenario method badge.
- /visualize/batch: 5 sweep presets + multi-model x V1/V2 matrix picker.
- /explorer/run-detail: Feature frame panel (V1/V2 + per-group columns +
  per-column safety chips).
- /explorer/run-compare: Champion compatibility badge + Feature frame
  version row.
- /ops: stale-alias V mismatch chip, model-health explainer columns,
  safer Promote dialog (artifact verify + worse-WAPE ack + V-mismatch ack).

Adds 11 components under components/forecast-intelligence/, 1 chart
under components/charts/, 2 lib modules under lib/, with colocated
vitest tests for every component and helper. api.ts extended with
PRP-35/PRP-36 wire types (all Optional, additive). use-runs gains an
optional feature_frame_version param (not forwarded to the backend list
endpoint; no server-side filter exists).

Validation: pnpm tsc --noEmit + pnpm lint + pnpm test --run all clean
(202 frontend tests). Backend regression suite (forecasting +
backtesting + registry + ops, non-integration) 518 passed.
Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @w7-mgfcode, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 26, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 50edb0f2-6d3b-4a86-ba00-677302228309

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/forecast-interactive-ui

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@w7-mgfcode w7-mgfcode merged commit 5e86b6f into dev May 26, 2026
8 checks passed
@w7-mgfcode w7-mgfcode deleted the feat/forecast-interactive-ui branch May 26, 2026 07:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant