You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: wire harness config, real generalization gap, honest run status/trace (#28)
Address P0 blockers from #28: thread harness config through proposal
generation/tools/prompts/stopping policy with clear errors on
unsupported knobs; compute generalization gap from search vs holdout
sharpe instead of a within-search formula that always returned ~0;
isolate/seed reproducible_benchmark.py arms and read holdout_sharpe;
stop collapsing all hypothesize events to llm_call and marking usage
as zero when actually unknown; separate passed_quality_gate,
budget_exhausted, no_valid_candidate, and execution_failed outcomes;
persist a run manifest (data hash, config hash, seeds, candidates,
fallback path, failures); reconcile README/results claims with an
evidence table.
> **This document predates the generalization-gap fix and harness-config-threading work
4
+
> on `fix/harness-p0-issue-28`.** The "Gap" column below was computed as
5
+
> `max(avg_sharpe - best_sharpe, 0)` across in-sample search results only — it never
6
+
> compared to held-out/out-of-sample performance, so it is not a real generalization
7
+
> gap and should not be cited as one. It also predates the epoch harness configs
8
+
> actually being threaded through `run_agent` at all (Epochs 4-6's "grid_adaptation"
9
+
> and "ensemble" settings had no effect on execution when this report was produced).
10
+
> Treat every number in this file as **unverified legacy** per the README's Evidence
11
+
> Table, not as measured historical results. To regenerate a trustworthy version of
12
+
> this report, run `python3 scripts/harness_evolution_6_epochs.py` on the current
13
+
> branch and cite the resulting `results.json` + `experiments/run_manifests/*.json`.
2
14
3
15
## Executive Summary
4
16
5
17
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.
- ℹ️ **Claim accuracy is not reported** — the current harness records claims but does not yet evaluate numerical Sharpe forecasts against realized outcomes
124
-
125
-
### Algorithm Comparison
126
-
127
-
Compared manual evolution against experimental evolutionary optimizers on the same mock fitness function. These figures are a development benchmark, not backtest results.
Genetic Algorithm (20×5) → 0.594 (+35.6%) Only 2.7% behind, faster
132
-
Differential Evolution (20×5) → 0.571 (+28.3%) Struggles with discrete decisions
133
-
Random Baseline (Control) → 0.465 (+12.9%) All beat random 5-33x
134
-
```
135
-
136
-
**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.
|**Fixture / demo**| Deterministic synthetic price paths, offline, no API keys. Useful for testing wiring (config threading, holdout mechanics), not for judging strategy quality. |`reproducible_benchmark.py` 1-vs-3-iteration holdout Sharpe comparison |`python3 scripts/reproducible_benchmark.py --output results/reproducible_benchmark.json`|
116
+
|**Measured historical experiment**| Real OHLCV history (yfinance), an actual `run_agent`/epoch execution, with in-sample search Sharpe reported separately from held-out Sharpe. Still a single historical window, not a claim about future/live performance. | 6-epoch harness evolution runs, each producing a `HarnessConfig` hash + run manifest |`python3 scripts/harness_evolution_6_epochs.py --strategy momentum --output results.json`|
117
+
|**Unverified legacy**| Numbers that appeared in earlier revisions of this README/results docs without an attached command, manifest, or seed. Treat as anecdotal until reproduced; do not cite as validation. | Prior "Live Results" table (removed) | none — this is exactly the gap this section replaces |
118
+
119
+
**What the code actually measures today, and what it doesn't:**
120
+
- ✅ Search-set Sharpe and holdout-set Sharpe are reported separately (`agent_graph.holdout_eval_node`); the generalization gap is `search_sharpe - holdout_sharpe` on the *same* winning proposal, and is reported as `unavailable` (not 0.0) when no holdout evaluation ran.
121
+
- ✅ Run outcome is one of `passed_quality_gate`, `budget_exhausted`, `no_valid_candidate`, or `execution_failed` — "we ran out of iterations and kept the best guess" is never reported as having passed the quality gate.
122
+
- ✅ GA/DE optimizer comparisons (see `docs/EVOLUTIONARY_HARNESS_OPTIMIZATION.md`) use a **mock fitness function**, not real backtests — treat any GA/DE numbers as algorithm-search behavior, not trading performance.
123
+
- ❌ There is no calibrated numerical Sharpe-forecast-accuracy metric yet; falsifiable claims are recorded as text, not scored against realized outcomes.
124
+
- ❌ "Tool calls per epoch" is a raw count, not an efficiency ratio; a change in tool-call count alone is not evidence of an efficiency improvement and should not be reported as one (the previous "8x efficiency" framing has been removed for this reason).
169
125
170
126
### UI & Dashboards
171
127
@@ -215,11 +171,11 @@ graph TD
215
171
```
216
172
217
173
**Implemented Features:**
218
-
- ✅ **Tool Orchestration** — Claude reasons over market context, web search, and research
219
-
-✅**Multi-Agent Ensemble** — Tool-based, grid search, and random proposals voted together
- ✅ **Tool Orchestration** — Claude reasons over market context, web search, and research; a resolved, versioned harness config gates tool admission (disabling tools yields zero tool-orchestrator calls) and prompt content
175
+
-🧪**Multi-Agent Ensemble** — Planned (epochs 5-6 in the harness sequence); the runtime currently rejects a harness config that requests ensemble voting (`use_ensemble=True`) with an explicit `UnsupportedHarnessKnobError` rather than silently ignoring it, since it is not wired through yet
176
+
- ✅ **Walk-Forward Validation** — A trailing holdout window is carved out before the search loop runs and is scored exactly once (`holdout_eval_node`), separate from in-sample search Sharpe
221
177
- ✅ **Memory Persistence** — Learns which strategies work in which market regimes
- ✅ **Falsifiable Claims** — Proposals record a written, falsifiable claim and confidence score; numerical Sharpe-forecast accuracy against realized outcomes is not yet computed or reported (no accuracy percentage should be cited until that scoring exists)
223
179
224
180
---
225
181
@@ -263,22 +219,26 @@ graph TD
263
219
The system itself evolves across epochs:
264
220
265
221
```
266
-
Epoch 1: Start with grid search
267
-
↓ (Analyze results: tools could help)
268
-
Epoch 2: Enable tools + Claude reasoning
269
-
↓ (Analyze results: need to refine prompt)
270
-
Epoch 3: Tune prompt based on v2 learnings
271
-
↓ (Analyze results: focus on winning parameters)
272
-
Epoch 4: Adapt grid to high-performers
273
-
↓ (Analyze results: ensemble improves robustness)
274
-
Epoch 5: Add multi-agent voting
275
-
↓ (Analyze results: need novel ideas)
276
-
Epoch 6: Deploy research agent
277
-
↓
278
-
RESEARCH HARNESS: 0.621 Sharpe, 61% gap reduction
222
+
Epoch 1: Grid search only (use_tools=False) -- implemented
223
+
Epoch 2: Enable tools + Claude reasoning (use_tools=True) -- implemented
224
+
Epoch 3: Tune prompt based on v2 learnings (prompt_template changed) -- implemented
225
+
Epoch 4: Adapt grid to high-performers (grid_adaptation_strategy) -- NOT wired: runtime raises
0 commit comments