diff --git a/PRPs/PRP-showcase-workspace-E2-preset-exposure.md b/PRPs/PRP-showcase-workspace-E2-preset-exposure.md new file mode 100644 index 00000000..e20eb7a5 --- /dev/null +++ b/PRPs/PRP-showcase-workspace-E2-preset-exposure.md @@ -0,0 +1,620 @@ +name: "PRP — Showcase Workspace E2: Full Preset Exposure (issue #391)" +description: | + +## Purpose + +Implement the first Parallel epic of the showcase-workspace initiative (umbrella #389): +surface all 8 `ScenarioPreset` values as guided, business-friendly cards in the +frontend `ScenarioPicker`, give per-preset demo seed profiles to the pipeline's +seed step, and attach expected-skip semantics (card caveat + runbook entry) to +presets that cannot complete every pipeline step. Frontend-mostly; the backend +already accepts the full enum. + +## Core Principles + +1. **Context is King**: every reference below was verified against the live code on 2026-06-12 (branch dev @ 0493192, post-E1 merge). +2. **Validation Loops**: each level is executable as written. +3. **Information Dense**: patterns cite exact file:line. +4. **Progressive Success**: backend seed profiles → types → picker cards → lockstep tests → docs → browser dogfood. +5. **Global rules**: follow CLAUDE.md / AGENTS.md; all five backend CI gates must pass; UI work follows `.claude/rules/ui-design.md` + `.claude/rules/shadcn-ui.md`. + +--- + +## Goal + +A user on `/showcase` can pick any of the 8 seeder presets (`retail_standard`, +`holiday_rush`, `high_variance`, `stockout_heavy`, `new_launches`, `sparse`, +`demo_minimal`, `showcase_rich`) from a card grid that explains, per preset: +what data it seeds (stores × products × window), its business character (promos, +stockouts, launches, noise), an estimated wall-clock, and — where applicable — +an **expected-skip/fail caveat** so a non-green outcome reads as documented +behavior, not a bug. Re-seeding with any preset produces a pipeline run that +either goes green or fails/skips exactly as its card predicts. + +**Deliverable** (all additive): + +- `app/features/demo/pipeline.py` — `_SCENARIO_SEED_PROFILE` extended from 3 to all 8 presets via a `_SeedProfile` NamedTuple that supports an optional calendar-pinned window (needed by `holiday_rush`); `step_seed` honors the pinned window. +- `frontend/src/types/api.ts` — `ScenarioPreset` union widened from 3 to all 8 string values. +- `frontend/src/components/demo/ScenarioPicker.tsx` — shadcn `` for the demo pipeline's scenario preset. + * E2 (#391) — guided card grid for the demo pipeline's scenario preset. * - * Composition rule: `` lives inside `` per - * `.claude/rules/shadcn-ui.md`. Three headline options; default - * `demo_minimal` keeps wire-compat with prior clients. + * All 8 backend ScenarioPreset values are exposed as aria-pressed toggle + * buttons (W3C APG button pattern — no roving tabindex needed, unlike + * role="radio"). Default `demo_minimal` keeps wire-compat with prior clients. */ export function ScenarioPicker({ value, onChange, disabled }: ScenarioPickerProps) { return (
- +
+ {SCENARIO_OPTIONS.map((opt) => ( + + ))} +
+

+ Tick Re-seed first when switching presets — without + it the run reuses the currently seeded dataset. +

) } diff --git a/frontend/src/pages/showcase.tsx b/frontend/src/pages/showcase.tsx index 0f590218..6f6e38ed 100644 --- a/frontend/src/pages/showcase.tsx +++ b/frontend/src/pages/showcase.tsx @@ -155,8 +155,9 @@ export default function ShowcasePage() {

Run the full forecasting pipeline live — phase by phase. The same flow as{' '} make demo, streamed to - the browser. Pick a scenario to control depth (demo_minimal stays fast; - showcase_rich exercises V1+V2 modeling). + the browser. Pick a scenario to control depth and data shape — all eight seeder + presets are available (demo_minimal stays fast; showcase_rich exercises V1+V2 + modeling).

diff --git a/frontend/src/types/api.ts b/frontend/src/types/api.ts index 88a204e1..54ff956a 100644 --- a/frontend/src/types/api.ts +++ b/frontend/src/types/api.ts @@ -742,9 +742,18 @@ export interface VerifyResult { export type DemoStepStatus = 'running' | 'pass' | 'fail' | 'skip' | 'warn' export type DemoEventType = 'step_start' | 'step_complete' | 'pipeline_complete' | 'error' -// PRP-38 — seeder scenario presets the picker offers. Mirrors the backend -// app/shared/seeder/config.py:ScenarioPreset enum's string values. -export type ScenarioPreset = 'demo_minimal' | 'showcase_rich' | 'sparse' +// PRP-38 / E2 (#391) — seeder scenario presets the picker offers. Mirrors +// the backend app/shared/seeder/config.py:ScenarioPreset enum's string +// values — all 8 members. +export type ScenarioPreset = + | 'retail_standard' + | 'holiday_rush' + | 'high_variance' + | 'stockout_heavy' + | 'new_launches' + | 'sparse' + | 'demo_minimal' + | 'showcase_rich' // One streamed pipeline event from WS /demo/stream (matches the backend // StepEvent Pydantic model; snake_case on the wire).