claude-evolve 1.8.47 → 1.8.49
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 +4 -2
- package/bin/claude-evolve-ideate +17 -10
- package/package.json +1 -1
|
@@ -292,10 +292,12 @@ with open('$csv_file', 'r') as f:
|
|
|
292
292
|
# Sort generations numerically
|
|
293
293
|
for gen in $(cut -d' ' -f1 "$gen_stats_file" | sort -u | awk '{print substr($0,4), $0}' | sort -n | cut -d' ' -f2 || echo ""); do
|
|
294
294
|
[[ -z "$gen" ]] && continue
|
|
295
|
-
total_in_gen=$(grep -c "^$gen " "$gen_stats_file" 2>/dev/null ||
|
|
296
|
-
|
|
295
|
+
total_in_gen=$(grep -c "^$gen " "$gen_stats_file" 2>/dev/null) || true
|
|
296
|
+
total_in_gen=${total_in_gen:-0}
|
|
297
|
+
completed_in_gen=$(grep -c "^$gen completed" "$gen_stats_file" 2>/dev/null) || true
|
|
297
298
|
# Clean any whitespace from the numbers
|
|
298
299
|
completed_in_gen=$(echo "$completed_in_gen" | tr -d '[:space:]')
|
|
300
|
+
completed_in_gen=${completed_in_gen:-0}
|
|
299
301
|
|
|
300
302
|
echo -n "$gen: $total_in_gen candidates"
|
|
301
303
|
|
package/bin/claude-evolve-ideate
CHANGED
|
@@ -144,7 +144,7 @@ call_ai_for_ideation() {
|
|
|
144
144
|
|
|
145
145
|
# Count remaining placeholders - there should be none if AI did its job
|
|
146
146
|
local placeholder_count
|
|
147
|
-
placeholder_count=$(grep -c "PLACEHOLDER" "$temp_csv_file" 2>/dev/null ||
|
|
147
|
+
placeholder_count=$(grep -c "PLACEHOLDER" "$temp_csv_file" 2>/dev/null) || true
|
|
148
148
|
placeholder_count=$(echo "$placeholder_count" | tr -d '[:space:]')
|
|
149
149
|
placeholder_count=${placeholder_count:-0}
|
|
150
150
|
|
|
@@ -271,7 +271,7 @@ print(max_gen)
|
|
|
271
271
|
while true; do
|
|
272
272
|
# Zero-pad to 2 digits for consistency (gen01, gen02, etc.)
|
|
273
273
|
local gen_formatted
|
|
274
|
-
gen_formatted=$(printf "%02d" "$candidate_gen")
|
|
274
|
+
gen_formatted=$(printf "%02d" "$((10#$candidate_gen))")
|
|
275
275
|
|
|
276
276
|
# Check if any Python files exist for this generation (check both padded and unpadded)
|
|
277
277
|
local py_files_exist=false
|
|
@@ -903,7 +903,8 @@ ideate_ai_strategies() {
|
|
|
903
903
|
# Helper to check if we've reached the target for this generation
|
|
904
904
|
check_generation_complete() {
|
|
905
905
|
local current_count
|
|
906
|
-
current_count=$(grep -c "^gen${CURRENT_GENERATION}-" "$FULL_CSV_PATH" 2>/dev/null ||
|
|
906
|
+
current_count=$(grep -c "^gen${CURRENT_GENERATION}-" "$FULL_CSV_PATH" 2>/dev/null) || true
|
|
907
|
+
current_count=${current_count:-0}
|
|
907
908
|
if [[ $current_count -ge $TOTAL_IDEAS ]]; then
|
|
908
909
|
echo "[INFO] Generation $CURRENT_GENERATION reached target ($current_count >= $TOTAL_IDEAS), stopping early" >&2
|
|
909
910
|
return 0
|
|
@@ -1706,12 +1707,16 @@ print(max_gen)
|
|
|
1706
1707
|
|
|
1707
1708
|
count_generation_ideas() {
|
|
1708
1709
|
local gen="$1"
|
|
1709
|
-
|
|
1710
|
+
local count
|
|
1711
|
+
count=$(grep -c "^gen${gen}-" "$FULL_CSV_PATH" 2>/dev/null) || true
|
|
1712
|
+
echo "${count:-0}"
|
|
1710
1713
|
}
|
|
1711
1714
|
|
|
1712
1715
|
count_generation_pending() {
|
|
1713
1716
|
local gen="$1"
|
|
1714
|
-
|
|
1717
|
+
local count
|
|
1718
|
+
count=$(grep -c "^gen${gen}-.*,pending" "$FULL_CSV_PATH" 2>/dev/null) || true
|
|
1719
|
+
echo "${count:-0}"
|
|
1715
1720
|
}
|
|
1716
1721
|
|
|
1717
1722
|
# Find the right generation to use
|
|
@@ -1728,7 +1733,7 @@ else
|
|
|
1728
1733
|
existing_ideas=$(count_generation_ideas "$highest_gen")
|
|
1729
1734
|
pending_ideas=$(count_generation_pending "$highest_gen")
|
|
1730
1735
|
# Also check padded format
|
|
1731
|
-
padded_gen=$(printf "%02d" "$highest_gen")
|
|
1736
|
+
padded_gen=$(printf "%02d" "$((10#$highest_gen))")
|
|
1732
1737
|
existing_ideas_padded=$(count_generation_ideas "$padded_gen")
|
|
1733
1738
|
pending_ideas_padded=$(count_generation_pending "$padded_gen")
|
|
1734
1739
|
# Use whichever found more (handles both gen1 and gen01 formats)
|
|
@@ -1743,7 +1748,7 @@ else
|
|
|
1743
1748
|
# Highest generation is full, create a new one
|
|
1744
1749
|
CURRENT_GENERATION=$(get_next_generation)
|
|
1745
1750
|
# Ensure it's zero-padded
|
|
1746
|
-
CURRENT_GENERATION=$(printf "%02d" "$CURRENT_GENERATION")
|
|
1751
|
+
CURRENT_GENERATION=$(printf "%02d" "$((10#$CURRENT_GENERATION))")
|
|
1747
1752
|
echo "[INFO] Generation $highest_gen is full ($existing_ideas >= $TOTAL_IDEAS), creating generation $CURRENT_GENERATION"
|
|
1748
1753
|
elif [[ $pending_ideas -ge $TOTAL_IDEAS ]]; then
|
|
1749
1754
|
# Already have enough pending, skip ideation
|
|
@@ -1752,7 +1757,7 @@ else
|
|
|
1752
1757
|
exit 0
|
|
1753
1758
|
else
|
|
1754
1759
|
# Continue filling the current highest generation - use padded format
|
|
1755
|
-
CURRENT_GENERATION=$(printf "%02d" "$highest_gen")
|
|
1760
|
+
CURRENT_GENERATION=$(printf "%02d" "$((10#$highest_gen))")
|
|
1756
1761
|
echo "[INFO] Continuing generation $CURRENT_GENERATION (need $((TOTAL_IDEAS - existing_ideas)) more ideas)"
|
|
1757
1762
|
fi
|
|
1758
1763
|
fi
|
|
@@ -1766,8 +1771,10 @@ max_wait_seconds=300 # Cap at 5 minutes
|
|
|
1766
1771
|
|
|
1767
1772
|
while true; do
|
|
1768
1773
|
# Re-check pending count in case another process added ideas
|
|
1769
|
-
pending_count=$(grep -c "^gen${CURRENT_GENERATION}-.*,pending" "$FULL_CSV_PATH" 2>/dev/null ||
|
|
1770
|
-
|
|
1774
|
+
pending_count=$(grep -c "^gen${CURRENT_GENERATION}-.*,pending" "$FULL_CSV_PATH" 2>/dev/null) || true
|
|
1775
|
+
pending_count=${pending_count:-0}
|
|
1776
|
+
total_count=$(grep -c "^gen${CURRENT_GENERATION}-" "$FULL_CSV_PATH" 2>/dev/null) || true
|
|
1777
|
+
total_count=${total_count:-0}
|
|
1771
1778
|
|
|
1772
1779
|
if [[ $total_count -ge $TOTAL_IDEAS ]]; then
|
|
1773
1780
|
echo "[INFO] Generation $CURRENT_GENERATION now has $total_count ideas (target: $TOTAL_IDEAS)"
|