Commit Graph

1266 Commits

Author SHA1 Message Date
dependabot[bot] 17bba1a920 chore(deps): Bump codacy/codacy-analysis-cli-action from 1.1.0 to 4.4.7 (#24)
Bumps [codacy/codacy-analysis-cli-action](https://github.com/codacy/codacy-analysis-cli-action) from 1.1.0 to 4.4.7.
- [Release notes](https://github.com/codacy/codacy-analysis-cli-action/releases)
- [Commits](https://github.com/codacy/codacy-analysis-cli-action/compare/d840f886c4bd4edc059706d09c6a1586111c540b...562ee3e92b8e92df8b67e0a5ff8aa8e261919c08)

---
updated-dependencies:
- dependency-name: codacy/codacy-analysis-cli-action
  dependency-version: 4.4.7
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-20 18:52:48 +02:00
dependabot[bot] 360df4083a chore(deps): Bump actions/checkout from 4 to 6 (#25)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-20 18:52:45 +02:00
dependabot[bot] e2c2fefe9a chore(deps): Bump actions/upload-pages-artifact from 3 to 5 (#26)
Bumps [actions/upload-pages-artifact](https://github.com/actions/upload-pages-artifact) from 3 to 5.
- [Release notes](https://github.com/actions/upload-pages-artifact/releases)
- [Commits](https://github.com/actions/upload-pages-artifact/compare/v3...v5)

---
updated-dependencies:
- dependency-name: actions/upload-pages-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-20 18:52:36 +02:00
TPTBusiness 32f7d66e07 feat(backtest): add rolling walk-forward validation and Monte Carlo trade permutation test
- monte_carlo_trade_pvalue(): shuffles trade P&L N times, returns fraction of
  permuted sequences that beat real total return (p<0.05 = genuine edge)
- walk_forward_rolling(): multiple IS/OOS windows (IS=3yr, OOS=1yr, step=1yr),
  computes wf_oos_sharpe_mean, wf_oos_consistency (% profitable windows)
- backtest_signal_ftmo(): new wf_rolling and mc_n_permutations params
- Strategy generator: enables both (200 MC permutations), adds mc_ok and wf_ok
  to acceptance filter (mc_p<0.20, wf_consistency>=50%)
- Rebacktest script: enables both, stores all wf_*/mc_* fields in write-back
- 6 new tests covering MC pvalue, disabled-by-default, zero-trades edge case,
  rolling WF key presence and consistency range

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 18:59:00 +02:00
TPTBusiness 4d6ef04411 test(backtest): add FTMO and OOS walk-forward validation tests
Covers backtest_signal_ftmo leverage caps, zero-signal, IS/OOS split keys,
bar counts, OOS independence from IS losses, and Monte Carlo permutation
tests (marked slow, excluded from default pytest run).

Also excludes slow-marked tests from default addopts in pyproject.toml.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 18:26:32 +02:00
github-actions[bot] a757eb4b79 chore(master): release 1.2.2 (#21)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
v1.2.2
2026-04-19 15:47:03 +02:00
TPTBusiness 1dc44d33ed chore(release): reset version to 1.2.1 2026-04-19 15:32:47 +02:00
TPTBusiness e672433305 chore(release): use patch bumps for feat commits before v1.0
Add release-please-config.json with bump-patch-for-minor-pre-major=true
so feat: commits produce patch bumps (2.2.0 → 2.2.1) instead of minor
bumps (2.2.0 → 2.3.0) while the project is pre-1.0.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
v1.2.1
2026-04-19 15:03:25 +02:00
TPTBusiness f875439105 feat(strategies): make OOS validation mandatory in strategy generator
OOS split is now enforced — no fallback to IS metrics. Strategies are
rejected if OOS data is missing or OOS sharpe/monthly <= 0. Feedback
to LLM now includes OOS metrics so it learns to build generalising strategies.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 14:54:56 +02:00
TPTBusiness 4afd03dbaf feat(backtest): add walk-forward OOS validation to backtest_signal_ftmo
Split IS (2020-2023) and OOS (2024-2026) periods with independent FTMO
simulations. Strategy acceptance now requires OOS sharpe > 0 and
OOS monthly return > 0 to prevent overfitting. OOS metrics stored in
strategy JSON summary and CSV reports.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 12:53:00 +02:00
TPTBusiness 90b36c174d feat(scripts): add full file logging to strategy generation and rebacktest scripts
Each script now creates a timestamped log file in git_ignore_folder/logs/,
captures all logging calls and Rich console output via _TeeFile, and prints
the log path at startup for easy tail access.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 15:37:03 +02:00
TPTBusiness 5da3ba6752 feat(backtest): use backtest_signal_ftmo in strategy orchestrator and optuna optimizer 2026-04-18 15:29:39 +02:00
TPTBusiness d8b5bc4237 feat(backtest): add FTMO-realistic backtest mode with leverage, daily/total loss limits and realistic EUR/USD costs 2026-04-18 15:27:41 +02:00
github-actions[bot] 5a6948d321 chore(master): release 2.2.0 (#19) v1.2.0 2026-04-18 12:51:41 +02:00
TPTBusiness c62d9c4efa fix(kronos): replace rdagent_logger with stdlib logging for CI compatibility 2026-04-18 12:24:47 +02:00
TPTBusiness 1a1bd2c712 feat(fin_quant): auto-generate Kronos factor before loop start
Adds _ensure_kronos_factor_in_pool() which runs automatically at the
start of every fin_quant / predix quant invocation. If the Kronos
factor is not yet in results/factors/values/, it generates it
(stride=500, batch=32 GPU) and computes IC via evaluate_kronos_model.
Writes a StrategyOrchestrator-compatible JSON so the factor is
immediately available to strategy generation without manual steps.
Is a no-op when the factor already exists with a valid IC.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 12:18:51 +02:00
TPTBusiness 999bbac08d perf(kronos): batch GPU inference via predict_batch — 75x faster
Replace sequential predict() calls with predict_batch() in both
build_kronos_factor and evaluate_kronos_model. Up to batch_size windows
processed simultaneously on GPU, reducing per-window time from ~10s to
~0.13s (10 windows in 1.3s on RTX 5060 Ti, 75x speedup).

Adds --batch-size / -b option (default 32) to both kronos-factor and
kronos-eval CLI commands. Falls back to single inference per window if a
batch fails. Refactors timestamp prep into _build_window_inputs helper.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 12:10:30 +02:00
TPTBusiness ea87495a6a perf(kronos): batch GPU inference via predict_batch — 75x faster
Replace sequential predict() calls with predict_batch() in both
build_kronos_factor and evaluate_kronos_model. Up to batch_size windows
are processed simultaneously on GPU, reducing per-window time from ~10s
to ~0.13s (measured: 10 windows in 1.3s on RTX 5060 Ti).

Adds --batch-size / -b option (default 32) to both kronos-factor and
kronos-eval CLI commands. Falls back to single inference per window if
a batch fails. Refactors timestamp preparation into _build_window_inputs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 12:04:44 +02:00
TPTBusiness 3a1adf7e0a fix(kronos): pass actual datetime Series to Kronos predictor timestamps
KronosPredictor.predict() requires x_timestamp and y_timestamp to be
pandas Series of datetime values for its calc_time_stamps() helper.
Previously we passed integer ranges (after reset_index), which raised
AttributeError on .dt.minute. Fixed by extracting datetime index values
before resetting and using future_idx for y_timestamp.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 10:12:51 +02:00
TPTBusiness e819dcc3b9 fix(kronos): lazy torch import to fix CI ModuleNotFoundError
Move top-level `import torch` into _cuda_available() helper so
kronos_adapter.py can be imported in CI environments without torch.
All device defaults resolved at runtime via lazy detection.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 10:00:45 +02:00
TPTBusiness 016eed7df7 feat: add Kronos CLI commands, expand tests, document in README
- predix kronos-factor: generate KronosPredReturn alpha factor via CLI
- predix kronos-eval: evaluate Kronos IC/hit-rate vs LightGBM via CLI
- 19 tests covering adapter, factor builder, model evaluator, CLI (mock-based)
- README: Kronos section in Features + CLI commands table
- Total test suite: 153 passed

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 09:53:56 +02:00
TPTBusiness 3f3a23bd38 feat: integrate Kronos-mini OHLCV foundation model (Option A + B)
Add Kronos-mini (4.1M params, AAAI 2026, MIT) as:
- Option A: predicted-return alpha factor via rolling daily inference
  (kronos_factor_gen.py — stride=96 bars/day, ~2k inference calls)
- Option B: standalone model evaluator alongside LightGBM
  (kronos_model_eval.py — IC / hit-rate vs actual realized returns)

KronosAdapter wraps NeoQuasar/Kronos-mini + Kronos-Tokenizer-2k,
auto-detects GPU, gracefully degrades if ~/Kronos repo is missing.
Factor output: MultiIndex (datetime, instrument) with KronosPredReturn.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 09:49:25 +02:00
dependabot[bot] 6868002beb chore(deps): Bump azure-identity from 1.17.1 to 1.25.3 (#15)
Bumps [azure-identity](https://github.com/Azure/azure-sdk-for-python) from 1.17.1 to 1.25.3.
- [Release notes](https://github.com/Azure/azure-sdk-for-python/releases)
- [Commits](https://github.com/Azure/azure-sdk-for-python/compare/azure-identity_1.17.1...azure-identity_1.25.3)

---
updated-dependencies:
- dependency-name: azure-identity
  dependency-version: 1.25.3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-18 09:16:20 +02:00
dependabot[bot] 0302fbe66a chore(deps): Bump psutil from 6.1.0 to 6.1.1 (#17)
Bumps [psutil](https://github.com/giampaolo/psutil) from 6.1.0 to 6.1.1.
- [Changelog](https://github.com/giampaolo/psutil/blob/master/docs/changelog.rst)
- [Commits](https://github.com/giampaolo/psutil/compare/v6.1.0...v6.1.1)

---
updated-dependencies:
- dependency-name: psutil
  dependency-version: 6.1.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-18 09:16:18 +02:00
TPTBusiness 89ef9fb33d docs: fix duplicate sections, add hardware requirements and data setup guide
- Remove duplicate Configuration and CLI Commands sections
- Add System Requirements table (GPU VRAM, RAM, CUDA)
- Expand Data Setup with concrete step-by-step instructions
- Add prerequisites checklist to Quick Start (Docker, data, LLM health)
- Consolidate all CLI commands into one section

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 09:16:02 +02:00
dependabot[bot] c533a0346d chore(deps): Update snowballstemmer requirement from <3.0 to <4.0 (#16)
Updates the requirements on [snowballstemmer](https://github.com/snowballstem/snowball) to permit the latest version.
- [Changelog](https://github.com/snowballstem/snowball/blob/master/NEWS)
- [Commits](https://github.com/snowballstem/snowball/compare/v2.0.0...v3.0.1)

---
updated-dependencies:
- dependency-name: snowballstemmer
  dependency-version: 3.0.1
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-18 09:09:39 +02:00
dependabot[bot] d91263a70c chore(deps): Bump scipy from 1.14.1 to 1.15.3 (#14)
Bumps [scipy](https://github.com/scipy/scipy) from 1.14.1 to 1.15.3.
- [Release notes](https://github.com/scipy/scipy/releases)
- [Commits](https://github.com/scipy/scipy/compare/v1.14.1...v1.15.3)

---
updated-dependencies:
- dependency-name: scipy
  dependency-version: 1.15.3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-18 09:09:36 +02:00
dependabot[bot] e650b01da0 chore(deps): Bump dill from 0.3.9 to 0.4.1 (#13)
Bumps [dill](https://github.com/uqfoundation/dill) from 0.3.9 to 0.4.1.
- [Release notes](https://github.com/uqfoundation/dill/releases)
- [Commits](https://github.com/uqfoundation/dill/compare/0.3.9...0.4.1)

---
updated-dependencies:
- dependency-name: dill
  dependency-version: 0.4.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-18 09:09:33 +02:00
dependabot[bot] 670585f640 chore(deps): Bump github/codeql-action from 3 to 4 (#12)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3 to 4.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v3...v4)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-18 09:09:31 +02:00
dependabot[bot] bdb1d03357 chore(deps): Bump actions/deploy-pages from 4 to 5 (#11)
Bumps [actions/deploy-pages](https://github.com/actions/deploy-pages) from 4 to 5.
- [Release notes](https://github.com/actions/deploy-pages/releases)
- [Commits](https://github.com/actions/deploy-pages/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/deploy-pages
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-18 09:09:29 +02:00
dependabot[bot] 8433795a4a chore(deps): Bump actions/cache from 4 to 5 (#10)
Bumps [actions/cache](https://github.com/actions/cache) from 4 to 5.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-18 09:09:26 +02:00
dependabot[bot] 210c4e8ad3 chore(deps): Bump codecov/codecov-action from 4 to 6 (#9)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4 to 6.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v4...v6)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-18 09:09:23 +02:00
dependabot[bot] 9e68c761b8 chore(deps): Bump actions/upload-artifact from 4 to 7 (#8)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 7.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4...v7)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-18 09:09:20 +02:00
github-actions[bot] ce2f0b951f chore(master): release 2.1.0 (#18)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
v1.1.0
2026-04-18 09:09:12 +02:00
TPTBusiness 5ee1a4ac5a docs: improve README badges, fix llama-server flags, clean up structure
- Fix CI badge branch main→master
- Add Security scan and Conventional Commits badges
- Fix llama-server flags: --parallel 2, --reasoning off (not --reasoning-budget 0)
- Remove duplicate Configuration section
- Add predix best command to CLI table
- Update Contributing section to use Conventional Commits format

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 08:50:59 +02:00
TPTBusiness cfba49d7c4 ci(codacy): fix ESLint/PMD/pylint SARIF crash
Add .codacy.yml to disable ESLint (no .eslintrc in web/), PMD (no Java
code), and Prospector; restrict analysis paths to rdagent/ core.
Limit codacy workflow to bandit-only to avoid IndexOutOfBoundsException
at Sarif.scala:185 caused by 14k+ pylint results overwhelming the
SARIF formatter.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 08:40:46 +02:00
TPTBusiness cb6cbd2bfc ci: add dependabot, conventional commits check, and scheduled weekly tests
- dependabot.yml: weekly auto-PRs for pip and github-actions deps
  (major version bumps ignored, reviewed manually)
- conventional-commits.yml: blocks PRs with non-conforming titles;
  warns on individual commits (required for release-please changelogs)
- scheduled-tests.yml: weekly pytest run on py3.10+3.11, plus
  dependency vulnerability audit via safety

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 08:35:19 +02:00
TPTBusiness 7a0f81f275 fix(optuna): fix inverted parameter range in Stage 2/3 when signal_bias is negative
`_sample_fine_params` and `_sample_very_fine_params` used `max(0.0, center - half_width)`
for all float parameters. When signal_bias=-0.95 (a valid Stage-1 result), this
produced low=0.0, high=-0.75 — an inverted range that causes Optuna to raise
ValueError on every trial, silently caught and returned as -inf.

Fix:
- Extract `_suggest_bounded()` helper with per-parameter floor values
- signal_bias floor is -1.0 (not 0.0 — it is a signed parameter)
- Guard against high <= low for both float and int suggestions
- Elevate trial failure logs from debug to warning so future regressions are visible

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 08:05:49 +02:00
TPTBusiness 0651faed92 feat: unified backtest engine, LLM error handling, strategy refactor
- Add vbt_backtest.py as single source of truth for all metric formulas
  (Sharpe, drawdown, IC, transaction costs) — backtest_engine.py and
  strategy_orchestrator.py now delegate to it
- Add LLMUnavailableError to exception.py; rd_loop.py catches it at the
  proposal stage and raises LoopResumeError to avoid corrupting trace
  history with None hypotheses
- Guard record() against None exp/hypothesis so loop resets leave
  trace.hist in a consistent state
- Refactor strategy_orchestrator and optuna_optimizer to use unified
  backtest path; remove duplicate metric calculation code
- Add predix_rebacktest_unified.py script for offline re-evaluation
- Update tests and README

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 22:52:07 +02:00
TPTBusiness 2baa8d3e65 fix(ci): remove CodeQL workflow (conflicts with default setup), drop duplicate lint job
- codeql.yml removed: GitHub default setup already runs CodeQL; advanced
  config upload fails when default setup is enabled
- ci.yml lint job removed: duplicate of lint.yml, fails on pre-existing
  violations unrelated to this PR

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 22:46:15 +02:00
TPTBusiness cfbe50e63e fix(ci): set JAVA_TOOL_OPTIONS UTF-8 in Codacy workflow
Fixes MalformedInputException when Codacy SARIF formatter reads Python
files containing non-ASCII characters.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 22:38:15 +02:00
TPTBusiness bc717ffe84 ci: add CodeQL workflow, switch release to release-please, simplify CI
- ci.yml: lint + bandit (PyCQA/bandit-action) + pytest test/backtesting/
- release.yml: switch from manual tag-based to release-please auto-changelog
- codeql.yml: new weekly + on-push CodeQL Python analysis

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 22:37:22 +02:00
Trading Prediction Technology fb8fba2668 Add Codacy security scan workflow
This workflow integrates Codacy security scans with GitHub Actions.
2026-04-17 22:07:29 +02:00
TPTBusiness 03346e7997 fix(deps): pin aiohttp>=3.13.4 to patch 4 CVEs
Explicitly require aiohttp>=3.13.4 to ensure the patched version is
installed regardless of what mlflow, langchain-community, or litellm
resolve as their transitive dependency.

Fixes Dependabot alerts #64, #67, #68, #73:
- CVE-2026-22815: unlimited trailer headers (memory exhaustion)
- CVE-2026-34515: UNC SSRF / NTLMv2 credential theft on Windows
- CVE-2026-34516: multipart header size bypass (DoS)
- CVE-2026-34525: duplicate Host header acceptance

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 22:02:07 +02:00
TPTBusiness ec2b8ec7af fix(security): replace relative_to() with realpath+startswith for CodeQL sanitization
Path injection (#22, #28, #29, #30):
- Switch from Path.relative_to() to os.path.realpath() + str.startswith()
  in all four path-validation sites across finetune and rl UI data_loader.py
  and finetune app.py. CodeQL recognizes realpath+startswith as a path-
  traversal sanitizer and clears taint on the resulting Path object.
- Also simplify finetune/app.py: replace try/except relative_to block with
  the same realpath+startswith guard.

Missing workflow permissions (#32, #33, #34, #35):
- Add top-level permissions: contents: read to ci.yml, docs.yml, lint.yml,
  and security.yml. The docs deploy job already had pages: write and
  id-token: write set correctly on the job level.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 21:59:03 +02:00
TPTBusiness 52bee1b35a fix(security): resolve CodeQL path-injection and clear-text-logging alerts
Path injection (#37, #39, #40):
- _safe_resolve() in app.py: return safe_root / candidate.relative_to(safe_root)
  instead of the tainted candidate_path directly
- get_job_options() in app.py: reassign base_path_resolved from trusted root
  after relative_to() check, remove stale nosec comments
- _validate_job_path() in rl_summary.py: return root-derived path and omit
  resolved_job from the error message to avoid information leakage

Clear-text logging (#38):
- eurusd_llm.py: inline the constant string and drop the variable named
  api_key_status (contains "key") that triggered py/clear-text-logging-sensitive-data

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 21:51:35 +02:00
TPTBusiness f5af707b79 fix(security): resolve CodeQL path-injection alerts in UI data loaders
After the relative_to() boundary check, reassign the path variable using
resolved_root / resolved_path.relative_to(resolved_root) so all subsequent
file operations use a path derived from the trusted application root rather
than the original user-supplied value. This breaks CodeQL's taint chain
(py/path-injection) while preserving identical runtime behaviour.

Fixes alerts #41, #42, #43, #44.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 21:49:30 +02:00
TPTBusiness 3ab0d236cf feat(logging): write complete LLM prompts and responses to daily JSONL log
Add log_llm_call() to daily_log.py that appends every LLM interaction
(system prompt, user prompt, response, duration_ms) as a JSON object to
logs/YYYY-MM-DD/llm_calls.jsonl. Call it from both chat completion paths
in base.py so all LLM activity — factor generation, strategy generation,
feedback, proposals — is captured in a human-readable, grep/jq-friendly
format alongside the existing binary pickle logs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 21:46:28 +02:00
Trading Prediction Technology a422b6ff3f Merge pull request #7 from TPTBusiness/dependabot/npm_and_yarn/web/follow-redirects-1.16.0 2026-04-16 16:54:21 +02:00
TPTBusiness 46cffe4879 fix(ci): fix closed-source asset check false positives in security workflow
- Remove git_ignore_folder/RD-Agent_workspace symlink from tracking
  (local symlink pointing to results/rd_agent_workspace, not for VCS)
- Rewrite closed-source check to use precise patterns:
  - grep -F for exact prefix matching (no regex metacharacter issues)
  - results/: allow README.md and .gitkeep, block everything else
  - .env: match only .env and .env.* files, not paths containing "env"
    (previously matched kaggle_environment.yaml, env.py, etc.)
  - Add explicit check for committed data files (*.db, *.h5, *.parquet, *.log)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 07:47:24 +02:00