claude-evolve 1.8.18 → 1.8.19
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/bin/claude-evolve-edit
CHANGED
|
@@ -35,6 +35,7 @@ OPTIONS:
|
|
|
35
35
|
SELECTORS:
|
|
36
36
|
gen01, gen02, etc. Target specific generation
|
|
37
37
|
all Target all generations
|
|
38
|
+
winner Target the candidate with highest performance score
|
|
38
39
|
failed Target all candidates with failed status (includes retries)
|
|
39
40
|
complete Target all candidates with complete status
|
|
40
41
|
pending Target all candidates with pending status
|
|
@@ -56,6 +57,7 @@ ACTIONS:
|
|
|
56
57
|
|
|
57
58
|
EXAMPLES:
|
|
58
59
|
claude-evolve edit gen03 failed # Mark all gen03 as failed
|
|
60
|
+
claude-evolve edit winner pending # Reset the winner to pending (recalculate)
|
|
59
61
|
claude-evolve edit failed pending # Reset all failed candidates to pending
|
|
60
62
|
claude-evolve edit pending skipped # Skip all pending candidates
|
|
61
63
|
claude-evolve edit --recent-generations=15 failed pending # Reset only recent 15 gen failures
|
|
@@ -116,8 +118,8 @@ if ! validate_config; then
|
|
|
116
118
|
fi
|
|
117
119
|
|
|
118
120
|
# Validate selector format
|
|
119
|
-
if [[ "$SELECTOR" != "all" && ! "$SELECTOR" =~ ^gen[0-9]+$ && "$SELECTOR" != "failed" && "$SELECTOR" != "complete" && "$SELECTOR" != "pending" && "$SELECTOR" != "running" && "$SELECTOR" != "skipped" && "$SELECTOR" != "0perf" ]]; then
|
|
120
|
-
echo "[ERROR] Selector must be 'all', 'genXX' (e.g., gen01), or status ('failed', 'complete', 'pending', 'running', 'skipped', '0perf')" >&2
|
|
121
|
+
if [[ "$SELECTOR" != "all" && "$SELECTOR" != "winner" && ! "$SELECTOR" =~ ^gen[0-9]+$ && "$SELECTOR" != "failed" && "$SELECTOR" != "complete" && "$SELECTOR" != "pending" && "$SELECTOR" != "running" && "$SELECTOR" != "skipped" && "$SELECTOR" != "0perf" ]]; then
|
|
122
|
+
echo "[ERROR] Selector must be 'all', 'winner', 'genXX' (e.g., gen01), or status ('failed', 'complete', 'pending', 'running', 'skipped', '0perf')" >&2
|
|
121
123
|
exit 1
|
|
122
124
|
fi
|
|
123
125
|
|
|
@@ -201,19 +203,45 @@ try:
|
|
|
201
203
|
recent_gen_set = set(sorted_generations[:n_recent])
|
|
202
204
|
print(f'[INFO] Filtering to recent generations: {sorted(recent_gen_set)}', file=sys.stderr)
|
|
203
205
|
|
|
206
|
+
# For 'winner' selector, find the candidate with highest performance
|
|
207
|
+
winner_candidate_id = None
|
|
208
|
+
if selector == 'winner':
|
|
209
|
+
max_performance = None
|
|
210
|
+
for i in range(1, len(rows)):
|
|
211
|
+
row = rows[i]
|
|
212
|
+
if len(row) < 4:
|
|
213
|
+
continue
|
|
214
|
+
try:
|
|
215
|
+
perf_str = row[3].strip()
|
|
216
|
+
if perf_str and perf_str != '':
|
|
217
|
+
performance = float(perf_str)
|
|
218
|
+
if max_performance is None or performance > max_performance:
|
|
219
|
+
max_performance = performance
|
|
220
|
+
winner_candidate_id = row[0]
|
|
221
|
+
except (ValueError, IndexError):
|
|
222
|
+
continue
|
|
223
|
+
|
|
224
|
+
if winner_candidate_id:
|
|
225
|
+
print(f'[INFO] Winner candidate: {winner_candidate_id} with performance: {max_performance}', file=sys.stderr)
|
|
226
|
+
else:
|
|
227
|
+
print('[WARN] No winner found (no valid performance scores)', file=sys.stderr)
|
|
228
|
+
|
|
204
229
|
# Update matching rows
|
|
205
230
|
for i in range(1, len(rows)):
|
|
206
231
|
row = rows[i]
|
|
207
232
|
if len(row) < 1:
|
|
208
233
|
continue
|
|
209
|
-
|
|
234
|
+
|
|
210
235
|
candidate_id = row[0]
|
|
211
236
|
current_status = row[4] if len(row) > 4 else ''
|
|
212
|
-
|
|
237
|
+
|
|
213
238
|
# Check if this row matches selector
|
|
214
239
|
matches = False
|
|
215
240
|
if selector == 'all':
|
|
216
241
|
matches = True
|
|
242
|
+
elif selector == 'winner':
|
|
243
|
+
# Match only the winner candidate
|
|
244
|
+
matches = (candidate_id == winner_candidate_id)
|
|
217
245
|
elif selector.startswith('gen') and '-' in candidate_id:
|
|
218
246
|
# Generation selector (e.g., gen01, gen02)
|
|
219
247
|
matches = candidate_id.startswith(selector + '-')
|
|
@@ -335,41 +363,60 @@ try:
|
|
|
335
363
|
|
|
336
364
|
# Skip header if present
|
|
337
365
|
start_idx = 1 if rows and rows[0] and rows[0][0].lower() == 'id' else 0
|
|
338
|
-
|
|
366
|
+
|
|
339
367
|
# Determine recent generations if filtering is requested
|
|
340
368
|
recent_gen_set = set()
|
|
341
369
|
if recent_generations and recent_generations.isdigit():
|
|
342
370
|
n_recent = int(recent_generations)
|
|
343
|
-
|
|
371
|
+
|
|
344
372
|
# Find all generation numbers from candidate IDs
|
|
345
373
|
all_generations = set()
|
|
346
374
|
for row in rows[start_idx:]:
|
|
347
375
|
if len(row) < 1:
|
|
348
376
|
continue
|
|
349
377
|
candidate_id = row[0]
|
|
350
|
-
|
|
378
|
+
|
|
351
379
|
# Extract generation number from candidate_id (e.g., gen01-001 -> 1)
|
|
352
380
|
match = re.match(r'^gen(\d+)-', candidate_id)
|
|
353
381
|
if match:
|
|
354
382
|
gen_num = int(match.group(1))
|
|
355
383
|
all_generations.add(gen_num)
|
|
356
|
-
|
|
384
|
+
|
|
357
385
|
# Get the most recent N generations
|
|
358
386
|
if all_generations:
|
|
359
387
|
sorted_generations = sorted(all_generations, reverse=True)
|
|
360
388
|
recent_gen_set = set(sorted_generations[:n_recent])
|
|
361
|
-
|
|
389
|
+
|
|
390
|
+
# For 'winner' selector, find the candidate with highest performance
|
|
391
|
+
winner_candidate_id = None
|
|
392
|
+
if selector == 'winner':
|
|
393
|
+
max_performance = None
|
|
394
|
+
for row in rows[start_idx:]:
|
|
395
|
+
if len(row) < 4:
|
|
396
|
+
continue
|
|
397
|
+
try:
|
|
398
|
+
perf_str = row[3].strip()
|
|
399
|
+
if perf_str and perf_str != '':
|
|
400
|
+
performance = float(perf_str)
|
|
401
|
+
if max_performance is None or performance > max_performance:
|
|
402
|
+
max_performance = performance
|
|
403
|
+
winner_candidate_id = row[0]
|
|
404
|
+
except (ValueError, IndexError):
|
|
405
|
+
continue
|
|
406
|
+
|
|
362
407
|
candidates = []
|
|
363
408
|
for row in rows[start_idx:]:
|
|
364
409
|
if len(row) < 1:
|
|
365
410
|
continue
|
|
366
|
-
|
|
411
|
+
|
|
367
412
|
candidate_id = row[0]
|
|
368
413
|
current_status = row[4] if len(row) > 4 else ''
|
|
369
|
-
|
|
414
|
+
|
|
370
415
|
# Check if matches status selector
|
|
371
416
|
matches = False
|
|
372
|
-
if selector == '
|
|
417
|
+
if selector == 'winner':
|
|
418
|
+
matches = (candidate_id == winner_candidate_id)
|
|
419
|
+
elif selector == 'pending':
|
|
373
420
|
matches = current_status == '' or current_status == 'pending'
|
|
374
421
|
elif selector == 'failed':
|
|
375
422
|
matches = current_status.startswith('failed')
|
|
@@ -478,17 +525,36 @@ with EvolutionCSV('$FULL_CSV_PATH') as csv:
|
|
|
478
525
|
if all_generations:
|
|
479
526
|
sorted_generations = sorted(all_generations, reverse=True)
|
|
480
527
|
recent_gen_set = set(sorted_generations[:n_recent])
|
|
481
|
-
|
|
528
|
+
|
|
529
|
+
# For 'winner' selector, find the candidate with highest performance
|
|
530
|
+
winner_candidate_id = None
|
|
531
|
+
if selector == 'winner':
|
|
532
|
+
max_performance = None
|
|
533
|
+
for row in rows[start_idx:]:
|
|
534
|
+
if not row or len(row) < 4:
|
|
535
|
+
continue
|
|
536
|
+
try:
|
|
537
|
+
perf_str = row[3].strip()
|
|
538
|
+
if perf_str and perf_str != '':
|
|
539
|
+
performance = float(perf_str)
|
|
540
|
+
if max_performance is None or performance > max_performance:
|
|
541
|
+
max_performance = performance
|
|
542
|
+
winner_candidate_id = row[0].strip()
|
|
543
|
+
except (ValueError, IndexError):
|
|
544
|
+
continue
|
|
545
|
+
|
|
482
546
|
for row in rows[start_idx:]:
|
|
483
547
|
if not row or not row[0].strip():
|
|
484
548
|
continue
|
|
485
|
-
|
|
549
|
+
|
|
486
550
|
candidate_id = row[0].strip()
|
|
487
551
|
current_status = row[4].strip() if len(row) > 4 else ''
|
|
488
|
-
|
|
552
|
+
|
|
489
553
|
matches = False
|
|
490
554
|
if selector == 'all':
|
|
491
555
|
matches = True
|
|
556
|
+
elif selector == 'winner':
|
|
557
|
+
matches = (candidate_id == winner_candidate_id)
|
|
492
558
|
elif selector.startswith('gen') and re.match(r'^gen\\d+$', selector):
|
|
493
559
|
# Generation selector (e.g., gen01, gen02)
|
|
494
560
|
gen_pattern = f'^{selector}-'
|
|
Binary file
|