claude-evolve 1.7.22 → 1.7.24
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-py +97 -0
- package/lib/ideation_helper.py +745 -0
- package/package.json +2 -1
- package/bin/claude-evolve-ideate.debug +0 -907
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Python-based ideation wrapper for claude-evolve
|
|
3
|
+
# This is a simple wrapper that calls the Python ideation helper
|
|
4
|
+
|
|
5
|
+
set -e
|
|
6
|
+
|
|
7
|
+
# Load configuration to ensure paths are set up
|
|
8
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
9
|
+
# shellcheck source=../lib/config.sh
|
|
10
|
+
source "$SCRIPT_DIR/../lib/config.sh"
|
|
11
|
+
|
|
12
|
+
# Use CLAUDE_EVOLVE_CONFIG if set, otherwise default
|
|
13
|
+
if [[ -n ${CLAUDE_EVOLVE_CONFIG:-} ]]; then
|
|
14
|
+
load_config "$CLAUDE_EVOLVE_CONFIG"
|
|
15
|
+
else
|
|
16
|
+
# Check if config.yaml exists in current directory
|
|
17
|
+
if [[ -f "config.yaml" ]]; then
|
|
18
|
+
CONFIG_FILE="$(pwd)/config.yaml"
|
|
19
|
+
load_config "$CONFIG_FILE"
|
|
20
|
+
else
|
|
21
|
+
load_config
|
|
22
|
+
fi
|
|
23
|
+
fi
|
|
24
|
+
|
|
25
|
+
# Setup logging to file
|
|
26
|
+
if [[ -n "${FULL_EVOLUTION_DIR:-}" ]]; then
|
|
27
|
+
LOG_DIR="$FULL_EVOLUTION_DIR/logs"
|
|
28
|
+
mkdir -p "$LOG_DIR"
|
|
29
|
+
LOG_FILE="$LOG_DIR/ideate-py-$$-$(date +%Y%m%d-%H%M%S).log"
|
|
30
|
+
|
|
31
|
+
# Log to both terminal and file with timestamps
|
|
32
|
+
exec > >(while IFS= read -r line; do echo "$(date '+%Y-%m-%d %H:%M:%S'): $line"; done | tee -a "$LOG_FILE") 2>&1
|
|
33
|
+
echo "[IDEATE-PY-$$] Logging to: $LOG_FILE"
|
|
34
|
+
fi
|
|
35
|
+
|
|
36
|
+
# Parse arguments
|
|
37
|
+
use_strategies=true
|
|
38
|
+
|
|
39
|
+
while [[ $# -gt 0 ]]; do
|
|
40
|
+
case $1 in
|
|
41
|
+
--help)
|
|
42
|
+
cat <<EOF
|
|
43
|
+
claude-evolve ideate (Python version) - Generate new algorithm ideas
|
|
44
|
+
|
|
45
|
+
USAGE:
|
|
46
|
+
claude-evolve ideate-py [--legacy N]
|
|
47
|
+
|
|
48
|
+
OPTIONS:
|
|
49
|
+
--legacy N Use legacy mode with N ideas (ignores strategy config)
|
|
50
|
+
--help Show this help message
|
|
51
|
+
|
|
52
|
+
DESCRIPTION:
|
|
53
|
+
Python-based ideation that uses MD5 hashing to verify AI actually modified files.
|
|
54
|
+
This solves the problem where AIs claim they edited files but didn't.
|
|
55
|
+
|
|
56
|
+
Uses multi-strategy evolutionary approach:
|
|
57
|
+
- Novel exploration: Pure creativity, global search
|
|
58
|
+
- Hill climbing: Parameter tuning of top performers
|
|
59
|
+
- Structural mutation: Algorithmic changes to top performers
|
|
60
|
+
- Crossover hybrid: Combine successful approaches
|
|
61
|
+
|
|
62
|
+
Strategy distribution is configured in evolution/config.yaml
|
|
63
|
+
EOF
|
|
64
|
+
exit 0
|
|
65
|
+
;;
|
|
66
|
+
--legacy)
|
|
67
|
+
use_strategies=false
|
|
68
|
+
shift
|
|
69
|
+
if [[ $1 =~ ^[0-9]+$ ]]; then
|
|
70
|
+
export LEGACY_IDEA_COUNT=$1
|
|
71
|
+
shift
|
|
72
|
+
else
|
|
73
|
+
echo "[ERROR] --legacy requires a number" >&2
|
|
74
|
+
exit 1
|
|
75
|
+
fi
|
|
76
|
+
;;
|
|
77
|
+
*)
|
|
78
|
+
echo "[ERROR] Unknown option: $1" >&2
|
|
79
|
+
exit 1
|
|
80
|
+
;;
|
|
81
|
+
esac
|
|
82
|
+
done
|
|
83
|
+
|
|
84
|
+
# Check workspace using config
|
|
85
|
+
if [[ ! -d "$FULL_EVOLUTION_DIR" ]]; then
|
|
86
|
+
echo "[ERROR] Evolution workspace not found: $FULL_EVOLUTION_DIR. Run 'claude-evolve setup' first." >&2
|
|
87
|
+
exit 1
|
|
88
|
+
fi
|
|
89
|
+
|
|
90
|
+
# Call Python helper
|
|
91
|
+
echo "[INFO] Using Python ideation helper (more reliable AI result verification)"
|
|
92
|
+
|
|
93
|
+
if [[ $use_strategies == true ]]; then
|
|
94
|
+
exec "$PYTHON_CMD" "$SCRIPT_DIR/../lib/ideation_helper.py" run
|
|
95
|
+
else
|
|
96
|
+
exec "$PYTHON_CMD" "$SCRIPT_DIR/../lib/ideation_helper.py" run --legacy "$LEGACY_IDEA_COUNT"
|
|
97
|
+
fi
|