claude-evolve 1.2.8 → 1.2.10
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-analyze +55 -25
- package/package.json +1 -1
|
@@ -83,16 +83,19 @@ while IFS=, read -r id _ desc perf status; do
|
|
|
83
83
|
case "$status" in
|
|
84
84
|
"complete" | "completed")
|
|
85
85
|
((completed++))
|
|
86
|
-
# Only count performance for completed runs
|
|
86
|
+
# Only count performance for completed runs with non-zero values
|
|
87
87
|
if [[ -n $perf && $perf != "" ]]; then
|
|
88
|
-
|
|
89
|
-
((
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
88
|
+
# Skip zeros (they're errors)
|
|
89
|
+
if (( $(echo "$perf > 0" | bc -l 2>/dev/null || echo "0") )); then
|
|
90
|
+
total_performance=$(echo "$total_performance + $perf" | bc -l 2>/dev/null || echo "$total_performance")
|
|
91
|
+
((count_with_performance++))
|
|
92
|
+
|
|
93
|
+
# Check if this is the top performer
|
|
94
|
+
if [[ -z $top_score ]] || (($(echo "$perf > $top_score" | bc -l 2>/dev/null || echo "0"))); then
|
|
95
|
+
top_score="$perf"
|
|
96
|
+
top_id="$id"
|
|
97
|
+
top_desc="$desc"
|
|
98
|
+
fi
|
|
96
99
|
fi
|
|
97
100
|
fi
|
|
98
101
|
;;
|
|
@@ -148,7 +151,12 @@ while IFS=, read -r id _ desc perf status; do
|
|
|
148
151
|
# Write generation data to temp file
|
|
149
152
|
echo -n "$gen " >> "$gen_stats_file"
|
|
150
153
|
if [[ $status =~ ^(complete|completed)$ && -n $perf && $perf != "" ]]; then
|
|
151
|
-
|
|
154
|
+
# Exclude zeros from statistics (they're errors)
|
|
155
|
+
if (( $(echo "$perf > 0" | bc -l 2>/dev/null || echo "0") )); then
|
|
156
|
+
echo "completed $perf" >> "$gen_stats_file"
|
|
157
|
+
else
|
|
158
|
+
echo "error" >> "$gen_stats_file"
|
|
159
|
+
fi
|
|
152
160
|
else
|
|
153
161
|
echo "incomplete" >> "$gen_stats_file"
|
|
154
162
|
fi
|
|
@@ -178,43 +186,65 @@ if command -v gnuplot >/dev/null 2>&1 && [[ $count_with_performance -gt 0 ]]; th
|
|
|
178
186
|
echo
|
|
179
187
|
echo "Generating performance chart: $output_file"
|
|
180
188
|
|
|
181
|
-
# Create data file for gnuplot with row numbers
|
|
189
|
+
# Create data file for gnuplot with row numbers, excluding zeros
|
|
182
190
|
data_file="/tmp/evolution_data_$$.dat"
|
|
183
|
-
|
|
191
|
+
winner_file="/tmp/evolution_winner_$$.dat"
|
|
192
|
+
echo "# Row ID Performance" >"$data_file"
|
|
184
193
|
|
|
185
194
|
row_num=0
|
|
195
|
+
max_perf=0
|
|
196
|
+
max_row=0
|
|
197
|
+
max_id=""
|
|
198
|
+
|
|
186
199
|
while IFS=, read -r id _ desc perf status; do
|
|
187
200
|
[[ $id == "id" ]] && continue # Skip header
|
|
188
201
|
((row_num++))
|
|
202
|
+
|
|
203
|
+
# Only include completed algorithms with non-zero performance
|
|
189
204
|
if [[ -n $perf && $perf != "" && $status =~ ^(complete|completed)$ ]]; then
|
|
190
|
-
#
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
205
|
+
# Skip zero values (they're errors)
|
|
206
|
+
if (( $(echo "$perf > 0" | bc -l) )); then
|
|
207
|
+
echo "$row_num \"$id\" $perf" >>"$data_file"
|
|
208
|
+
|
|
209
|
+
# Track the winner
|
|
210
|
+
if (( $(echo "$perf > $max_perf" | bc -l) )); then
|
|
211
|
+
max_perf=$perf
|
|
212
|
+
max_row=$row_num
|
|
213
|
+
max_id=$id
|
|
214
|
+
fi
|
|
194
215
|
fi
|
|
195
|
-
echo "$row_num \"$id\" $perf $gen_num" >>"$data_file"
|
|
196
216
|
fi
|
|
197
217
|
done <"$csv_file"
|
|
198
218
|
|
|
219
|
+
# Create winner data point
|
|
220
|
+
if [[ -n $max_id ]]; then
|
|
221
|
+
echo "$max_row \"$max_id\" $max_perf" >"$winner_file"
|
|
222
|
+
fi
|
|
223
|
+
|
|
199
224
|
# Generate plot
|
|
200
225
|
gnuplot <<EOF
|
|
201
226
|
set terminal png size 1000,600
|
|
202
227
|
set output "$output_file"
|
|
203
228
|
set title "Algorithm Evolution Performance"
|
|
204
|
-
set xlabel "Evolution
|
|
229
|
+
set xlabel "Evolution Run"
|
|
205
230
|
set ylabel "Performance Score"
|
|
206
231
|
set grid
|
|
207
|
-
set key
|
|
232
|
+
set key off
|
|
233
|
+
|
|
234
|
+
# Set y-axis range with some padding
|
|
235
|
+
stats "$data_file" using 3 nooutput
|
|
236
|
+
set yrange [STATS_min*0.95:STATS_max*1.05]
|
|
208
237
|
|
|
209
|
-
#
|
|
210
|
-
|
|
238
|
+
# Plot the main line in dark blue, winner as large blue circle
|
|
239
|
+
plot "$data_file" using 1:3 with lines linewidth 2 linecolor rgb "#1f77b4" notitle, \
|
|
240
|
+
"$data_file" using 1:3 with points pointtype 7 pointsize 0.5 linecolor rgb "#1f77b4" notitle, \
|
|
241
|
+
"$winner_file" using 1:3 with points pointtype 7 pointsize 3 linecolor rgb "#0000ff" notitle
|
|
211
242
|
|
|
212
|
-
#
|
|
213
|
-
|
|
214
|
-
"$data_file" using 1:3:(sprintf("%g", \$3)) with labels offset 0,0.5 notitle
|
|
243
|
+
# Add label with winner info at bottom
|
|
244
|
+
set label 1 "Best: $max_id (Score: $max_perf)" at graph 0.5, -0.15 center font ",10"
|
|
215
245
|
EOF
|
|
216
246
|
|
|
217
|
-
rm -f "$data_file"
|
|
247
|
+
rm -f "$data_file" "$winner_file"
|
|
218
248
|
echo "Chart saved to: $output_file"
|
|
219
249
|
|
|
220
250
|
# Always try to open chart (not just when --open is used)
|