Skip to content

feat(futures): prepare known-at individual-contract inputs - #128

Merged
stefan-jansen merged 40 commits into
mainfrom
feat/contract-facts
Oct 21, 2026
Merged

stefan-jansen merged 40 commits into
mainfrom
feat/contract-facts

Conversation

@stefan-jansen

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

Copy link
Copy Markdown
Contributor

Workflow and boundary

Closes #120. Prepare individual-contract source observations and dated definitions for known-at research decisions and consumer handoffs. Prerequisites #125-127 are merged. This is not a release or an execution engine.

  • Add FuturesInputs and prepare_futures_inputs, reusing file loaders, the dated registry, revision selection, FeedSpec calendars and native lagged roll strategies. Each call produces one current source-vintage decision per root/venue; callers repeat preparation at their actual historical decision cutoffs.
  • Preserve raw observations, stable IDs, source/definition revisions, lifecycle dates and field-specific publication. A later price correction does not hide an independently known OI fact. Unknown OI publication cannot inherit a price timestamp.
  • Export actual paired raw-leg marks and explicit currency/quote units. Unit conversion adjusts multiplier/tick consistently and leaves original prices intact. Typed empty outputs and custom feed/identity mappings remain supported. Coverage counts observations, not complete calendars or complete chains.
  • Reuse declared notice dates and selected calendars, without mutating caller strategies. Repair native zero-offset handling and deterministic equal-expiry ties. Keep dated source-symbol ordering independent of stable contract identity, including renames and ranking-lag observations.
  • Minimum-dependency installed tests reproduced false advertised floors: Polars0.20 cannot import the current package and PMC4.3 cannot construct the calendar. Raise only those requirement floors to Polars1.36.1/PMC5.4.0. They also reproduced real pandas2.3 Arrow timestamp truncation and Date32/64 misclassification; repair conversion while preserving explicit us/ns and civil-date semantics.
  • Add an offline loader/continuous-builder/prepared-input migration recipe and update existing guides. Data does not own broker fills, account state, settlement, margin, auto-close execution, BarData or synthetic price filling.

Executed qualification

  • Final source 95eea4787aab1d62b7cd31e5300ce7be4e554e4c: 80 source-file preparation cases pass with ResourceWarning errors. Final review reproduced and repaired the original-signature custom-strategy failure; seven native subclasses now retain their original API and tie policy. A producing-code mutation independently makes those regressions fail.
  • Seven formal premise/claim controls pass on correct source and fail deliberate producing-code defects; coverage reports seven covered, zero waivers/findings/deferrals. Additional failure controls cover native source-symbol/expiry ties and actual Arrow disk conversion.
  • Complete local runtime qualification at immediate parent e83e6b0868c36a04299c21f7b51d57bed1a0d104: 4,424 tests pass separately in native and ResourceWarning-error lanes, 292 external/slow/paid tests deselected, 86.67% coverage. Ruff lint/format, ty, strict docs, wheel/sdist, actionlint and all hooks pass. The final delta is the exact built-in dispatch guard, its seven regressions and guide updates, tested separately. This evidence is reused only within its unchanged scope. All applicable final-head hosted full-suite/platform/security/type/docs/package checks remain required before merge.
  • Final-head wheel and sdist (0.2.2.dev58+g95eea4787) each match all 172 packaged Git source files. Both actual isolated installs pass immutable Backtest 12a2c483f8f1fda54244af187db8bf44e6f85fc9 public ContractSpec/Position consumption: raw price4000->4010 times multiplier50 gives USD500; explicit cents-to-dollars normalization gives500.0000000000071 within declared1e-9 absolute tolerance. Specs0.2.0/Python3.12.11/pandas3.0.6/Polars2.0.0. This is candidate-source input consumption, not fills/account simulation or a released compatible stack.
  • Final exact-wheel minimum pair: 422 tests pass with Arrow and 412 with10 optional Arrow skips without it (48.96/48.47s), using Python3.12.11/Polars1.36.1/PMC5.4.0/pandas2.3.3. No harness warnings. Actual minimum tests exposed the import/calendar floor defects and Arrow timestamp/civil-date conversion defects; retained failing inputs and producing-code controls establish corrections.

AI assistance was used for code, regression tests and documentation; the Data owner reviewed the producing workflows, independent oracles and substantive diff. No legacy package is a mandatory dependency. No release, tag, package publication or documentation deployment.

Stefan Jansen added 30 commits October 20, 2026 16:53
…offs

Retain timestamp precision, declared label clocks and source keys. Keep sparse price panels reversible without filling observations or rounding integer prices. Exercise actual disk, calendar and recovery workflows plus an offline migration recipe.

Refs #117
Record the installed wheel/sdist consumer versions and the incompatible published Engineer boundary. Add a regression that retains a wholly null input session instead of compressing its clock.

Closes #117
…tinctions

Reproduce naive New York instants shifted to UTC incorrectly and preserve them through bounded disk reads. Keep source NaN distinct from null across price panels and retain pandas label timezones. Validate bad timezone metadata before replacing source generations.

Refs #117
Keep axis identity and native schema metadata serializable without Arrow as a runtime requirement. Exercise an actual pandas Parquet round trip retaining absent observations, nulls and source dtypes. Document the native panel APIs and remove unqualified storage timing claims.

Refs #117
Retain source terms, availability and unknown coverage without broker effects. Keep imported factor definitions explicit and reuse shared feed declarations. Refs #118.
…tor provenance

