claude-evolve 1.7.2 → 1.7.4

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.
@@ -131,17 +131,25 @@ call_ai_for_ideation() {
131
131
  # Try each model until CSV changes
132
132
  for model in "${ordered_models[@]}"; do
133
133
  echo "[AI] Attempting ideate with $model" >&2
134
-
134
+
135
+ # Restore temp CSV before each attempt (in case previous model corrupted it)
136
+ # This ensures each model starts with the original data
137
+ if [[ -f "$FULL_CSV_PATH" ]]; then
138
+ cp "$FULL_CSV_PATH" "$temp_csv_file"
139
+ # Recapture original count in case it changed
140
+ original_csv_count=$(grep -v '^[[:space:]]*$' "$temp_csv_file" | tail -n +2 | wc -l)
141
+ fi
142
+
135
143
  # Call the model directly
136
144
  local ai_output
137
145
  ai_output=$(call_ai_model_configured "$model" "$prompt")
138
146
  local ai_exit_code=$?
139
-
147
+
140
148
  # Check if the file was modified - this is ALL that matters
141
149
  if [[ -f "$temp_csv_file" ]]; then
142
150
  local new_csv_count
143
151
  new_csv_count=$(grep -v '^[[:space:]]*$' "$temp_csv_file" | tail -n +2 | wc -l)
144
-
152
+
145
153
  if [[ $new_csv_count -gt $original_csv_count ]]; then
146
154
  echo "[INFO] CSV was modified by $model ($new_csv_count vs $original_csv_count rows) - validating format..." >&2
147
155
 
@@ -885,6 +893,8 @@ Current evolution context:
885
893
  - Algorithm: algorithm.py (base algorithm)
886
894
  - Brief: $(head -5 "$FULL_BRIEF_PATH" 2>/dev/null | head -c 500 || echo "No brief file found")
887
895
 
896
+ 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.
897
+
888
898
  CRITICAL INSTRUCTIONS:
889
899
  1. Use the Read tool to examine the current CSV file
890
900
  IMPORTANT: If the CSV file is large (>200 lines), read it in chunks using the offset and limit parameters to avoid context overload
@@ -986,10 +996,19 @@ IMPORTANT: You MUST use one of these exact parent IDs: $valid_parent_ids
986
996
  Successful algorithms to tune:
987
997
  $top_performers
988
998
 
989
- OPTIONAL: If needed for context, you may read parent algorithm source files at: evolution_<PARENT_ID>.py
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.
999
+ IMPORTANT: Generate parameter tuning ideas based primarily on the descriptions and scores above.
1000
+
1001
+ ONLY read parent source files (evolution_<PARENT_ID>.py) if:
1002
+ - The description is too vague to identify specific parameters
1003
+ - You need to verify actual parameter names/values
1004
+ - Reading is absolutely necessary for meaningful tuning
1005
+
1006
+ If you must read source files:
1007
+ - Read in small chunks (offset/limit) to minimize token usage
1008
+ - Focus only on finding parameter definitions at the top of the file
1009
+ - Do NOT read the entire implementation
1010
+
1011
+ Most of the time, you can infer parameters from descriptions like "RSI with threshold 30" or "MA period 20".
993
1012
 
994
1013
  CRITICAL INSTRUCTIONS:
995
1014
  1. Use the Read tool to examine the current CSV file
@@ -1074,10 +1093,11 @@ IMPORTANT: You MUST use one of these exact parent IDs: $valid_parent_ids
1074
1093
  Successful algorithms to modify structurally:
1075
1094
  $top_performers
1076
1095
 
1077
- OPTIONAL: If needed for context, you may read parent algorithm source files at: evolution_<PARENT_ID>.py
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.
1096
+ IMPORTANT: DO NOT read evolution_*.py files. Generate structural ideas based ONLY on:
1097
+ - The algorithm descriptions above
1098
+ - The performance scores
1099
+ - Your knowledge of common algorithmic structures and patterns
1100
+ Reading code files wastes tokens and time. Focus on high-level architectural ideas based on the descriptions.
1081
1101
 
1082
1102
  CRITICAL INSTRUCTIONS:
1083
1103
  1. Use the Read tool to examine the current CSV file
@@ -1162,10 +1182,11 @@ IMPORTANT: You MUST use ONLY these exact parent IDs: $valid_parent_ids
1162
1182
  Top performers to combine (reference at least 2 in each idea):
1163
1183
  $top_performers
1164
1184
 
1165
- OPTIONAL: If needed for context, you may read parent algorithm source files at: evolution_<PARENT_ID>.py
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.
1185
+ IMPORTANT: DO NOT read evolution_*.py files. Generate crossover ideas based ONLY on:
1186
+ - The algorithm descriptions above (which describe their key features)
1187
+ - The performance scores
1188
+ - Your knowledge of how different algorithmic approaches can be combined
1189
+ Reading code files wastes tokens and time. Focus on combining the described features creatively.
1169
1190
 
1170
1191
  CRITICAL INSTRUCTIONS:
1171
1192
  1. Use the Read tool to examine the current CSV file
@@ -1252,9 +1273,7 @@ Current evolution context:
1252
1273
  - Algorithm: algorithm.py (base algorithm)
1253
1274
  - Brief: $(head -10 "$FULL_BRIEF_PATH" 2>/dev/null | head -c 1000 || echo "No brief file found")
1254
1275
 
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."
1276
+ IMPORTANT: DO NOT read algorithm.py or any evolution_*.py files - that uses too many tokens and is unnecessary for ideation. Just generate creative ideas based on the brief and top performers listed above. Focus your creativity on the problem space, not the implementation details."
1258
1277
 
1259
1278
  if [[ -n $top_performers ]]; then
1260
1279
  prompt+="
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-evolve",
3
- "version": "1.7.2",
3
+ "version": "1.7.4",
4
4
  "bin": {
5
5
  "claude-evolve": "./bin/claude-evolve",
6
6
  "claude-evolve-main": "./bin/claude-evolve-main",