T-47: M1.2a — Scaffold tools/curate-etl Rust crate: split-factor table + un-adjustment core with local benchmark (no new crates)

This commit is contained in:
Studio 2026-11-27 15:39:38 -05:00
parent ce4b8fa91c
commit 4c8a621e48
4 changed files with 161 additions and 41 deletions

View file

@ -12,7 +12,7 @@ Aligned with `design/DATA-CONTRACTS.md` (§1 `qmSplits`, `eodPrices`, `eodIntrad
- No-op rows (`ratio == 1.0`) are dropped during `SplitTable::from_events`.
- Duplicate events on the same `ex_date` are multiplied (and dropped if reciprocal pairs cancel to `1.0`).
- Non-finite or `<= 0.0` ratios and compounding overflow/underflow return a typed `SplitError` rather than panicking.
- **Ex-date boundary (strict `>`):** `cum_factor_after(key, bar_date)` returns the product of all split ratios with `ex_date > bar_date`. A bar dated on the ex-date itself is already post-split (`factor = 1.0`). Unknown keys and post-split dates return `1.0`.
- **Ex-date boundary (strict `>`):** `cum_factor_after(key, bar_date)` returns the product of all split ratios with `ex_date > bar_date`. A bar dated on an ex-date excludes that day's split (it is already post-split for that event) while still including any later splits (for example, NVDA on its `2021-07-20` 4:1 ex-date still has `factor = 10.0` from the later `2024-06-10` 10:1 split). Unknown keys and dates with no later splits return `1.0`.
- **`eodPrices` (daily bars):** OHLC is raw and only volume is retroactively split-adjusted:
- `raw_volume = unadjust_volume(adj_volume, factor) = adj_volume / factor`
- **`eodIntraday1M` (1m bars, reused in M2):** both OHLC and volume are retroactively split-adjusted: