Skip to content

fix: plan and acquire daily backfills from declared sessions - #92

Merged
stefan-jansen merged 3 commits into
mainfrom
fix/calendar-backfill-ranges
Oct 17, 2026
Merged

stefan-jansen merged 3 commits into
mainfrom
fix/calendar-backfill-ranges

Conversation

@stefan-jansen

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

Copy link
Copy Markdown
Contributor

Closes #91

Outcome

The separate update/backfill range planner now uses authoritative daily exchange sessions with shared FeedSpec resolution: explicit selection, declared feed/stored metadata, then NYSE. Explicit None disables schedule classification; 24/7 preserves real weekend gaps. It covers leading/trailing ranges and entirely absent datasets, not just gaps between observations.

Daily range bounds are inclusive UTC-midnight session labels, and size_days/tolerance_days count missing selected sessions. Legacy exclude_weekends=False retains continuous days absent a canonical declaration; omission and True follow NYSE. Intraday/weekly legacy paths are not claimed repaired, and named declarations for those paths are rejected rather than ignored.

Backfill matches daily labels rather than midnight event bounds, so non-midnight provider bars are retained. It only acquires scheduled rows and cannot insert provider observations for closures inside a range. Declared label timezone survives storage's canonical UTC reads. Classification itself never fills or writes storage.

Reproduction and verification

  • Original production base55b86e250fd6279222876c5a1e4c20ae1469d7fa, imported from an isolated git archive: five actual workflow regressions fail on phantom July4 gaps, closed-only storage boundaries, and closed-date provider rows being inserted during backfill. No new-keyword TypeError is used as evidence for those five defects.
  • Regression-only6a90325: initial26 cases produce24 failures/2 controls passing.
  • Current head ee48e05 (production repair93c043d): tests/test_calendar_backfill_ranges.py and tests/test_update_manager.py pass86 cases with ResourceWarning as error, POLARS_MAX_THREADS=1. New producer/storage cases cover both Flat and Hive, all-asset missing sessions, explicit/null/continuous metadata including a real weekday outage, per-call overrides, boundaries, timezone labels and invalid-input atomicity. Six relevant incremental-strategy checks also pass.
  • Ruff lint/format, ty and commit hooks pass. Relevant incremental-strategy checks are also run locally. Full coverage/resource/platform/package/ecosystem and strict docs checks must pass in hosted CI before merge.
  • No local full suite or benchmark is launched during Backtest's workstation timing reservation. No release or deployment; 0.2.1 remains unchanged. The immutable Specs source pin is unchanged.

Review and assistance

AI-assisted source, regressions and prose under maintainer direction. Owner reviewed schedule independence from observed dates, range units/bounds, declared-null propagation, storage/backend parity, timezone restoration, provider-row selection and legacy compatibility. Full harmonization still requires the separate intraday/session API and roll-calendar repairs.

Copilot AI balanced review requested due to automatic review settings October 17, 2026 14:11

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 7571793 into main Oct 17, 2026
27 checks passed
@stefan-jansen
stefan-jansen deleted the fix/calendar-backfill-ranges branch October 17, 2026 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: plan daily backfill ranges from declared exchange sessions

2 participants