claude-evolve 1.1.0 → 1.1.1
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-run +39 -8
- package/package.json +1 -1
package/bin/claude-evolve-run
CHANGED
|
@@ -53,6 +53,9 @@ echo "[INFO] Starting continuous evolution run..."
|
|
|
53
53
|
echo "[INFO] Will continue running until no more pending candidates or 5 consecutive failures"
|
|
54
54
|
[[ -n $timeout_seconds ]] && echo "[INFO] Using timeout: ${timeout_seconds} seconds per evaluation"
|
|
55
55
|
|
|
56
|
+
# Prepare logging directory
|
|
57
|
+
mkdir -p logs
|
|
58
|
+
|
|
56
59
|
# Track consecutive failures
|
|
57
60
|
consecutive_failures=0
|
|
58
61
|
MAX_FAILURES=5
|
|
@@ -145,6 +148,9 @@ while true; do
|
|
|
145
148
|
echo "[INFO] No more pending candidates found. Evolution run complete!"
|
|
146
149
|
exit 0
|
|
147
150
|
fi
|
|
151
|
+
|
|
152
|
+
# Create log file for this iteration
|
|
153
|
+
LOGFILE="logs/claude-$(date +%Y%m%d_%H%M%S).txt"
|
|
148
154
|
|
|
149
155
|
# Get row data
|
|
150
156
|
row_data=$(get_csv_row "$row_num")
|
|
@@ -240,11 +246,26 @@ if [[ $id == "000" || $id == "0" ]]; then
|
|
|
240
246
|
else
|
|
241
247
|
echo "[INFO] Calling Claude $CLAUDE_MODEL to apply mutation..."
|
|
242
248
|
echo "[INFO] Claude will edit: $output_file"
|
|
249
|
+
echo "[INFO] Logging to: ${LOGFILE}-developer"
|
|
250
|
+
|
|
251
|
+
# Claude will edit the file directly - log both prompt and response
|
|
252
|
+
{
|
|
253
|
+
echo "=== EVOLUTION MUTATION PROMPT ==="
|
|
254
|
+
echo "ID: $id"
|
|
255
|
+
echo "Based on: $based_on_id"
|
|
256
|
+
echo "Description: $description"
|
|
257
|
+
echo "Output file: $output_file"
|
|
258
|
+
echo "Model: $CLAUDE_MODEL"
|
|
259
|
+
echo "Timestamp: $(date)"
|
|
260
|
+
echo
|
|
261
|
+
echo "$prompt"
|
|
262
|
+
echo
|
|
263
|
+
echo "=== CLAUDE RESPONSE ==="
|
|
264
|
+
} >> "${LOGFILE}-developer"
|
|
243
265
|
|
|
244
|
-
#
|
|
245
|
-
if !
|
|
266
|
+
# Use tee to show output and log simultaneously
|
|
267
|
+
if ! echo "$prompt" | "$claude_cmd" --model $CLAUDE_MODEL -p 2>&1 | tee -a "${LOGFILE}-developer"; then
|
|
246
268
|
echo "[ERROR] Claude failed to mutate algorithm" >&2
|
|
247
|
-
echo "[ERROR] Claude output: $output" >&2
|
|
248
269
|
update_csv_row "$row_num" "" "failed"
|
|
249
270
|
if should_continue_after_failure; then
|
|
250
271
|
continue
|
|
@@ -254,10 +275,6 @@ else
|
|
|
254
275
|
fi
|
|
255
276
|
|
|
256
277
|
echo "[INFO] Claude completed mutation"
|
|
257
|
-
# Show Claude's response (it might contain useful information about what was changed)
|
|
258
|
-
if [[ -n $output ]]; then
|
|
259
|
-
echo "[INFO] Claude response: $output"
|
|
260
|
-
fi
|
|
261
278
|
fi
|
|
262
279
|
|
|
263
280
|
echo "[INFO] Algorithm ready at: $output_file"
|
|
@@ -292,12 +309,26 @@ else
|
|
|
292
309
|
fi
|
|
293
310
|
fi
|
|
294
311
|
|
|
295
|
-
# Show evaluator output
|
|
312
|
+
# Show evaluator output and log it
|
|
296
313
|
echo "[INFO] Evaluator output:"
|
|
297
314
|
echo "----------------------------------------"
|
|
298
315
|
echo "$eval_output"
|
|
299
316
|
echo "----------------------------------------"
|
|
300
317
|
|
|
318
|
+
# Log evaluator phase
|
|
319
|
+
{
|
|
320
|
+
echo "=== EVALUATOR EXECUTION ==="
|
|
321
|
+
echo "ID: $id"
|
|
322
|
+
echo "Algorithm: $output_file"
|
|
323
|
+
echo "Command: $PYTHON_CMD $FULL_EVALUATOR_PATH $output_file"
|
|
324
|
+
echo "Exit code: $eval_exit_code"
|
|
325
|
+
echo "Timestamp: $(date)"
|
|
326
|
+
echo
|
|
327
|
+
echo "=== EVALUATOR OUTPUT ==="
|
|
328
|
+
echo "$eval_output"
|
|
329
|
+
echo
|
|
330
|
+
} >> "${LOGFILE}-evaluator"
|
|
331
|
+
|
|
301
332
|
# Process results
|
|
302
333
|
if [[ $eval_exit_code -eq 0 ]]; then
|
|
303
334
|
# Extract score from JSON (simple grep approach)
|