145 Commits

Author SHA1 Message Date
TPTBusiness 7c22287793 fix: case-insensitive assertion in test_add_column_idempotent 2026-05-25 19:43:03 +02:00
TPTBusiness 4758de0eee refactor: remove all proprietary terms from codebase and git history
- Rename FTMO_* constants → generic names (RISK_PER_TRADE, MAX_DAILY_LOSS, etc.)
- Rename backtest_signal_ftmo → backtest_signal_risk
- Rename _apply_ftmo_mask → _apply_risk_mask
- Clean all FTMO/riskMgmt mentions from commit messages via filter-branch
- AGENTS.md: add non-negotiable rule — NEVER mention proprietary terms in commits/releases
- Code variables and function names sanitized project-wide
- Force-pushed rewritten history to remote
2026-05-22 15:10:36 +02:00
TPTBusiness e0000a18d2 feat: 15% monthly return target — infrastructure + daily signal resampling
Phase 1 — Infrastructure:
- RiskMgmt_RISK_PER_TRADE 0.5% → 1.5% (vbt_backtest.py)
- min_monthly_return_pct=15% acceptance filter (strategy_orchestrator)
- --min-monthly-return 15 CLI option (nexquant.py)
- {{ min_monthly_return }}% in strategy prompts
- MIN_MONTHLY_RETURN_PCT=15.0 in gen_strategies_real_bt + smart_strategy_gen
- realistic_backtest_all.py target_monthly 4→15%

Phase 2 — Factor quality:
- IC thresholds: prompt 0.05→0.08, bandit IC weight 0.10→0.20
- Explicite IC > 0.04 target in RAG prompt
- min_ic filters: data_loader 0.0→0.04, strategy_worker 0.02→0.04, ml_trainer 0.01→0.04

Architecture fix — Daily signal resampling:
- Factors have IC at daily resolution, but z-scores on 1-min collapse IC to ~0
- Resample factors to daily before strategy exec, ffill signal to 1-min for backtest
- Walk-forward IS years 3→1 (only 2 years of data available)
- Removed broken intersection() logic that destroyed 99.99% of 1-min data
- ffill stale propagation limited to 2880 bars (2 trading days)
- Fixed logger crash in _load_strategies
- Preflight: removed constant-signal check (false positive on random sandbox data)
- Tests: test_daily_signal_resampling.py (8 tests)

Non-negotiable rules: R1-R10 in AGENTS.md
2026-05-16 19:06:09 +02:00
TPTBusiness 0d9b0916f2 test: 434 deep hypothesis tests across RiskMgmt OOS, Kronos, auto-fixer, factor coder, pipeline, integration
- RiskMgmt OOS: 88 tests (leverage bounds, DD limits, trade counting, MC p-value, daily breach)
- Kronos adapter: 73 tests (OHLCV idempotence, batch/sequential equivalence, forward-fill)
- Auto-fixer: 78 tests (fix idempotence, MultiIndex conversion, fuzzing random patterns)
- Factor coder: 65 tests (FactorTask roundtrip, evaluator invariants, workspace paths)
- QLib pipeline: 61 tests (Metrics, bandit, precision matrices, noise_var)
- Integration: 69 tests (portfolio weights, correlation, RiskMgmt limits, JSON roundtrip)
2026-05-11 00:47:38 +02:00
TPTBusiness 827f80ce2e test: 343 deep hypothesis property-based tests across engine, DB, risk, ground truth, robustness, CV
- Backtest engine: 68 tests (IC symmetry, Sharpe formula, MaxDD bounds, cost monotonicity)
- Results DB: 78 tests (add_factor idempotence, metric roundtrip, sorting, persistence)
- Risk management: 71 tests (correlation PSD, MV weights, RP convergence, threshold checks)
- Ground truth: 44 tests (Sharpe sign, MaxDD, win_rate, signal invariants)
- Robustness: 44 tests (slippage, latency, MC reshuffle, OOS stress, random data)
- Cross-validation: 38 tests (IC ∈ [-1,1], scaling invariance, multi-instrument)
2026-05-10 23:42:46 +02:00
TPTBusiness a469692141 test: 441 deep property-based tests across CoSTEER, workflow, core, LLM utils, and formatting
- costeer_deep: 112 tests (knowledge base, feedback, evaluators, auto-fixer)
- workflow_deep: 84 tests (RDLoop, proposals, traces, hypothesis/pickle)
- core_deep: 74 tests (developer, evaluator, exceptions, experiment, scenario)
- llm_utils_deep: 49 tests (embeddings, APIBackend, edge cases, Unicode/NaN)
- utils_deep: 122 tests (shrink_text, templates, md5_hash, property-based, stress)
2026-05-10 22:14:11 +02:00
TPTBusiness a781d003ba test: deep tests for factor_runner (look-ahead fix, IC, dedup) and strategy_builder (combinator, evaluator)
- factor_runner: shift_daily_constant (property-based, 50 inputs), multi-instrument,
  NaN handling, edge cases (2-day, all-same, all-NaN), IC import, safe_float
