claude-evolve 1.7.21 → 1.7.22

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.
@@ -107,7 +107,7 @@ call_ai_for_ideation() {
107
107
 
108
108
  # Get the current row count before any modifications (from the pre-populated file with stubs)
109
109
  local original_csv_count
110
- original_csv_count=$(grep -v '^[[:space:]]*$' "$temp_csv_file" | tail -n +2 | wc -l)
110
+ original_csv_count=$(grep -v '^[[:space:]]*$' "$temp_csv_file" | tail -n +2 | wc -l | tr -d '[:space:]')
111
111
 
112
112
  echo "[DEBUG] Pre-populated temp CSV has $original_csv_count rows (includes stub rows with placeholders)" >&2
113
113
 
@@ -152,7 +152,7 @@ call_ai_for_ideation() {
152
152
  # Check if the file was modified correctly
153
153
  if [[ -f "$temp_csv_file" ]]; then
154
154
  local new_csv_count
155
- new_csv_count=$(grep -v '^[[:space:]]*$' "$temp_csv_file" | tail -n +2 | wc -l)
155
+ new_csv_count=$(grep -v '^[[:space:]]*$' "$temp_csv_file" | tail -n +2 | wc -l | tr -d '[:space:]')
156
156
  local added_count=$((new_csv_count - original_csv_count))
157
157
 
158
158
  echo "[DEBUG] After $model: original=$original_csv_count, new=$new_csv_count, added=$added_count" >&2
@@ -162,6 +162,9 @@ call_ai_for_ideation() {
162
162
  # Count remaining placeholders - there should be none if AI did its job
163
163
  local placeholder_count
164
164
  placeholder_count=$(grep -c "PLACEHOLDER" "$temp_csv_file" 2>/dev/null || echo "0")
165
+ # Strip whitespace and ensure we have a clean integer
166
+ placeholder_count=$(echo "$placeholder_count" | tr -d '[:space:]')
167
+ placeholder_count=${placeholder_count:-0}
165
168
 
166
169
  if [[ $placeholder_count -eq 0 ]]; then
167
170
  echo "[INFO] CSV modified by $model: filled $expected_count placeholder rows ✓" >&2
@@ -377,11 +380,11 @@ validate_direct_csv_modification() {
377
380
  # We need to track this before the AI runs by reading from the beginning state
378
381
  # First, get a fresh count from the current main CSV (which reflects any previous operations in this session)
379
382
  local current_original_count
380
- current_original_count=$(grep -v '^[[:space:]]*$' "$FULL_CSV_PATH" | tail -n +2 | wc -l)
383
+ current_original_count=$(grep -v '^[[:space:]]*$' "$FULL_CSV_PATH" | tail -n +2 | wc -l | tr -d '[:space:]')
381
384
 
382
385
  # Count data rows in the modified temp CSV
383
386
  local new_count
384
- new_count=$(grep -v '^[[:space:]]*$' "$temp_csv" | tail -n +2 | wc -l)
387
+ new_count=$(grep -v '^[[:space:]]*$' "$temp_csv" | tail -n +2 | wc -l | tr -d '[:space:]')
385
388
 
386
389
 
387
390
  # Check if AI overwrote the file instead of appending
@@ -442,7 +445,7 @@ validate_direct_csv_modification() {
442
445
  fi
443
446
 
444
447
  # Get just the new entries (skip header and existing entries)
445
- local original_line_count=$(wc -l < "$FULL_CSV_PATH")
448
+ local original_line_count=$(wc -l < "$FULL_CSV_PATH" | tr -d '[:space:]')
446
449
 
447
450
  # Append only the new lines from temp CSV to the main CSV
448
451
  tail -n +$((original_line_count + 1)) "$temp_csv" >> "$FULL_CSV_PATH"
@@ -514,9 +517,9 @@ validate_and_apply_csv_modification_old() {
514
517
 
515
518
  # Validate the modified CSV has more entries than original
516
519
  local original_count
517
- original_count=$(wc -l < "$FULL_CSV_PATH")
520
+ original_count=$(wc -l < "$FULL_CSV_PATH" | tr -d '[:space:]')
518
521
  local new_count
519
- new_count=$(wc -l < "$temp_csv")
522
+ new_count=$(wc -l < "$temp_csv" | tr -d '[:space:]')
520
523
 
521
524
 
522
525
  if [[ $new_count -le $original_count ]]; then
@@ -543,7 +546,7 @@ validate_and_apply_csv_modification_old() {
543
546
  fi
544
547
 
545
548
  # Get just the new entries (skip header and existing entries)
546
- local original_line_count=$(wc -l < "$FULL_CSV_PATH")
549
+ local original_line_count=$(wc -l < "$FULL_CSV_PATH" | tr -d '[:space:]')
547
550
 
548
551
  # Append only the new lines from temp CSV to the main CSV
549
552
  tail -n +$((original_line_count + 1)) "$temp_csv" >> "$FULL_CSV_PATH"
@@ -665,9 +668,9 @@ IMPORTANT: Output the complete modified CSV file. Do not add any explanation or
665
668
 
666
669
  # Validate the modified CSV has more entries than original
667
670
  local original_count
668
- original_count=$(wc -l < "$FULL_CSV_PATH")
671
+ original_count=$(wc -l < "$FULL_CSV_PATH" | tr -d '[:space:]')
669
672
  local new_count
670
- new_count=$(wc -l < "$temp_csv")
673
+ new_count=$(wc -l < "$temp_csv" | tr -d '[:space:]')
671
674
 
672
675
 
673
676
  if [[ $new_count -le $original_count ]]; then
@@ -696,7 +699,7 @@ IMPORTANT: Output the complete modified CSV file. Do not add any explanation or
696
699
  fi
697
700
 
698
701
  # Get just the new entries (skip header and existing entries)
699
- local original_line_count=$(wc -l < "$FULL_CSV_PATH")
702
+ local original_line_count=$(wc -l < "$FULL_CSV_PATH" | tr -d '[:space:]')
700
703
 
701
704
  # Append only the new lines from temp CSV to the main CSV
702
705
  tail -n +$((original_line_count + 1)) "$temp_csv" >> "$FULL_CSV_PATH"
@@ -1007,7 +1010,7 @@ generate_novel_ideas_direct() {
1007
1010
 
1008
1011
  # Count total lines in temp CSV (including header)
1009
1012
  local total_lines
1010
- total_lines=$(wc -l < "$temp_csv")
1013
+ total_lines=$(wc -l < "$temp_csv" | tr -d '[:space:]')
1011
1014
  local read_offset=$((total_lines - 25))
1012
1015
  if [[ $read_offset -lt 1 ]]; then
1013
1016
  read_offset=1
@@ -1145,7 +1148,7 @@ generate_hill_climbing_direct() {
1145
1148
 
1146
1149
  # Count total lines in temp CSV (including header)
1147
1150
  local total_lines
1148
- total_lines=$(wc -l < "$temp_csv")
1151
+ total_lines=$(wc -l < "$temp_csv" | tr -d '[:space:]')
1149
1152
  local read_offset=$((total_lines - 25))
1150
1153
  if [[ $read_offset -lt 1 ]]; then
1151
1154
  read_offset=1
@@ -1274,7 +1277,7 @@ generate_structural_mutation_direct() {
1274
1277
 
1275
1278
  # Count total lines in temp CSV (including header)
1276
1279
  local total_lines
1277
- total_lines=$(wc -l < "$temp_csv")
1280
+ total_lines=$(wc -l < "$temp_csv" | tr -d '[:space:]')
1278
1281
  local read_offset=$((total_lines - 25))
1279
1282
  if [[ $read_offset -lt 1 ]]; then
1280
1283
  read_offset=1
@@ -1394,7 +1397,7 @@ generate_crossover_direct() {
1394
1397
 
1395
1398
  # Count total lines in temp CSV (including header)
1396
1399
  local total_lines
1397
- total_lines=$(wc -l < "$temp_csv")
1400
+ total_lines=$(wc -l < "$temp_csv" | tr -d '[:space:]')
1398
1401
  local read_offset=$((total_lines - 25))
1399
1402
  if [[ $read_offset -lt 1 ]]; then
1400
1403
  read_offset=1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-evolve",
3
- "version": "1.7.21",
3
+ "version": "1.7.22",
4
4
  "bin": {
5
5
  "claude-evolve": "./bin/claude-evolve",
6
6
  "claude-evolve-main": "./bin/claude-evolve-main",