feat(api,db,ui): forecast champion selector slice C — forecast decision, business summary & promotion (#362)#363
Conversation
There was a problem hiding this comment.
Sorry @w7-mgfcode, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Summary
Slice C of the Forecast Champion Selector — Forecast Decision, Business Summary & Promotion. Closes the A→B→C series (tracking issue #362). Additive to the
model_selectionslice; extends the existing/visualize/championpage (no new route/nav).Backend
decision.py(new, pure) —z_for_service_level(fixed table, no scipy),compute_forecast_decision(King safety-stockz·σ·√L),forecast_peak_low,BIAS_EXPLANATION.schemas.py—TrainSelectedRequest,ForecastDecisionParams,ForecastDecision,PromoteRequest,PromoteResponse; extendedForecastSummary/TrainWinnerResponse/PredictWinnerResponse.models.py— 7 additive columns onModelSelectionRun(trained_model_type, is_override, override_reason, champion_run_id, promoted_alias, promotion_decision, feature_frame_version).service.py—train_selected(override, validated against candidate models),promote(lazyRegistryService: create_run→RUNNING→register artifact→SUCCESS→create_alias + audit),predict_winnerreturns the decision tuple;feature_frame_versionpersisted at run-creation.routes.py—POST /train-selected,POST /promote, optional decision body on/predict.e4f5a6b7c8d9— 7 additive cols; up/down round-trip verified.Frontend
types/api.ts.useTrainWinner/useTrainSelected/usePredictWinner/usePromoteChampionhooks.components/champion-selector/decision/—DecisionSectionorchestration root (keyed by selectionId) + 8 presentational panels, each with tests.champion.tsxrenders<DecisionSection>below Slice B results when terminal + winner.Docs
docs/user-guide/champion-selector-guide.md+ cross-link fromfeature-reference.md.Validation
tsc/lintclean + 319 vitest green.