enhance_swarm 2.0.0 → 2.1.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.
Files changed (105) hide show
  1. checksums.yaml +4 -4
  2. data/.claude/CLAUDE.md +164 -0
  3. data/.claude/MCP.md +117 -0
  4. data/.claude/PERSONAS.md +114 -0
  5. data/.claude/RULES.md +221 -0
  6. data/.enhance_swarm/logs/general_output.log +0 -404
  7. data/.enhance_swarm.yml +33 -0
  8. data/CHANGELOG.md +71 -0
  9. data/README.md +128 -3
  10. data/lib/enhance_swarm/agent_spawner.rb +205 -12
  11. data/lib/enhance_swarm/cli.rb +129 -1
  12. data/lib/enhance_swarm/task_coordinator.rb +363 -86
  13. data/lib/enhance_swarm/version.rb +1 -1
  14. metadata +13 -97
  15. data/PRODUCTION_TEST_LOG.md +0 -502
  16. data/debug_agent_spawner.rb +0 -99
  17. data/debug_cli_spawn.rb +0 -95
  18. data/debug_fixes.rb +0 -209
  19. data/debug_script_execution.rb +0 -124
  20. data/debug_session_issue.rb +0 -87
  21. data/debug_spawn.rb +0 -113
  22. data/debug_spawn_step_by_step.rb +0 -190
  23. data/debug_worktree.rb +0 -77
  24. data/enhance_swarm-0.1.1.gem +0 -0
  25. data/enhance_swarm-1.0.0.gem +0 -0
  26. data/final_validation_test.rb +0 -199
  27. data/setup.sh +0 -86
  28. data/test_blog_app/.enhance_swarm/archives/session_1751187575_e119ea73_20250629_105935.json +0 -16
  29. data/test_blog_app/.enhance_swarm/archives/session_1751187637_7fda97dd_20250629_110037.json +0 -32
  30. data/test_blog_app/.enhance_swarm/archives/session_1751190527_4c99147e_20250629_114847.json +0 -32
  31. data/test_blog_app/.enhance_swarm/archives/session_1751190541_8dc83406_20250629_114901.json +0 -16
  32. data/test_blog_app/.ruby-version +0 -1
  33. data/test_blog_app/Gemfile +0 -18
  34. data/test_blog_app/Gemfile.lock +0 -206
  35. data/test_blog_app/README.md +0 -24
  36. data/test_blog_app/Rakefile +0 -6
  37. data/test_blog_app/app/assets/images/.keep +0 -0
  38. data/test_blog_app/app/assets/stylesheets/application.css +0 -10
  39. data/test_blog_app/app/controllers/application_controller.rb +0 -4
  40. data/test_blog_app/app/controllers/concerns/.keep +0 -0
  41. data/test_blog_app/app/helpers/application_helper.rb +0 -2
  42. data/test_blog_app/app/models/application_record.rb +0 -3
  43. data/test_blog_app/app/models/concerns/.keep +0 -0
  44. data/test_blog_app/app/views/layouts/application.html.erb +0 -27
  45. data/test_blog_app/app/views/pwa/manifest.json.erb +0 -22
  46. data/test_blog_app/app/views/pwa/service-worker.js +0 -26
  47. data/test_blog_app/bin/dev +0 -2
  48. data/test_blog_app/bin/rails +0 -4
  49. data/test_blog_app/bin/rake +0 -4
  50. data/test_blog_app/bin/setup +0 -34
  51. data/test_blog_app/config/application.rb +0 -42
  52. data/test_blog_app/config/boot.rb +0 -3
  53. data/test_blog_app/config/credentials.yml.enc +0 -1
  54. data/test_blog_app/config/database.yml +0 -32
  55. data/test_blog_app/config/environment.rb +0 -5
  56. data/test_blog_app/config/environments/development.rb +0 -51
  57. data/test_blog_app/config/environments/production.rb +0 -67
  58. data/test_blog_app/config/environments/test.rb +0 -42
  59. data/test_blog_app/config/initializers/assets.rb +0 -7
  60. data/test_blog_app/config/initializers/content_security_policy.rb +0 -25
  61. data/test_blog_app/config/initializers/filter_parameter_logging.rb +0 -8
  62. data/test_blog_app/config/initializers/inflections.rb +0 -16
  63. data/test_blog_app/config/locales/en.yml +0 -31
  64. data/test_blog_app/config/master.key +0 -1
  65. data/test_blog_app/config/puma.rb +0 -38
  66. data/test_blog_app/config/routes.rb +0 -14
  67. data/test_blog_app/config.ru +0 -6
  68. data/test_blog_app/db/seeds.rb +0 -9
  69. data/test_blog_app/lib/tasks/.keep +0 -0
  70. data/test_blog_app/log/.keep +0 -0
  71. data/test_blog_app/public/400.html +0 -114
  72. data/test_blog_app/public/404.html +0 -114
  73. data/test_blog_app/public/406-unsupported-browser.html +0 -114
  74. data/test_blog_app/public/422.html +0 -114
  75. data/test_blog_app/public/500.html +0 -114
  76. data/test_blog_app/public/icon.png +0 -0
  77. data/test_blog_app/public/icon.svg +0 -3
  78. data/test_blog_app/public/robots.txt +0 -1
  79. data/test_blog_app/script/.keep +0 -0
  80. data/test_blog_app/storage/.keep +0 -0
  81. data/test_blog_app/test/controllers/.keep +0 -0
  82. data/test_blog_app/test/fixtures/files/.keep +0 -0
  83. data/test_blog_app/test/helpers/.keep +0 -0
  84. data/test_blog_app/test/integration/.keep +0 -0
  85. data/test_blog_app/test/models/.keep +0 -0
  86. data/test_blog_app/test/test_helper.rb +0 -15
  87. data/test_blog_app/test_enhance_swarm_e2e.rb +0 -244
  88. data/test_blog_app/test_realistic_workflow.rb +0 -292
  89. data/test_blog_app/tmp/.keep +0 -0
  90. data/test_blog_app/tmp/pids/.keep +0 -0
  91. data/test_blog_app/tmp/storage/.keep +0 -0
  92. data/test_blog_app/vendor/.keep +0 -0
  93. data/test_builtin_functionality.rb +0 -121
  94. data/test_complete_system.rb +0 -267
  95. data/test_core_components.rb +0 -156
  96. data/test_real_claude_integration.rb +0 -285
  97. data/test_security.rb +0 -150
  98. data/test_smart_defaults.rb +0 -155
  99. data/test_task_integration.rb +0 -173
  100. data/test_web_ui.rb +0 -245
  101. data/web/assets/css/main.css +0 -645
  102. data/web/assets/js/kanban.js +0 -499
  103. data/web/assets/js/main.js +0 -525
  104. data/web/templates/dashboard.html.erb +0 -226
  105. data/web/templates/kanban.html.erb +0 -193
