Skip to content

fix: adopt versioned calendar selection across Engine workflows - #152

Merged
stefan-jansen merged 21 commits into
mainfrom
codex/calendar-contract-v2
Oct 20, 2026
Merged

stefan-jansen merged 21 commits into
mainfrom
codex/calendar-contract-v2

Conversation

@stefan-jansen

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

Copy link
Copy Markdown
Contributor

Purpose

Closes #151. Implement the confirmed calendar contract on a next-version branch. The pending Backtest 0.1.13 candidate at e74bed7 and its artifacts remain unchanged.

Current reviewed head: a39bfea. Engine source bytes remain identical to qualified df10938. Current-head hosted qualification is complete; this is not a release or deployment request.

Behavior and compatibility

  • Explicit calendar=None disables calendars. Omission inherits declared feed metadata, then NYSE. Feed, Engine, result aggregation and schedules preserve that distinction.
  • Sparse config metadata inherits declared input fields. Explicit config declarations and existing positional timezone/frequency arguments retain priority.
  • Unversioned saved configs retain legacy null handling. Direct result selectors use the current explicit-None contract. Versioned JSON/YAML serialization and copying preserve omission versus null. The original 0.1 compatibility snapshot remains; the new boundary has a separate 0.2 snapshot.
  • Observation-mode annualization defaults to 252 return periods per numerical year, independent of cadence. Positive finite periods_per_year overrides survive serialization. CAGR uses (N-1)/scale years for N equity values.
  • Declared timestamp semantics govern sessions, funding validation and daily close scheduling. CME overnight event instants remain valid; session labels use date membership. Calendar-required weekly/month-end schedules reject explicit None.
  • Runnable crypto tutorials explicitly select crypto and assert the 365 scale.

Published dependency

Requires ml4t-specs>=0.2.0. The downloaded PyPI wheel SHA256 is cfd550d19b469f1b083d6ac3f83b235fe71aee19c28465f2ac2c8620064bae61. Its calendar module is byte-identical to the originally qualified immutable Specs source. All seven locks changed only Specs version/source identity; other package versions and sources are unchanged. Comparison locks resolved offline without licensed-source authentication.

Performance evidence

Retain the accepted October 13 measurements, including every sample, median, confidence interval, speed ratio, measurement date, environment and original source identity. The generated documentation preserves those numbers.

An explicit performance-impact review covers the exact current engine, timing runners, all seven dependency locks, current correctness evidence and original measurement identity. Review of the retained frozen workloads found no material impact: they use explicit legacy calendar metadata, do not use rebalance schedules, and preserve the dominant per-asset, broker and order-execution paths. The detailed analysis is retained in validation/REAL_STRATEGY_PERFORMANCE.json.

Matching numerical results alone cannot certify performance reuse. Material or unknown performance impact requires fresh measurements. Changed source, runner, selected dependency packages/artifacts or measurement inputs cannot silently inherit an earlier review. Raw lock hashes remain recorded. The parsed lock graph omits only the prerelease resolver permission: uv adding prerelease-mode="allow" without changing any selected package, source, artifact, hash or marker does not invalidate the evidence. Reviews validate before mutating the report and preserve the original measurement and correctness timestamps.

The separate October 17 timing attempt did not replace the accepted baseline. Completing its two native reference sides is not required to retain the reviewed accepted measurements. No new speed numbers are published here and no CI checks have been disabled.