- strategy_builder: combinator (pairs/triplets, category filtering, empty/single),
  evaluator (cost calc, safe names), builder import
2026-05-09 22:39:22 +02:00
TPTBusiness abca9eb899 fix: add hypothesis to test deps and fix missing imports in deep tests 2026-05-09 18:06:39 +02:00
TPTBusiness cbe1c52e00 refactor: rename project from Predix to NexQuant
Rename all source files, scripts, tests, documentation, and configuration
from Predix/predix to NexQuant/nexquant across the entire codebase.
2026-05-09 17:48:22 +02:00
TPTBusiness ba7458fba5 test: deep tests for predix_parallel (RunState, env, commands) and continuous_strategies (ML model)
- predix_parallel: 20 tests — RunState elapsed formatting (property-based, 200 inputs),
  status icons, API key loading, round-robin assignment, env building (local +
  openrouter), command building, edge cases
- continuous_strategies: 11 tests — build_ml_model (sufficient/insufficient data,
  OOS rejection, never-crashes property), config validation, style cycling
2026-05-09 08:50:13 +02:00
TPTBusiness 92ddcc47c7 test: deep tests for predix_gen_strategies_real_bt (36 tests)
- _rescale_thresholds: property-based fuzzing (200 random inputs),
  RSI toward-50 logic, small-threshold scaling, syntax preservation
- Factor loading: empty dir, sort by IC, top_n, missing parquet, corrupt JSON
- OHLCV loading: file-not-found, cache reuse
- TeeFile: writes to multiple handles, fileno delegation
- Backtest runner: sandbox execution, syntax error, missing signal
- Acceptance criteria: 7-parameter combinatorial check (daytrading + swing)
- Configuration: style defaults (daytrading vs swing)
2026-05-09 08:41:08 +02:00
TPTBusiness 160ac96130 test: deep property-based + fuzzing tests for backtest, verifier, and autopilot
- test_verify_runtime_deep: hypothesis property tests, fuzzing 1000 random results,
  invariant independence checking, edge cases (NaN, inf, negative trades)
- test_vbt_backtest_deep: property tests (cost monotonicity, signal inversion,
  max_dd invariants), edge cases (1 bar, empty, NaN, inf, mismatched lengths)
- test_autopilot: mocked orchestrator tests (failure recovery, counting logic,
  ensemble building, style cycling, hypothesis property tests)