Add an offline CSV-to-disk workflow, explicit unknown-term coverage and destination-ID validation. Reject reserved factor output fields rather than silently overwrite their source method. Public workflow regression fails on e58be69 and passes after repair. Seven producer controls cover accepted premises. Closes #118.
Keep stable IDs separate from renamed or reused tickers. Select actual known-at revisions, enforce half-open intervals without rounding nanoseconds, and retain original membership provenance. Refs #119.
Expose the existing private factor-producing operation for causal history preparation without changing split/dividend definitions, validation or public defaults. Refs #119.
Select actual available source revisions and explicit raw/split/total-return bases. Preserve missing observations, share units and consumer field mappings. Use canonical session assignment for overnight label cutoffs and authoritative closes before native dividend factors. Keep the owning history batch open for identity integration, supplied-factor history and final qualification. Refs #119.
Select source factor revisions and their declared share basis without recomputing vendor or merger research factors. Preserve source provenance and unknown retrospective availability, reject causal gaps and conflicting methods, and keep broker consideration unavailable. Refs #119.
Resolve squash-ancestry-only conflicts by retaining the existing qualified action code and guide. Main has the exact bfc source tree; the resolved merge tree is byte-identical to existing3947654. Preserve both histories and require fresh main-head hosted checks.
Preserve the existing history source tree while incorporating the qualified prerequisite history. No source behavior change.
…ppings

Retain captured display symbols while normalizing to source stable IDs. Reject ambiguous venue/lifetime mappings and output collisions before returning a result. Causal history ignores unavailable future price revisions before identity resolution and retains matched identity provenance. Related focused history,registry,assets,storage and adjustment checks:271 ResourceWarning-clean passes.
…ssions

Reuse canonical batched session assignment when instant observations meet dated session identity intervals. Require captured ex-date close currency to match cash and price units. Retain actual failing public-input controls and typed-empty coverage;274 focused ResourceWarning-clean checks pass.
Retain pre-entry observations,source identity intervals and known-at revisions through actual CSV storage. Add supplied-factor causal-basis,units,coverage and immutable-source regressions and document native versus imported definitions. Seven producing-code failure controls cover the accepted premises without waivers. Full final-revision and installed consumer qualification remains required before closure.
Actual finite CSV terms can overflow under reciprocal or rational normalization,or underflow to zero. Validate the canonical ratio after normalization before publishing event facts. Three public-input regressions fail on5a4b and pass with the guard;134 focused adjustment/handoff ResourceWarning-clean tests pass.
Preserve all dated history work and incorporate the prerequisite's three source-ratio overflow/underflow regressions. Combined focused history,identity,assets,action,storage and conversion checks pass with ResourceWarning errors.
…cation

The native dated registry,source revision,raw/split/total-return and supplied-factor workflows retain source keys and missingness. Frozen history source passed4336tests per native/ResourceWarning lane and both installed artifacts passed actual public Engineer/Diagnostic consumption. The combined action-ratio repair passes288focused tests and all seven dated producer failure controls. Final current-head hosted main gates and artifact identity remain required before merge. Closes #119.
Actual captured source workflows preserve pre-event cash terms while converting the derived share basis,and retain the universe known at the earlier cutoff. Each regression passes correct code and fails its producing-operation violation. No runtime source change.
First bounded native preparation uses captured source-file loaders,dated registry mappings and existing lagged roll algorithms. Keep raw bars and separate metric publication eligibility,stable selection IDs,paired raw marks and explicit price units. Four public workflow tests cover native builder agreement,delayed OI,future revisions and missing old legs;470 focused canonical ResourceWarning-clean regressions pass. Further lifecycle,unit,edge and installed qualification remains under issue120;this checkpoint does not claim completion.
Source-file workflows reproduced ignored actual notice dates and a constructor calendar overriding the receiving API. Reuse scheduled offset logic with actual dates and copy native policies onto the selected feed calendar without mutating callers. An existing native zero-offset regression also failed because0became25;unknown offsets alone retain that fallback. Preserve raw cents and dimensionally correct normalized multipliers,and record policy parameters.476 canonical focused ResourceWarning-clean checks pass,plus10current preparation checks. Not final issue120 qualification.
A real captured price correction suppressed previously available OI and changed the current contract. Preserve eligible captures until each metric selects its own publication revision;price output still selects the latest known price. Keep source capture lineage,distinguish explicit metric revisions from repeated unchanged facts,and allow genuinely unknown optional OI without inventing values. Both actual source regressions fail90b and pass with the repair;482canonical focused ResourceWarning checks pass.
Retain the existing27fca source tree byte-for-byte while reconciling squash-only ancestry conflicts. Preserve both histories and require fresh final main-head hosted/package identity gates.290focused ResourceWarning tests and strict docs pass again.
Preserve the808c source tree exactly while incorporating the main-reconciled history prerequisite. No runtime or test behavior change;future final main-head gates remain required.
Copilot AI balanced review requested due to automatic review settings October 21, 2026 02: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.

Restrict automatic source-symbol tie mapping to built-in selectors. Existing custom subclasses retain the original selection method contract and their own tie policy. Seven captured-file regressions and a failing producing-code control cover the boundary. Record actual installed candidate versions and minimum-pair qualification.

Closes #120.
@stefan-jansen
stefan-jansen merged commit 31f45af into main Oct 21, 2026
27 checks passed
@stefan-jansen
stefan-jansen deleted the feat/contract-facts branch October 21, 2026 02:46
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.

Export known-at futures selections and dated lifecycle inputs

2 participants