claude-evolve 1.3.40 → 1.3.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +79 -354
- package/bin/claude-evolve-csv-fix +100 -0
- package/bin/claude-evolve-edit +33 -12
- package/bin/claude-evolve-ideate +79 -12
- package/bin/claude-evolve-main +16 -14
- package/bin/claude-evolve-run +3 -22
- package/bin/claude-evolve-status +27 -5
- package/bin/claude-evolve-worker +154 -34
- package/lib/config.sh +8 -0
- package/lib/csv-lock.sh +14 -4
- package/lib/csv_helper.py +40 -2
- package/lib/evolution_processor.py +10 -3
- package/package.json +1 -1
- package/templates/config.yaml +4 -0
package/bin/claude-evolve-edit
CHANGED
|
@@ -25,23 +25,27 @@ USAGE:
|
|
|
25
25
|
SELECTORS:
|
|
26
26
|
gen01, gen02, etc. Target specific generation
|
|
27
27
|
all Target all generations
|
|
28
|
-
failed Target all candidates with failed status
|
|
28
|
+
failed Target all candidates with failed status (includes retries)
|
|
29
29
|
complete Target all candidates with complete status
|
|
30
30
|
pending Target all candidates with pending status
|
|
31
31
|
running Target all candidates with running status
|
|
32
32
|
|
|
33
33
|
ACTIONS:
|
|
34
|
-
failed
|
|
35
|
-
complete
|
|
36
|
-
pending
|
|
37
|
-
|
|
34
|
+
failed Mark candidates as failed (keeps scores)
|
|
35
|
+
complete Mark candidates as complete (keeps scores)
|
|
36
|
+
pending Mark candidates as pending (keeps scores)
|
|
37
|
+
failed-retry1 Mark candidates for retry attempt 1 (bug fixing)
|
|
38
|
+
failed-retry2 Mark candidates for retry attempt 2 (bug fixing)
|
|
39
|
+
failed-retry3 Mark candidates for retry attempt 3 (bug fixing)
|
|
40
|
+
reboot Reset completely (delete .py files, clear scores, set pending)
|
|
38
41
|
|
|
39
42
|
EXAMPLES:
|
|
40
|
-
claude-evolve edit gen03 failed
|
|
41
|
-
claude-evolve edit failed pending
|
|
42
|
-
claude-evolve edit
|
|
43
|
-
claude-evolve edit
|
|
44
|
-
claude-evolve edit
|
|
43
|
+
claude-evolve edit gen03 failed # Mark all gen03 as failed
|
|
44
|
+
claude-evolve edit failed pending # Reset all failed candidates to pending
|
|
45
|
+
claude-evolve edit failed failed-retry1 # Convert failed to retry status (bug fixing)
|
|
46
|
+
claude-evolve edit complete failed # Mark all complete as failed for re-run
|
|
47
|
+
claude-evolve edit all pending # Mark everything as pending for re-run
|
|
48
|
+
claude-evolve edit gen02 reboot # Full reset of gen02 (delete files + clear data)
|
|
45
49
|
|
|
46
50
|
DESCRIPTION:
|
|
47
51
|
This command helps manage evolution runs when you need to re-evaluate candidates.
|
|
@@ -73,9 +77,9 @@ fi
|
|
|
73
77
|
|
|
74
78
|
# Validate action
|
|
75
79
|
case "$ACTION" in
|
|
76
|
-
failed|complete|pending|reboot) ;;
|
|
80
|
+
failed|complete|pending|failed-retry1|failed-retry2|failed-retry3|reboot) ;;
|
|
77
81
|
*)
|
|
78
|
-
echo "[ERROR] Action must be one of: failed, complete, pending, reboot" >&2
|
|
82
|
+
echo "[ERROR] Action must be one of: failed, complete, pending, failed-retry1, failed-retry2, failed-retry3, reboot" >&2
|
|
79
83
|
exit 1
|
|
80
84
|
;;
|
|
81
85
|
esac
|
|
@@ -100,12 +104,14 @@ update_candidates_status() {
|
|
|
100
104
|
import csv
|
|
101
105
|
import sys
|
|
102
106
|
import os
|
|
107
|
+
import re
|
|
103
108
|
|
|
104
109
|
csv_file = '$FULL_CSV_PATH'
|
|
105
110
|
selector = '$selector'
|
|
106
111
|
new_status = '$new_status'
|
|
107
112
|
clear_scores = '$clear_scores' == 'true'
|
|
108
113
|
|
|
114
|
+
|
|
109
115
|
try:
|
|
110
116
|
# Read CSV
|
|
111
117
|
with open(csv_file, 'r') as f:
|
|
@@ -139,6 +145,8 @@ try:
|
|
|
139
145
|
# Status selector
|
|
140
146
|
if selector == 'pending':
|
|
141
147
|
matches = current_status == '' or current_status == 'pending'
|
|
148
|
+
elif selector == 'failed':
|
|
149
|
+
matches = current_status.startswith('failed')
|
|
142
150
|
else:
|
|
143
151
|
matches = current_status == selector
|
|
144
152
|
|
|
@@ -210,10 +218,12 @@ delete_evolution_files() {
|
|
|
210
218
|
candidates_to_delete=$("$PYTHON_CMD" -c "
|
|
211
219
|
import csv
|
|
212
220
|
import sys
|
|
221
|
+
import re
|
|
213
222
|
|
|
214
223
|
csv_file = '$FULL_CSV_PATH'
|
|
215
224
|
selector = '$selector'
|
|
216
225
|
|
|
226
|
+
|
|
217
227
|
try:
|
|
218
228
|
with open(csv_file, 'r') as f:
|
|
219
229
|
reader = csv.reader(f)
|
|
@@ -231,6 +241,8 @@ try:
|
|
|
231
241
|
matches = False
|
|
232
242
|
if selector == 'pending':
|
|
233
243
|
matches = current_status == '' or current_status == 'pending'
|
|
244
|
+
elif selector == 'failed':
|
|
245
|
+
matches = current_status.startswith('failed')
|
|
234
246
|
else:
|
|
235
247
|
matches = current_status == selector
|
|
236
248
|
|
|
@@ -278,6 +290,15 @@ case "$ACTION" in
|
|
|
278
290
|
pending)
|
|
279
291
|
update_candidates_status "$SELECTOR" "" "false" # Empty status means pending
|
|
280
292
|
;;
|
|
293
|
+
failed-retry1)
|
|
294
|
+
update_candidates_status "$SELECTOR" "failed-retry1" "false"
|
|
295
|
+
;;
|
|
296
|
+
failed-retry2)
|
|
297
|
+
update_candidates_status "$SELECTOR" "failed-retry2" "false"
|
|
298
|
+
;;
|
|
299
|
+
failed-retry3)
|
|
300
|
+
update_candidates_status "$SELECTOR" "failed-retry3" "false"
|
|
301
|
+
;;
|
|
281
302
|
reboot)
|
|
282
303
|
echo "[INFO] Performing full reboot of '$SELECTOR'..."
|
|
283
304
|
delete_evolution_files "$SELECTOR"
|
package/bin/claude-evolve-ideate
CHANGED
|
@@ -328,10 +328,25 @@ CRITICAL CSV FORMAT RULES:
|
|
|
328
328
|
* Are impossible given the codebase structure
|
|
329
329
|
* Would break the algorithm interface requirements
|
|
330
330
|
|
|
331
|
+
⚠️ AVOID ONLY: Kelly floor/cap adjustments that assume leverage > 1.0 (these get clamped and have no effect)
|
|
332
|
+
|
|
333
|
+
✅ EXPLORE ANY CREATIVE IDEAS INCLUDING:
|
|
334
|
+
- **Machine Learning**: Neural networks, decision trees, ensemble methods (use train() method properly)
|
|
335
|
+
- **New Indicators**: Custom combinations, alternative calculations, multi-timeframe signals
|
|
336
|
+
- **Market Regime Detection**: VIX patterns, correlation shifts, volume analysis, cross-asset signals
|
|
337
|
+
- **Risk Management**: Dynamic stops, correlation-based position sizing, drawdown protection
|
|
338
|
+
- **Timing**: Time-of-day effects, calendar patterns, volatility timing
|
|
339
|
+
- **Alternative Strategies**: New sub-strategies, momentum scoring, mean reversion variants
|
|
340
|
+
- **Cross-Asset Signals**: Bond yields, sector rotation, crypto correlations
|
|
341
|
+
- **Multi-Timeframe**: Combining 30m/1h/daily signals for confirmation
|
|
342
|
+
- **Advanced Exits**: Profit targets, time-based exits, volatility-based exits
|
|
343
|
+
|
|
344
|
+
Think outside the box! The codebase supports sophisticated approaches - be creative and ambitious.
|
|
345
|
+
|
|
331
346
|
Example descriptions:
|
|
332
|
-
-
|
|
333
|
-
-
|
|
334
|
-
- Implement
|
|
347
|
+
- Train LSTM network on 30-day OHLCV sequences to predict next-day direction probability
|
|
348
|
+
- Add cross-correlation filter that reduces positions when TQQQ correlation with QQQ breaks down
|
|
349
|
+
- Implement intraday momentum using 30-minute data to adjust daily position sizes
|
|
335
350
|
|
|
336
351
|
Add exactly $count rows to the CSV file now."
|
|
337
352
|
|
|
@@ -391,10 +406,22 @@ CRITICAL CSV FORMAT RULES:
|
|
|
391
406
|
* What changes made this algorithm successful vs its parent
|
|
392
407
|
* What parameter ranges make sense given the implementation
|
|
393
408
|
|
|
409
|
+
⚠️ AVOID ONLY: Kelly floor/cap adjustments that assume leverage > 1.0 (these get clamped and have no effect)
|
|
410
|
+
|
|
411
|
+
✅ EXPLORE PARAMETER TUNING INCLUDING:
|
|
412
|
+
- **Entry/Exit Thresholds**: IBS_BUY_THRESHOLD, LARISSA_LOW_THRESHOLD, RSI levels, etc.
|
|
413
|
+
- **Indicator Periods**: ATR_PERIOD, RSI_PERIOD, moving average lengths, etc.
|
|
414
|
+
- **Strategy Weights**: Emphasize best performers or rebalance for diversification
|
|
415
|
+
- **Risk Parameters**: Stop levels, timeout periods, correlation thresholds
|
|
416
|
+
- **Regime Parameters**: Volatility thresholds, trend detection sensitivity
|
|
417
|
+
- **ML Hyperparameters**: Learning rates, network sizes, ensemble weights (if using ML)
|
|
418
|
+
|
|
419
|
+
Be creative with parameter combinations and ranges - the system is sophisticated!
|
|
420
|
+
|
|
394
421
|
Example descriptions:
|
|
395
|
-
-
|
|
396
|
-
-
|
|
397
|
-
-
|
|
422
|
+
- Lower IBS_BUY_THRESHOLD from 0.15 to 0.12 to enter deeper oversold conditions
|
|
423
|
+
- Increase TRS_RSI_PERIOD from 2 to 3 for smoother RSI signals
|
|
424
|
+
- Raise WEIGHT_TDD from 0.38 to 0.42 to emphasize best performing strategy
|
|
398
425
|
|
|
399
426
|
Add exactly $count parameter tuning rows to the CSV file now."
|
|
400
427
|
|
|
@@ -454,10 +481,23 @@ CRITICAL CSV FORMAT RULES:
|
|
|
454
481
|
* What architectural decisions led to this algorithm's success
|
|
455
482
|
* Which components are essential vs which can be replaced
|
|
456
483
|
|
|
484
|
+
⚠️ AVOID ONLY: Kelly floor/cap adjustments that assume leverage > 1.0 (these get clamped and have no effect)
|
|
485
|
+
|
|
486
|
+
✅ EXPLORE STRUCTURAL INNOVATIONS INCLUDING:
|
|
487
|
+
- **Algorithm Architecture**: Replace sub-strategies, change combination logic, add new layers
|
|
488
|
+
- **Indicator Swaps**: RSI → Stochastic, SMA → Hull MA, Bollinger → Keltner, etc.
|
|
489
|
+
- **Machine Learning Integration**: Add neural networks, decision trees, reinforcement learning
|
|
490
|
+
- **Market Regime Systems**: Multi-regime detection, regime-specific strategies
|
|
491
|
+
- **Risk Management Overhauls**: Portfolio heat, correlation-based sizing, adaptive stops
|
|
492
|
+
- **Multi-Asset Integration**: Cross-asset signals, sector rotation, bond/equity relationships
|
|
493
|
+
- **Time-Based Innovations**: Intraday patterns, calendar effects, volatility timing
|
|
494
|
+
|
|
495
|
+
The codebase is flexible - think architecturally about major improvements!
|
|
496
|
+
|
|
457
497
|
Example descriptions:
|
|
458
|
-
- Replace
|
|
459
|
-
-
|
|
460
|
-
-
|
|
498
|
+
- Replace 2-period RSI with LSTM-predicted momentum scores for TRS strategy
|
|
499
|
+
- Add ensemble voting system where sub-strategies vote on market regime
|
|
500
|
+
- Implement hierarchical risk budgeting with correlation-adjusted position sizing
|
|
461
501
|
|
|
462
502
|
Add exactly $count structural modification rows to the CSV file now."
|
|
463
503
|
|
|
@@ -517,10 +557,23 @@ CRITICAL CSV FORMAT RULES:
|
|
|
517
557
|
* Understand which components are compatible for merging
|
|
518
558
|
* Ensure the combined approach is technically feasible in the codebase
|
|
519
559
|
|
|
560
|
+
⚠️ AVOID ONLY: Kelly floor/cap adjustments that assume leverage > 1.0 (these get clamped and have no effect)
|
|
561
|
+
|
|
562
|
+
✅ EXPLORE CREATIVE COMBINATIONS INCLUDING:
|
|
563
|
+
- **Strategy Fusion**: Merge successful sub-strategies, combine entry/exit logic
|
|
564
|
+
- **Indicator Blending**: Mix different technical analysis approaches from successful algorithms
|
|
565
|
+
- **Machine Learning Hybrids**: Combine ML predictions with rule-based systems
|
|
566
|
+
- **Multi-Regime Integration**: Blend different regime detection methods
|
|
567
|
+
- **Risk System Combinations**: Merge multiple risk management approaches
|
|
568
|
+
- **Cross-Asset Blends**: Combine internal signals with external market data
|
|
569
|
+
- **Multi-Timeframe Fusion**: Blend signals from different time horizons
|
|
570
|
+
|
|
571
|
+
Think creatively about what worked in different algorithms and how to combine them!
|
|
572
|
+
|
|
520
573
|
Example descriptions:
|
|
521
|
-
- Combine
|
|
522
|
-
-
|
|
523
|
-
-
|
|
574
|
+
- Combine VIX regime filter from algorithm 3 with LSTM predictions from algorithm 5
|
|
575
|
+
- Merge volatility regime detection with machine learning momentum scoring
|
|
576
|
+
- Integrate multi-timeframe signals with correlation-based position adjustments
|
|
524
577
|
|
|
525
578
|
Add exactly $count hybrid combination rows to the CSV file now."
|
|
526
579
|
|
|
@@ -591,6 +644,20 @@ CRITICAL CSV FORMAT RULES:
|
|
|
591
644
|
- Leave performance and status fields completely empty (just commas)
|
|
592
645
|
- Use proper CSV quoting only when descriptions contain commas
|
|
593
646
|
|
|
647
|
+
⚠️ AVOID ONLY: Kelly floor/cap adjustments that assume leverage > 1.0 (these get clamped and have no effect)
|
|
648
|
+
|
|
649
|
+
✅ EXPLORE ALL CREATIVE POSSIBILITIES INCLUDING:
|
|
650
|
+
- **Machine Learning**: Neural networks, ensemble methods, reinforcement learning (use train() method)
|
|
651
|
+
- **Advanced Indicators**: Custom combinations, multi-timeframe signals, cross-asset indicators
|
|
652
|
+
- **Market Regime Detection**: VIX patterns, correlation analysis, volatility clustering
|
|
653
|
+
- **Risk Management**: Dynamic stops, portfolio heat, correlation-based position sizing
|
|
654
|
+
- **Alternative Strategies**: New sub-strategies, momentum variants, mean reversion innovations
|
|
655
|
+
- **Multi-Asset Signals**: Sector rotation, bond yields, commodity signals
|
|
656
|
+
- **Time-Based Patterns**: Intraday effects, calendar anomalies, volatility timing
|
|
657
|
+
- **Parameter Optimization**: Entry thresholds, indicator periods, strategy weights
|
|
658
|
+
|
|
659
|
+
Think outside the box - the system is sophisticated and can handle advanced approaches!
|
|
660
|
+
|
|
594
661
|
Add exactly $TOTAL_IDEAS algorithm variation rows to the CSV file now."
|
|
595
662
|
|
|
596
663
|
echo "[INFO] Generating $TOTAL_IDEAS ideas (legacy mode)..."
|
package/bin/claude-evolve-main
CHANGED
|
@@ -55,7 +55,7 @@ show_help() {
|
|
|
55
55
|
claude-evolve - AI-powered algorithm evolution tool
|
|
56
56
|
|
|
57
57
|
USAGE:
|
|
58
|
-
claude-evolve [--
|
|
58
|
+
claude-evolve [--working-dir=PATH] [COMMAND] [OPTIONS]
|
|
59
59
|
|
|
60
60
|
COMMANDS:
|
|
61
61
|
setup Initialize evolution workspace
|
|
@@ -69,16 +69,16 @@ COMMANDS:
|
|
|
69
69
|
help Show this help message
|
|
70
70
|
|
|
71
71
|
GLOBAL OPTIONS:
|
|
72
|
-
--
|
|
73
|
-
-h, --help
|
|
74
|
-
-v, --version
|
|
72
|
+
--working-dir=PATH Use alternate working directory (default: evolution/)
|
|
73
|
+
-h, --help Show help message
|
|
74
|
+
-v, --version Show version
|
|
75
75
|
|
|
76
76
|
EXAMPLES:
|
|
77
77
|
claude-evolve setup
|
|
78
78
|
claude-evolve ideate 5
|
|
79
79
|
claude-evolve run --timeout 300
|
|
80
80
|
claude-evolve analyze --open
|
|
81
|
-
claude-evolve --
|
|
81
|
+
claude-evolve --working-dir=evolution-abc run
|
|
82
82
|
|
|
83
83
|
For more information, visit: https://github.com/anthropics/claude-evolve
|
|
84
84
|
EOF
|
|
@@ -111,19 +111,19 @@ show_menu() {
|
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
# Parse global options
|
|
114
|
-
|
|
114
|
+
WORKING_DIR=""
|
|
115
115
|
while [[ $# -gt 0 ]] && [[ "$1" =~ ^-- ]]; do
|
|
116
116
|
case "$1" in
|
|
117
|
-
--
|
|
117
|
+
--working-dir)
|
|
118
118
|
if [[ -z ${2:-} ]]; then
|
|
119
|
-
echo -e "${RED}[ERROR] --
|
|
119
|
+
echo -e "${RED}[ERROR] --working-dir requires a directory path${NC}" >&2
|
|
120
120
|
exit 1
|
|
121
121
|
fi
|
|
122
|
-
|
|
122
|
+
WORKING_DIR="$2"
|
|
123
123
|
shift 2
|
|
124
124
|
;;
|
|
125
|
-
--
|
|
126
|
-
|
|
125
|
+
--working-dir=*)
|
|
126
|
+
WORKING_DIR="${1#*=}"
|
|
127
127
|
shift
|
|
128
128
|
;;
|
|
129
129
|
*)
|
|
@@ -132,9 +132,11 @@ while [[ $# -gt 0 ]] && [[ "$1" =~ ^-- ]]; do
|
|
|
132
132
|
esac
|
|
133
133
|
done
|
|
134
134
|
|
|
135
|
-
# Export
|
|
136
|
-
if [[ -n $
|
|
137
|
-
|
|
135
|
+
# Export config file path for subcommands
|
|
136
|
+
if [[ -n $WORKING_DIR ]]; then
|
|
137
|
+
# Remove trailing slash if present
|
|
138
|
+
WORKING_DIR="${WORKING_DIR%/}"
|
|
139
|
+
export CLAUDE_EVOLVE_CONFIG="$WORKING_DIR/config.yaml"
|
|
138
140
|
fi
|
|
139
141
|
|
|
140
142
|
# Check for updates (quick, non-blocking)
|
package/bin/claude-evolve-run
CHANGED
|
@@ -236,7 +236,6 @@ cleanup_workers() {
|
|
|
236
236
|
# Worker finished
|
|
237
237
|
if wait "$pid" 2>/dev/null; then
|
|
238
238
|
echo "[DISPATCHER] Worker $pid completed successfully"
|
|
239
|
-
consecutive_failures=0 # Reset counter on success
|
|
240
239
|
else
|
|
241
240
|
local exit_code=$?
|
|
242
241
|
if [[ $exit_code -eq 2 ]]; then
|
|
@@ -244,24 +243,7 @@ cleanup_workers() {
|
|
|
244
243
|
# Rate limits don't count as consecutive failures
|
|
245
244
|
else
|
|
246
245
|
echo "[DISPATCHER] Worker $pid failed with exit code $exit_code"
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
# Check if we've hit the failure limit
|
|
250
|
-
if [[ $consecutive_failures -ge $MAX_CONSECUTIVE_FAILURES ]]; then
|
|
251
|
-
echo "" >&2
|
|
252
|
-
echo "🚨🚨🚨 EVOLUTION STOPPED: TOO MANY FAILURES 🚨🚨🚨" >&2
|
|
253
|
-
echo "ERROR: $consecutive_failures consecutive worker failures detected" >&2
|
|
254
|
-
echo "ERROR: This indicates a systemic problem (Claude API issues, evaluator bugs, etc.)" >&2
|
|
255
|
-
echo "ERROR: Check logs and fix issues before restarting evolution" >&2
|
|
256
|
-
echo "🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨" >&2
|
|
257
|
-
echo "" >&2
|
|
258
|
-
|
|
259
|
-
# Shutdown all workers and exit
|
|
260
|
-
shutdown_workers
|
|
261
|
-
exit 1
|
|
262
|
-
fi
|
|
263
|
-
|
|
264
|
-
echo "[DISPATCHER] Consecutive failures: $consecutive_failures/$MAX_CONSECUTIVE_FAILURES"
|
|
246
|
+
# With retry mechanism, failures are normal - just keep processing
|
|
265
247
|
fi
|
|
266
248
|
fi
|
|
267
249
|
fi
|
|
@@ -406,9 +388,8 @@ else
|
|
|
406
388
|
echo "[DISPATCHER] No cleanup issues detected - proceeding with run"
|
|
407
389
|
fi
|
|
408
390
|
|
|
409
|
-
#
|
|
410
|
-
|
|
411
|
-
MAX_CONSECUTIVE_FAILURES=5
|
|
391
|
+
# With retry mechanism, we don't need consecutive failure tracking
|
|
392
|
+
# Failures are handled gracefully through the retry system
|
|
412
393
|
|
|
413
394
|
# Main dispatch loop
|
|
414
395
|
while true; do
|
package/bin/claude-evolve-status
CHANGED
|
@@ -105,12 +105,23 @@ fi
|
|
|
105
105
|
"$PYTHON_CMD" -c "
|
|
106
106
|
import csv
|
|
107
107
|
import sys
|
|
108
|
+
import re
|
|
108
109
|
|
|
109
110
|
csv_file = '$FULL_CSV_PATH'
|
|
110
111
|
show_brief = '$SHOW_BRIEF' == 'true'
|
|
111
112
|
show_winner_only = '$SHOW_WINNER_ONLY' == 'true'
|
|
112
113
|
evolution_context = '$EVOLUTION_CONTEXT'
|
|
113
114
|
|
|
115
|
+
def normalize_status(status):
|
|
116
|
+
'''Convert retry statuses to base status for counting.'''
|
|
117
|
+
if status.startswith('failed'):
|
|
118
|
+
return 'failed'
|
|
119
|
+
return status
|
|
120
|
+
|
|
121
|
+
def is_retry_status(status):
|
|
122
|
+
'''Check if status is a retry status.'''
|
|
123
|
+
return bool(re.match(r'^failed-retry[0-9]+$', status))
|
|
124
|
+
|
|
114
125
|
try:
|
|
115
126
|
with open(csv_file, 'r') as f:
|
|
116
127
|
reader = csv.reader(f)
|
|
@@ -126,6 +137,7 @@ try:
|
|
|
126
137
|
all_candidates = []
|
|
127
138
|
stats_by_gen = {}
|
|
128
139
|
total_stats = {'pending': 0, 'complete': 0, 'failed': 0, 'running': 0}
|
|
140
|
+
retry_count = 0
|
|
129
141
|
|
|
130
142
|
for row in rows[1:]:
|
|
131
143
|
if len(row) >= 1 and row[0]: # Must have an ID
|
|
@@ -139,19 +151,26 @@ try:
|
|
|
139
151
|
status = row[4] if len(row) > 4 and row[4] else 'pending'
|
|
140
152
|
performance = row[3] if len(row) > 3 and row[3] else ''
|
|
141
153
|
|
|
154
|
+
# Normalize status (failed-retry* becomes failed)
|
|
155
|
+
normalized_status = normalize_status(status)
|
|
156
|
+
|
|
157
|
+
# Count retries
|
|
158
|
+
if is_retry_status(status):
|
|
159
|
+
retry_count += 1
|
|
160
|
+
|
|
142
161
|
# Track by generation
|
|
143
162
|
if gen not in stats_by_gen:
|
|
144
163
|
stats_by_gen[gen] = {'pending': 0, 'complete': 0, 'failed': 0, 'running': 0}
|
|
145
164
|
|
|
146
|
-
if
|
|
147
|
-
stats_by_gen[gen][
|
|
148
|
-
total_stats[
|
|
165
|
+
if normalized_status in stats_by_gen[gen]:
|
|
166
|
+
stats_by_gen[gen][normalized_status] += 1
|
|
167
|
+
total_stats[normalized_status] += 1
|
|
149
168
|
else:
|
|
150
169
|
stats_by_gen[gen]['pending'] += 1
|
|
151
170
|
total_stats['pending'] += 1
|
|
152
171
|
|
|
153
172
|
# Collect for winner analysis (only completed with valid scores)
|
|
154
|
-
if
|
|
173
|
+
if normalized_status == 'complete' and performance:
|
|
155
174
|
try:
|
|
156
175
|
score = float(performance)
|
|
157
176
|
description = row[2] if len(row) > 2 else 'No description'
|
|
@@ -183,7 +202,10 @@ try:
|
|
|
183
202
|
print(f'📊 OVERALL: {total_candidates} total candidates')
|
|
184
203
|
print(f' • {total_stats[\"pending\"]} pending')
|
|
185
204
|
print(f' • {total_stats[\"complete\"]} complete')
|
|
186
|
-
|
|
205
|
+
failed_display = f'{total_stats[\"failed\"]} failed'
|
|
206
|
+
if retry_count > 0:
|
|
207
|
+
failed_display += f' ({retry_count} retries)'
|
|
208
|
+
print(f' • {failed_display}')
|
|
187
209
|
print(f' • {total_stats[\"running\"]} running')
|
|
188
210
|
print()
|
|
189
211
|
|