]> Piment Noir Git Repositories - freqai-strategies.git/commit
fix(reforcexy): align training, inference and reward analysis contracts
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Sat, 19 Sep 2026 21:36:04 +0000 (23:36 +0200)
committerGitHub <noreply@github.com>
Sat, 19 Sep 2026 21:36:04 +0000 (23:36 +0200)
commitb1c9538427baa49f14426573a459b709c0c30667
tree40770d36b536372c39099ef6c2d48cd1675c3beb
parent3b3f62f3b14adab9858e86f1c8d80a4fca83761a
fix(reforcexy): align training, inference and reward analysis contracts

* fix(reforcexy): account for portfolio transition returns

* fix(reforcexy): align training inference and reward analysis contracts

* fix(reforcexy): resolve statistical reporting and type-narrowing findings

- BH correction filters undefined p-values out of the finite family;
  non-applicable tests keep significant flags None and NaN adjusted values.
- Bootstrap percentile CIs validate finite ordered bounds only; constants
  keep exact degenerate bounds in both diagnostic modes without widening.
- Distribution diagnostics mark constant columns as N/A (skewness/kurtosis
  None, normality tests and Q-Q omitted) and reject fabricated fallbacks.
- Explicit independent_observations contract across hypothesis tests,
  bootstrap, shift metrics and report sections; trajectory report is
  descriptive (no inferential p-values/CIs unless declared independent).
- Distribution shift computes exact ks_2samp statistics on raw values;
  KS p-value reported only for independent observations.
- PBRS certification requires ordered-episode evidence: local identity
  F = gamma*next - prev, continuity, discounted boundary residual;
  non-canonical configurations are never certified from raw sums.
- Report renders actual bootstrap resample count, independent sections
  and N/A constant rows; transforms rename bounded asinh to softsign_sqrt
  without aliases; loss-potential bound docs corrected.
- Narrow Optional callback/env/attr types and force float arrays so the
  BasedPyright snapshot holds 142 diagnostics; ruff clean.

* docs(reforcexy): align HPO continuation contract with merged behavior

* fix(reforcexy): harden inference contracts and reward accounting

Isolate deployed policy on continuation, account open positions at
terminal liquidation, guarantee Python bool terminated, handle OHLC
drop without holdout, prune no-learning DQN trials, preserve replay
buffer and chronology across restarts and splits, propagate complete
observation validity, reset temporal caches on discontinuities, fix
terminal neutral potential in analysis, align history events with
transitions, enforce loss amplification threshold, honor simulated
unrealized PnL, keep idle duration past threshold, reject missing
real_episodes files and unknown overrides. Transport inference dates
through dk.data_dictionary with explicit length alignment guard.

* fix(reforcexy): address review follow-ups

* refactor(reforcexy): consolidate constants and helpers

* fix(reforcexy): close review follow-ups

* fix(reforcexy): address final review findings

* fix(reforcexy): apply final review corrections

* fix(reforcexy): harmonize diagnostic messages

* fix(reforcexy): clarify remaining diagnostics

* fix(reforcexy): align simulated pnl trajectories

* refactor(reforcexy): align replay pair terminology

* refactor(reforcexy): require explicit entry pnl

* fix: remove ReforceXY legacy compatibility paths

* fix: address PBRS review findings
29 files changed:
README.md
ReforceXY/.basedpyright/diagnostics.json
ReforceXY/reward_space_analysis/README.md
ReforceXY/reward_space_analysis/reward_space_analysis.py
ReforceXY/reward_space_analysis/test_reward_space_analysis_cli.py
ReforceXY/reward_space_analysis/tests/.docstring_template.md
ReforceXY/reward_space_analysis/tests/README.md
ReforceXY/reward_space_analysis/tests/api/test_api_helpers.py
ReforceXY/reward_space_analysis/tests/cli/test_cli_params_and_csv.py
ReforceXY/reward_space_analysis/tests/components/test_additives.py
ReforceXY/reward_space_analysis/tests/components/test_reward_components.py
ReforceXY/reward_space_analysis/tests/constants.py
ReforceXY/reward_space_analysis/tests/helpers/__init__.py
ReforceXY/reward_space_analysis/tests/helpers/assertions.py
ReforceXY/reward_space_analysis/tests/helpers/test_internal_branches.py
ReforceXY/reward_space_analysis/tests/helpers/test_utilities.py
ReforceXY/reward_space_analysis/tests/helpers/warnings.py
ReforceXY/reward_space_analysis/tests/integration/test_report_formatting.py
ReforceXY/reward_space_analysis/tests/pbrs/test_pbrs.py
ReforceXY/reward_space_analysis/tests/robustness/test_branch_coverage.py
ReforceXY/reward_space_analysis/tests/robustness/test_robustness.py
ReforceXY/reward_space_analysis/tests/statistics/test_statistics.py
ReforceXY/reward_space_analysis/tests/test_base.py
ReforceXY/reward_space_analysis/tests/transforms/test_transforms.py
ReforceXY/tests/test_portfolio_returns.py [new file with mode: 0644]
ReforceXY/tests/test_review_contracts.py [new file with mode: 0644]
ReforceXY/tests/test_training_observations.py [new file with mode: 0644]
ReforceXY/user_data/freqaimodels/ReforceXY.py
ReforceXY/user_data/strategies/RLAgentStrategy.py