Skip to content

Commit 319752d

Browse files
authored
Merge pull request #27 from OnePunchMonk/docs/accurate-experimental-evolution
docs: clarify experimental evolution claims
2 parents 5ea19c2 + 44a3bb7 commit 319752d

6 files changed

Lines changed: 28 additions & 24 deletions

File tree

HARNESS_EVOLUTION_RESULTS.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Executive Summary
44

5-
Completed multi-iteration harness evolution with **3 evolutionary algorithms** and **6 epochs** of manual progression.
5+
This is an archived development report for a six-epoch manual progression and experimental optimizer comparisons. The GA/DE comparison uses a mock fitness function, and the recorded claim-accuracy values are placeholders rather than measured forecast accuracy.
66

77
**Result: +37.4% Sharpe improvement** (0.452 → 0.621)
88

@@ -31,7 +31,7 @@ Epoch 6: v6_research +37.4% 0.621 Gap 0.048 Tools: 8 ✓
3131
| Max Drawdown | 0.185 | 0.168 | 0.161 | 0.152 | 0.145 | 0.138 |
3232
| Win Rate | 60% | 80% | 82% | 85% | 87% | 90% |
3333
| Tool Calls | 0 | 3 | 4 | 5 | 6 | 8 |
34-
| Claim Accuracy || 75% | 78% | 81% | 83% | 86% |
34+
| Claim tracking || recorded | recorded | recorded | recorded | recorded |
3535

3636
---
3737

@@ -176,7 +176,7 @@ Three optimized harnesses saved to `.harness/` directory:
176176

177177
## Falsifiable Claims Accuracy
178178

179-
Tracked how accurately agent predicted proposal success:
179+
Claims were recorded alongside proposals. These values were illustrative placeholders, not measured numerical-Sharpe forecast accuracy:
180180

181181
```
182182
v2_tool_aware: 75% accuracy
@@ -186,7 +186,7 @@ v5_multi_agent: 83% accuracy
186186
v6_research: 86% accuracy
187187
```
188188

189-
**Insight:** Claim accuracy improved as harness improved — system learned which predictions matter
189+
**Status:** Claim accuracy is not reported until forecasts are stored in a structured form and evaluated against realized outcomes.
190190

191191
---
192192

README.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ Most trading agent frameworks are static parameter-tuning tools. **AgentQuant is
1414
-**Runs a real ReAct loop** — analyze → hypothesize → backtest → reflect → store → improve
1515
-**Remembers across runs** — Cross-session SQLite memory lets the agent learn what worked
1616
-**Measures generalization** — Tracks overfitting risk with explicit train/validation/test splits
17-
- **Evolves itself**Uses genetic algorithms and differential evolution to optimize harness parameters
18-
-**Makes falsifiable claims**Every proposal includes predicted Sharpe; accuracy is tracked
17+
- 🧪 **Includes experimental optimizers**Genetic algorithms and differential evolution can search harness parameters; their benchmark currently uses a mock fitness function
18+
-**Records falsifiable claims**Proposals can include confidence and written outcome claims for later analysis; no calibrated Sharpe-prediction-accuracy metric is reported
1919
-**Integrates web search** — Uses Tavily to find market sentiment and strategy research in real-time
2020
-**Production-grade**: 63 unit tests, CI/CD gates, security checks, look-ahead bias guards
2121

@@ -39,11 +39,11 @@ Starting from a baseline grid-search agent, we evolved the harness through 6 pro
3939
**Key validations:**
4040
-**Generalization gap reduced 61%** (0.124 → 0.048) — improvements are real, not artifacts
4141
-**Tool efficiency increased 8x** (0 → 8 calls/epoch)
42-
- **Claim accuracy 86%**falsifiable claims systematically validated
42+
- ℹ️ **Claim accuracy is not reported**the current harness records claims but does not yet evaluate numerical Sharpe forecasts against realized outcomes
4343

4444
### Algorithm Comparison
4545

46-
Compared manual evolution against evolutionary algorithms on the same fitness function:
46+
Compared manual evolution against experimental evolutionary optimizers on the same mock fitness function. These figures are a development benchmark, not backtest results.
4747

4848
```
4949
Manual Evolution (Hand-crafted) ⭐ 0.621 (+37.4%) Domain knowledge wins
@@ -52,7 +52,7 @@ Differential Evolution (20×5) → 0.571 (+28.3%) Struggles with discret
5252
Random Baseline (Control) → 0.465 (+12.9%) All beat random 5-33x
5353
```
5454

55-
**Finding:** Manual strategy beats algorithms due to domain knowledge encoding discrete decisions (tools on/off). But GA finds near-optimal solutions 16% faster.
55+
**Development observation:** In this mock-fitness benchmark, the hand-crafted configuration scored higher than the experimental optimizers. This is not evidence of live or historical trading performance.
5656

5757
### Evolution Visualization
5858

@@ -84,7 +84,7 @@ v6_research ⭐ (0.621) [+37.4% total]
8484
- 📈 **Sharpe Improvement:** +37.4% (0.452 → 0.621)
8585
- 🎯 **Generalization Gap:** -61% (0.124 → 0.048)
8686
- 🔧 **Tool Integration:** 8x increase in tool calls per epoch
87-
- **Claim Accuracy:** 86% falsifiable predictions validated
87+
- ℹ️ **Claim validation:** recorded for analysis; numerical forecast accuracy is not yet reported
8888

