claude-evolve 1.4.2 → 1.4.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.
- package/bin/claude-evolve-worker +27 -11
- package/package.json +1 -1
package/bin/claude-evolve-worker
CHANGED
|
@@ -69,10 +69,15 @@ process_candidate() {
|
|
|
69
69
|
# Check if already evaluated
|
|
70
70
|
local current_status
|
|
71
71
|
current_status=$("$PYTHON_CMD" -c "
|
|
72
|
+
import sys
|
|
73
|
+
sys.path.insert(0, '$SCRIPT_DIR/..')
|
|
72
74
|
from lib.evolution_csv import EvolutionCSV
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
75
|
+
with EvolutionCSV('$FULL_CSV_PATH') as csv:
|
|
76
|
+
candidate = csv.get_candidate_info('$candidate_id')
|
|
77
|
+
if candidate:
|
|
78
|
+
print(candidate.get('status', 'unknown'))
|
|
79
|
+
else:
|
|
80
|
+
print('unknown')
|
|
76
81
|
")
|
|
77
82
|
|
|
78
83
|
if [[ "$current_status" == "complete" ]]; then
|
|
@@ -126,9 +131,12 @@ Important: Make meaningful changes that match the description. Don't just add co
|
|
|
126
131
|
|
|
127
132
|
# Update CSV with result
|
|
128
133
|
"$PYTHON_CMD" -c "
|
|
134
|
+
import sys
|
|
135
|
+
sys.path.insert(0, '$SCRIPT_DIR/..')
|
|
129
136
|
from lib.evolution_csv import EvolutionCSV
|
|
130
|
-
|
|
131
|
-
csv.update_candidate_status('$candidate_id', 'complete'
|
|
137
|
+
with EvolutionCSV('$FULL_CSV_PATH') as csv:
|
|
138
|
+
csv.update_candidate_status('$candidate_id', 'complete')
|
|
139
|
+
csv.update_candidate_performance('$candidate_id', '$score')
|
|
132
140
|
"
|
|
133
141
|
else
|
|
134
142
|
echo "[WORKER-$$] ERROR: No score found in evaluation output" >&2
|
|
@@ -142,9 +150,11 @@ csv.update_candidate_status('$candidate_id', 'complete', performance='$score')
|
|
|
142
150
|
|
|
143
151
|
# Mark as failed in CSV
|
|
144
152
|
"$PYTHON_CMD" -c "
|
|
153
|
+
import sys
|
|
154
|
+
sys.path.insert(0, '$SCRIPT_DIR/..')
|
|
145
155
|
from lib.evolution_csv import EvolutionCSV
|
|
146
|
-
|
|
147
|
-
csv.update_candidate_status('$candidate_id', 'failed')
|
|
156
|
+
with EvolutionCSV('$FULL_CSV_PATH') as csv:
|
|
157
|
+
csv.update_candidate_status('$candidate_id', 'failed')
|
|
148
158
|
"
|
|
149
159
|
|
|
150
160
|
return $exit_code
|
|
@@ -157,11 +167,17 @@ echo "[WORKER-$$] Worker started"
|
|
|
157
167
|
while true; do
|
|
158
168
|
# Try to claim a pending candidate
|
|
159
169
|
candidate_info=$("$PYTHON_CMD" -c "
|
|
170
|
+
import sys
|
|
171
|
+
sys.path.insert(0, '$SCRIPT_DIR/..')
|
|
160
172
|
from lib.evolution_csv import EvolutionCSV
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
if
|
|
164
|
-
|
|
173
|
+
with EvolutionCSV('$FULL_CSV_PATH') as csv:
|
|
174
|
+
result = csv.get_next_pending_candidate()
|
|
175
|
+
if result:
|
|
176
|
+
candidate_id, _ = result
|
|
177
|
+
# Get full candidate info
|
|
178
|
+
candidate = csv.get_candidate_info(candidate_id)
|
|
179
|
+
if candidate:
|
|
180
|
+
print(f'{candidate[\"id\"]}|{candidate.get(\"parent_id\", \"\")}|{candidate[\"description\"]}')
|
|
165
181
|
")
|
|
166
182
|
|
|
167
183
|
if [[ -z "$candidate_info" ]]; then
|