claude-evolve 1.0.15 → 1.0.17

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.
@@ -77,9 +77,10 @@ fi
77
77
  # Find oldest pending row (pure shell)
78
78
  find_empty_row() {
79
79
  local row_num=2 # Start after header
80
- while IFS=, read -r id based_on desc perf status; do
80
+ local csv_id csv_based_on csv_desc csv_perf csv_status
81
+ while IFS=, read -r csv_id csv_based_on csv_desc csv_perf csv_status; do
81
82
  # Look for rows with pending status or empty status (but not complete/failed/running)
82
- if [[ $status == "pending" || (-z $perf && -z $status) ]]; then
83
+ if [[ $csv_status == "pending" || (-z $csv_perf && -z $csv_status) ]]; then
83
84
  echo $row_num
84
85
  return 0
85
86
  fi
@@ -102,14 +103,15 @@ update_csv_row() {
102
103
  # Read CSV and update specific row
103
104
  local temp_file="${FULL_CSV_PATH}.tmp"
104
105
  local current_row=1
106
+ local csv_id csv_based_on csv_desc csv_perf csv_stat
105
107
 
106
- while IFS=, read -r id based_on desc perf stat; do
108
+ while IFS=, read -r csv_id csv_based_on csv_desc csv_perf csv_stat; do
107
109
  if [[ $current_row -eq $row_num ]]; then
108
110
  # Update this row
109
- echo "$id,$based_on,$desc,$performance,$status"
111
+ echo "$csv_id,$csv_based_on,$csv_desc,$performance,$status"
110
112
  else
111
113
  # Keep original row
112
- echo "$id,$based_on,$desc,$perf,$stat"
114
+ echo "$csv_id,$csv_based_on,$csv_desc,$csv_perf,$csv_stat"
113
115
  fi
114
116
  ((current_row++))
115
117
  done <"$FULL_CSV_PATH" >"$temp_file"
@@ -125,9 +127,7 @@ fi
125
127
 
126
128
  # Get row data
127
129
  row_data=$(get_csv_row "$row_num")
128
- echo "[DEBUG] Raw row data: '$row_data'"
129
130
  IFS=, read -r id based_on_id description performance status <<<"$row_data"
130
- echo "[DEBUG] After parsing - ID: '$id', based_on_id: '$based_on_id'"
131
131
 
132
132
  # Check if ID is empty
133
133
  if [[ -z $id ]]; then
@@ -147,9 +147,6 @@ echo "[INFO] Based on ID: $based_on_id"
147
147
  # Set interrupt handler - just exit without updating CSV status
148
148
  trap 'echo "[INFO] Evolution interrupted"; exit 130' INT
149
149
 
150
- # Mark as running
151
- update_csv_row "$row_num" "" "running"
152
-
153
150
  # Determine parent algorithm
154
151
  if [[ -z $based_on_id || $based_on_id == "0" || $based_on_id == '""' ]]; then
155
152
  # Empty or zero basedonID means use the base algorithm
@@ -167,9 +164,7 @@ fi
167
164
  echo "[INFO] Using parent algorithm: $parent_file"
168
165
 
169
166
  # Generate mutation
170
- echo "[DEBUG] ID is: '$id', FULL_OUTPUT_DIR is: '$FULL_OUTPUT_DIR'"
171
167
  output_file="$FULL_OUTPUT_DIR/evolution_id${id}.py"
172
- echo "[DEBUG] Output file will be: '$output_file'"
173
168
  echo "[INFO] Generating algorithm mutation..."
174
169
 
175
170
  # Copy parent algorithm to output file first
@@ -228,24 +223,32 @@ INSTRUCTIONS:
228
223
 
229
224
  The output should be a complete, executable Python file that builds upon the existing algorithm."
230
225
 
231
- # Generate mutation
232
- if ! generated_code=$(echo "$prompt" | "$claude_cmd" --model $CLAUDE_MODEL); then
233
- echo "[ERROR] Claude failed to generate algorithm mutation" >&2
234
- update_csv_row "$row_num" "" "failed"
235
- exit 1
226
+ # Generate mutation (skip for baseline)
227
+ if [[ $id == "000" || $id == "0" ]]; then
228
+ echo "[INFO] Baseline algorithm - skipping mutation, using original"
229
+ else
230
+ echo "[INFO] Calling Claude $CLAUDE_MODEL to apply mutation..."
231
+ if ! generated_code=$(echo "$prompt" | "$claude_cmd" --model $CLAUDE_MODEL); then
232
+ echo "[ERROR] Claude failed to generate algorithm mutation" >&2
233
+ update_csv_row "$row_num" "" "failed"
234
+ exit 1
235
+ fi
236
+
237
+ # Save generated algorithm (overwrite the copied file)
238
+ echo "$generated_code" >"$output_file"
239
+ echo "[INFO] Claude successfully mutated algorithm"
236
240
  fi
237
241
 
238
- # Save generated algorithm (overwrite the copied file)
239
- echo "$generated_code" >"$output_file"
240
- echo "[INFO] Updated algorithm: $output_file"
242
+ echo "[INFO] Algorithm ready at: $output_file"
241
243
 
242
244
  # Run evaluator
243
245
  echo "[INFO] Running evaluation..."
246
+ echo "[INFO] Executing: $PYTHON_CMD $FULL_EVALUATOR_PATH $output_file"
244
247
  eval_output=""
245
248
  eval_exit_code=0
246
249
 
247
250
  if [[ -n $timeout_seconds ]]; then
248
- echo "[INFO] Starting evaluation with ${timeout_seconds}s timeout..."
251
+ echo "[INFO] Evaluation timeout: ${timeout_seconds}s"
249
252
  if eval_output=$(timeout "$timeout_seconds" "$PYTHON_CMD" "$FULL_EVALUATOR_PATH" "$output_file" 2>&1); then
250
253
  eval_exit_code=0
251
254
  else
@@ -264,18 +267,24 @@ else
264
267
  fi
265
268
  fi
266
269
 
270
+ # Show evaluator output
271
+ echo "[INFO] Evaluator output:"
272
+ echo "----------------------------------------"
273
+ echo "$eval_output"
274
+ echo "----------------------------------------"
275
+
267
276
  # Process results
268
277
  if [[ $eval_exit_code -eq 0 ]]; then
269
278
  # Extract score from JSON (simple grep approach)
270
279
  if score=$(echo "$eval_output" | grep -o '"score"[[:space:]]*:[[:space:]]*[0-9.]*' | cut -d: -f2 | tr -d ' '); then
271
280
  if [[ -n $score ]]; then
272
- update_csv_row "$row_num" "$score" "completed"
281
+ update_csv_row "$row_num" "$score" "complete"
273
282
  echo "[INFO] ✓ Evaluation completed successfully"
274
283
  echo "[INFO] Performance score: $score"
275
284
  else
276
285
  # Try "performance" field
277
286
  if score=$(echo "$eval_output" | grep -o '"performance"[[:space:]]*:[[:space:]]*[0-9.]*' | cut -d: -f2 | tr -d ' '); then
278
- update_csv_row "$row_num" "$score" "completed"
287
+ update_csv_row "$row_num" "$score" "complete"
279
288
  echo "[INFO] ✓ Evaluation completed successfully"
280
289
  echo "[INFO] Performance score: $score"
281
290
  else
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-evolve",
3
- "version": "1.0.15",
3
+ "version": "1.0.17",
4
4
  "bin": {
5
5
  "claude-evolve": "./bin/claude-evolve",
6
6
  "claude-evolve-main": "./bin/claude-evolve-main",