claude-evolve 1.7.0 → 1.7.2
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-ideate +19 -52
- package/bin/claude-evolve-worker +4 -0
- package/lib/config.sh +0 -10
- package/lib/config.sh.new +0 -10
- package/lib/config_with_ollama.sh +0 -10
- package/package.json +1 -1
package/bin/claude-evolve-ideate
CHANGED
|
@@ -103,7 +103,6 @@ call_ai_for_ideation() {
|
|
|
103
103
|
original_csv_count=0
|
|
104
104
|
fi
|
|
105
105
|
|
|
106
|
-
echo "[DEBUG] Original CSV has $original_csv_count data rows" >&2
|
|
107
106
|
|
|
108
107
|
# Get models for ideation
|
|
109
108
|
local model_list
|
|
@@ -162,7 +161,6 @@ call_ai_for_ideation() {
|
|
|
162
161
|
return 0
|
|
163
162
|
else
|
|
164
163
|
echo "[INFO] CSV unchanged after $model (exit code: $ai_exit_code)" >&2
|
|
165
|
-
echo "[DEBUG] Original count: $original_csv_count, New count: $new_csv_count" >&2
|
|
166
164
|
# Continue to next model
|
|
167
165
|
fi
|
|
168
166
|
else
|
|
@@ -343,14 +341,10 @@ validate_direct_csv_modification() {
|
|
|
343
341
|
local new_count
|
|
344
342
|
new_count=$(grep -v '^[[:space:]]*$' "$temp_csv" | tail -n +2 | wc -l)
|
|
345
343
|
|
|
346
|
-
echo "[DEBUG] Current main CSV data rows: $current_original_count" >&2
|
|
347
|
-
echo "[DEBUG] Modified temp CSV data rows: $new_count" >&2
|
|
348
|
-
echo "[DEBUG] Expected to add: $expected_count ideas" >&2
|
|
349
344
|
|
|
350
345
|
# Check if AI overwrote the file instead of appending
|
|
351
346
|
if [[ $new_count -lt $current_original_count ]]; then
|
|
352
347
|
echo "[ERROR] AI overwrote the CSV file instead of appending ($new_count < $current_original_count)" >&2
|
|
353
|
-
echo "[DEBUG] First 10 lines of CSV after AI attempt:" >&2
|
|
354
348
|
head -10 "$temp_csv" >&2
|
|
355
349
|
return 1
|
|
356
350
|
fi
|
|
@@ -358,7 +352,6 @@ validate_direct_csv_modification() {
|
|
|
358
352
|
# Check if no changes were made
|
|
359
353
|
if [[ $new_count -eq $current_original_count ]]; then
|
|
360
354
|
echo "[ERROR] CSV file wasn't modified - same number of data rows ($new_count = $current_original_count)" >&2
|
|
361
|
-
echo "[DEBUG] First 10 lines of CSV after AI attempt:" >&2
|
|
362
355
|
head -10 "$temp_csv" >&2
|
|
363
356
|
return 1
|
|
364
357
|
fi
|
|
@@ -399,7 +392,6 @@ validate_direct_csv_modification() {
|
|
|
399
392
|
# Update each new row with the model that generated it
|
|
400
393
|
for id in $new_ids; do
|
|
401
394
|
if [[ -n "$id" && "$id" != "id" ]]; then
|
|
402
|
-
echo "[DEBUG] Updating $id with idea-LLM = $ai_model" >&2
|
|
403
395
|
"$PYTHON_CMD" "$SCRIPT_DIR/../lib/evolution_csv.py" "$FULL_CSV_PATH" field "$id" "idea-LLM" "$ai_model" || echo "[WARN] Failed to update $id" >&2
|
|
404
396
|
fi
|
|
405
397
|
done
|
|
@@ -422,7 +414,6 @@ validate_and_apply_csv_modification_old() {
|
|
|
422
414
|
# Check if the response looks like an error message (but not if it's just CSV data containing these words)
|
|
423
415
|
if echo "$modified_csv" | head -1 | grep -q "id,basedOnId,description,performance,status"; then
|
|
424
416
|
# This looks like a CSV file, not an error message
|
|
425
|
-
echo "[DEBUG] AI returned what appears to be a CSV file" >&2
|
|
426
417
|
elif echo "$modified_csv" | grep -qi "error\|failed\|limit\|exceeded\|sorry\|cannot\|unable"; then
|
|
427
418
|
echo "[ERROR] AI failed to modify CSV and returned an error message:" >&2
|
|
428
419
|
echo "$modified_csv" | head -200 >&2
|
|
@@ -443,12 +434,10 @@ validate_and_apply_csv_modification_old() {
|
|
|
443
434
|
if [[ -n "$csv_start_line" ]]; then
|
|
444
435
|
# Extract CSV starting from the header line
|
|
445
436
|
modified_csv=$(echo "$modified_csv" | tail -n +$csv_start_line)
|
|
446
|
-
echo "[DEBUG] Found CSV header at line $csv_start_line, extracting from there" >&2
|
|
447
437
|
elif ! echo "$modified_csv" | head -1 | grep -q "id,basedOnId,description,performance,status"; then
|
|
448
438
|
echo "[ERROR] AI failed to return a valid CSV file. Expected CSV with header, but got:" >&2
|
|
449
439
|
echo "$modified_csv" | head -c 500 >&2
|
|
450
440
|
echo "" >&2
|
|
451
|
-
echo "[DEBUG] The AI was asked to output the complete modified CSV but didn't" >&2
|
|
452
441
|
return 1
|
|
453
442
|
fi
|
|
454
443
|
|
|
@@ -461,13 +450,9 @@ validate_and_apply_csv_modification_old() {
|
|
|
461
450
|
local new_count
|
|
462
451
|
new_count=$(wc -l < "$temp_csv")
|
|
463
452
|
|
|
464
|
-
echo "[DEBUG] Original CSV line count: $original_count" >&2
|
|
465
|
-
echo "[DEBUG] Modified CSV line count: $new_count" >&2
|
|
466
|
-
echo "[DEBUG] Expected to add: $expected_count ideas" >&2
|
|
467
453
|
|
|
468
454
|
if [[ $new_count -le $original_count ]]; then
|
|
469
455
|
echo "[ERROR] Modified CSV doesn't have more entries ($new_count <= $original_count)" >&2
|
|
470
|
-
echo "[DEBUG] First 10 lines of modified CSV:" >&2
|
|
471
456
|
head -10 "$temp_csv" >&2
|
|
472
457
|
return 1
|
|
473
458
|
fi
|
|
@@ -508,7 +493,6 @@ validate_and_apply_csv_modification_old() {
|
|
|
508
493
|
# Update each new row with the model that generated it
|
|
509
494
|
for id in $new_ids; do
|
|
510
495
|
if [[ -n "$id" && "$id" != "id" ]]; then
|
|
511
|
-
echo "[DEBUG] Updating $id with idea-LLM = $ai_model" >&2
|
|
512
496
|
"$PYTHON_CMD" "$SCRIPT_DIR/../lib/evolution_csv.py" "$FULL_CSV_PATH" field "$id" "idea-LLM" "$ai_model" || echo "[WARN] Failed to update $id" >&2
|
|
513
497
|
fi
|
|
514
498
|
done
|
|
@@ -532,10 +516,6 @@ process_ai_ideas_direct_old() {
|
|
|
532
516
|
local temp_csv="$FULL_EVOLUTION_DIR/temp-csv-$$.csv"
|
|
533
517
|
cp "$FULL_CSV_PATH" "$temp_csv"
|
|
534
518
|
|
|
535
|
-
echo "[DEBUG] Starting CSV modification for $count $idea_type ideas" >&2
|
|
536
|
-
echo "[DEBUG] Original CSV path: $FULL_CSV_PATH" >&2
|
|
537
|
-
echo "[DEBUG] Temp CSV path: $temp_csv" >&2
|
|
538
|
-
echo "[DEBUG] Original CSV size: $(wc -l < "$FULL_CSV_PATH") lines" >&2
|
|
539
519
|
|
|
540
520
|
# Build prompt for AI to directly modify the CSV
|
|
541
521
|
local csv_prompt="I need you to add exactly $count new $idea_type ideas to this CSV file.
|
|
@@ -598,12 +578,10 @@ IMPORTANT: Output the complete modified CSV file. Do not add any explanation or
|
|
|
598
578
|
if [[ -n "$csv_start_line" ]]; then
|
|
599
579
|
# Extract CSV starting from the header line
|
|
600
580
|
modified_csv=$(echo "$modified_csv" | tail -n +$csv_start_line)
|
|
601
|
-
echo "[DEBUG] Found CSV header at line $csv_start_line, extracting from there" >&2
|
|
602
581
|
elif ! echo "$modified_csv" | head -1 | grep -q "id,basedOnId,description,performance,status"; then
|
|
603
582
|
echo "[ERROR] AI failed to return a valid CSV file. Expected CSV with header, but got:" >&2
|
|
604
583
|
echo "$modified_csv" | head -c 500 >&2
|
|
605
584
|
echo "" >&2
|
|
606
|
-
echo "[DEBUG] The AI was asked to output the complete modified CSV but didn't" >&2
|
|
607
585
|
rm -f "$temp_csv"
|
|
608
586
|
return 1
|
|
609
587
|
fi
|
|
@@ -612,11 +590,8 @@ IMPORTANT: Output the complete modified CSV file. Do not add any explanation or
|
|
|
612
590
|
echo "$modified_csv" > "$temp_csv"
|
|
613
591
|
|
|
614
592
|
# Debug: Show the AI's CSV modification attempt
|
|
615
|
-
echo "[DEBUG] AI response length: ${#modified_csv} characters" >&2
|
|
616
|
-
echo "[DEBUG] First 300 chars of AI response:" >&2
|
|
617
593
|
echo "$modified_csv" | head -c 300 >&2
|
|
618
594
|
echo "" >&2
|
|
619
|
-
echo "[DEBUG] Last 300 chars of AI response:" >&2
|
|
620
595
|
echo "$modified_csv" | tail -c 300 >&2
|
|
621
596
|
echo "" >&2
|
|
622
597
|
|
|
@@ -626,15 +601,10 @@ IMPORTANT: Output the complete modified CSV file. Do not add any explanation or
|
|
|
626
601
|
local new_count
|
|
627
602
|
new_count=$(wc -l < "$temp_csv")
|
|
628
603
|
|
|
629
|
-
echo "[DEBUG] Original CSV line count: $original_count" >&2
|
|
630
|
-
echo "[DEBUG] Modified CSV line count: $new_count" >&2
|
|
631
|
-
echo "[DEBUG] Expected to add: $count ideas" >&2
|
|
632
604
|
|
|
633
605
|
if [[ $new_count -le $original_count ]]; then
|
|
634
606
|
echo "[ERROR] Modified CSV doesn't have more entries ($new_count <= $original_count)" >&2
|
|
635
|
-
echo "[DEBUG] Temp CSV contents:" >&2
|
|
636
607
|
cat "$temp_csv" | head -10 >&2
|
|
637
|
-
echo "[DEBUG] Original CSV contents:" >&2
|
|
638
608
|
cat "$FULL_CSV_PATH" | head -10 >&2
|
|
639
609
|
rm -f "$temp_csv"
|
|
640
610
|
return 1
|
|
@@ -901,7 +871,6 @@ generate_novel_ideas_direct() {
|
|
|
901
871
|
|
|
902
872
|
echo "[INFO] Generating $count novel exploration ideas..."
|
|
903
873
|
local data_rows=$(grep -v '^[[:space:]]*$' "$FULL_CSV_PATH" | tail -n +2 | wc -l)
|
|
904
|
-
echo "[DEBUG] Original CSV has $data_rows data rows" >&2
|
|
905
874
|
|
|
906
875
|
# Use relative paths and change to evolution directory so AI can access files
|
|
907
876
|
local temp_csv_basename=$(basename "$temp_csv")
|
|
@@ -918,6 +887,8 @@ Current evolution context:
|
|
|
918
887
|
|
|
919
888
|
CRITICAL INSTRUCTIONS:
|
|
920
889
|
1. Use the Read tool to examine the current CSV file
|
|
890
|
+
IMPORTANT: If the CSV file is large (>200 lines), read it in chunks using the offset and limit parameters to avoid context overload
|
|
891
|
+
Example: Read(file_path='temp-csv-123.csv', offset=0, limit=100) then Read(offset=100, limit=100), etc.
|
|
921
892
|
2. DO NOT DELETE OR REPLACE ANY EXISTING ROWS - YOU MUST PRESERVE ALL EXISTING DATA
|
|
922
893
|
3. Find the highest ID number for generation $CURRENT_GENERATION (e.g., if gen$CURRENT_GENERATION-003 exists, next should be gen$CURRENT_GENERATION-004)
|
|
923
894
|
4. If no gen$CURRENT_GENERATION entries exist yet, start with gen$CURRENT_GENERATION-001"
|
|
@@ -949,14 +920,8 @@ CRITICAL: You must use your file editing tools (Edit/MultiEdit) to modify the CS
|
|
|
949
920
|
CRITICAL: Do NOT use any git commands (git add, git commit, git reset, etc.). Only modify the file directly."
|
|
950
921
|
|
|
951
922
|
# Debug prompt size and context
|
|
952
|
-
echo "[DEBUG] Novel ideas prompt length: ${#prompt} characters" >&2
|
|
953
|
-
echo "[DEBUG] Working dir: $(pwd)" >&2
|
|
954
|
-
echo "[DEBUG] Evolution dir: $FULL_EVOLUTION_DIR" >&2
|
|
955
|
-
echo "[DEBUG] Temp CSV: $temp_csv" >&2
|
|
956
923
|
if [[ -f "$temp_csv" ]]; then
|
|
957
|
-
echo "[DEBUG] Temp CSV exists, size: $(wc -l < "$temp_csv") lines" >&2
|
|
958
924
|
else
|
|
959
|
-
echo "[DEBUG] Temp CSV does not exist yet" >&2
|
|
960
925
|
fi
|
|
961
926
|
|
|
962
927
|
# Change to evolution directory so AI can access files
|
|
@@ -964,8 +929,6 @@ CRITICAL: Do NOT use any git commands (git add, git commit, git reset, etc.). On
|
|
|
964
929
|
cd "$FULL_EVOLUTION_DIR"
|
|
965
930
|
|
|
966
931
|
# Debug: Show files in evolution directory
|
|
967
|
-
echo "[DEBUG] Current directory: $(pwd)" >&2
|
|
968
|
-
echo "[DEBUG] Temp CSV exists: $(ls -la "$temp_csv_basename" 2>&1)" >&2
|
|
969
932
|
|
|
970
933
|
# Get AI to directly edit the CSV file
|
|
971
934
|
local ai_response
|
|
@@ -973,10 +936,7 @@ CRITICAL: Do NOT use any git commands (git add, git commit, git reset, etc.). On
|
|
|
973
936
|
# Temporarily show stderr for debugging
|
|
974
937
|
if ! ai_response=$(call_ai_for_ideation "$prompt" "$CURRENT_GENERATION" "$count" "$temp_csv_basename"); then
|
|
975
938
|
echo "[ERROR] All AI models failed to generate novel ideas" >&2
|
|
976
|
-
echo "[DEBUG] Stderr output from AI calls:" >&2
|
|
977
939
|
cat "$stderr_file" >&2
|
|
978
|
-
echo "[DEBUG] Temp CSV location: $temp_csv" >&2
|
|
979
|
-
echo "[DEBUG] Working directory: $(pwd)" >&2
|
|
980
940
|
cd "$original_pwd"
|
|
981
941
|
rm -f "$temp_csv" "$stderr_file"
|
|
982
942
|
return 1
|
|
@@ -986,7 +946,6 @@ CRITICAL: Do NOT use any git commands (git add, git commit, git reset, etc.). On
|
|
|
986
946
|
# Restore working directory
|
|
987
947
|
cd "$original_pwd"
|
|
988
948
|
|
|
989
|
-
echo "[DEBUG] AI response: $ai_response" >&2
|
|
990
949
|
|
|
991
950
|
# Validate that the CSV file was actually modified
|
|
992
951
|
if ! validate_direct_csv_modification "$temp_csv" "$count" "novel" "$ai_response"; then
|
|
@@ -1009,7 +968,6 @@ generate_hill_climbing_direct() {
|
|
|
1009
968
|
|
|
1010
969
|
echo "[INFO] Generating $count hill climbing ideas..."
|
|
1011
970
|
local data_rows=$(grep -v '^[[:space:]]*$' "$FULL_CSV_PATH" | tail -n +2 | wc -l)
|
|
1012
|
-
echo "[DEBUG] Original CSV has $data_rows data rows" >&2
|
|
1013
971
|
|
|
1014
972
|
# Get existing Python files for this generation to avoid ID collisions
|
|
1015
973
|
local existing_py_files=$(get_existing_py_files_for_generation "$CURRENT_GENERATION")
|
|
@@ -1030,9 +988,13 @@ $top_performers
|
|
|
1030
988
|
|
|
1031
989
|
OPTIONAL: If needed for context, you may read parent algorithm source files at: evolution_<PARENT_ID>.py
|
|
1032
990
|
However, you can often generate good parameter tuning ideas just from the descriptions and performance scores above.
|
|
991
|
+
IMPORTANT: If you read .py files, read them in chunks using offset and limit parameters to avoid context overload
|
|
992
|
+
Example: Read(file_path='evolution_gen01-001.py', offset=0, limit=100) then Read(offset=100, limit=100), etc.
|
|
1033
993
|
|
|
1034
994
|
CRITICAL INSTRUCTIONS:
|
|
1035
995
|
1. Use the Read tool to examine the current CSV file
|
|
996
|
+
IMPORTANT: If the CSV file is large (>200 lines), read it in chunks using the offset and limit parameters to avoid context overload
|
|
997
|
+
Example: Read(file_path='temp-csv-123.csv', offset=0, limit=100) then Read(offset=100, limit=100), etc.
|
|
1036
998
|
2. DO NOT DELETE OR REPLACE ANY EXISTING ROWS - YOU MUST PRESERVE ALL EXISTING DATA
|
|
1037
999
|
3. Find the highest ID number for generation $CURRENT_GENERATION (e.g., if gen$CURRENT_GENERATION-003 exists, next should be gen$CURRENT_GENERATION-004)
|
|
1038
1000
|
4. If no gen$CURRENT_GENERATION entries exist yet, start with gen$CURRENT_GENERATION-001
|
|
@@ -1072,7 +1034,6 @@ CRITICAL: Do NOT use any git commands (git add, git commit, git reset, etc.). On
|
|
|
1072
1034
|
# Restore working directory
|
|
1073
1035
|
cd "$original_pwd"
|
|
1074
1036
|
|
|
1075
|
-
echo "[DEBUG] AI response: $ai_response" >&2
|
|
1076
1037
|
|
|
1077
1038
|
# Validate that the CSV file was actually modified
|
|
1078
1039
|
if ! validate_direct_csv_modification "$temp_csv" "$count" "hill-climbing" "$ai_response"; then
|
|
@@ -1095,7 +1056,6 @@ generate_structural_mutation_direct() {
|
|
|
1095
1056
|
|
|
1096
1057
|
echo "[INFO] Generating $count structural mutation ideas..."
|
|
1097
1058
|
local data_rows=$(grep -v '^[[:space:]]*$' "$FULL_CSV_PATH" | tail -n +2 | wc -l)
|
|
1098
|
-
echo "[DEBUG] Original CSV has $data_rows data rows" >&2
|
|
1099
1059
|
|
|
1100
1060
|
# Get existing Python files for this generation to avoid ID collisions
|
|
1101
1061
|
local existing_py_files=$(get_existing_py_files_for_generation "$CURRENT_GENERATION")
|
|
@@ -1116,9 +1076,13 @@ $top_performers
|
|
|
1116
1076
|
|
|
1117
1077
|
OPTIONAL: If needed for context, you may read parent algorithm source files at: evolution_<PARENT_ID>.py
|
|
1118
1078
|
However, you can often generate good structural ideas just from the descriptions and performance scores above.
|
|
1079
|
+
IMPORTANT: If you read .py files, read them in chunks using offset and limit parameters to avoid context overload
|
|
1080
|
+
Example: Read(file_path='evolution_gen01-001.py', offset=0, limit=100) then Read(offset=100, limit=100), etc.
|
|
1119
1081
|
|
|
1120
1082
|
CRITICAL INSTRUCTIONS:
|
|
1121
1083
|
1. Use the Read tool to examine the current CSV file
|
|
1084
|
+
IMPORTANT: If the CSV file is large (>200 lines), read it in chunks using the offset and limit parameters to avoid context overload
|
|
1085
|
+
Example: Read(file_path='temp-csv-123.csv', offset=0, limit=100) then Read(offset=100, limit=100), etc.
|
|
1122
1086
|
2. DO NOT DELETE OR REPLACE ANY EXISTING ROWS - YOU MUST PRESERVE ALL EXISTING DATA
|
|
1123
1087
|
3. Find the highest ID number for generation $CURRENT_GENERATION (e.g., if gen$CURRENT_GENERATION-003 exists, next should be gen$CURRENT_GENERATION-004)
|
|
1124
1088
|
4. If no gen$CURRENT_GENERATION entries exist yet, start with gen$CURRENT_GENERATION-001
|
|
@@ -1158,7 +1122,6 @@ CRITICAL: Do NOT use any git commands (git add, git commit, git reset, etc.). On
|
|
|
1158
1122
|
# Restore working directory
|
|
1159
1123
|
cd "$original_pwd"
|
|
1160
1124
|
|
|
1161
|
-
echo "[DEBUG] AI response: $ai_response" >&2
|
|
1162
1125
|
|
|
1163
1126
|
# Validate that the CSV file was actually modified
|
|
1164
1127
|
if ! validate_direct_csv_modification "$temp_csv" "$count" "structural" "$ai_response"; then
|
|
@@ -1181,7 +1144,6 @@ generate_crossover_direct() {
|
|
|
1181
1144
|
|
|
1182
1145
|
echo "[INFO] Generating $count crossover hybrid ideas..."
|
|
1183
1146
|
local data_rows=$(grep -v '^[[:space:]]*$' "$FULL_CSV_PATH" | tail -n +2 | wc -l)
|
|
1184
|
-
echo "[DEBUG] Original CSV has $data_rows data rows" >&2
|
|
1185
1147
|
|
|
1186
1148
|
# Get existing Python files for this generation to avoid ID collisions
|
|
1187
1149
|
local existing_py_files=$(get_existing_py_files_for_generation "$CURRENT_GENERATION")
|
|
@@ -1202,9 +1164,13 @@ $top_performers
|
|
|
1202
1164
|
|
|
1203
1165
|
OPTIONAL: If needed for context, you may read parent algorithm source files at: evolution_<PARENT_ID>.py
|
|
1204
1166
|
However, you can often generate good hybrid ideas just from the descriptions and performance scores above.
|
|
1167
|
+
IMPORTANT: If you read .py files, read them in chunks using offset and limit parameters to avoid context overload
|
|
1168
|
+
Example: Read(file_path='evolution_gen01-001.py', offset=0, limit=100) then Read(offset=100, limit=100), etc.
|
|
1205
1169
|
|
|
1206
1170
|
CRITICAL INSTRUCTIONS:
|
|
1207
1171
|
1. Use the Read tool to examine the current CSV file
|
|
1172
|
+
IMPORTANT: If the CSV file is large (>200 lines), read it in chunks using the offset and limit parameters to avoid context overload
|
|
1173
|
+
Example: Read(file_path='temp-csv-123.csv', offset=0, limit=100) then Read(offset=100, limit=100), etc.
|
|
1208
1174
|
2. DO NOT DELETE OR REPLACE ANY EXISTING ROWS - YOU MUST PRESERVE ALL EXISTING DATA
|
|
1209
1175
|
3. Find the highest ID number for generation $CURRENT_GENERATION (e.g., if gen$CURRENT_GENERATION-003 exists, next should be gen$CURRENT_GENERATION-004)
|
|
1210
1176
|
4. If no gen$CURRENT_GENERATION entries exist yet, start with gen$CURRENT_GENERATION-001
|
|
@@ -1244,7 +1210,6 @@ CRITICAL: Do NOT use any git commands (git add, git commit, git reset, etc.). On
|
|
|
1244
1210
|
# Restore working directory
|
|
1245
1211
|
cd "$original_pwd"
|
|
1246
1212
|
|
|
1247
|
-
echo "[DEBUG] AI response: $ai_response" >&2
|
|
1248
1213
|
|
|
1249
1214
|
# Validate that the CSV file was actually modified
|
|
1250
1215
|
if ! validate_direct_csv_modification "$temp_csv" "$count" "crossover" "$ai_response"; then
|
|
@@ -1268,7 +1233,6 @@ ideate_ai_legacy() {
|
|
|
1268
1233
|
cp "$FULL_CSV_PATH" "$temp_csv"
|
|
1269
1234
|
|
|
1270
1235
|
echo "[INFO] Generating $TOTAL_IDEAS ideas (legacy mode)..."
|
|
1271
|
-
echo "[DEBUG] Original CSV has $(wc -l < "$FULL_CSV_PATH") lines" >&2
|
|
1272
1236
|
|
|
1273
1237
|
# Get top performers for context
|
|
1274
1238
|
local top_performers=""
|
|
@@ -1288,7 +1252,9 @@ Current evolution context:
|
|
|
1288
1252
|
- Algorithm: algorithm.py (base algorithm)
|
|
1289
1253
|
- Brief: $(head -10 "$FULL_BRIEF_PATH" 2>/dev/null | head -c 1000 || echo "No brief file found")
|
|
1290
1254
|
|
|
1291
|
-
IMPORTANT: DO NOT read all evolution files - that uses too many tokens. Just generate creative ideas based on the brief.
|
|
1255
|
+
IMPORTANT: DO NOT read all evolution files - that uses too many tokens. Just generate creative ideas based on the brief.
|
|
1256
|
+
IMPORTANT: If you read .py or .csv files, read them in chunks using offset and limit parameters to avoid context overload
|
|
1257
|
+
Example: Read(file_path='temp-csv-123.csv', offset=0, limit=100) then Read(offset=100, limit=100), etc."
|
|
1292
1258
|
|
|
1293
1259
|
if [[ -n $top_performers ]]; then
|
|
1294
1260
|
prompt+="
|
|
@@ -1301,6 +1267,8 @@ $top_performers"
|
|
|
1301
1267
|
|
|
1302
1268
|
CRITICAL INSTRUCTIONS:
|
|
1303
1269
|
1. Use the Read tool to examine the current CSV file
|
|
1270
|
+
IMPORTANT: If the CSV file is large (>200 lines), read it in chunks using the offset and limit parameters to avoid context overload
|
|
1271
|
+
Example: Read(file_path='temp-csv-123.csv', offset=0, limit=100) then Read(offset=100, limit=100), etc.
|
|
1304
1272
|
2. DO NOT DELETE OR REPLACE ANY EXISTING ROWS - YOU MUST PRESERVE ALL EXISTING DATA
|
|
1305
1273
|
3. Find the highest ID number for generation $CURRENT_GENERATION (e.g., if gen$CURRENT_GENERATION-003 exists, next should be gen$CURRENT_GENERATION-004)
|
|
1306
1274
|
4. If no gen$CURRENT_GENERATION entries exist yet, start with gen$CURRENT_GENERATION-001
|
|
@@ -1350,7 +1318,6 @@ CRITICAL: Do NOT use any git commands (git add, git commit, git reset, etc.). On
|
|
|
1350
1318
|
# Restore working directory
|
|
1351
1319
|
cd "$original_pwd"
|
|
1352
1320
|
|
|
1353
|
-
echo "[DEBUG] AI response: $ai_response" >&2
|
|
1354
1321
|
|
|
1355
1322
|
# Validate that the CSV file was actually modified
|
|
1356
1323
|
if ! validate_direct_csv_modification "$temp_csv" "$TOTAL_IDEAS" "mixed" "$ai_response"; then
|
package/bin/claude-evolve-worker
CHANGED
|
@@ -276,6 +276,10 @@ The modification should be substantial and follow the description exactly. Make
|
|
|
276
276
|
|
|
277
277
|
Important: Make meaningful changes that match the description. Don't just add comments or make trivial adjustments.
|
|
278
278
|
|
|
279
|
+
IMPORTANT: If you need to read Python (.py) or CSV files, read them in chunks using offset and limit parameters to avoid context overload
|
|
280
|
+
Example: Read(file_path='evolution_gen01-001.py', offset=0, limit=100) then Read(offset=100, limit=100), etc.
|
|
281
|
+
This is especially important for models with smaller context windows (like GLM).
|
|
282
|
+
|
|
279
283
|
CRITICAL: If you do not know how to implement what was asked for, or if the requested change is unclear or not feasible, you MUST refuse to make any changes. DO NOT modify the code if you are uncertain about the implementation. Simply respond that you cannot implement the requested change and explain why. It is better to refuse than to make incorrect or random changes.
|
|
280
284
|
|
|
281
285
|
CRITICAL: Do NOT use any git commands (git add, git commit, git reset, etc.). Only modify the file directly."
|
package/lib/config.sh
CHANGED
|
@@ -69,7 +69,6 @@ _load_yaml_config() {
|
|
|
69
69
|
return 0 # File does not exist, nothing to load
|
|
70
70
|
fi
|
|
71
71
|
|
|
72
|
-
echo "[DEBUG] Loading configuration from: $config_file" >&2
|
|
73
72
|
|
|
74
73
|
local in_ideation_section=false
|
|
75
74
|
local in_parallel_section=false
|
|
@@ -175,8 +174,6 @@ _load_yaml_config() {
|
|
|
175
174
|
}
|
|
176
175
|
|
|
177
176
|
load_config() {
|
|
178
|
-
echo "[DEBUG] $1 at start of load_config: '$1'" >&2
|
|
179
|
-
echo "[DEBUG] DEFAULT_EVOLUTION_DIR: $DEFAULT_EVOLUTION_DIR" >&2
|
|
180
177
|
# Set defaults first
|
|
181
178
|
EVOLUTION_DIR="$DEFAULT_EVOLUTION_DIR" # Initialize with default
|
|
182
179
|
ALGORITHM_FILE="$DEFAULT_ALGORITHM_FILE"
|
|
@@ -189,18 +186,13 @@ load_config() {
|
|
|
189
186
|
|
|
190
187
|
# Determine EVOLUTION_DIR based on specified logic, overriding default if found
|
|
191
188
|
if [[ -n "$CLAUDE_EVOLVE_WORKING_DIR" ]]; then
|
|
192
|
-
echo "[DEBUG] EVOLUTION_DIR set by CLAUDE_EVOLVE_WORKING_DIR: $CLAUDE_EVOLVE_WORKING_DIR" >&2
|
|
193
189
|
EVOLUTION_DIR="$CLAUDE_EVOLVE_WORKING_DIR"
|
|
194
190
|
elif [[ -f "evolution/evolution.csv" ]]; then
|
|
195
|
-
echo "[DEBUG] EVOLUTION_DIR set by evolution/evolution.csv: evolution" >&2
|
|
196
191
|
EVOLUTION_DIR="evolution"
|
|
197
192
|
elif [[ -f "./evolution.csv" ]]; then
|
|
198
|
-
echo "[DEBUG] EVOLUTION_DIR set by ./evolution.csv: ." >&2
|
|
199
193
|
EVOLUTION_DIR="."
|
|
200
194
|
else
|
|
201
|
-
echo "[DEBUG] EVOLUTION_DIR defaulting to: $DEFAULT_EVOLUTION_DIR" >&2
|
|
202
195
|
fi
|
|
203
|
-
echo "[DEBUG] EVOLUTION_DIR after initial determination: $EVOLUTION_DIR" >&2
|
|
204
196
|
|
|
205
197
|
TOTAL_IDEAS="$DEFAULT_TOTAL_IDEAS"
|
|
206
198
|
NOVEL_EXPLORATION="$DEFAULT_NOVEL_EXPLORATION"
|
|
@@ -232,7 +224,6 @@ load_config() {
|
|
|
232
224
|
local global_config_file="$HOME/.config/claude-evolve/config.yaml"
|
|
233
225
|
_load_yaml_config "$global_config_file"
|
|
234
226
|
|
|
235
|
-
echo "[DEBUG] EVOLUTION_DIR before FULL_EVOLUTION_DIR calculation: $EVOLUTION_DIR" >&2
|
|
236
227
|
|
|
237
228
|
# Create full paths - ALL paths are relative to EVOLUTION_DIR
|
|
238
229
|
# Make EVOLUTION_DIR absolute if it\'s relative
|
|
@@ -252,7 +243,6 @@ load_config() {
|
|
|
252
243
|
else
|
|
253
244
|
FULL_OUTPUT_DIR="$FULL_EVOLUTION_DIR"
|
|
254
245
|
fi
|
|
255
|
-
echo "[DEBUG] FULL_EVOLUTION_DIR at end of load_config: $FULL_EVOLUTION_DIR" >&2
|
|
256
246
|
}
|
|
257
247
|
|
|
258
248
|
# Validate configuration
|
package/lib/config.sh.new
CHANGED
|
@@ -66,7 +66,6 @@ _load_yaml_config() {
|
|
|
66
66
|
return 0 # File does not exist, nothing to load
|
|
67
67
|
fi
|
|
68
68
|
|
|
69
|
-
echo "[DEBUG] Loading configuration from: $config_file" >&2
|
|
70
69
|
|
|
71
70
|
local in_ideation_section=false
|
|
72
71
|
local in_parallel_section=false
|
|
@@ -171,8 +170,6 @@ _load_yaml_config() {
|
|
|
171
170
|
}
|
|
172
171
|
|
|
173
172
|
load_config() {
|
|
174
|
-
echo "[DEBUG] $1 at start of load_config: '$1'" >&2
|
|
175
|
-
echo "[DEBUG] DEFAULT_EVOLUTION_DIR: $DEFAULT_EVOLUTION_DIR" >&2
|
|
176
173
|
# Set defaults first
|
|
177
174
|
EVOLUTION_DIR="$DEFAULT_EVOLUTION_DIR" # Initialize with default
|
|
178
175
|
ALGORITHM_FILE="$DEFAULT_ALGORITHM_FILE"
|
|
@@ -185,18 +182,13 @@ load_config() {
|
|
|
185
182
|
|
|
186
183
|
# Determine EVOLUTION_DIR based on specified logic, overriding default if found
|
|
187
184
|
if [[ -n "$CLAUDE_EVOLVE_WORKING_DIR" ]]; then
|
|
188
|
-
echo "[DEBUG] EVOLUTION_DIR set by CLAUDE_EVOLVE_WORKING_DIR: $CLAUDE_EVOLVE_WORKING_DIR" >&2
|
|
189
185
|
EVOLUTION_DIR="$CLAUDE_EVOLVE_WORKING_DIR"
|
|
190
186
|
elif [[ -f "evolution/evolution.csv" ]]; then
|
|
191
|
-
echo "[DEBUG] EVOLUTION_DIR set by evolution/evolution.csv: evolution" >&2
|
|
192
187
|
EVOLUTION_DIR="evolution"
|
|
193
188
|
elif [[ -f "./evolution.csv" ]]; then
|
|
194
|
-
echo "[DEBUG] EVOLUTION_DIR set by ./evolution.csv: ." >&2
|
|
195
189
|
EVOLUTION_DIR="."
|
|
196
190
|
else
|
|
197
|
-
echo "[DEBUG] EVOLUTION_DIR defaulting to: $DEFAULT_EVOLUTION_DIR" >&2
|
|
198
191
|
fi
|
|
199
|
-
echo "[DEBUG] EVOLUTION_DIR after initial determination: $EVOLUTION_DIR" >&2
|
|
200
192
|
|
|
201
193
|
TOTAL_IDEAS="$DEFAULT_TOTAL_IDEAS"
|
|
202
194
|
NOVEL_EXPLORATION="$DEFAULT_NOVEL_EXPLORATION"
|
|
@@ -240,7 +232,6 @@ load_config() {
|
|
|
240
232
|
local global_config_file="$HOME/.config/claude-evolve/config.yaml"
|
|
241
233
|
_load_yaml_config "$global_config_file"
|
|
242
234
|
|
|
243
|
-
echo "[DEBUG] EVOLUTION_DIR before FULL_EVOLUTION_DIR calculation: $EVOLUTION_DIR" >&2
|
|
244
235
|
|
|
245
236
|
# Create full paths - ALL paths are relative to EVOLUTION_DIR
|
|
246
237
|
# Make EVOLUTION_DIR absolute if it\'s relative
|
|
@@ -260,7 +251,6 @@ load_config() {
|
|
|
260
251
|
else
|
|
261
252
|
FULL_OUTPUT_DIR="$FULL_EVOLUTION_DIR"
|
|
262
253
|
fi
|
|
263
|
-
echo "[DEBUG] FULL_EVOLUTION_DIR at end of load_config: $FULL_EVOLUTION_DIR" >&2
|
|
264
254
|
}
|
|
265
255
|
|
|
266
256
|
# Validate configuration
|
|
@@ -66,7 +66,6 @@ _load_yaml_config() {
|
|
|
66
66
|
return 0 # File does not exist, nothing to load
|
|
67
67
|
fi
|
|
68
68
|
|
|
69
|
-
echo "[DEBUG] Loading configuration from: $config_file" >&2
|
|
70
69
|
|
|
71
70
|
local in_ideation_section=false
|
|
72
71
|
local in_parallel_section=false
|
|
@@ -171,8 +170,6 @@ _load_yaml_config() {
|
|
|
171
170
|
}
|
|
172
171
|
|
|
173
172
|
load_config() {
|
|
174
|
-
echo "[DEBUG] $1 at start of load_config: '$1'" >&2
|
|
175
|
-
echo "[DEBUG] DEFAULT_EVOLUTION_DIR: $DEFAULT_EVOLUTION_DIR" >&2
|
|
176
173
|
# Set defaults first
|
|
177
174
|
EVOLUTION_DIR="$DEFAULT_EVOLUTION_DIR" # Initialize with default
|
|
178
175
|
ALGORITHM_FILE="$DEFAULT_ALGORITHM_FILE"
|
|
@@ -185,18 +182,13 @@ load_config() {
|
|
|
185
182
|
|
|
186
183
|
# Determine EVOLUTION_DIR based on specified logic, overriding default if found
|
|
187
184
|
if [[ -n "$CLAUDE_EVOLVE_WORKING_DIR" ]]; then
|
|
188
|
-
echo "[DEBUG] EVOLUTION_DIR set by CLAUDE_EVOLVE_WORKING_DIR: $CLAUDE_EVOLVE_WORKING_DIR" >&2
|
|
189
185
|
EVOLUTION_DIR="$CLAUDE_EVOLVE_WORKING_DIR"
|
|
190
186
|
elif [[ -f "evolution/evolution.csv" ]]; then
|
|
191
|
-
echo "[DEBUG] EVOLUTION_DIR set by evolution/evolution.csv: evolution" >&2
|
|
192
187
|
EVOLUTION_DIR="evolution"
|
|
193
188
|
elif [[ -f "./evolution.csv" ]]; then
|
|
194
|
-
echo "[DEBUG] EVOLUTION_DIR set by ./evolution.csv: ." >&2
|
|
195
189
|
EVOLUTION_DIR="."
|
|
196
190
|
else
|
|
197
|
-
echo "[DEBUG] EVOLUTION_DIR defaulting to: $DEFAULT_EVOLUTION_DIR" >&2
|
|
198
191
|
fi
|
|
199
|
-
echo "[DEBUG] EVOLUTION_DIR after initial determination: $EVOLUTION_DIR" >&2
|
|
200
192
|
|
|
201
193
|
TOTAL_IDEAS="$DEFAULT_TOTAL_IDEAS"
|
|
202
194
|
NOVEL_EXPLORATION="$DEFAULT_NOVEL_EXPLORATION"
|
|
@@ -240,7 +232,6 @@ load_config() {
|
|
|
240
232
|
local global_config_file="$HOME/.config/claude-evolve/config.yaml"
|
|
241
233
|
_load_yaml_config "$global_config_file"
|
|
242
234
|
|
|
243
|
-
echo "[DEBUG] EVOLUTION_DIR before FULL_EVOLUTION_DIR calculation: $EVOLUTION_DIR" >&2
|
|
244
235
|
|
|
245
236
|
# Create full paths - ALL paths are relative to EVOLUTION_DIR
|
|
246
237
|
# Make EVOLUTION_DIR absolute if it\'s relative
|
|
@@ -260,7 +251,6 @@ load_config() {
|
|
|
260
251
|
else
|
|
261
252
|
FULL_OUTPUT_DIR="$FULL_EVOLUTION_DIR"
|
|
262
253
|
fi
|
|
263
|
-
echo "[DEBUG] FULL_EVOLUTION_DIR at end of load_config: $FULL_EVOLUTION_DIR" >&2
|
|
264
254
|
}
|
|
265
255
|
|
|
266
256
|
# Validate configuration
|