Executed evidence

  • Public 42-case regression file against untouched e74bed7 plus the exact new Specs source: 32 failures and 10 positive controls. Intermediate public-workflow reproductions cover positional metadata, sessions/funding and legacy result selection.
  • Published-dependency source qualification: 47 calendar/support tests passed. Actual crypto tutorial base workflow failed independent calendar/scale assertions; all 10 affected runnable examples passed after correction.
  • Wheel at c6feb24 installed outside the checkout with published Specs 0.2.0: 42 public regressions passed. Installed documentation examples, Zipline migration, Diagnostic 0.1.4 handoff, typing consumer, independent reproducible builds, artifact and Twine checks passed. The unchanged wheel also passed the two handoff examples with published Diagnostic 0.1.9.
  • Wheel SHA256: f2621525858635f6da04c0f871a2241340ed4c1b119362471548f99ae496f51d. Sdist SHA256: f7ee38d0c234209d23cbc2af0afc6cb6f6dc4bf1dcb806bfeb0e00b045d42ae2.
  • Retained unchanged-runtime evidence: 697 focused tests, 66 required synthetic and 17 required real-strategy comparisons passed, with respectively 2 and 8 declared unsupported cases. Native correctness outputs were hash-verified and reused; Backtest outputs were fresh. All 17 fill/equity/terminal surface identities and counts match the previous accepted evidence.
  • The five initial reuse regressions failed on 391cc8a and passed after the fix. The final-head contract selection passed 35 tests in 12.33s at b49307a. Dependency-drift regressions use an actual uv-generated historical reference lock and cover direct measurements and reviewed reuse.
  • Strict documentation build, 9,089 rendered links, 38 external destinations and exact rendered source identity passed at 6631288. The final b49307a change affects only the dependency-test fixture; documentation content and generator are unchanged.
  • Current qualification repair reproduced the exact shared Python 3.15 failure: four contracts pass on b49307a, then fail after the actual uv resolver adds only the prerelease permission. The new public regression also fails on b49307a at the intended evidence assertion after successful resolution, and passes on the fix. A real alternative dependency lock remains rejected.
  • At the current source: 36 focused validator contracts pass; the complete suite passes 2,320 tests with 14 declared skips and coverage above the required 84%. Ruff, ty, generator/snapshot checks and ordinary commit hooks pass. Strict documentation builds successfully. All 17 accepted measurement records and original measurement identity remain byte-equivalent in decoded data; no timings were rerun.
  • All 42 applicable current-head checks succeeded, including supported platforms, compatibility, security, coverage, runtime regression, public parity, documentation and Build Package. The inapplicable Python 3.15 exception validator is skipped.

Remaining qualification

All applicable current-head checks have been inspected and pass; perform the ordinary reviewed-green merge. No new benchmark window or product-feature decision is required. Pending 0.1.13 licensed-source authentication remains a separate publication boundary; no authentication retry, release, tag or documentation deployment was performed.

AI assistance

Codex assisted with implementation, tests, documentation, code-path review and qualification harnesses under maintainer instructions. The evidence above distinguishes executed current checks from retained checks and pending qualification.

Adopt the immutable Specs temporal contract, keep legacy config payloads readable, and make explicit None select observation semantics. Qualify the next API boundary separately from the retained 0.1.13 candidate.
Regenerate lock metadata offline after the direct immutable source dependency. Preserve all other package versions and source identities; the public locked Zipline builder now succeeds.
…ication

Reproduce the shared Python 3.15 failure through uv resolution. Bind selected packages, artifacts, markers and lock declarations while excluding the resolver prerelease permission alone. Preserve raw identities and all 17 accepted measurement records, and keep actual dependency drift rejection. Full suite: 2320 passed, 14 skipped. Fixes qualification of #151.
Use a real uv-generated self-contained lock instead of requiring every platform package and build backend in the runner cache. Preserve the failing-base producer operation and the actual dependency-drift rejection control. Addresses the clean-runner failures at 7233675 without changing validator or runtime behavior.
@stefan-jansen
stefan-jansen marked this pull request as ready for review October 20, 2026 22:10
Copilot AI balanced review requested due to automatic review settings October 20, 2026 22:10
@stefan-jansen
stefan-jansen merged commit efbe057 into main Oct 20, 2026
43 checks passed
@stefan-jansen
stefan-jansen deleted the codex/calendar-contract-v2 branch October 20, 2026 22:10

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.

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.

Adopt versioned calendar selection through Engine, feed and results

2 participants