feat(api,ui): showcase advanced seed config and scope selection (#409)#416
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
Implements showcase-completion E3 #409 (Parallel after Foundation E1 #407, umbrella #406): an allow-listed nested seed-override contract, a store/product focus-pair selector, and replay-verbatim persistence of both into the E1 workspace story slots.
Backend
app/shared/seeder/overrides.py(NEW) —SeederOverrides: 7 curated knobs (stores,products,window_days,sparsity,promotion_intensity,stockout_intensity,noise_sigma),ConfigDict(strict=True, extra="forbid")— an unknown knob is a 422 (umbrella risk-1 mitigation, machine-enforced).POST /seeder/generate— additive Optionaloverridesobject;_apply_seed_overridesapplied LAST in_build_config_from_params(wins over the scalarstores/products/sparsity);dataclasses.replacepreserves preset character (sparse gaps, region/category lists). Absent = byte-identical (regression-tested).DemoRunRequest— additiveseed_overrides+user_scopewith two cross-field validators: overrides requireskip_seed=false;window_daysrejected on the calendar-pinnedholiday_rush;{}normalizes toNone.step_seedforwards overrides verbatim and echoes effective dims +overrides_applied;step_statusvalidates auser_scopepair via/dimensions/*/{id}, adopts it ("(user-selected)"), or WARNS + falls back to discovery on a dangling pair (replay of areset=trueworkspace can never hard-fail).create_workspacerecords both story slots (sparse JSON / NULL, inside the warn-and-continue try); slots exposed onWorkspaceListItem(replay reads list rows; Detail inherits).Frontend
SeedConfigPanel(collapsible 7-knob panel, gated on Re-seed first,holiday_rushwindow lock, NaN-WAPE caveat badge, live summary) +ScopeSelector(live/dimensionsdropdowns + preview card with seeded window).buildReplayRequestextended — replay re-submits recordedseed_overrides/user_scopeverbatim; legacy rows stay byte-identical. Load repopulates panel + selector; Reset tick clears the scope (ids re-issue); Re-seed untick clears overrides.Docs
API_CONTRACTS(seeder/demo/WS/workspaces rows),RUNBOOKS(showcase incident 29 + workspace-section scope update),DOMAIN_MODEL(authoritative slot schemas, requested-vs-effective grain).ZERO migrations (E1 #407 owns the schema); no new endpoints; all changes additive.
Test plan
pnpm lint+ 420 vitest; no newtsc -berrors in touched filestest_demo_replay_preserves_seed_overrides_and_scope(replay-verbatim slots + dangling-scope warn-fallback)replayed_from_workspace_idlineageCloses #409