claude-evolve 1.3.5 → 1.3.7

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.
@@ -6,7 +6,13 @@ set -e
6
6
  SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
7
7
  # shellcheck source=../lib/config.sh
8
8
  source "$SCRIPT_DIR/../lib/config.sh"
9
- load_config
9
+
10
+ # Use CLAUDE_EVOLVE_CONFIG if set, otherwise default
11
+ if [[ -n ${CLAUDE_EVOLVE_CONFIG:-} ]]; then
12
+ load_config "$CLAUDE_EVOLVE_CONFIG"
13
+ else
14
+ load_config
15
+ fi
10
16
 
11
17
  # Parse arguments
12
18
  open_chart=false
@@ -61,7 +61,12 @@ while [[ $# -gt 0 ]]; do
61
61
  done
62
62
 
63
63
  # Load current config
64
- load_config
64
+ # Use CLAUDE_EVOLVE_CONFIG if set, otherwise default
65
+ if [[ -n ${CLAUDE_EVOLVE_CONFIG:-} ]]; then
66
+ load_config "$CLAUDE_EVOLVE_CONFIG"
67
+ else
68
+ load_config
69
+ fi
65
70
 
66
71
  case $action in
67
72
  show)
@@ -6,7 +6,13 @@ set -e
6
6
  SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
7
7
  # shellcheck source=../lib/config.sh
8
8
  source "$SCRIPT_DIR/../lib/config.sh"
9
- load_config
9
+
10
+ # Use CLAUDE_EVOLVE_CONFIG if set, otherwise default
11
+ if [[ -n ${CLAUDE_EVOLVE_CONFIG:-} ]]; then
12
+ load_config "$CLAUDE_EVOLVE_CONFIG"
13
+ else
14
+ load_config
15
+ fi
10
16
 
11
17
  # Helper function to call Claude with usage limit detection
12
18
  call_claude_with_limit_check() {
@@ -47,7 +47,7 @@ show_help() {
47
47
  claude-evolve - AI-powered algorithm evolution tool
48
48
 
49
49
  USAGE:
50
- claude-evolve [COMMAND] [OPTIONS]
50
+ claude-evolve [--config=PATH] [COMMAND] [OPTIONS]
51
51
 
52
52
  COMMANDS:
53
53
  setup Initialize evolution workspace
@@ -56,7 +56,8 @@ COMMANDS:
56
56
  analyze Analyze evolution results
57
57
  help Show this help message
58
58
 
59
- OPTIONS:
59
+ GLOBAL OPTIONS:
60
+ --config=PATH Use alternate config file (default: evolution/config.yaml)
60
61
  -h, --help Show help message
61
62
  -v, --version Show version
62
63
 
@@ -65,6 +66,7 @@ EXAMPLES:
65
66
  claude-evolve ideate 5
66
67
  claude-evolve run --timeout 300
67
68
  claude-evolve analyze --open
69
+ claude-evolve --config=evolution-abc/config.yaml run
68
70
 
69
71
  For more information, visit: https://github.com/anthropics/claude-evolve
70
72
  EOF
@@ -94,6 +96,33 @@ show_menu() {
94
96
  echo
95
97
  }
96
98
 
99
+ # Parse global options
100
+ CONFIG_FILE=""
101
+ while [[ $# -gt 0 ]] && [[ "$1" =~ ^-- ]]; do
102
+ case "$1" in
103
+ --config)
104
+ if [[ -z ${2:-} ]]; then
105
+ echo -e "${RED}[ERROR] --config requires a file path${NC}" >&2
106
+ exit 1
107
+ fi
108
+ CONFIG_FILE="$2"
109
+ shift 2
110
+ ;;
111
+ --config=*)
112
+ CONFIG_FILE="${1#*=}"
113
+ shift
114
+ ;;
115
+ *)
116
+ break
117
+ ;;
118
+ esac
119
+ done
120
+
121
+ # Export CONFIG_FILE for subcommands
122
+ if [[ -n $CONFIG_FILE ]]; then
123
+ export CLAUDE_EVOLVE_CONFIG="$CONFIG_FILE"
124
+ fi
125
+
97
126
  # Check for updates (quick, non-blocking)
98
127
  check_for_updates
99
128
 
@@ -6,7 +6,13 @@ set -e
6
6
  SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
7
7
  # shellcheck source=../lib/config.sh
8
8
  source "$SCRIPT_DIR/../lib/config.sh"
9
- load_config
9
+
10
+ # Use CLAUDE_EVOLVE_CONFIG if set, otherwise default
11
+ if [[ -n ${CLAUDE_EVOLVE_CONFIG:-} ]]; then
12
+ load_config "$CLAUDE_EVOLVE_CONFIG"
13
+ else
14
+ load_config
15
+ fi
10
16
 
11
17
  # Parse arguments
12
18
  timeout_seconds=""
@@ -144,8 +150,14 @@ find_empty_row() {
144
150
  local row_num=2 # Start after header
145
151
  local csv_id csv_based_on csv_desc csv_perf csv_status
146
152
  while IFS=, read -r csv_id csv_based_on csv_desc csv_perf csv_status; do
147
- # Look for rows with pending status or empty status (but not complete/failed/running)
148
- if [[ $csv_status == "pending" || (-z $csv_perf && -z $csv_status) ]]; then
153
+ # Look for rows with pending status or empty status (but not complete/failed/running/timeout)
154
+ # Treat blank status as pending
155
+ if [[ $csv_status == "pending" || -z $csv_status || $csv_status == '""' ]]; then
156
+ # Skip if status is explicitly complete, failed, running, or timeout
157
+ if [[ $csv_status == "complete" || $csv_status == "failed" || $csv_status == "running" || $csv_status == "timeout" ]]; then
158
+ ((row_num++))
159
+ continue
160
+ fi
149
161
  echo $row_num
150
162
  return 0
151
163
  fi
@@ -253,26 +265,34 @@ attempt_recovery() {
253
265
  while true; do
254
266
  # Find next candidate
255
267
  if ! row_num=$(find_empty_row); then
256
- echo "[INFO] No more pending candidates found. Generating new ideas..."
268
+ echo "[INFO] No more pending candidates found."
257
269
 
258
- # Check if claude-evolve-ideate exists
259
- ideate_script="$SCRIPT_DIR/claude-evolve-ideate"
260
- if [[ ! -f "$ideate_script" ]]; then
261
- echo "[ERROR] claude-evolve-ideate script not found: $ideate_script" >&2
262
- echo "[INFO] Evolution run complete - no way to generate more ideas."
270
+ # Check if auto ideation is enabled
271
+ if [[ "$AUTO_IDEATE" == "true" || "$AUTO_IDEATE" == "1" ]]; then
272
+ echo "[INFO] Auto ideation is enabled. Generating new ideas..."
273
+
274
+ # Check if claude-evolve-ideate exists
275
+ ideate_script="$SCRIPT_DIR/claude-evolve-ideate"
276
+ if [[ ! -f "$ideate_script" ]]; then
277
+ echo "[ERROR] claude-evolve-ideate script not found: $ideate_script" >&2
278
+ echo "[INFO] Evolution run complete - no way to generate more ideas."
279
+ exit 0
280
+ fi
281
+
282
+ # Generate new ideas using the multi-strategy approach
283
+ echo "[INFO] Calling claude-evolve-ideate to generate new candidates..."
284
+ if ! "$ideate_script"; then
285
+ echo "[ERROR] Failed to generate new ideas" >&2
286
+ echo "[INFO] Evolution run complete - ideation failed."
287
+ exit 1
288
+ fi
289
+
290
+ echo "[INFO] New ideas generated successfully. Continuing evolution..."
291
+ continue # Go back to start of loop to find the new candidates
292
+ else
293
+ echo "[INFO] Auto ideation is disabled. Evolution run complete."
263
294
  exit 0
264
295
  fi
265
-
266
- # Generate new ideas using the multi-strategy approach
267
- echo "[INFO] Calling claude-evolve-ideate to generate new candidates..."
268
- if ! "$ideate_script"; then
269
- echo "[ERROR] Failed to generate new ideas" >&2
270
- echo "[INFO] Evolution run complete - ideation failed."
271
- exit 1
272
- fi
273
-
274
- echo "[INFO] New ideas generated successfully. Continuing evolution..."
275
- continue # Go back to start of loop to find the new candidates
276
296
  fi
277
297
 
278
298
  # Create log file for this iteration
@@ -9,7 +9,13 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
9
9
  source "$SCRIPT_DIR/../lib/config.sh"
10
10
  # shellcheck source=../lib/csv-lock.sh
11
11
  source "$SCRIPT_DIR/../lib/csv-lock.sh"
12
- load_config
12
+
13
+ # Use CLAUDE_EVOLVE_CONFIG if set, otherwise default
14
+ if [[ -n ${CLAUDE_EVOLVE_CONFIG:-} ]]; then
15
+ load_config "$CLAUDE_EVOLVE_CONFIG"
16
+ else
17
+ load_config
18
+ fi
13
19
 
14
20
  # Parse arguments
15
21
  timeout_seconds=""
@@ -10,7 +10,13 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
10
10
  source "$SCRIPT_DIR/../lib/config.sh"
11
11
  # shellcheck source=../lib/csv-lock.sh
12
12
  source "$SCRIPT_DIR/../lib/csv-lock.sh"
13
- load_config
13
+
14
+ # Use CLAUDE_EVOLVE_CONFIG if set, otherwise default
15
+ if [[ -n ${CLAUDE_EVOLVE_CONFIG:-} ]]; then
16
+ load_config "$CLAUDE_EVOLVE_CONFIG"
17
+ else
18
+ load_config
19
+ fi
14
20
 
15
21
  # Parse arguments
16
22
  timeout_seconds=""
package/lib/config.sh CHANGED
@@ -24,8 +24,14 @@ DEFAULT_PARALLEL_ENABLED=false
24
24
  DEFAULT_MAX_WORKERS=4
25
25
  DEFAULT_LOCK_TIMEOUT=30
26
26
 
27
+ # Default auto ideation value
28
+ DEFAULT_AUTO_IDEATE=true
29
+
27
30
  # Load configuration from config file
28
31
  load_config() {
32
+ # Accept config file path as parameter
33
+ local config_file="${1:-evolution/config.yaml}"
34
+
29
35
  # Set defaults first
30
36
  EVOLUTION_DIR="$DEFAULT_EVOLUTION_DIR"
31
37
  ALGORITHM_FILE="$DEFAULT_ALGORITHM_FILE"
@@ -48,9 +54,9 @@ load_config() {
48
54
  PARALLEL_ENABLED="$DEFAULT_PARALLEL_ENABLED"
49
55
  MAX_WORKERS="$DEFAULT_MAX_WORKERS"
50
56
  LOCK_TIMEOUT="$DEFAULT_LOCK_TIMEOUT"
51
-
52
- # Single config file location: evolution/config.yaml
53
- local config_file="evolution/config.yaml"
57
+
58
+ # Set auto ideation default
59
+ AUTO_IDEATE="$DEFAULT_AUTO_IDEATE"
54
60
 
55
61
  # Load config if found
56
62
  if [[ -f "$config_file" ]]; then
@@ -127,11 +133,22 @@ load_config() {
127
133
  output_dir) OUTPUT_DIR="$value" ;;
128
134
  parent_selection) PARENT_SELECTION="$value" ;;
129
135
  python_cmd) PYTHON_CMD="$value" ;;
136
+ auto_ideate) AUTO_IDEATE="$value" ;;
130
137
  esac
131
138
  fi
132
139
  done < "$config_file"
133
140
  fi
134
141
 
142
+ # If config file is in a different directory, use that as the evolution dir
143
+ if [[ "$config_file" != "evolution/config.yaml" ]]; then
144
+ # Extract directory from config file path
145
+ local config_dir=$(dirname "$config_file")
146
+ if [[ "$config_dir" != "." && "$config_dir" != "" ]]; then
147
+ EVOLUTION_DIR="$config_dir"
148
+ echo "[INFO] Using evolution directory from config path: $EVOLUTION_DIR"
149
+ fi
150
+ fi
151
+
135
152
  # Create full paths - ALL paths are relative to evolution_dir
136
153
  FULL_EVOLUTION_DIR="$EVOLUTION_DIR"
137
154
  FULL_ALGORITHM_PATH="$EVOLUTION_DIR/$ALGORITHM_FILE"
@@ -192,4 +209,5 @@ show_config() {
192
209
  echo " Parallel enabled: $PARALLEL_ENABLED"
193
210
  echo " Max workers: $MAX_WORKERS"
194
211
  echo " Lock timeout: $LOCK_TIMEOUT"
212
+ echo " Auto ideate: $AUTO_IDEATE"
195
213
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-evolve",
3
- "version": "1.3.5",
3
+ "version": "1.3.7",
4
4
  "bin": {
5
5
  "claude-evolve": "./bin/claude-evolve",
6
6
  "claude-evolve-main": "./bin/claude-evolve-main",
@@ -37,6 +37,10 @@ ideation_strategies:
37
37
  # Python command to use for evaluation
38
38
  python_cmd: "python3"
39
39
 
40
+ # Auto ideation configuration
41
+ # When true, automatically generate new ideas when no pending candidates remain
42
+ auto_ideate: true
43
+
40
44
  # Parallel execution configuration
41
45
  parallel:
42
46
  # Enable parallel execution of evolution candidates