Skip to content

Preserve calendar intent in versioned time contracts - #35

Merged
stefan-jansen merged 2 commits into
mainfrom
feat/time-contract-v2
Oct 16, 2026
Merged

stefan-jansen merged 2 commits into
mainfrom
feat/time-contract-v2

Conversation

@stefan-jansen

Copy link
Copy Markdown
Contributor

Problem and behavior

Legacy feed metadata collapses omitted calendar and explicit null, and with_overrides(calendar=None) cannot disable a declared calendar. Opt-in temporal contract version 2 preserves the distinction through JSON/YAML, nested market-data artifacts, copies and feed projections. Its resolver uses explicit calendar argument, declared metadata, then NYSE. Explicit None disables calendar handling.

Version 1 remains the default because old null payloads cannot reveal the producer's intent. Canonical serializers preserve their existing wire fields. Version 2 adds explicit bar-grid origin, timestamp side and partial-interval policy, plus distinct observation/expected-bar/session/elapsed unit values. Specs does not compute schedules or annualization. Existing consumers must adopt the resolver and canonical serializers before claiming conformance; dataclasses.asdict is not the version-2 wire format.

Closes #34.

Validation

  • Base ed74a25: the public metadata workflow preserves CME_Equity after a null override; omitted and null feeds compare equal. Initial regression checkpoint 362cbe7 produced 30 failures and one passing control, including missing new APIs, not 30 separate numerical defects.
  • Implementation ee125aa: 422 tests pass with 100% statement/branch coverage; Ruff, formatting, ty and commit hooks pass.
  • Strict MkDocs passes. Wheel built from sdist; all 40 new public-contract tests pass from an installed wheel in isolated Python 3.12 outside the checkout. Qualification artifacts retain the existing package version and are not a release.
  • Engineer issue 76 is validating the actual missing-bar consumer against this exact source. Cross-library compatibility and hosted checks remain required before merge. No complete runtime rollout is claimed.

AI assistance was used for design, implementation, tests and this description. The diff and executed behavior were reviewed directly; maintainers remain accountable for the change.

Copilot AI balanced review requested due to automatic review settings October 15, 2026 22:03

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 701bde6 into main Oct 16, 2026
30 checks passed
@stefan-jansen
stefan-jansen deleted the feat/time-contract-v2 branch October 16, 2026 23:23
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.

Preserve calendar intent and declare versioned bar-grid semantics

2 participants