Methods

Evaluation methodology, integrity controls, and reward design. Every claim on this site is either backed by a measured number or clearly marked as design intent.

Out-of-Sample Holdout Policy

All training data is restricted to dates before May 1, 2025. The subsequent 12+ months constitute the evaluation window that no model has seen during training.

OOS Cutoff
2025-05-01
static, enforced in CI
Holdout Window
12+ mo
evaluation data
Date Columns Checked
12
date, obs_date, ts, …

Static Enforcement (CI-Blocking)

test_oos_leakage.py runs 5 tests in the CI pipeline:

  1. test_sql_files_filter_training_tables — scans all .sql files; any query referencing 19 known training tables must include WHERE <date_col> < '2025-05-01'
  2. test_python_inline_sql_filters_training_tables — AST parses all Python files to extract SQL strings (including f-strings with JoinedStr nodes); same filter requirement
  3. test_oos_pragma_only_in_allowlisted_files — the @oos-eval-only pragma (for evaluation code that intentionally reads OOS data) must only appear in allowlisted files
  4. test_allowlist_entries_exist — validates every allowlisted file actually exists
  5. test_oos_cutoff_date_is_consistent — confirms cutoff date in test matches dashboard constants

Runtime Enforcement

bq_safe.py provides a TrainingBQClient wrapper that raises OOSLeakageError if a query touches a training table without the cutoff filter — defence-in-depth for dynamically constructed queries that static analysis might miss.

OOS Filter Impact on Training Data

TableTotal RowsPre-CutoffRemoved%
sentinel1_weekly_tank_features5,1244,57854610.7%
calendar_spreads20,27619,8044722.3%
market_prices40,01439,0629522.4%
release_clock1,1481,099494.3%
cot_positions3277525277.1%

Causal Leakage Prevention

During out-of-sample replay, the agent traverses historical decision points chronologically. Without safeguards, memory retrieval could access episodes recorded after the simulated timestamp — letting the agent "remember the future."

All 8 memory retrieval paths accept an optional query_ts parameter. When provided, each path applies a strict less-than filter:

Retrieval SiteFilterColumn
EpisodicMemory._bq_keyword_search()AND ts < @query_tsts
EpisodicMemory.get_recent()WHERE ts < @query_tsts
EpisodicMemory._local_search()ep.timestamp < query_tstimestamp
SemanticMemory._bq_search()AND first_observed < @query_tsfirst_observed
SemanticMemory.retrieve_relevant()fact.first_observed < query_tsfirst_observed
ProceduralMemory._bq_lookup()AND last_used < @query_tslast_used
ProceduralMemory.get_best_sequences()record.last_used < query_tslast_used
compare_to_history skillAND trade_date < @query_tstrade_date

Enforced by 16 dedicated tests in test_causal_leakage.py that verify local cache filtering, backward compatibility, and BQ query source code analysis.

Reward Function Design

Multi-Objective Formulation

R_total = R_directional + α·R_task + β·R_memory + γ·R_consistency + δ·R_retention − λ·C_cost + penalties

Default weights: α = 1.0, β = 0.5, γ = 0.3, δ = 0.2, λ = 0.1

ComponentDefinitionSignal Source
R_directionaltanh(pnl_realized / 10.0)Environment — subsequent price movement
R_taskSkill completion quality [0,1]LLM judge or heuristic
R_memoryreward_with − reward_without memoryCounterfactual differential
R_consistencyDirectional agreement across turnsInternal coherence
R_retentionprobe_pass_count / probe_totalRetention probe tests
C_costclip(cost / $0.50, 0, 1)API costs

Penalties

DPO Training Pipeline

Preference pairs are generated from environment feedback (not human annotation): trajectories whose recommended direction aligns with subsequent price movement are preferred. Target base model: Qwen 2.5 7B. Infrastructure is built; execution is deferred pending strategy refinement to ensure the P&L signal carries sufficient edge.

Statistical Methodology