claude-evolve 1.3.4 → 1.3.5
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/README.md +21 -0
- package/bin/claude-evolve-run +5 -5
- package/bin/claude-evolve-worker +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -196,6 +196,27 @@ your-project/
|
|
|
196
196
|
└── (your main project files)
|
|
197
197
|
```
|
|
198
198
|
|
|
199
|
+
## Environment Variables for Evaluators
|
|
200
|
+
|
|
201
|
+
When your evaluator.py runs, it has access to the `EXPERIMENT_ID` environment variable containing the current experiment's ID (e.g., `gen07-001`). This allows evaluators to:
|
|
202
|
+
|
|
203
|
+
- Save experiment-specific output files
|
|
204
|
+
- Log metrics with experiment identifiers
|
|
205
|
+
- Implement experiment-aware logic
|
|
206
|
+
- Track which algorithm variant is being evaluated
|
|
207
|
+
|
|
208
|
+
Example usage in evaluator.py:
|
|
209
|
+
```python
|
|
210
|
+
import os
|
|
211
|
+
|
|
212
|
+
# Get the current experiment ID
|
|
213
|
+
experiment_id = os.environ.get('EXPERIMENT_ID', 'unknown')
|
|
214
|
+
|
|
215
|
+
# Use it for logging or file naming
|
|
216
|
+
output_file = f"results_{experiment_id}.json"
|
|
217
|
+
print(f"Evaluating experiment: {experiment_id}")
|
|
218
|
+
```
|
|
219
|
+
|
|
199
220
|
## Configuration
|
|
200
221
|
|
|
201
222
|
Edit `evolution/config.yaml` to customize:
|
package/bin/claude-evolve-run
CHANGED
|
@@ -434,13 +434,13 @@ echo "[INFO] Algorithm ready at: $output_file"
|
|
|
434
434
|
|
|
435
435
|
# Run evaluator
|
|
436
436
|
echo "[INFO] Running evaluation..."
|
|
437
|
-
echo "[INFO] Executing: $PYTHON_CMD $FULL_EVALUATOR_PATH $output_file"
|
|
437
|
+
echo "[INFO] Executing: EXPERIMENT_ID=$id $PYTHON_CMD $FULL_EVALUATOR_PATH $output_file"
|
|
438
438
|
eval_output=""
|
|
439
439
|
eval_exit_code=0
|
|
440
440
|
|
|
441
441
|
if [[ -n $timeout_seconds ]]; then
|
|
442
442
|
echo "[INFO] Evaluation timeout: ${timeout_seconds}s"
|
|
443
|
-
if eval_output=$(timeout "$timeout_seconds" "$PYTHON_CMD" "$FULL_EVALUATOR_PATH" "$output_file" 2>&1); then
|
|
443
|
+
if eval_output=$(EXPERIMENT_ID="$id" timeout "$timeout_seconds" "$PYTHON_CMD" "$FULL_EVALUATOR_PATH" "$output_file" 2>&1); then
|
|
444
444
|
eval_exit_code=0
|
|
445
445
|
else
|
|
446
446
|
eval_exit_code=$?
|
|
@@ -455,7 +455,7 @@ if [[ -n $timeout_seconds ]]; then
|
|
|
455
455
|
fi
|
|
456
456
|
fi
|
|
457
457
|
else
|
|
458
|
-
if eval_output=$("$PYTHON_CMD" "$FULL_EVALUATOR_PATH" "$output_file" 2>&1); then
|
|
458
|
+
if eval_output=$(EXPERIMENT_ID="$id" "$PYTHON_CMD" "$FULL_EVALUATOR_PATH" "$output_file" 2>&1); then
|
|
459
459
|
eval_exit_code=0
|
|
460
460
|
else
|
|
461
461
|
eval_exit_code=$?
|
|
@@ -473,7 +473,7 @@ echo "----------------------------------------"
|
|
|
473
473
|
echo "=== EVALUATOR EXECUTION ==="
|
|
474
474
|
echo "ID: $id"
|
|
475
475
|
echo "Algorithm: $output_file"
|
|
476
|
-
echo "Command: $PYTHON_CMD $FULL_EVALUATOR_PATH $output_file"
|
|
476
|
+
echo "Command: EXPERIMENT_ID=$id $PYTHON_CMD $FULL_EVALUATOR_PATH $output_file"
|
|
477
477
|
echo "Exit code: $eval_exit_code"
|
|
478
478
|
echo "Timestamp: $(date)"
|
|
479
479
|
echo
|
|
@@ -554,7 +554,7 @@ else
|
|
|
554
554
|
recovery_attempted=true
|
|
555
555
|
# Retry the evaluation
|
|
556
556
|
echo "[INFO] Retrying evaluation after recovery attempt..."
|
|
557
|
-
if eval_output=$("$PYTHON_CMD" "$FULL_EVALUATOR_PATH" "$output_file" 2>&1); then
|
|
557
|
+
if eval_output=$(EXPERIMENT_ID="$id" "$PYTHON_CMD" "$FULL_EVALUATOR_PATH" "$output_file" 2>&1); then
|
|
558
558
|
# Re-process the successful result
|
|
559
559
|
if score=$(echo "$eval_output" | grep -o '"score"[[:space:]]*:[[:space:]]*[0-9.]*' | cut -d: -f2 | tr -d ' '); then
|
|
560
560
|
if [[ -n $score ]]; then
|
package/bin/claude-evolve-worker
CHANGED
|
@@ -188,7 +188,7 @@ eval_exit_code=0
|
|
|
188
188
|
if [[ -n $timeout_seconds ]]; then
|
|
189
189
|
echo "[WORKER-$$] Evaluation timeout: ${timeout_seconds}s"
|
|
190
190
|
# For Modal compatibility, don't capture stderr
|
|
191
|
-
if eval_output=$(timeout "$timeout_seconds" "$PYTHON_CMD" "$FULL_EVALUATOR_PATH" "$output_file"); then
|
|
191
|
+
if eval_output=$(EXPERIMENT_ID="$id" timeout "$timeout_seconds" "$PYTHON_CMD" "$FULL_EVALUATOR_PATH" "$output_file"); then
|
|
192
192
|
eval_exit_code=0
|
|
193
193
|
else
|
|
194
194
|
eval_exit_code=$?
|
|
@@ -200,7 +200,7 @@ if [[ -n $timeout_seconds ]]; then
|
|
|
200
200
|
fi
|
|
201
201
|
else
|
|
202
202
|
# For Modal compatibility, don't capture stderr
|
|
203
|
-
if eval_output=$("$PYTHON_CMD" "$FULL_EVALUATOR_PATH" "$output_file"); then
|
|
203
|
+
if eval_output=$(EXPERIMENT_ID="$id" "$PYTHON_CMD" "$FULL_EVALUATOR_PATH" "$output_file"); then
|
|
204
204
|
eval_exit_code=0
|
|
205
205
|
else
|
|
206
206
|
eval_exit_code=$?
|