data/debug_spawn.rb DELETED
@@ -1,113 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # Debug script to test agent spawning
3
-
4
- $LOAD_PATH.unshift File.expand_path('lib', __dir__)
5
- require 'enhance_swarm'
6
-
7
- def test_agent_spawning
8
- puts "šŸ” Testing Agent Spawning Debug"
9
- puts "=" * 50
10
-
11
- begin
12
- spawner = EnhanceSwarm::AgentSpawner.new
13
-
14
- # Test Claude CLI availability
15
- puts "\n1ļøāƒ£ Testing Claude CLI..."
16
- available = spawner.claude_cli_available?
17
- puts " šŸ“Š Claude CLI available: #{available}"
18
-
19
- if available
20
- version = `claude --version 2>/dev/null`.strip
21
- puts " šŸ“Š Claude version: #{version}"
22
- end
23
-
24
- # Test session manager
25
- puts "\n2ļøāƒ£ Testing Session Manager..."
26
- session_manager = EnhanceSwarm::SessionManager.new
27
- session = session_manager.create_session("Debug test session")
28
- puts " šŸ“Š Session created: #{session[:session_id]}"
29
-
30
- # Test enhanced prompt building
31
- puts "\n3ļøāƒ£ Testing Enhanced Prompt Building..."
32
- prompt = spawner.send(:build_enhanced_agent_prompt,
33
- "Test task for debugging",
34
- "backend",
35
- Dir.pwd)
36
- puts " šŸ“Š Prompt length: #{prompt.length} characters"
37
- puts " šŸ“Š Contains role: #{prompt.include?('BACKEND')}"
38
-
39
- # Test script creation
40
- puts "\n4ļøāƒ£ Testing Agent Script Creation..."
41
- script_path = spawner.send(:create_agent_script,
42
- "Test prompt for script creation",
43
- "backend",
44
- Dir.pwd)
45
- puts " šŸ“Š Script created: #{File.exist?(script_path)}"
46
- puts " šŸ“Š Script executable: #{File.executable?(script_path)}"
47
-
48
- if File.exist?(script_path)
49
- script_content = File.read(script_path)
50
- puts " šŸ“Š Script length: #{script_content.length} characters"
51
- puts " šŸ“Š Contains claude command: #{script_content.include?('claude')}"
52
- end
53
-
54
- # Test the full spawn_agent method
55
- puts "\n5ļøāƒ£ Testing Full Agent Spawn..."
56
- puts " šŸš€ Attempting to spawn agent..."
57
-
58
- result = spawner.spawn_agent(
59
- role: "backend",
60
- task: "Create a simple test file with hello world",
61
- worktree: true
62
- )
63
-
64
- if result
65
- puts " āœ… Agent spawned successfully!"
66
- puts " šŸ“Š PID: #{result[:pid]}"
67
- puts " šŸ“Š Role: #{result[:role]}"
68
- puts " šŸ“Š Worktree: #{result[:worktree_path]}"
69
-
70
- # Check if the process is actually running
71
- begin
72
- if result[:pid]
73
- running = Process.getpgid(result[:pid])
74
- puts " šŸ“Š Process running: #{running ? 'Yes' : 'No'}"
75
- end
76
- rescue Errno::ESRCH
77
- puts " šŸ“Š Process running: No (not found)"
78
- end
79
-
80
- # Wait a moment and check logs
81
- sleep(3)
82
-
83
- # Check log files
84
- puts "\n6ļøāƒ£ Checking Log Files..."
85
- log_dir = '.enhance_swarm/logs'
86
- if Dir.exist?(log_dir)
87
- log_files = Dir.entries(log_dir).reject { |f| f.start_with?('.') }
88
- log_files.each do |log_file|
89
- log_path = File.join(log_dir, log_file)
90
- content = File.read(log_path) rescue ""
91
- puts " šŸ“Š #{log_file}: #{content.length} characters"
92
- if content.length > 0
93
- puts " Preview: #{content[0..100]}..."
94
- end
95
- end
96
- end
97
- else
98
- puts " āŒ Agent spawn failed"
99
- end
100
-
101
- rescue => e
102
- puts " āŒ Error: #{e.class}: #{e.message}"
103
- puts " šŸ“Š Backtrace:"
104
- e.backtrace.first(5).each { |line| puts " #{line}" }
105
- ensure
106
- # Cleanup
107
- session_manager&.cleanup_session
108
- end
109
- end
110
-
111
- if __FILE__ == $0
112
- test_agent_spawning
113
- end
@@ -1,190 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # Debug spawn process step by step
3
-
4
- $LOAD_PATH.unshift File.expand_path('lib', __dir__)
5
- require 'enhance_swarm'
6
-
7
- def debug_spawn_process
8
- puts "šŸ”§ Debugging Spawn Process Step by Step"
9
- puts "=" * 50
10
-
11
- begin
12
- ENV['ENHANCE_SWARM_DEBUG'] = 'true'
13
-
14
- # Step 1: Test AgentSpawner initialization
15
- puts "\n1ļøāƒ£ Initializing AgentSpawner..."
16
- spawner = EnhanceSwarm::AgentSpawner.new
17
- puts " āœ… AgentSpawner initialized"
18
-
19
- # Step 2: Test Claude CLI availability
20
- puts "\n2ļøāƒ£ Testing Claude CLI..."
21
- claude_available = spawner.claude_cli_available?
22
- puts " šŸ“Š Claude CLI available: #{claude_available}"
23
-
24
- if claude_available
25
- claude_version = `claude --version 2>/dev/null`.strip
26
- puts " šŸ“Š Claude version: #{claude_version}"
27
- end
28
-
29
- # Step 3: Test worktree creation
30
- puts "\n3ļøāƒ£ Testing Worktree Creation..."
31
- role = "frontend"
32
-
33
- # Call the private method using send
34
- worktree_path = spawner.send(:create_agent_worktree, role)
35
- puts " šŸ“Š Worktree created: #{worktree_path}"
36
-
37
- if worktree_path
38
- puts " šŸ“Š Worktree exists: #{Dir.exist?(worktree_path)}"
39
- puts " šŸ“Š Worktree files: #{Dir.entries(worktree_path).reject { |f| f.start_with?('.') }}"
40
- end
41
-
42
- # Step 4: Test prompt building
43
- puts "\n4ļøāƒ£ Testing Prompt Building..."
44
- task = "Create a simple test component"
45
- prompt = spawner.send(:build_agent_prompt, task, role, worktree_path)
46
- puts " šŸ“Š Prompt length: #{prompt.length} characters"
47
- puts " šŸ“Š First 100 chars: #{prompt[0..100]}..."
48
-
49
- # Step 5: Test script creation
50
- puts "\n5ļøāƒ£ Testing Script Creation..."
51
- script_path = spawner.send(:create_agent_script, prompt, role, worktree_path || Dir.pwd)
52
- puts " šŸ“Š Script created: #{script_path}"
53
- puts " šŸ“Š Script exists: #{File.exist?(script_path)}"
54
- puts " šŸ“Š Script executable: #{File.executable?(script_path)}"
55
-
56
- if File.exist?(script_path)
57
- script_content = File.read(script_path)
58
- puts " šŸ“Š Script length: #{script_content.length} characters"
59
- puts " šŸ“Š First few lines:"
60
- script_content.lines.first(5).each_with_index do |line, i|
61
- puts " #{i+1}: #{line.strip}"
62
- end
63
- end
64
-
65
- # Step 6: Test environment building
66
- puts "\n6ļøāƒ£ Testing Environment..."
67
- env = spawner.send(:build_agent_environment, role, worktree_path)
68
- puts " šŸ“Š Environment variables set:"
69
- env.select { |k, v| k.start_with?('ENHANCE_SWARM') }.each do |k, v|
70
- puts " #{k}=#{v}"
71
- end
72
-
73
- # Step 7: Try manual script execution
74
- puts "\n7ļøāƒ£ Testing Manual Script Execution..."
75
- if File.exist?(script_path)
76
- puts " šŸš€ Attempting to run script manually..."
77
-
78
- # Change to the working directory
79
- original_dir = Dir.pwd
80
- working_dir = worktree_path || Dir.pwd
81
-
82
- begin
83
- Dir.chdir(working_dir)
84
- puts " šŸ“Š Changed to directory: #{Dir.pwd}"
85
-
86
- # Try to execute the script with timeout
87
- require 'timeout'
88
-
89
- output = ""
90
- error = ""
91
-
92
- begin
93
- Timeout::timeout(10) do
94
- output = `bash #{script_path} 2>&1`
95
- end
96
- exit_status = $?.exitstatus
97
-
98
- puts " šŸ“Š Script exit status: #{exit_status}"
99
- puts " šŸ“Š Output length: #{output.length}"
100
- puts " šŸ“Š Output preview: #{output[0..300]}..." if output.length > 0
101
-
102
- rescue Timeout::Error
103
- puts " āš ļø Script execution timed out (>10s)"
104
- end
105
-
106
- ensure
107
- Dir.chdir(original_dir)
108
- end
109
- end
110
-
111
- # Step 8: Test Process.spawn approach
112
- puts "\n8ļøāƒ£ Testing Process.spawn..."
113
- if File.exist?(script_path)
114
- working_dir = worktree_path || Dir.pwd
115
- log_dir = '.enhance_swarm/logs'
116
-
117
- puts " šŸš€ Spawning process..."
118
- puts " šŸ“Š Working dir: #{working_dir}"
119
- puts " šŸ“Š Log dir: #{log_dir}"
120
-
121
- begin
122
- FileUtils.mkdir_p(log_dir)
123
-
124
- pid = Process.spawn(
125
- '/bin/bash', script_path,
126
- chdir: working_dir,
127
- out: File.join(log_dir, 'debug_manual_output.log'),
128
- err: File.join(log_dir, 'debug_manual_error.log')
129
- )
130
-
131
- puts " šŸ“Š Process spawned: PID #{pid}"
132
- Process.detach(pid)
133
-
134
- # Wait a moment and check status
135
- sleep(3)
136
-
137
- begin
138
- Process.getpgid(pid)
139
- puts " šŸ“Š Process still running"
140
- rescue Errno::ESRCH
141
- puts " šŸ“Š Process completed"
142
- end
143
-
144
- # Check output files
145
- output_file = File.join(log_dir, 'debug_manual_output.log')
146
- error_file = File.join(log_dir, 'debug_manual_error.log')
147
-
148
- if File.exist?(output_file)
149
- output = File.read(output_file)
150
- puts " šŸ“Š Manual output: #{output.length} chars"
151
- puts " šŸ“Š Output preview: #{output[0..200]}..." if output.length > 0
152
- end
153
-
154
- if File.exist?(error_file)
155
- error = File.read(error_file)
156
- puts " šŸ“Š Manual error: #{error.length} chars"
157
- puts " šŸ“Š Error preview: #{error[0..200]}..." if error.length > 0
158
- end
159
-
160
- rescue => e
161
- puts " āŒ Process spawn failed: #{e.message}"
162
- end
163
- end
164
-
165
- # Cleanup
166
- puts "\n9ļøāƒ£ Cleanup..."
167
- if worktree_path && Dir.exist?(worktree_path)
168
- puts " 🧹 Cleaning up worktree..."
169
- begin
170
- system("git worktree remove #{worktree_path}")
171
- branch_name = File.basename(worktree_path)
172
- system("git branch -d #{branch_name}")
173
- puts " āœ… Worktree cleaned up"
174
- rescue => e
175
- puts " āš ļø Cleanup warning: #{e.message}"
176
- end
177
- end
178
-
179
- rescue => e
180
- puts " āŒ Error: #{e.class}: #{e.message}"
181
- puts " šŸ“Š Backtrace:"
182
- e.backtrace.first(10).each { |line| puts " #{line}" }
183
- ensure
184
- ENV.delete('ENHANCE_SWARM_DEBUG')
185
- end
186
- end
187
-
188
- if __FILE__ == $0
189
- debug_spawn_process
190
- end
data/debug_worktree.rb DELETED
@@ -1,77 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # Debug script to test worktree creation
3
-
4
- $LOAD_PATH.unshift File.expand_path('lib', __dir__)
5
- require 'enhance_swarm'
6
-
7
- def test_worktree_creation
8
- puts "šŸ” Testing Git Worktree Creation Debug"
9
- puts "=" * 50
10
-
11
- spawner = EnhanceSwarm::AgentSpawner.new
12
-
13
- # Test the private create_agent_worktree method
14
- begin
15
- puts "\n1ļøāƒ£ Testing worktree creation..."
16
-
17
- # Check current git status
18
- git_status = `git status --porcelain 2>&1`
19
- puts " šŸ“Š Git status: #{git_status.strip}"
20
-
21
- # Check if we're in a git repository
22
- in_git_repo = system('git rev-parse --git-dir > /dev/null 2>&1')
23
- puts " šŸ“Š In git repo: #{in_git_repo}"
24
-
25
- # Check current branch
26
- current_branch = `git branch --show-current 2>&1`.strip
27
- puts " šŸ“Š Current branch: #{current_branch}"
28
-
29
- # Check if we have commits
30
- has_commits = system('git log --oneline -1 > /dev/null 2>&1')
31
- puts " šŸ“Š Has commits: #{has_commits}"
32
-
33
- # Test directory creation
34
- worktree_dir = '.enhance_swarm/worktrees'
35
- puts " šŸ“Š Creating directory: #{worktree_dir}"
36
- FileUtils.mkdir_p(worktree_dir) unless Dir.exist?(worktree_dir)
37
- puts " šŸ“Š Directory exists: #{Dir.exist?(worktree_dir)}"
38
-
39
- # Try to call the create_agent_worktree method
40
- puts "\n2ļøāƒ£ Calling create_agent_worktree..."
41
- worktree_path = spawner.send(:create_agent_worktree, 'debug_test')
42
-
43
- if worktree_path
44
- puts " āœ… Success! Worktree created at: #{worktree_path}"
45
- puts " šŸ“Š Directory exists: #{Dir.exist?(worktree_path)}"
46
-
47
- # List contents
48
- if Dir.exist?(worktree_path)
49
- contents = Dir.entries(worktree_path).reject { |f| f.start_with?('.') }
50
- puts " šŸ“Š Contents: #{contents.join(', ')}"
51
- end
52
- else
53
- puts " āŒ Failed to create worktree"
54
- end
55
-
56
- rescue => e
57
- puts " āŒ Error: #{e.class}: #{e.message}"
58
- puts " šŸ“Š Backtrace: #{e.backtrace.first(3).join(', ')}"
59
- end
60
-
61
- puts "\n3ļøāƒ£ Checking existing worktrees..."
62
- existing_worktrees = `git worktree list 2>&1`
63
- puts " šŸ“Š Existing worktrees:"
64
- existing_worktrees.each_line { |line| puts " #{line.strip}" }
65
-
66
- puts "\n4ļøāƒ£ Testing CommandExecutor directly..."
67
- begin
68
- result = EnhanceSwarm::CommandExecutor.execute('git', 'worktree', 'list')
69
- puts " āœ… CommandExecutor works: #{result}"
70
- rescue => e
71
- puts " āŒ CommandExecutor error: #{e.message}"
72
- end
73
- end
74
-
75
- if __FILE__ == $0
76
- test_worktree_creation
77
- end
Binary file
Binary file
@@ -1,199 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # Final comprehensive validation test for EnhanceSwarm v1.0
3
-
4
- $LOAD_PATH.unshift File.expand_path('lib', __dir__)
5
- require 'enhance_swarm'
6
-
7
- def run_final_validation
8
- puts "šŸ” EnhanceSwarm v1.0 Final Validation Test"
9
- puts "=" * 60
10
-
11
- results = {
12
- core_functionality: {},
13
- reliability: {},
14
- user_experience: {},
15
- production_readiness: {}
16
- }
17
-
18
- begin
19
- # 1. Core Functionality Tests
20
- puts "\n1ļøāƒ£ CORE FUNCTIONALITY VALIDATION"
21
- puts "-" * 40
22
-
23
- # Test AgentSpawner
24
- puts " Testing AgentSpawner..."
25
- spawner = EnhanceSwarm::AgentSpawner.new
26
- claude_available = spawner.claude_cli_available?
27
- results[:core_functionality][:claude_cli] = claude_available
28
- puts " šŸ“Š Claude CLI: #{claude_available ? 'āœ…' : 'āŒ'}"
29
-
30
- # Test SessionManager
31
- puts " Testing SessionManager..."
32
- session_manager = EnhanceSwarm::SessionManager.new
33
- session = session_manager.create_session("Validation test")
34
- session_works = session && session[:session_id]
35
- results[:core_functionality][:session_management] = session_works
36
- puts " šŸ“Š Session Management: #{session_works ? 'āœ…' : 'āŒ'}"
37
-
38
- # Test Configuration
39
- puts " Testing Configuration..."
40
- config = EnhanceSwarm.configuration
41
- config_works = config && config.project_name
42
- results[:core_functionality][:configuration] = config_works
43
- puts " šŸ“Š Configuration: #{config_works ? 'āœ…' : 'āŒ'}"
44
-
45
- # Test Orchestrator
46
- puts " Testing Orchestrator..."
47
- orchestrator = EnhanceSwarm::Orchestrator.new
48
- orchestrator_works = orchestrator.respond_to?(:spawn_single)
49
- results[:core_functionality][:orchestrator] = orchestrator_works
50
- puts " šŸ“Š Orchestrator: #{orchestrator_works ? 'āœ…' : 'āŒ'}"
51
-
52
- # 2. Reliability Tests
53
- puts "\n2ļøāƒ£ RELIABILITY VALIDATION"
54
- puts "-" * 40
55
-
56
- # Test Error Handling
57
- puts " Testing Error Handling..."
58
- begin
59
- # Test with invalid input
60
- spawner.spawn_agent(role: nil, task: nil, worktree: false)
61
- error_handling = false
62
- rescue => e
63
- error_handling = true
64
- puts " šŸ“Š Error properly caught: #{e.class}"
65
- end
66
- results[:reliability][:error_handling] = error_handling
67
- puts " šŸ“Š Error Handling: #{error_handling ? 'āœ…' : 'āŒ'}"
68
-
69
- # Test Logger
70
- puts " Testing Logger..."
71
- logger_works = EnhanceSwarm::Logger.respond_to?(:info)
72
- results[:reliability][:logging] = logger_works
73
- puts " šŸ“Š Logging System: #{logger_works ? 'āœ…' : 'āŒ'}"
74
-
75
- # Test Cleanup
76
- puts " Testing Cleanup..."
77
- cleanup_works = EnhanceSwarm::CleanupManager.respond_to?(:cleanup_stale_worktrees)
78
- results[:reliability][:cleanup] = cleanup_works
79
- puts " šŸ“Š Cleanup Manager: #{cleanup_works ? 'āœ…' : 'āŒ'}"
80
-
81
- # 3. User Experience Tests
82
- puts "\n3ļøāƒ£ USER EXPERIENCE VALIDATION"
83
- puts "-" * 40
84
-
85
- # Test CLI Components
86
- puts " Testing CLI Components..."
87
- cli_works = EnhanceSwarm::CLI.respond_to?(:new)
88
- results[:user_experience][:cli] = cli_works
89
- puts " šŸ“Š CLI Interface: #{cli_works ? 'āœ…' : 'āŒ'}"
90
-
91
- # Test Dashboard
92
- puts " Testing Dashboard..."
93
- dashboard_works = EnhanceSwarm::VisualDashboard.respond_to?(:instance)
94
- results[:user_experience][:dashboard] = dashboard_works
95
- puts " šŸ“Š Visual Dashboard: #{dashboard_works ? 'āœ…' : 'āŒ'}"
96
-
97
- # Test Smart Defaults
98
- puts " Testing Smart Defaults..."
99
- smart_defaults_works = EnhanceSwarm::SmartDefaults.respond_to?(:suggest_role_for_task)
100
- results[:user_experience][:smart_defaults] = smart_defaults_works
101
- puts " šŸ“Š Smart Defaults: #{smart_defaults_works ? 'āœ…' : 'āŒ'}"
102
-
103
- # 4. Production Readiness Tests
104
- puts "\n4ļøāƒ£ PRODUCTION READINESS VALIDATION"
105
- puts "-" * 40
106
-
107
- # Test actual spawn (non-blocking)
108
- puts " Testing Real Agent Spawn..."
109
- spawn_result = spawner.spawn_agent(
110
- role: "general",
111
- task: "Quick validation test - just echo 'validation successful'",
112
- worktree: false
113
- )
114
- spawn_works = spawn_result && spawn_result[:pid]
115
- results[:production_readiness][:real_spawn] = spawn_works
116
- puts " šŸ“Š Real Agent Spawn: #{spawn_works ? 'āœ…' : 'āŒ'}"
117
-
118
- if spawn_works
119
- puts " šŸ“Š Spawned PID: #{spawn_result[:pid]}"
120
-
121
- # Brief wait to check process
122
- sleep(2)
123
- begin
124
- Process.getpgid(spawn_result[:pid])
125
- puts " šŸ“Š Process Status: Running āœ…"
126
- rescue Errno::ESRCH
127
- puts " šŸ“Š Process Status: Completed āœ…"
128
- end
129
- end
130
-
131
- # Test Dependencies
132
- puts " Testing Dependencies..."
133
- deps_works = EnhanceSwarm::DependencyValidator.respond_to?(:validate_all)
134
- results[:production_readiness][:dependencies] = deps_works
135
- puts " šŸ“Š Dependency Validation: #{deps_works ? 'āœ…' : 'āŒ'}"
136
-
137
- # Test Process Monitoring
138
- puts " Testing Process Monitoring..."
139
- monitor_works = EnhanceSwarm::ProcessMonitor.respond_to?(:new)
140
- results[:production_readiness][:monitoring] = monitor_works
141
- puts " šŸ“Š Process Monitoring: #{monitor_works ? 'āœ…' : 'āŒ'}"
142
-
143
- # 5. Calculate Final Score
144
- puts "\n5ļøāƒ£ FINAL SCORING"
145
- puts "-" * 40
146
-
147
- total_tests = 0
148
- passed_tests = 0
149
-
150
- results.each do |category, tests|
151
- category_passed = tests.values.count(true)
152
- category_total = tests.count
153
- total_tests += category_total
154
- passed_tests += category_passed
155
-
156
- percentage = category_total > 0 ? (category_passed.to_f / category_total * 100).round(1) : 0
157
- puts " #{category.to_s.gsub('_', ' ').capitalize}: #{category_passed}/#{category_total} (#{percentage}%)"
158
- end
159
-
160
- overall_percentage = total_tests > 0 ? (passed_tests.to_f / total_tests * 100).round(1) : 0
161
-
162
- puts "\n" + "=" * 60
163
- puts "šŸŽÆ FINAL VALIDATION RESULTS"
164
- puts "=" * 60
165
- puts "Total Tests: #{total_tests}"
166
- puts "Tests Passed: #{passed_tests}"
167
- puts "Success Rate: #{overall_percentage}%"
168
-
169
- if overall_percentage >= 95
170
- puts "\nšŸš€ PRODUCTION READY - EXCELLENT"
171
- puts " All critical systems operational"
172
- elsif overall_percentage >= 85
173
- puts "\nāœ… PRODUCTION READY - GOOD"
174
- puts " Minor issues, but deployable"
175
- elsif overall_percentage >= 70
176
- puts "\nāš ļø PRODUCTION READY - WITH CAVEATS"
177
- puts " Some issues need attention"
178
- else
179
- puts "\nāŒ NOT PRODUCTION READY"
180
- puts " Significant issues require resolution"
181
- end
182
-
183
- return overall_percentage
184
-
185
- rescue => e
186
- puts " āŒ Validation Error: #{e.class}: #{e.message}"
187
- puts " šŸ“Š Backtrace:"
188
- e.backtrace.first(3).each { |line| puts " #{line}" }
189
- return 0
190
- ensure
191
- # Cleanup
192
- session_manager&.cleanup_session
193
- end
194
- end
195
-
196
- if __FILE__ == $0
197
- score = run_final_validation
198
- puts "\nšŸŽ–ļø EnhanceSwarm v1.0 Production Score: #{score}/100"
199
- end
data/setup.sh DELETED
@@ -1,86 +0,0 @@
1
- #!/bin/bash
2
- set -e
3
-
4
- # EnhanceSwarm Auto-Setup Script
5
- # This script can be run directly from GitHub to set up EnhanceSwarm in any project
6
-
7
- echo "šŸš€ EnhanceSwarm Auto-Setup"
8
- echo "========================="
9
-
10
- # Colors
11
- GREEN='\033[0;32m'
12
- YELLOW='\033[1;33m'
13
- RED='\033[0;31m'
14
- NC='\033[0m' # No Color
15
-
16
- # Check dependencies
17
- echo -e "\n${YELLOW}Checking dependencies...${NC}"
18
-
19
- check_dependency() {
20
- if command -v $1 &> /dev/null; then
21
- echo -e " āœ… $1 found"
22
- return 0
23
- else
24
- echo -e " āŒ $1 not found"
25
- return 1
26
- fi
27
- }
28
-
29
- MISSING_DEPS=0
30
- check_dependency "ruby" || MISSING_DEPS=1
31
- check_dependency "git" || MISSING_DEPS=1
32
- check_dependency "bundle" || MISSING_DEPS=1
33
-
34
- if [ $MISSING_DEPS -eq 1 ]; then
35
- echo -e "\n${RED}Missing required dependencies. Please install them first.${NC}"
36
- exit 1
37
- fi
38
-
39
- # Clone or update enhance_swarm
40
- ENHANCE_DIR="$HOME/.enhance_swarm"
41
-
42
- if [ -d "$ENHANCE_DIR" ]; then
43
- echo -e "\n${YELLOW}Updating EnhanceSwarm...${NC}"
44
- cd "$ENHANCE_DIR"
45
- git pull origin main
46
- else
47
- echo -e "\n${YELLOW}Installing EnhanceSwarm...${NC}"
48
- git clone https://github.com/todddickerson/enhance_swarm.git "$ENHANCE_DIR"
49
- cd "$ENHANCE_DIR"
50
- fi
51
-
52
- # Install gem dependencies
53
- echo -e "\n${YELLOW}Installing dependencies...${NC}"
54
- bundle install
55
-
56
- # Build and install the gem
57
- echo -e "\n${YELLOW}Building and installing gem...${NC}"
58
- rake build
59
- gem install pkg/enhance_swarm-*.gem
60
-
61
- # Check optional dependencies
62
- echo -e "\n${YELLOW}Checking optional dependencies...${NC}"
63
- check_dependency "claude" || echo " āš ļø Install Claude CLI for enhanced agent spawning"
64
- check_dependency "gemini" || echo " āš ļø Install Gemini CLI for large context analysis"
65
-
66
- # Initialize in current project if we're in a project directory
67
- if [ -f "Gemfile" ] || [ -f "package.json" ] || [ -f ".git/config" ]; then
68
- echo -e "\n${YELLOW}Detected project directory. Initialize EnhanceSwarm here?${NC}"
69
- read -p "Initialize EnhanceSwarm in current directory? (y/n) " -n 1 -r
70
- echo
71
- if [[ $REPLY =~ ^[Yy]$ ]]; then
72
- enhance-swarm init
73
- fi
74
- else
75
- echo -e "\n${GREEN}āœ… EnhanceSwarm installed successfully!${NC}"
76
- echo -e "\nTo initialize in a project, run:"
77
- echo -e " ${YELLOW}cd your-project${NC}"
78
- echo -e " ${YELLOW}enhance-swarm init${NC}"
79
- fi
80
-
81
- echo -e "\n${GREEN}šŸŽ‰ Setup complete!${NC}"
82
- echo -e "\nAvailable commands:"
83
- echo " enhance-swarm init - Initialize in a project"
84
- echo " enhance-swarm enhance - Run ENHANCE protocol"
85
- echo " enhance-swarm doctor - Check system setup"
86
- echo " enhance-swarm --help - See all commands"
@@ -1,16 +0,0 @@
1
- {
2
- "session_id": "1751187575_e119ea73",
3
- "start_time": "2025-06-29T10:59:35+02:00",
4
- "task_description": "Rails E2E test session",
5
- "agents": [
6
- {
7
- "role": "test_agent",
8
- "pid": 99999,
9
- "worktree_path": "/test/path",
10
- "task": "Test Rails development",
11
- "start_time": "2025-06-29T10:59:35+02:00",
12
- "status": "running"
13
- }
14
- ],
15
- "status": "active"
16
- }