2026-05-08 23:12:33 +02:00
TPTBusiness e029120090 chore: remove accidentally committed pycache files 2026-05-08 22:47:50 +02:00
TPTBusiness 4d9459a9f9 test: add tests for RDAgentLog debug() and LiteLLMAPIBackend 2026-05-08 22:47:41 +02:00
TPTBusiness d458e39940 fix: prevent LLM retry loop from consecutive assistant message corruption 2026-05-05 18:56:12 +02:00
TPTBusiness e76d5ab9cf fix: relax WF default test (wf_oos_sharpe_mean not present when 0 windows) 2026-05-05 06:44:04 +02:00
TPTBusiness d55bd518d3 docs: add closed-source test policy; remove closed-source test imports 2026-05-04 22:31:11 +02:00
TPTBusiness f99acca6e0 test: add 9 tests (verifier edge cases, factor loader, stability, MTF, save strategy) — 641 total 2026-05-04 22:19:49 +02:00
TPTBusiness 49a2c34c5c test: add 10 tests (continuous gen, strategy builder, live trader, factor integration) — 632 total 2026-05-04 22:11:39 +02:00
TPTBusiness 71ceb9c809 fix: update WF test for new default (wf_rolling=True) 2026-05-04 22:04:05 +02:00
TPTBusiness 7f5acccfd9 test: add 15 tests (WF details, optuna, preflight, signal validation, IC bounds) — 622 total 2026-05-04 21:56:28 +02:00
TPTBusiness a459518dfa test: add 15 tests (perf bounds, chaining, multi-index, metric bounds, factor runner edges) — 607 total 2026-05-04 21:43:18 +02:00
TPTBusiness 41c231e418 test: add 16 headform tests (docker mocks, spread, rollover, regression, cross-system) — 592 total 2026-05-04 21:39:27 +02:00
TPTBusiness 5c93c786e7 test: add 7 robustness tests (slippage, latency, MC-reshuffle, OOS, weekend gaps) — 576 total 2026-05-04 21:06:53 +02:00
TPTBusiness f5e55d2dad test: add 15 deepest tests (property-based, metamorphic, fuzzing, stress) — 569 total 2026-05-04 18:31:28 +02:00
TPTBusiness b78b9dea8c test: add 14 tests for final untested modules (runtime_info, repo_utils, json_loader) — 554 total 2026-05-04 18:21:31 +02:00
TPTBusiness 02083409e0 test: add 23 open-source tests (CLI, backtest edge cases, core utils, protections, env, log) — 540 total 2026-05-03 23:13:55 +02:00
TPTBusiness 06a5d5d92d refactor: move strategy_orchestrator and optuna_optimizer to closed-source (local/) 2026-05-03 21:38:09 +02:00
TPTBusiness 6d37f8956f feat: add runtime backtest verification (10 invariant checks in <1ms) + 489 tests + README docs 2026-05-03 14:00:49 +02:00
TPTBusiness 020bc11742 test: add 8 cross-implementation validation tests (IC/Sharpe/MaxDD cross-check, buy-and-hold equality, IC invariance) — closes 5% gap, 477 total 2026-05-03 13:53:43 +02:00
TPTBusiness 0f7eb908b4 test: add 10 ground-truth verification tests (hand-computed metrics, mathematical invariants, trend directions) — 469 total 2026-05-03 13:47:35 +02:00
TPTBusiness 4d8b389b47 test: add 13 final tests (walk-forward, dedup, e2e, edge-cases, cross-check, legacy-vs-new) — 459 total, 0 failures 2026-05-03 13:37:33 +02:00
TPTBusiness 72b9a735c9 test: add 28 deep-detail tests (look-ahead shift, alignment, safe_float, trade_pnl, MC p-value) — 446 total, 0 failures 2026-05-03 12:35:39 +02:00
TPTBusiness ce4a5b7b4f fix: correct MaxDD to equity curve in strategy_builder; test: add 8 cross-validation tests for metric correctness 2026-05-03 12:28:09 +02:00
TPTBusiness 037f7ba7d2 fix: correct Sharpe/MaxDD/WinRate in direct factor eval (was computing on raw factor, now on strategy returns) 2026-05-03 12:17:27 +02:00
TPTBusiness e31963713b test: add 31 tests for remaining modules (log, loader, doc_reader, scripts, fx_validator) — 410 total, 0 failures 2026-05-03 12:00:54 +02:00
TPTBusiness dc2a1a41f4 test: add 16 tests for eurusd, rl env, and all 379 tests now pass (0 failures) 2026-05-03 11:39:24 +02:00
TPTBusiness 1a530440c1 test: add 42 tests for remaining modules (conf, kb, interactor, fmt, llm_utils, graph) 2026-05-03 11:31:28 +02:00
TPTBusiness 13dbf27457 test: add 28 tests for LLM components, RL indicators, and model evaluators 2026-05-03 11:24:28 +02:00
TPTBusiness 49ebc19fd0 test: add 39 tests for fx_config, utils, predix_full_eval, exceptions, and log 2026-05-03 11:18:27 +02:00
TPTBusiness 58eb551898 test: add 4 tests for QuantTrace and QlibQuantHypothesis 2026-05-03 11:14:33 +02:00
TPTBusiness 2e18b7c104 test: add 24 tests for factor/model scenarios and experiments 2026-05-03 11:12:23 +02:00
TPTBusiness 28743eb043 test: add 33 tests for app config, strategy builder, and quant scenario 2026-05-03 11:09:55 +02:00
TPTBusiness a4d4266295 test: add 129 tests for critical untested code (core, CoSTEER, factor_coder, model_coder, qlib pipeline) 2026-05-03 10:59:24 +02:00
TPTBusiness 8f2ed4185f fix: add missing sys import and fix undefined acc_rate in factor eval 2026-05-03 10:19:59 +02:00
TPTBusiness aba88dd090 fix: 15 bug fixes across orchestrator, runner, backtest, and infrastructure
Critical:
- strategy_orchestrator: fix IndentationError that prevented import (line 764)
- factor_runner: fix literal 'sys.executable' string → variable (line 966)

