Skip to content

fix: restore inclusive date ranges and complete Massive histories - #85

Merged
stefan-jansen merged 6 commits into
mainfrom
codex/fix-correctness-73
Oct 15, 2026
Merged

stefan-jansen merged 6 commits into
mainfrom
codex/fix-correctness-73

Conversation

@stefan-jansen

@stefan-jansen stefan-jansen commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Outcome

Date ranges dropped requested observations in Fama-French, storage gap detection, the macro Yahoo fallback, and Finnhub. Massive OHLCV requests returned only the first aggregate page. This change includes the true month-end and end-date observations, interprets Finnhub dates in UTC, and follows Massive aggregate cursors.

Closes #73

The five commits preserve the authorship and co-author credit from quantum-like's PR #74. Its Kalshi and Polymarket fixes are already implemented by merged PR #76, so those commits are omitted.

Compatibility and numerical behavior

Results can include observations previously omitted at the end of a requested range, and Massive histories can contain more than 50,000 bars. No public signatures change. Storage gap detection no longer reports an absent final bar when that bar is stored.

Verification

Reviewed contributor revision: e09a0e8.
Original base: 885bc11.
Original replacement commits: 781a78d.
Reviewed integration head: 81fda99, based on merged main 72b5e9b.

The same seven contributor regression tests passed at their exact head and failed after restoring only their production files to the original base, under TZ=America/New_York. They exercise cached factor acquisition, real Hive storage, and the HTTP/download boundaries of the providers.

Executed at original replacement commit 781a78d (267 passed):

TZ=America/New_York uv run pytest -q -ra \
  tests/test_fama_french_provider.py tests/test_update_manager.py \
  tests/test_macro_downloader.py tests/test_finnhub_provider.py \
  tests/test_polygon_provider.py tests/providers/test_kalshi_history.py \
  tests/providers/test_polymarket_history.py

Ruff check and format checks on the ten changed files, plus uv run ty check, passed. The seven original negative-control node IDs were:

tests/test_fama_french_provider.py::TestFetch::test_fetch_month_filter_includes_final_calendar_day
tests/test_update_manager.py::TestGapDetectorStorage::test_detect_gaps_in_storage_keeps_bar_on_inclusive_end
tests/test_macro_downloader.py::TestMacroDataManager::test_download_from_yfinance
tests/test_finnhub_provider.py::TestFetchRawData::test_fetch_raw_data_uses_inclusive_utc_day
tests/test_kalshi_unit.py::TestKalshiFetchWithMocks::test_fetch_raw_data_uses_utc_calendar_bounds
tests/test_polymarket_unit.py::TestFetchOHLCV::test_fetch_price_history_uses_utc_day_bounds
tests/test_polygon_provider.py::TestIntegration::test_fetch_raw_data_follows_next_url

The simulated combination with PRs #81, #78, #80, and #83 passed 3,768 offline tests at 85.98% coverage and 3,768 tests with ResourceWarning treated as an error. Strict documentation and link validation, actionlint, pre-commit, wheel and sdist metadata, isolated installs, CLI help, and the README quick start passed. Public CI on this PR must complete before merge.

AI assistance

The original implementation was contributed through PR #74 by quantum-like with Cursor Agent assistance. Codex independently reviewed and reproduced the regressions, preserved the five applicable commits, and prepared and verified this replacement. The recorded commands and results support the proposed behavior changes.

Documentation and release

Include the five corrected date-range and pagination behaviors in the next patch release notes. The proposed release is 0.2.1 after the approved maintenance batch passes qualification on merged main.

cursoragent and others added 5 commits October 13, 2026 12:16
A YYYY-MM end bound used day 28, so daily and weekly observations on the
29th through the 31st were dropped from the requested month.

Co-authored-by: quantum-like <quantum-like@users.noreply.github.com>
Storage reads treat the end bound as exclusive, but gap detection treats
it as inclusive. A bar timestamped on the requested end date was omitted
and reported as a one-day gap.

Co-authored-by: quantum-like <quantum-like@users.noreply.github.com>
yfinance treats the download end as exclusive. The treasury fallback passed
the configured end through unchanged, so the last requested session was omitted.

Co-authored-by: quantum-like <quantum-like@users.noreply.github.com>
Naive datetimes were converted with the local timezone, and a date-only end
stopped at midnight, so the requested end day was shifted or truncated.

Co-authored-by: quantum-like <quantum-like@users.noreply.github.com>
OHLCV responses stopped after the first page. Requests larger than the
50,000-row limit silently returned only the earliest bars.

Co-authored-by: quantum-like <quantum-like@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 14, 2026 20:39

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@stefan-jansen
stefan-jansen merged commit f2a2252 into main Oct 15, 2026
27 checks passed
@stefan-jansen
stefan-jansen deleted the codex/fix-correctness-73 branch October 15, 2026 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants