feat(data,api): seeder Phase 1 — exogenous signals, multi-seasonality, changepoints, returns, substitution#89
Conversation
…s, returns, substitution to seeder (#88)
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
Phase 1 of the seeder realism extension (closes #88). Adds opt-in mechanics so the synthetic dataset can exercise exogenous-aware forecasting, multi-seasonal patterns, trend changepoints, returns volume, and cross-product substitution.
exogenous_signal(weather / macro / events) andsales_returns.SalesDailyGenerator: yearly seasonality, changepoint impulse + exponential decay, linear weather effect, stockout substitution.GET /seeder/exogenous, 6 new Phase 1 fields onGenerateParams, expandedSeederStatus.Regression invariant: with every Phase 1 flag off, all six existing scenarios (
retail_standard,holiday_rush,high_variance,stockout_heavy,new_launches,sparse) produce byte-identical seeded output. Enforced byapp/shared/seeder/tests/test_phase1_regression.py.What's included
alembic/versions/f7a8b9c0d123_*app/features/data_platform/models.py(+ExogenousSignal, +SalesReturn)app/shared/seeder/config.py(+5 dataclasses + wiring onSeederConfig)app/shared/seeder/generators/{exogenous,returns}.py+ extensions tofacts.pyapp/shared/seeder/core.py(_generate_exogenous, returns, expanded delete + verify, expandedSeederResult)app/features/seeder/{schemas,service,routes}.py(+6 fields, +GET /seeder/exogenous, +ChangepointEventParam, +ExogenousSignalResponse)docs/DATA-SEEDER.mdPhase 1 sectionTest plan
uv run ruff check .— cleanuv run ruff format --check .— cleanuv run mypy app/— 0 issues, 175 filesuv run pyright app/— 0 errors (49 pre-existing warnings)uv run pytest -m "not integration"— 786 passed (4 pre-existing.env-bleed failures, confirmed againstdevbaseline)uv run pytest -m integration— 110 passed (including 8 new Phase 1 + 16 existing seeder DB tests)uv run alembic downgrade -1 && uv run alembic upgrade head— roundtrips cleanly on real PostgresNon-goals (deferred to later phases)
Out-of-band
The 4 failing config/agent-key tests are the pre-existing
.env-bleed issue documented indocs/_base/RUNBOOKS.md; they fail identically onorigin/devand are unrelated to this PR.