claude-evolve 1.8.43 → 1.8.44
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-ideate +31 -12
- package/package.json +1 -1
package/bin/claude-evolve-ideate
CHANGED
|
@@ -236,10 +236,11 @@ if [[ $use_strategies == true ]]; then
|
|
|
236
236
|
fi
|
|
237
237
|
|
|
238
238
|
# Get next generation number that doesn't have existing Python files
|
|
239
|
+
# AIDEV-NOTE: Returns zero-padded generation number (e.g., "02" not "2")
|
|
239
240
|
get_next_generation() {
|
|
240
241
|
# Start with generation 1 if no CSV exists
|
|
241
242
|
local start_gen=1
|
|
242
|
-
|
|
243
|
+
|
|
243
244
|
if [[ -f "$FULL_CSV_PATH" ]]; then
|
|
244
245
|
# Use Python for proper CSV parsing to find max generation
|
|
245
246
|
local max_gen
|
|
@@ -264,21 +265,25 @@ print(max_gen)
|
|
|
264
265
|
# Start checking from the next generation after max
|
|
265
266
|
start_gen=$((max_gen + 1))
|
|
266
267
|
fi
|
|
267
|
-
|
|
268
|
+
|
|
268
269
|
# Keep incrementing until we find a generation with no Python files
|
|
269
270
|
local candidate_gen=$start_gen
|
|
270
271
|
while true; do
|
|
271
|
-
#
|
|
272
|
-
local gen_formatted
|
|
272
|
+
# Zero-pad to 2 digits for consistency (gen01, gen02, etc.)
|
|
273
|
+
local gen_formatted
|
|
274
|
+
gen_formatted=$(printf "%02d" "$candidate_gen")
|
|
273
275
|
|
|
274
|
-
# Check if any Python files exist for this generation
|
|
276
|
+
# Check if any Python files exist for this generation (check both padded and unpadded)
|
|
275
277
|
local py_files_exist=false
|
|
276
278
|
if ls "$FULL_OUTPUT_DIR"/evolution_gen${gen_formatted}-*.py >/dev/null 2>&1; then
|
|
277
279
|
py_files_exist=true
|
|
280
|
+
elif ls "$FULL_OUTPUT_DIR"/evolution_gen${candidate_gen}-*.py >/dev/null 2>&1; then
|
|
281
|
+
# Also check unpadded format for legacy compatibility
|
|
282
|
+
py_files_exist=true
|
|
278
283
|
fi
|
|
279
284
|
|
|
280
285
|
if [[ "$py_files_exist" == "false" ]]; then
|
|
281
|
-
# This generation is safe to use
|
|
286
|
+
# This generation is safe to use - return padded format
|
|
282
287
|
echo "$gen_formatted"
|
|
283
288
|
return
|
|
284
289
|
else
|
|
@@ -1710,30 +1715,44 @@ count_generation_pending() {
|
|
|
1710
1715
|
}
|
|
1711
1716
|
|
|
1712
1717
|
# Find the right generation to use
|
|
1718
|
+
# AIDEV-NOTE: Generation numbers must be zero-padded to 2 digits (gen01, gen02, etc.)
|
|
1719
|
+
# to maintain consistency with existing CSV data format
|
|
1713
1720
|
highest_gen=$(get_highest_generation)
|
|
1714
1721
|
if [[ $highest_gen -eq 0 ]]; then
|
|
1715
|
-
# No generations yet, start with
|
|
1716
|
-
CURRENT_GENERATION=
|
|
1717
|
-
echo "[INFO] No existing generations, starting with generation
|
|
1722
|
+
# No generations yet, start with 01
|
|
1723
|
+
CURRENT_GENERATION="01"
|
|
1724
|
+
echo "[INFO] No existing generations, starting with generation 01"
|
|
1718
1725
|
else
|
|
1719
1726
|
# Check if highest generation needs more ideas
|
|
1727
|
+
# Use unpadded for grep patterns (matches both gen1- and gen01-)
|
|
1720
1728
|
existing_ideas=$(count_generation_ideas "$highest_gen")
|
|
1721
1729
|
pending_ideas=$(count_generation_pending "$highest_gen")
|
|
1730
|
+
# Also check padded format
|
|
1731
|
+
padded_gen=$(printf "%02d" "$highest_gen")
|
|
1732
|
+
existing_ideas_padded=$(count_generation_ideas "$padded_gen")
|
|
1733
|
+
pending_ideas_padded=$(count_generation_pending "$padded_gen")
|
|
1734
|
+
# Use whichever found more (handles both gen1 and gen01 formats)
|
|
1735
|
+
if [[ $existing_ideas_padded -gt $existing_ideas ]]; then
|
|
1736
|
+
existing_ideas=$existing_ideas_padded
|
|
1737
|
+
pending_ideas=$pending_ideas_padded
|
|
1738
|
+
fi
|
|
1722
1739
|
|
|
1723
1740
|
echo "[INFO] Highest generation: $highest_gen with $existing_ideas total ideas ($pending_ideas pending)"
|
|
1724
1741
|
|
|
1725
1742
|
if [[ $existing_ideas -ge $TOTAL_IDEAS ]]; then
|
|
1726
1743
|
# Highest generation is full, create a new one
|
|
1727
1744
|
CURRENT_GENERATION=$(get_next_generation)
|
|
1745
|
+
# Ensure it's zero-padded
|
|
1746
|
+
CURRENT_GENERATION=$(printf "%02d" "$CURRENT_GENERATION")
|
|
1728
1747
|
echo "[INFO] Generation $highest_gen is full ($existing_ideas >= $TOTAL_IDEAS), creating generation $CURRENT_GENERATION"
|
|
1729
1748
|
elif [[ $pending_ideas -ge $TOTAL_IDEAS ]]; then
|
|
1730
1749
|
# Already have enough pending, skip ideation
|
|
1731
|
-
echo "[INFO] Generation $
|
|
1750
|
+
echo "[INFO] Generation $padded_gen already has $pending_ideas pending ideas (target: $TOTAL_IDEAS)"
|
|
1732
1751
|
echo "[INFO] Skipping ideation - workers will process existing ideas"
|
|
1733
1752
|
exit 0
|
|
1734
1753
|
else
|
|
1735
|
-
# Continue filling the current highest generation
|
|
1736
|
-
CURRENT_GENERATION=$highest_gen
|
|
1754
|
+
# Continue filling the current highest generation - use padded format
|
|
1755
|
+
CURRENT_GENERATION=$(printf "%02d" "$highest_gen")
|
|
1737
1756
|
echo "[INFO] Continuing generation $CURRENT_GENERATION (need $((TOTAL_IDEAS - existing_ideas)) more ideas)"
|
|
1738
1757
|
fi
|
|
1739
1758
|
fi
|