High (path bugs causing wrong directories):
- backtest_engine: fix results_path depth (3→4 .parent hops)
- results_db: fix factors_dir/failed_dir depth (3→4 .parent hops)
- factor_runner: eliminate run_id variable shadowing (parallel_run_id/db_run_id)
- model_runner: fix DB connection leak on add_backtest exception
- optuna_optimizer: fix imported logger shadowed by module-level reassignment

Medium:
- env: handle non-UTF-8 Docker build output with errors='replace'
- env: guard conda env list parsing against empty lines
- factor_runner: add check=False + stderr logging for full-data subprocess
- strategy_orchestrator: log exec() exceptions at ERROR level with traceback
- strategy_orchestrator: warn on unreplaced {{template}} variables in prompts

Low:
- factor_runner: guard IC_max.index access against scalar (AttributeError)
- predix_parallel: close log file handle on Popen failure
- predix_rebacktest_strategies: replace 4 bare except: with except Exception:
2026-05-03 09:37:00 +02:00
TPTBusiness 28766c932e test: add regression tests for background task path and env bugs
- Verify parallel runner project_root is repo root, not scripts/
- Verify .env loading from correct path
- Verify API key distribution (single key, multi-key comma-separated)
- Verify CLI project_root depth (3 .parent hops, not 4)
- Verify start_loop uses sys.executable and child_proc, not pkill
- Verify parallel_cli does not hardcode model=local
- Verify all referenced scripts exist at resolved paths
2026-05-03 08:57:56 +02:00
TPTBusiness 02ac3f7aae test: add direct unit tests for _apply_riskmgmt_mask, safe_resolve_path, import_class, and _add_column_if_not_exists 2026-05-03 00:35:57 +02:00
TPTBusiness 2de7275b8f fix(auto-fixer): replace zero \$volume with price-range proxy for FX data
EUR/USD synthetic data has \$volume=0 for all rows, causing any VWAP or
volume-weighted factor to produce all-NaN output. Insert a guard after
pd.read_hdf() that replaces zero volume with (\$high - \$low) range proxy
so volume-dependent factors produce meaningful signals.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-27 16:07:06 +02:00
TPTBusiness 9691b64938 fix(auto-fixer): strip spurious .reset_index() after .transform() calls
LLM sometimes copies the .reset_index(level=N, drop=True) suffix from
groupby().rolling().method() patterns and adds it after .transform(),
but transform() already preserves the original index. The extra
reset_index() drops an index level and causes ValueError: 'cannot reindex
on an axis with duplicate labels' or shape mismatch on assignment.

Detect: any line containing both .transform( and .reset_index(level=..., drop=True)
Fix: strip the .reset_index() suffix from those lines.

Adds 1 new test (test_transform_reset_index_stripped) — total 30 tests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-27 15:57:04 +02:00