claude-evolve 1.7.26 → 1.8.0

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.
@@ -1,5 +1,5 @@
1
1
  #!/bin/bash
2
- set -e
2
+ # Note: set -e removed - we handle errors explicitly with exit codes
3
3
 
4
4
  # Source configuration
5
5
  SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)"
@@ -593,7 +593,7 @@ with EvolutionCSV('$FULL_CSV_PATH') as csv:
593
593
 
594
594
  # Set current candidate for cleanup
595
595
  CURRENT_CANDIDATE_ID="$candidate_id"
596
-
596
+
597
597
  # Process the candidate and capture exit code
598
598
  process_candidate "$candidate_id" "$parent_id" "$description"
599
599
  process_exit_code=$?
@@ -611,10 +611,9 @@ with EvolutionCSV('$FULL_CSV_PATH') as csv:
611
611
  csv.update_candidate_status('$candidate_id', 'failed-ai-retry')
612
612
  " 2>/dev/null || true
613
613
  elif [[ $process_exit_code -eq 78 ]]; then
614
- # Missing parent; mark child as failed and auto-recover parent
614
+ # Missing parent; mark child as failed and immediately process parent
615
615
  echo "[WORKER-$$] Parent '$parent_id' missing for $candidate_id"
616
616
  echo "[WORKER-$$] Marking $candidate_id as failed-parent-missing"
617
- echo "[WORKER-$$] Auto-recovering: marking parent '$parent_id' as pending"
618
617
 
619
618
  "$PYTHON_CMD" -c "
620
619
  import sys
@@ -623,21 +622,60 @@ from lib.evolution_csv import EvolutionCSV
623
622
  with EvolutionCSV('$FULL_CSV_PATH') as csv:
624
623
  # Mark child as failed
625
624
  csv.update_candidate_status('$candidate_id', 'failed-parent-missing')
625
+ " 2>/dev/null || true
626
626
 
627
- # Auto-recover: mark parent as pending so it gets processed
628
- parent_info = csv.get_candidate_info('$parent_id')
629
- if parent_info:
630
- parent_status = parent_info.get('status', '').lower()
631
- if parent_status in ('', 'skipped', 'failed-parent-missing'):
632
- csv.update_candidate_status('$parent_id', 'pending')
633
- print(f'Auto-recovered parent $parent_id: {parent_status} -> pending', file=sys.stderr)
634
- else:
635
- print(f'Parent $parent_id has status: {parent_status} (not auto-recovering)', file=sys.stderr)
636
- else:
637
- print(f'Warning: parent $parent_id not found in CSV', file=sys.stderr)
638
- " 2>&1 | grep -E "Auto-recovered|Parent.*status|Warning" || true
627
+ # Get parent info to process it immediately
628
+ parent_info=$("$PYTHON_CMD" -c "
629
+ import sys
630
+ sys.path.insert(0, '$SCRIPT_DIR/..')
631
+ from lib.evolution_csv import EvolutionCSV
632
+ with EvolutionCSV('$FULL_CSV_PATH') as csv:
633
+ parent = csv.get_candidate_info('$parent_id')
634
+ if parent:
635
+ status = parent.get('status', '').lower()
636
+ parent_of_parent = parent.get('basedOnId', '')
637
+ description = parent.get('description', '')
638
+ # Output: status|parent_of_parent|description
639
+ print(f\"{status}|{parent_of_parent}|{description}\")
640
+ ")
641
+
642
+ if [[ -n "$parent_info" ]]; then
643
+ IFS='|' read -r parent_status parent_of_parent parent_description <<< "$parent_info"
644
+
645
+ # Only process if parent needs processing
646
+ if [[ "$parent_status" == "" || "$parent_status" == "pending" || "$parent_status" == "skipped" || "$parent_status" == "failed-parent-missing" ]]; then
647
+ echo "[WORKER-$$] Immediately processing parent '$parent_id' (status: $parent_status)"
648
+
649
+ # Mark parent as running
650
+ "$PYTHON_CMD" -c "
651
+ import sys
652
+ sys.path.insert(0, '$SCRIPT_DIR/..')
653
+ from lib.evolution_csv import EvolutionCSV
654
+ with EvolutionCSV('$FULL_CSV_PATH') as csv:
655
+ csv.update_candidate_status('$parent_id', 'running')
656
+ " 2>/dev/null || true
657
+
658
+ # Clear current candidate (parent processing will set its own)
659
+ CURRENT_CANDIDATE_ID=""
660
+
661
+ # Process parent recursively
662
+ process_candidate "$parent_id" "$parent_of_parent" "$parent_description"
663
+ parent_exit_code=$?
664
+
665
+ if [[ $parent_exit_code -eq 0 ]]; then
666
+ echo "[WORKER-$$] Successfully processed parent '$parent_id'"
667
+ # Now the child can potentially be retried (user can reset failed-parent-missing later)
668
+ else
669
+ echo "[WORKER-$$] Failed to process parent '$parent_id' (exit code: $parent_exit_code)"
670
+ fi
671
+ else
672
+ echo "[WORKER-$$] Parent '$parent_id' has status '$parent_status' - not processing"
673
+ fi
674
+ else
675
+ echo "[WORKER-$$] Warning: parent '$parent_id' not found in CSV"
676
+ fi
639
677
 
640
- # Clear current candidate and continue to next (don't break)
678
+ # Clear current candidate and continue to next
641
679
  CURRENT_CANDIDATE_ID=""
642
680
  else
643
681
  echo "[WORKER-$$] Failed to process $candidate_id"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-evolve",
3
- "version": "1.7.26",
3
+ "version": "1.8.0",
4
4
  "bin": {
5
5
  "claude-evolve": "./bin/claude-evolve",
6
6
  "claude-evolve-main": "./bin/claude-evolve-main",