claude-evolve 1.7.15 → 1.7.16
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 +130 -112
- package/package.json +1 -1
package/bin/claude-evolve-ideate
CHANGED
|
@@ -339,38 +339,39 @@ validate_direct_csv_modification() {
|
|
|
339
339
|
local expected_count="$2"
|
|
340
340
|
local idea_type="$3"
|
|
341
341
|
local ai_model="${4:-}" # AI model that generated the ideas
|
|
342
|
-
|
|
342
|
+
local expected_ids="${5:-}" # Optional: comma or space separated list of expected IDs
|
|
343
|
+
|
|
343
344
|
# Check if the file was actually modified
|
|
344
345
|
if [[ ! -f "$temp_csv" ]]; then
|
|
345
346
|
echo "[ERROR] CSV file was not found after AI modification" >&2
|
|
346
347
|
return 1
|
|
347
348
|
fi
|
|
348
|
-
|
|
349
|
+
|
|
349
350
|
# Get the count before modification from the temp CSV (which was copied from original before AI ran)
|
|
350
351
|
# We need to track this before the AI runs by reading from the beginning state
|
|
351
352
|
# First, get a fresh count from the current main CSV (which reflects any previous operations in this session)
|
|
352
353
|
local current_original_count
|
|
353
354
|
current_original_count=$(grep -v '^[[:space:]]*$' "$FULL_CSV_PATH" | tail -n +2 | wc -l)
|
|
354
|
-
|
|
355
|
+
|
|
355
356
|
# Count data rows in the modified temp CSV
|
|
356
357
|
local new_count
|
|
357
358
|
new_count=$(grep -v '^[[:space:]]*$' "$temp_csv" | tail -n +2 | wc -l)
|
|
358
|
-
|
|
359
|
-
|
|
359
|
+
|
|
360
|
+
|
|
360
361
|
# Check if AI overwrote the file instead of appending
|
|
361
362
|
if [[ $new_count -lt $current_original_count ]]; then
|
|
362
363
|
echo "[ERROR] AI overwrote the CSV file instead of appending ($new_count < $current_original_count)" >&2
|
|
363
364
|
head -10 "$temp_csv" >&2
|
|
364
365
|
return 1
|
|
365
366
|
fi
|
|
366
|
-
|
|
367
|
+
|
|
367
368
|
# Check if no changes were made
|
|
368
369
|
if [[ $new_count -eq $current_original_count ]]; then
|
|
369
370
|
echo "[ERROR] CSV file wasn't modified - same number of data rows ($new_count = $current_original_count)" >&2
|
|
370
371
|
head -10 "$temp_csv" >&2
|
|
371
372
|
return 1
|
|
372
373
|
fi
|
|
373
|
-
|
|
374
|
+
|
|
374
375
|
local added_count=$((new_count - current_original_count))
|
|
375
376
|
if [[ $added_count -ne $expected_count ]]; then
|
|
376
377
|
echo "[ERROR] Expected to add $expected_count ideas but only added $added_count" >&2
|
|
@@ -379,6 +380,29 @@ validate_direct_csv_modification() {
|
|
|
379
380
|
return 1
|
|
380
381
|
fi
|
|
381
382
|
|
|
383
|
+
# If expected IDs were provided, validate that the AI used exactly those IDs
|
|
384
|
+
if [[ -n "$expected_ids" ]]; then
|
|
385
|
+
# Get the IDs that were actually added (last N rows of temp CSV)
|
|
386
|
+
local actual_ids
|
|
387
|
+
actual_ids=$(tail -n $added_count "$temp_csv" | cut -d',' -f1 | tr -d '"' | tr '\n' ' ' | xargs)
|
|
388
|
+
|
|
389
|
+
# Normalize expected_ids (convert commas to spaces, trim)
|
|
390
|
+
local expected_ids_normalized
|
|
391
|
+
expected_ids_normalized=$(echo "$expected_ids" | tr ',' ' ' | xargs)
|
|
392
|
+
|
|
393
|
+
# Compare
|
|
394
|
+
if [[ "$actual_ids" != "$expected_ids_normalized" ]]; then
|
|
395
|
+
echo "[ERROR] AI used wrong IDs!" >&2
|
|
396
|
+
echo "[ERROR] Expected: $expected_ids_normalized" >&2
|
|
397
|
+
echo "[ERROR] Actually used: $actual_ids" >&2
|
|
398
|
+
echo "[ERROR] Rejecting this attempt - AI must use the exact IDs specified" >&2
|
|
399
|
+
rm -f "$temp_csv"
|
|
400
|
+
return 1
|
|
401
|
+
fi
|
|
402
|
+
|
|
403
|
+
echo "[INFO] ✓ AI correctly used the specified IDs: $actual_ids" >&2
|
|
404
|
+
fi
|
|
405
|
+
|
|
382
406
|
# Use proper locking to safely update the CSV
|
|
383
407
|
echo "[INFO] Acquiring CSV lock to apply changes..."
|
|
384
408
|
|
|
@@ -946,6 +970,13 @@ generate_novel_ideas_direct() {
|
|
|
946
970
|
local temp_csv="$FULL_EVOLUTION_DIR/temp-csv-$$.csv"
|
|
947
971
|
cp "$FULL_CSV_PATH" "$temp_csv"
|
|
948
972
|
|
|
973
|
+
# Pre-populate the CSV with stub rows containing the correct IDs
|
|
974
|
+
# This ensures the AI can't possibly use wrong IDs - it just fills in descriptions
|
|
975
|
+
echo "[INFO] Pre-populating CSV with stub rows: $required_ids_str"
|
|
976
|
+
for id in "${required_ids[@]}"; do
|
|
977
|
+
echo "$id,,\"[PLACEHOLDER: Replace this with your algorithmic idea]\",,pending" >> "$temp_csv"
|
|
978
|
+
done
|
|
979
|
+
|
|
949
980
|
echo "[INFO] Generating $count novel exploration ideas with IDs: $required_ids_str"
|
|
950
981
|
local data_rows=$(grep -v '^[[:space:]]*$' "$FULL_CSV_PATH" | tail -n +2 | wc -l)
|
|
951
982
|
|
|
@@ -955,7 +986,7 @@ generate_novel_ideas_direct() {
|
|
|
955
986
|
# Get existing Python files for this generation to avoid ID collisions
|
|
956
987
|
local existing_py_files=$(get_existing_py_files_for_generation "$CURRENT_GENERATION")
|
|
957
988
|
|
|
958
|
-
local prompt="I need you to use your file editing capabilities to
|
|
989
|
+
local prompt="I need you to use your file editing capabilities to fill in PLACEHOLDER descriptions in the CSV file: $temp_csv_basename
|
|
959
990
|
|
|
960
991
|
Current evolution context:
|
|
961
992
|
- Generation: $CURRENT_GENERATION
|
|
@@ -964,18 +995,18 @@ Current evolution context:
|
|
|
964
995
|
|
|
965
996
|
IMPORTANT: DO NOT read algorithm.py or any evolution_*.py files. Focus on creative ideation based on the brief and CSV context only. Reading code files wastes tokens and time.
|
|
966
997
|
|
|
967
|
-
CRITICAL
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
998
|
+
CRITICAL TASK:
|
|
999
|
+
The CSV file already contains $count stub rows with these IDs: $required_ids_str
|
|
1000
|
+
Each stub row has a PLACEHOLDER description like: \"[PLACEHOLDER: Replace this with your algorithmic idea]\"
|
|
1001
|
+
Your job is to REPLACE each PLACEHOLDER with a real algorithmic idea description.
|
|
971
1002
|
|
|
972
1003
|
CRITICAL INSTRUCTIONS:
|
|
973
|
-
1. Use the Read tool to examine the
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
1004
|
+
1. Use the Read tool to examine the CSV file (read from the END to see the placeholder rows)
|
|
1005
|
+
Example: Read the last 20 lines to see the placeholders
|
|
1006
|
+
2. DO NOT ADD OR DELETE ANY ROWS - only EDIT the placeholder descriptions
|
|
1007
|
+
3. DO NOT CHANGE THE IDs - they are already correct
|
|
1008
|
+
4. Use the Edit tool to replace each PLACEHOLDER description with a real idea
|
|
1009
|
+
5. Each replacement should be one clear sentence describing a novel algorithmic approach"
|
|
979
1010
|
|
|
980
1011
|
if [[ -n "$existing_py_files" ]]; then
|
|
981
1012
|
prompt+="
|
|
@@ -1024,13 +1055,13 @@ CRITICAL: Do NOT use any git commands (git add, git commit, git reset, etc.). On
|
|
|
1024
1055
|
# Restore working directory
|
|
1025
1056
|
cd "$original_pwd"
|
|
1026
1057
|
|
|
1027
|
-
|
|
1028
|
-
# Validate that the CSV file was actually modified
|
|
1029
|
-
if ! validate_direct_csv_modification "$temp_csv" "$count" "novel" "$ai_response"; then
|
|
1058
|
+
|
|
1059
|
+
# Validate that the CSV file was actually modified with correct IDs
|
|
1060
|
+
if ! validate_direct_csv_modification "$temp_csv" "$count" "novel" "$ai_response" "$required_ids_str"; then
|
|
1030
1061
|
rm -f "$temp_csv"
|
|
1031
1062
|
return 1
|
|
1032
1063
|
fi
|
|
1033
|
-
|
|
1064
|
+
|
|
1034
1065
|
echo "[INFO] Novel exploration ideas generated successfully"
|
|
1035
1066
|
return 0
|
|
1036
1067
|
}
|
|
@@ -1058,6 +1089,15 @@ generate_hill_climbing_direct() {
|
|
|
1058
1089
|
local temp_csv="$FULL_EVOLUTION_DIR/temp-csv-$$.csv"
|
|
1059
1090
|
cp "$FULL_CSV_PATH" "$temp_csv"
|
|
1060
1091
|
|
|
1092
|
+
# Pre-populate the CSV with stub rows containing the correct IDs and parent IDs
|
|
1093
|
+
echo "[INFO] Pre-populating CSV with stub rows: $required_ids_str"
|
|
1094
|
+
# Use first parent as default for stubs (AI will adjust if needed)
|
|
1095
|
+
local first_parent_id
|
|
1096
|
+
first_parent_id=$(echo "$valid_parent_ids" | cut -d',' -f1)
|
|
1097
|
+
for id in "${required_ids[@]}"; do
|
|
1098
|
+
echo "$id,$first_parent_id,\"[PLACEHOLDER: Replace with parameter tuning idea]\",,pending" >> "$temp_csv"
|
|
1099
|
+
done
|
|
1100
|
+
|
|
1061
1101
|
echo "[INFO] Generating $count hill climbing ideas with IDs: $required_ids_str"
|
|
1062
1102
|
local data_rows=$(grep -v '^[[:space:]]*$' "$FULL_CSV_PATH" | tail -n +2 | wc -l)
|
|
1063
1103
|
|
|
@@ -1071,7 +1111,7 @@ generate_hill_climbing_direct() {
|
|
|
1071
1111
|
# Use relative paths and change to evolution directory so AI can access files
|
|
1072
1112
|
local temp_csv_basename=$(basename "$temp_csv")
|
|
1073
1113
|
|
|
1074
|
-
local prompt="I need you to use your file editing capabilities to
|
|
1114
|
+
local prompt="I need you to use your file editing capabilities to fill in PLACEHOLDER descriptions in the CSV file: $temp_csv_basename
|
|
1075
1115
|
|
|
1076
1116
|
IMPORTANT: You MUST use one of these exact parent IDs: $valid_parent_ids
|
|
1077
1117
|
|
|
@@ -1092,33 +1132,21 @@ If you must read source files:
|
|
|
1092
1132
|
|
|
1093
1133
|
Most of the time, you can infer parameters from descriptions like "RSI with threshold 30" or "MA period 20".
|
|
1094
1134
|
|
|
1095
|
-
CRITICAL
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1135
|
+
CRITICAL TASK:
|
|
1136
|
+
The CSV file already contains $count stub rows with these IDs: $required_ids_str
|
|
1137
|
+
Each stub row has a PLACEHOLDER description like: \"[PLACEHOLDER: Replace with parameter tuning idea]\"
|
|
1138
|
+
Your job is to REPLACE each PLACEHOLDER with a real parameter tuning idea.
|
|
1099
1139
|
|
|
1100
1140
|
CRITICAL INSTRUCTIONS:
|
|
1101
|
-
1. Use the Read tool to examine the
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
8. CRITICAL CSV FORMATTING RULES:
|
|
1111
|
-
- ALWAYS wrap the description field in double quotes
|
|
1112
|
-
- If the description contains quotes, escape them by doubling them (\" becomes \"\")
|
|
1113
|
-
- Example: gen01-001,gen00-000,\"Lower rsi_entry from 21 to 18\",,pending
|
|
1114
|
-
- BAD: gen01-001,gen00-000,Lower rsi_entry from 21 to 18,,pending
|
|
1115
|
-
- NEVER omit quotes around descriptions - this causes CSV parsing errors
|
|
1116
|
-
9. Each description should focus on adjusting specific parameters that exist in the parent's source code
|
|
1117
|
-
10. Include current and new parameter values - for example: \"Lower rsi_entry from 21 to 18\"
|
|
1118
|
-
|
|
1119
|
-
IMPORTANT: You must APPEND new rows to the existing CSV file. DO NOT replace the file contents. All existing rows must remain unchanged.
|
|
1120
|
-
CRITICAL: You must use your file editing tools (Edit/MultiEdit) to modify the CSV file. DO NOT return CSV text - use your tools to edit the file directly.
|
|
1121
|
-
CRITICAL: Do NOT use any git commands (git add, git commit, git reset, etc.). Only modify the file directly."
|
|
1141
|
+
1. Use the Read tool to examine the CSV file (read from the END to see the placeholder rows)
|
|
1142
|
+
2. DO NOT ADD OR DELETE ANY ROWS - only EDIT the placeholder descriptions
|
|
1143
|
+
3. DO NOT CHANGE THE IDs - they are already correct
|
|
1144
|
+
4. Use the Edit tool to replace each PLACEHOLDER description with a parameter tuning idea
|
|
1145
|
+
5. You may also change the parent_id field if needed to reference a different top performer
|
|
1146
|
+
6. Each description should focus on adjusting specific parameters - include current and new values
|
|
1147
|
+
Example: \"Lower rsi_entry from 21 to 18\" or \"Increase MA period from 20 to 50\"
|
|
1148
|
+
7. CRITICAL: When editing, preserve the CSV formatting with proper quoting
|
|
1149
|
+
8. DO NOT use any git commands (git add, git commit, git reset, etc.). Only modify the file directly."
|
|
1122
1150
|
|
|
1123
1151
|
# Change to evolution directory so AI can access files
|
|
1124
1152
|
local original_pwd=$(pwd)
|
|
@@ -1140,13 +1168,13 @@ CRITICAL: Do NOT use any git commands (git add, git commit, git reset, etc.). On
|
|
|
1140
1168
|
# Restore working directory
|
|
1141
1169
|
cd "$original_pwd"
|
|
1142
1170
|
|
|
1143
|
-
|
|
1144
|
-
# Validate that the CSV file was actually modified
|
|
1145
|
-
if ! validate_direct_csv_modification "$temp_csv" "$count" "hill-climbing" "$ai_response"; then
|
|
1171
|
+
|
|
1172
|
+
# Validate that the CSV file was actually modified with correct IDs
|
|
1173
|
+
if ! validate_direct_csv_modification "$temp_csv" "$count" "hill-climbing" "$ai_response" "$required_ids_str"; then
|
|
1146
1174
|
rm -f "$temp_csv"
|
|
1147
1175
|
return 1
|
|
1148
1176
|
fi
|
|
1149
|
-
|
|
1177
|
+
|
|
1150
1178
|
echo "[INFO] Hill climbing ideas generated successfully"
|
|
1151
1179
|
return 0
|
|
1152
1180
|
}
|
|
@@ -1174,6 +1202,14 @@ generate_structural_mutation_direct() {
|
|
|
1174
1202
|
local temp_csv="$FULL_EVOLUTION_DIR/temp-csv-$$.csv"
|
|
1175
1203
|
cp "$FULL_CSV_PATH" "$temp_csv"
|
|
1176
1204
|
|
|
1205
|
+
# Pre-populate the CSV with stub rows
|
|
1206
|
+
echo "[INFO] Pre-populating CSV with stub rows: $required_ids_str"
|
|
1207
|
+
local first_parent_id
|
|
1208
|
+
first_parent_id=$(echo "$valid_parent_ids" | cut -d',' -f1)
|
|
1209
|
+
for id in "${required_ids[@]}"; do
|
|
1210
|
+
echo "$id,$first_parent_id,\"[PLACEHOLDER: Replace with structural modification idea]\",,pending" >> "$temp_csv"
|
|
1211
|
+
done
|
|
1212
|
+
|
|
1177
1213
|
echo "[INFO] Generating $count structural mutation ideas with IDs: $required_ids_str"
|
|
1178
1214
|
local data_rows=$(grep -v '^[[:space:]]*$' "$FULL_CSV_PATH" | tail -n +2 | wc -l)
|
|
1179
1215
|
|
|
@@ -1187,7 +1223,7 @@ generate_structural_mutation_direct() {
|
|
|
1187
1223
|
# Use relative paths and change to evolution directory so AI can access files
|
|
1188
1224
|
local temp_csv_basename=$(basename "$temp_csv")
|
|
1189
1225
|
|
|
1190
|
-
local prompt="I need you to use your file editing capabilities to
|
|
1226
|
+
local prompt="I need you to use your file editing capabilities to fill in PLACEHOLDER descriptions in the CSV file: $temp_csv_basename
|
|
1191
1227
|
|
|
1192
1228
|
IMPORTANT: You MUST use one of these exact parent IDs: $valid_parent_ids
|
|
1193
1229
|
|
|
@@ -1200,33 +1236,20 @@ IMPORTANT: DO NOT read evolution_*.py files. Generate structural ideas based ONL
|
|
|
1200
1236
|
- Your knowledge of common algorithmic structures and patterns
|
|
1201
1237
|
Reading code files wastes tokens and time. Focus on high-level architectural ideas based on the descriptions.
|
|
1202
1238
|
|
|
1203
|
-
CRITICAL
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1239
|
+
CRITICAL TASK:
|
|
1240
|
+
The CSV file already contains $count stub rows with these IDs: $required_ids_str
|
|
1241
|
+
Each stub row has a PLACEHOLDER description like: \"[PLACEHOLDER: Replace with structural modification idea]\"
|
|
1242
|
+
Your job is to REPLACE each PLACEHOLDER with a real structural modification idea.
|
|
1207
1243
|
|
|
1208
1244
|
CRITICAL INSTRUCTIONS:
|
|
1209
|
-
1. Use the Read tool to examine the
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
7. Each parent_id MUST be one of: $valid_parent_ids
|
|
1218
|
-
8. CRITICAL CSV FORMATTING RULES:
|
|
1219
|
-
- ALWAYS wrap the description field in double quotes
|
|
1220
|
-
- If the description contains quotes, escape them by doubling them (\" becomes \"\")
|
|
1221
|
-
- Example: gen01-001,gen00-000,\"Add ML-based regime detection using LSTM\",,pending
|
|
1222
|
-
- BAD: gen01-001,gen00-000,Add ML-based regime detection using LSTM,,pending
|
|
1223
|
-
- NEVER omit quotes around descriptions - this causes CSV parsing errors
|
|
1224
|
-
9. Each description should focus on architectural/structural changes based on the parent's actual code
|
|
1225
|
-
10. Reference actual components/methods found in the source code
|
|
1226
|
-
|
|
1227
|
-
IMPORTANT: You must APPEND new rows to the existing CSV file. DO NOT replace the file contents. All existing rows must remain unchanged.
|
|
1228
|
-
CRITICAL: You must use your file editing tools (Edit/MultiEdit) to modify the CSV file. DO NOT return CSV text - use your tools to edit the file directly.
|
|
1229
|
-
CRITICAL: Do NOT use any git commands (git add, git commit, git reset, etc.). Only modify the file directly."
|
|
1245
|
+
1. Use the Read tool to examine the CSV file (read from the END to see the placeholder rows)
|
|
1246
|
+
2. DO NOT ADD OR DELETE ANY ROWS - only EDIT the placeholder descriptions
|
|
1247
|
+
3. DO NOT CHANGE THE IDs - they are already correct
|
|
1248
|
+
4. Use the Edit tool to replace each PLACEHOLDER description with a structural modification idea
|
|
1249
|
+
5. You may also change the parent_id field if needed to reference a different top performer
|
|
1250
|
+
6. Each description should focus on architectural/structural changes
|
|
1251
|
+
7. CRITICAL: When editing, preserve the CSV formatting with proper quoting
|
|
1252
|
+
8. DO NOT use any git commands (git add, git commit, git reset, etc.). Only modify the file directly."
|
|
1230
1253
|
|
|
1231
1254
|
# Change to evolution directory so AI can access files
|
|
1232
1255
|
local original_pwd=$(pwd)
|
|
@@ -1248,13 +1271,13 @@ CRITICAL: Do NOT use any git commands (git add, git commit, git reset, etc.). On
|
|
|
1248
1271
|
# Restore working directory
|
|
1249
1272
|
cd "$original_pwd"
|
|
1250
1273
|
|
|
1251
|
-
|
|
1252
|
-
# Validate that the CSV file was actually modified
|
|
1253
|
-
if ! validate_direct_csv_modification "$temp_csv" "$count" "structural" "$ai_response"; then
|
|
1274
|
+
|
|
1275
|
+
# Validate that the CSV file was actually modified with correct IDs
|
|
1276
|
+
if ! validate_direct_csv_modification "$temp_csv" "$count" "structural" "$ai_response" "$required_ids_str"; then
|
|
1254
1277
|
rm -f "$temp_csv"
|
|
1255
1278
|
return 1
|
|
1256
1279
|
fi
|
|
1257
|
-
|
|
1280
|
+
|
|
1258
1281
|
echo "[INFO] Structural mutation ideas generated successfully"
|
|
1259
1282
|
return 0
|
|
1260
1283
|
}
|
|
@@ -1282,6 +1305,14 @@ generate_crossover_direct() {
|
|
|
1282
1305
|
local temp_csv="$FULL_EVOLUTION_DIR/temp-csv-$$.csv"
|
|
1283
1306
|
cp "$FULL_CSV_PATH" "$temp_csv"
|
|
1284
1307
|
|
|
1308
|
+
# Pre-populate the CSV with stub rows
|
|
1309
|
+
echo "[INFO] Pre-populating CSV with stub rows: $required_ids_str"
|
|
1310
|
+
local first_parent_id
|
|
1311
|
+
first_parent_id=$(echo "$valid_parent_ids" | cut -d',' -f1)
|
|
1312
|
+
for id in "${required_ids[@]}"; do
|
|
1313
|
+
echo "$id,$first_parent_id,\"[PLACEHOLDER: Replace with crossover hybrid idea]\",,pending" >> "$temp_csv"
|
|
1314
|
+
done
|
|
1315
|
+
|
|
1285
1316
|
echo "[INFO] Generating $count crossover hybrid ideas with IDs: $required_ids_str"
|
|
1286
1317
|
local data_rows=$(grep -v '^[[:space:]]*$' "$FULL_CSV_PATH" | tail -n +2 | wc -l)
|
|
1287
1318
|
|
|
@@ -1295,7 +1326,7 @@ generate_crossover_direct() {
|
|
|
1295
1326
|
# Use relative paths and change to evolution directory so AI can access files
|
|
1296
1327
|
local temp_csv_basename=$(basename "$temp_csv")
|
|
1297
1328
|
|
|
1298
|
-
local prompt="I need you to use your file editing capabilities to
|
|
1329
|
+
local prompt="I need you to use your file editing capabilities to fill in PLACEHOLDER descriptions in the CSV file: $temp_csv_basename
|
|
1299
1330
|
|
|
1300
1331
|
IMPORTANT: You MUST use ONLY these exact parent IDs: $valid_parent_ids
|
|
1301
1332
|
|
|
@@ -1308,33 +1339,20 @@ IMPORTANT: DO NOT read evolution_*.py files. Generate crossover ideas based ONLY
|
|
|
1308
1339
|
- Your knowledge of how different algorithmic approaches can be combined
|
|
1309
1340
|
Reading code files wastes tokens and time. Focus on combining the described features creatively.
|
|
1310
1341
|
|
|
1311
|
-
CRITICAL
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1342
|
+
CRITICAL TASK:
|
|
1343
|
+
The CSV file already contains $count stub rows with these IDs: $required_ids_str
|
|
1344
|
+
Each stub row has a PLACEHOLDER description like: \"[PLACEHOLDER: Replace with crossover hybrid idea]\"
|
|
1345
|
+
Your job is to REPLACE each PLACEHOLDER with a real crossover/hybrid idea that combines 2+ algorithms.
|
|
1315
1346
|
|
|
1316
1347
|
CRITICAL INSTRUCTIONS:
|
|
1317
|
-
1. Use the Read tool to examine the
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
7. Each parent_id MUST be one of: $valid_parent_ids (choose the primary parent)
|
|
1326
|
-
8. CRITICAL CSV FORMATTING RULES:
|
|
1327
|
-
- ALWAYS wrap the description field in double quotes
|
|
1328
|
-
- If the description contains quotes, escape them by doubling them (\" becomes \"\")
|
|
1329
|
-
- Example: gen01-001,gen00-000,\"Combine gen01-123's RSI logic with gen01-456's volatility scaling\",,pending
|
|
1330
|
-
- BAD: gen01-001,gen00-000,Combine gen01-123's RSI logic with gen01-456's volatility scaling,,pending
|
|
1331
|
-
- NEVER omit quotes around descriptions - this causes CSV parsing errors
|
|
1332
|
-
9. Each description should combine actual elements from 2+ algorithms based on their source code
|
|
1333
|
-
10. Reference specific components/features found in the actual source code
|
|
1334
|
-
|
|
1335
|
-
IMPORTANT: You must APPEND new rows to the existing CSV file. DO NOT replace the file contents. All existing rows must remain unchanged.
|
|
1336
|
-
CRITICAL: You must use your file editing tools (Edit/MultiEdit) to modify the CSV file. DO NOT return CSV text - use your tools to edit the file directly.
|
|
1337
|
-
CRITICAL: Do NOT use any git commands (git add, git commit, git reset, etc.). Only modify the file directly."
|
|
1348
|
+
1. Use the Read tool to examine the CSV file (read from the END to see the placeholder rows)
|
|
1349
|
+
2. DO NOT ADD OR DELETE ANY ROWS - only EDIT the placeholder descriptions
|
|
1350
|
+
3. DO NOT CHANGE THE IDs - they are already correct
|
|
1351
|
+
4. Use the Edit tool to replace each PLACEHOLDER description with a crossover idea
|
|
1352
|
+
5. You may also change the parent_id field if needed (choose the primary parent)
|
|
1353
|
+
6. Each description should combine actual elements from 2+ top performers
|
|
1354
|
+
7. CRITICAL: When editing, preserve the CSV formatting with proper quoting
|
|
1355
|
+
8. DO NOT use any git commands (git add, git commit, git reset, etc.). Only modify the file directly."
|
|
1338
1356
|
|
|
1339
1357
|
# Change to evolution directory so AI can access files
|
|
1340
1358
|
local original_pwd=$(pwd)
|
|
@@ -1356,13 +1374,13 @@ CRITICAL: Do NOT use any git commands (git add, git commit, git reset, etc.). On
|
|
|
1356
1374
|
# Restore working directory
|
|
1357
1375
|
cd "$original_pwd"
|
|
1358
1376
|
|
|
1359
|
-
|
|
1360
|
-
# Validate that the CSV file was actually modified
|
|
1361
|
-
if ! validate_direct_csv_modification "$temp_csv" "$count" "crossover" "$ai_response"; then
|
|
1377
|
+
|
|
1378
|
+
# Validate that the CSV file was actually modified with correct IDs
|
|
1379
|
+
if ! validate_direct_csv_modification "$temp_csv" "$count" "crossover" "$ai_response" "$required_ids_str"; then
|
|
1362
1380
|
rm -f "$temp_csv"
|
|
1363
1381
|
return 1
|
|
1364
1382
|
fi
|
|
1365
|
-
|
|
1383
|
+
|
|
1366
1384
|
echo "[INFO] Crossover hybrid ideas generated successfully"
|
|
1367
1385
|
return 0
|
|
1368
1386
|
}
|