Skip to content

fix: classify daily gaps against declared exchange sessions #89

Closed

Description

@stefan-jansen

Problem

Daily GapDetector classification counts exchange closures as missing observations. At main 28677d6, SyntheticProvider.fetch_ohlcv('SPY', '2025-07-11', '2025-07-14', 'daily') returns Friday and Monday bars; GapDetector().detect_gaps(df) incorrectly reports two missing observations. Python 3.14.3, Polars 1.43.2.

Expected behavior and implementation scope

Use the authoritative selected exchange schedule for daily observations. Canonical calendar selection is explicit calendar argument, then declared FeedSpec metadata, then NYSE, using Specs' shared resolver rather than another local resolver. Explicit None disables schedule classification; named 24/7 still detects absent days. Preserve the is_crypto=True compatibility hint only when neither an explicit calendar nor declared feed calendar is supplied.

Regressions cover Friday/Monday, July 4 closure, July 3 early close, actual missing crypto days, and an entire missing session across every asset. Detection never fills or mutates the input. Filling remains a separately requested operation; existing elapsed-grid fill behavior must not be represented as calendar-aware imputation.

Daily timestamps without declared event semantics retain their existing session-label meaning. Explicit event-time/bar-close declarations must not be silently treated as labels. Intraday clock logic, separate update-manager range planning, and futures roll calendars are separate changes, not claims of this repair. Specs source qualification is pinned to merged 701bde68744035050ede386efce498234c661c21; no new release or deployment is part of this issue.

Assistance

AI-assisted reproduction, implementation and verification under maintainer direction.

Activity

  1. added a commit that references this issue on Oct 20, 2026
    55b86e2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions