feat(api,ui): showcase pipeline decision + portfolio lifecycle (#316)#318
Conversation
PRP-39 — extend the showcase_rich demo pipeline with three new decision-
phase steps (champion_compat_compare, stale_alias_trigger,
safer_promote_flow) and a new portfolio phase (batch_preset). The
decision lifecycle now demonstrates V1-vs-V2 champion-compat verdicts,
the stale-alias V-mismatch chip on /ops, and the safer-Promote dialog
gates. The portfolio phase runs the quick_baseline_sweep preset (3
stores x 2 products x 3 baselines = 18 items) via /batch/forecasting.
Backend:
- app/features/demo/pipeline.py — 4 new step functions, PHASE_PORTFOLIO
constant, BATCH_PRESET_QUICK_BASELINE_SWEEP_MODELS module constant,
DemoContext additive fields (compat_compare_result,
stale_alias_run_id, original_demo_alias_run_id, batch_id,
batch_status), step_cleanup extension that restores the
demo-production alias to its pre-swap target (R15).
- app/features/demo/tests/test_pipeline.py — 8 new unit tests (4 step
functions, 2 skip paths, 2 cleanup scenarios) + extended canned
responses for /ops/summary, /batch/forecasting, /registry/runs?...,
/registry/aliases/{name}, /registry/compare/{a}/{b}; lockstep
test_phase_table_showcase_rich expanded to 18 rows.
- tests/test_e2e_demo.py — new test_run_demo_showcase_rich_decision_
portfolio integration test asserting the four new step events fire
and R15 alias restoration completes.
Frontend:
- PHASE_DEFS.ts — appends 3 decision-phase rows + portfolio phase row;
PHASE_ORDER + PHASE_LABEL extend with 'portfolio'.
- showcase.tsx — resolveInspectHref gains 4 new case arms targeting
/explorer/runs/compare, /ops, and /visualize/batch/{batch_id}.
- demo-step-card.tsx — 4 new mini-summary chip-line components.
- demo-step-card.test.tsx (new) — 6 render tests covering chip-lines
and Inspect button behaviour.
- PHASE_DEFS.test.ts + use-demo-pipeline.test.ts — extended to assert
the new 18-step showcase_rich layout.
Docs:
- docs/_base/RUNBOOKS.md — 8 new failure-mode entries under the
/showcase pipeline section covering the 4 new steps (skip / fail
diagnostics, R15 cleanup recovery).
Drift resolutions (per PRPs/ai_docs/prp-39-contract-probe-report.md):
- D1 (compare envelope): champion_compat_compare derives compatible +
comparable_reason client-side; mirrors the frontend
computeCompatibility predicate.
- D2 (quick_baseline_sweep): preset expansion stays in the demo slice
(Option A); no preset_id on BatchSubmitRequest.
- D3 (sync settle): /batch/forecasting normally returns terminal status
on submit; the 90 s poll loop is a safety net.
WebSocket schema additive only — no StepEvent / DemoRunRequest field
changes. Relative-anchor phase insertion (PHASE_PORTFOLIO between
PHASE_DECISION and PHASE_VERIFY) keeps the slice merge-order
independent of PRP-40.
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
PRP-39 — extends the
showcase_richdemo pipeline with three new decision-phase steps and a new portfolio phase. A first-time visitor running/showcasewithscenario=showcase_richnow walks through the operator's decision lifecycle (champion-compat verdict, stale-alias V mismatch, safer-Promote dialog) and a portfolio-batch preset, then seescleanuprestore the alias to the V2 winner.champion_compat_compare(V1 vs V2 cross-V verdict),stale_alias_trigger(V-mismatch chip on /ops),safer_promote_flow(deliberate worse-WAPE alias swap).portfoliophase:batch_presetruns thequick_baseline_sweep(3 stores × 2 products × 3 baselines = 18 items) via/batch/forecasting.step_cleanuprestoresdemo-productionto the original V2 winner so the demo finishes with the alias on the actual champion.Slice B of the four-PRP
/showcaseupgrade epic (PRP-38..41).Tracks #316 (parent epic #295).
Drift resolutions (from
PRPs/ai_docs/prp-39-contract-probe-report.md)RunCompareResponsehas no top-levelcompatibleflag.champion_compat_comparederivescompatible+comparable_reasonclient-side, mirroring the existing frontend predicate.quick_baseline_sweeppreset stays frontend-only. The demo slice hard-codes the same 3 baselinemodel_types (naive,seasonal_naive,moving_average) intoBATCH_PRESET_QUICK_BASELINE_SWEEP_MODELSand expands the preset into a standardBatchSubmitRequestpayload (Option A — no backendpreset_id).POST /batch/forecastingnormally settles synchronously. The 90 s poll loop is a safety net guarding against a future async-runner mode.Test plan
uv run ruff check . && uv run ruff format --check .— greenuv run mypy app/— clean (303 source files)uv run pyright app/— 0 errors, 129 warnings (pre-existing baseline)uv run pytest -v -m "not integration"— 1635 passedpnpm tsc --noEmit -p tsconfig.app.json— no NEW errors introduced (23 pre-existing on dev baseline → 23 after; full diff against baseline = 0)cd frontend && pnpm lint— green on changed filescd frontend && pnpm test --run— 225 passedapp/features/demo/git diff app/features/demo/schemas.pyemptygit diff --check: zero whitespace errors_phase_table()+ frontendPHASE_DEFS.tsshow the same 18-row order undershowcase_richuv run pytest -v -m integration tests/test_e2e_demo.py::test_run_demo_showcase_rich_decision_portfolio— deferred; sharing Postgres with Worker D (PRP-40)