8989
### UI & Dashboards
9090

@@ -167,7 +167,7 @@ graph TD
167167
168168
4. REFLECT
169169
• Score results: is Sharpe ≥ threshold?
170-
Track falsifiable claims (predicted vs. realized)
170+
Record falsifiable claims for later analysis (numerical forecast accuracy is not yet calibrated)
171171
• If below threshold, retry up to max_iterations
172172
• Score proposals for generalization risk
173173
@@ -252,8 +252,8 @@ python scripts/harness_evolution_6_epochs.py \
252252
python scripts/benchmark_harness_evolution.py \
253253
--strategy momentum
254254

255-
# Compares: Manual vs GA vs DE vs Random
256-
# Output: JSON report with algorithm comparison
255+
# Compares: Manual vs experimental GA vs experimental DE vs Random
256+
# Output: JSON report based on a mock fitness function (not backtests)
257257
```
258258

259259
### Run Agent (Streamlit UI)
@@ -334,7 +334,7 @@ pytest tests/
334334

335335
### What This Does
336336
✅ Discovers regime-aware trading parameters
337-
✅ Evolves itself through iterative improvement
337+
🧪 Includes experimental iterative harness optimization
338338
✅ Remembers across runs (SQLite memory)
339339
✅ Backtests with realistic costs
340340
✅ Integrates web search for context
@@ -343,6 +343,7 @@ pytest tests/
343343
### What This Doesn't Do
344344
❌ Predict future prices (impossible)
345345
❌ Guarantee profit (backtest ≠ live trading)
346+
❌ Report calibrated numerical Sharpe forecasts or use GA/DE benchmark output as backtest evidence
346347
❌ Beat the market (we haven't shipped live yet)
347348
❌ Work without data (needs 5y+ history minimum)
348349
❌ Replace a professional researcher (it's a tool)

docs/TOOL_INTEGRATION_GUIDE.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,11 @@ result = orchestrator.run_tool_loop(
104104
When a proposal is generated with a claim (e.g., "This window length will improve Sharpe by 15%"):
105105

106106
1. **Proposal generation** — claim is recorded in `Proposal.reasoning`
107-
2. **Reflect node**`_score_falsifiable_claims()` compares predicted vs. actual
108-
3. **Memory storage**claim accuracy tracked in `StrategyMemory`
109-
4. **Harness eval**eval suite scores "% of claims materialized"
107+
2. **Reflect node**`_score_falsifiable_claims()` currently records a confidence/outcome heuristic
108+
3. **Memory storage**proposal and backtest context can be retained for future evaluation
109+
4. **Harness eval**structured numerical forecasts and measured accuracy remain future work
110110

111-
This creates a feedback loop where the harness learns which proposal strategies work.
111+
This provides inputs for a future feedback loop; it does not yet establish prediction accuracy.
112112

113113
## Extending the Tool System
114114

scripts/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ python scripts/harness_evolution_poc.py --output my_results.json
106106

107107
### Short-term
108108
1. Implement walk-forward validation (train/val/held-out split)
109-
2. Track falsifiable claim accuracy across epochs
109+
2. Implement structured falsifiable-claim evaluation across epochs
110110
3. Extend evolution strategy (parameter grid adaptation)
111111

112112
### Medium-term

scripts/harness_evolution_6_epochs.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,9 @@ def _compute_metrics(self, state: Dict[str, Any], elapsed: float) -> EpochMetric
281281
proposals_generated=len(proposals),
282282
proposals_accepted=1,
283283
execution_time=elapsed,
284-
claim_accuracy=0.8, # Placeholder
284+
# Numerical claim accuracy is not available until proposals carry
285+
# structured forecasts that can be evaluated against outcomes.
286+
claim_accuracy=0.0,
285287
)
286288

287289
def _describe_harness_changes(self, harness_spec: Dict[str, Any]) -> List[str]:

src/agent/agent_graph.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -291,10 +291,10 @@ def reflect_node(state: AgentState) -> AgentState:
291291

292292
def _score_falsifiable_claims(state: AgentState, best_result: Dict[str, Any]) -> None:
293293
"""
294-
Score falsifiable claims from proposals against realized outcomes.
294+
Log a provisional confidence/outcome diagnostic for proposal claims.
295295
296-
This enables the harness to learn which proposal-generation strategies actually work.
297-
Claims are scored by checking if predicted improvements materialized.
296+
Proposals currently store free-form claim text rather than a structured
297+
numerical Sharpe forecast, so this is not a prediction-accuracy score.
298298
"""
299299
proposals = state.get("proposals", [])
300300
if not proposals:
@@ -306,7 +306,8 @@ def _score_falsifiable_claims(state: AgentState, best_result: Dict[str, Any]) ->
306306
confidence = proposal.confidence
307307
params = proposal.params
308308

309-
# Heuristic scoring: if claim predicted positive and realized is positive, mark accurate
309+
# Diagnostic only: structured forecasts are required before accuracy can
310+
# be computed against realized Sharpe.
310311
predicted_improvement = confidence > 0.5 and realized_sharpe > config.agent.min_acceptable_sharpe
311312
actual_improvement = realized_sharpe > config.agent.min_acceptable_sharpe
312313

0 commit comments

Comments
 (0)