enhance_swarm 2.1.1 β 2.1.2
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +18 -0
- data/lib/enhance_swarm/task_coordinator.rb +95 -14
- data/lib/enhance_swarm/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b8c5522c0ed58c3863fddfd4e6f11d0d091440ae2de4b863bfae7e7bece5b6b
|
4
|
+
data.tar.gz: 286889e00e4f50c6100d5012f1320bb06ce6270c6b6b9dbcce2cd26846c1a16c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ed4192cb031f30d8baa2fcd9762ef161e463c23d01b44f14a6c2663dcac11896001a23fc8fb523fd75caf38e63c4d1555523c782c38ae7bc334d82e20ebb93d
|
7
|
+
data.tar.gz: 97aeaaf8afcd9396f6441ae82666759aaa25c545eb693371731a3d991372a25d1c9e84065143aad3a45155d0a58519f830dbfafa9dd6b518d517e045cb23bf27
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,24 @@ All notable changes to EnhanceSwarm will be documented in this file.
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
7
7
|
|
8
|
+
## [2.1.1] - 2025-06-30
|
9
|
+
|
10
|
+
### π§ Critical Bug Fixes
|
11
|
+
|
12
|
+
#### π₯ Production Issues Resolved
|
13
|
+
- **β
CRITICAL: Fixed Detached Mode Logging** - Absolute paths prevent log files from disappearing in background processes
|
14
|
+
- **β
CRITICAL: Fixed Bullet Train Super Scaffolding** - Non-interactive printf commands prevent NoMethodError on interactive prompts
|
15
|
+
- **β
Enhanced Non-Interactive Templates** - Comprehensive printf templates for common BT scaffolding patterns
|
16
|
+
- **β
Improved Status Reporting** - Better orchestration monitoring and error handling
|
17
|
+
|
18
|
+
#### π οΈ Technical Improvements
|
19
|
+
- **Detached Mode:** Fixed absolute path resolution for `.enhance_swarm/logs/` directory
|
20
|
+
- **BT Scaffolding:** Added `printf "y\\n[slug]\\n[icon]\\n"` templates for common Super Scaffolding patterns
|
21
|
+
- **Error Handling:** Enhanced subprocess error capture and reporting
|
22
|
+
- **Status Monitoring:** Reliable status file writing with working directory context
|
23
|
+
|
24
|
+
This patch release ensures production orchestration reliability with proper logging and Bullet Train scaffolding compliance.
|
25
|
+
|
8
26
|
## [2.1.0] - 2025-06-30
|
9
27
|
|
10
28
|
### π₯ Critical Orchestration Fixes & Production Enhancements
|
@@ -20,19 +20,37 @@ module EnhanceSwarm
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def coordinate_task(description)
|
23
|
-
Logger.info("π―
|
23
|
+
Logger.info("π― ENHANCE SWARM TASK COORDINATOR ACTIVATED")
|
24
|
+
Logger.info("π Master Task: #{description}")
|
25
|
+
Logger.info("π Beginning intelligent task analysis and decomposition...")
|
24
26
|
|
25
27
|
# 1. Analyze project context
|
28
|
+
Logger.info("π¬ PHASE 1: Project Context Analysis")
|
26
29
|
@project_analyzer.analyze
|
27
30
|
project_context = @project_analyzer.generate_smart_defaults
|
28
31
|
|
32
|
+
project_type = project_context[:project_type] || 'Generic'
|
33
|
+
tech_stack = project_context[:technology_stack]&.join(', ') || 'Unknown'
|
34
|
+
Logger.info(" π Detected: #{project_type} project using #{tech_stack}")
|
35
|
+
|
29
36
|
# 2. Break down task into specialized subtasks
|
37
|
+
Logger.info("π§© PHASE 2: Intelligent Task Decomposition")
|
30
38
|
subtasks = decompose_task(description, project_context)
|
39
|
+
Logger.info(" β‘ Decomposed into #{subtasks.length} specialized agent tasks")
|
40
|
+
subtasks.each_with_index do |task, i|
|
41
|
+
Logger.info(" #{i+1}. #{task[:role].upcase}: #{task[:description]}")
|
42
|
+
end
|
31
43
|
|
32
44
|
# 3. Create dependency-aware execution plan
|
45
|
+
Logger.info("πΊοΈ PHASE 3: Dependency-Aware Execution Planning")
|
33
46
|
execution_plan = create_execution_plan(subtasks)
|
47
|
+
phases = execution_plan[:phases].length
|
48
|
+
total_agents = execution_plan[:phases].sum { |p| p[:tasks].length }
|
49
|
+
Logger.info(" π― Generated #{phases}-phase execution plan with #{total_agents} coordinated agents")
|
34
50
|
|
35
51
|
# 4. Execute plan with coordination
|
52
|
+
Logger.info("π PHASE 4: Multi-Agent Orchestration Launch")
|
53
|
+
Logger.info("β" * 60)
|
36
54
|
execute_coordinated_plan(execution_plan)
|
37
55
|
end
|
38
56
|
|
@@ -538,71 +556,134 @@ module EnhanceSwarm
|
|
538
556
|
end
|
539
557
|
|
540
558
|
def execute_coordinated_plan(plan)
|
541
|
-
Logger.info("
|
559
|
+
Logger.info("π― MULTI-AGENT ORCHESTRATION STARTING")
|
560
|
+
Logger.info("π Execution Plan: #{plan[:phases].length} phases with #{plan[:phases].sum { |p| p[:tasks].length }} specialized agents")
|
561
|
+
|
562
|
+
# Show complete coordination plan
|
563
|
+
plan[:phases].each_with_index do |phase, i|
|
564
|
+
agent_roles = phase[:tasks].map { |t| "#{t[:role].upcase}" }.join(", ")
|
565
|
+
Logger.info(" Phase #{i + 1}: [#{agent_roles}] - #{phase[:description]}")
|
566
|
+
end
|
567
|
+
Logger.info("π€ Agent specializations defined, beginning coordinated execution...")
|
568
|
+
Logger.info("")
|
542
569
|
|
543
570
|
plan[:phases].each_with_index do |phase, index|
|
544
|
-
Logger.info("
|
571
|
+
Logger.info("π PHASE #{index + 1} ACTIVATION: #{phase[:description]}")
|
572
|
+
agent_count = phase[:tasks].length
|
573
|
+
agent_list = phase[:tasks].map { |t| "#{t[:role].upcase} Agent" }.join(", ")
|
574
|
+
Logger.info("π₯ Deploying #{agent_count} specialized agents: #{agent_list}")
|
575
|
+
|
576
|
+
# Show dependencies for this phase
|
577
|
+
if index > 0
|
578
|
+
Logger.info("π Dependencies: Awaiting completion of Phase #{index} handoffs")
|
579
|
+
end
|
545
580
|
|
546
581
|
# Execute all tasks in this phase (they can run in parallel)
|
547
582
|
phase_results = execute_phase(phase[:tasks])
|
548
583
|
|
549
584
|
# Validate phase completion before proceeding
|
550
585
|
if phase_results.all? { |result| result[:success] }
|
551
|
-
Logger.info("β
|
586
|
+
Logger.info("β
PHASE #{index + 1} COMPLETE: All agents completed successfully")
|
587
|
+
|
588
|
+
# Show what each agent accomplished
|
589
|
+
phase_results.each do |result|
|
590
|
+
Logger.info(" π #{result[:role].upcase} Agent: #{result[:summary] || 'Task completed'}")
|
591
|
+
end
|
552
592
|
|
553
593
|
# CRITICAL: Merge all agent worktree changes back to main project
|
594
|
+
Logger.info("π COORDINATION: Merging agent changes to main project...")
|
554
595
|
merge_agent_changes_to_main(phase_results)
|
596
|
+
Logger.info("β
HANDOFF: Phase #{index + 1} work integrated, ready for next phase")
|
555
597
|
else
|
556
|
-
Logger.error("β
|
598
|
+
Logger.error("β PHASE #{index + 1} FAILED: Agent coordination breakdown")
|
599
|
+
failed_agents = phase_results.select { |r| !r[:success] }.map { |r| r[:role].upcase }
|
600
|
+
Logger.error(" π¨ Failed agents: #{failed_agents.join(', ')}")
|
557
601
|
break
|
558
602
|
end
|
559
603
|
|
560
604
|
# Brief pause between phases for coordination
|
561
|
-
|
605
|
+
if index < plan[:phases].length - 1
|
606
|
+
Logger.info("βΈοΈ COORDINATION PAUSE: Preparing next phase handoff...")
|
607
|
+
sleep(2)
|
608
|
+
Logger.info("")
|
609
|
+
end
|
562
610
|
end
|
563
611
|
|
564
612
|
# Final cleanup and commit of merged changes
|
613
|
+
Logger.info("π― ORCHESTRATION FINALIZATION: Integrating all agent work...")
|
565
614
|
finalize_orchestration_results
|
615
|
+
Logger.info("π MULTI-AGENT ORCHESTRATION COMPLETE: Full team coordination successful!")
|
566
616
|
end
|
567
617
|
|
568
618
|
def execute_phase(tasks)
|
569
619
|
results = []
|
570
620
|
threads = []
|
571
621
|
|
572
|
-
Logger.info("
|
622
|
+
Logger.info("β‘ PARALLEL AGENT DEPLOYMENT: Activating #{tasks.length} specialized agents")
|
623
|
+
|
624
|
+
# Show agent deployment plan
|
625
|
+
tasks.each_with_index do |task, i|
|
626
|
+
dependencies = task[:dependencies]&.empty? ? "None" : task[:dependencies].join(", ")
|
627
|
+
Logger.info(" π€ #{task[:role].upcase} Agent ##{i+1}: #{task[:description]}")
|
628
|
+
Logger.info(" π Dependencies: #{dependencies}")
|
629
|
+
end
|
630
|
+
Logger.info("π Beginning parallel agent execution...")
|
573
631
|
|
574
632
|
# Execute tasks in parallel threads
|
575
|
-
tasks.
|
633
|
+
tasks.each_with_index do |task, index|
|
576
634
|
thread = Thread.new do
|
577
635
|
Thread.current[:task_id] = task[:id]
|
578
636
|
Thread.current[:role] = task[:role]
|
579
637
|
|
580
638
|
begin
|
639
|
+
Logger.info("π’ AGENT ACTIVATION: #{task[:role].upcase} Agent starting work...")
|
640
|
+
Logger.info(" π Task: #{task[:description]}")
|
641
|
+
|
581
642
|
enhanced_prompt = build_enhanced_task_prompt(task)
|
582
643
|
|
583
644
|
# Try agent spawning first
|
645
|
+
Logger.info(" π§ Spawning specialized #{task[:role]} agent in isolated worktree...")
|
646
|
+
start_time = Time.now
|
647
|
+
|
584
648
|
result = @agent_spawner.spawn_agent(
|
585
649
|
role: task[:role],
|
586
650
|
task: enhanced_prompt,
|
587
651
|
worktree: true
|
588
652
|
)
|
589
653
|
|
654
|
+
execution_time = (Time.now - start_time).round(1)
|
655
|
+
|
590
656
|
if result
|
591
657
|
@agent_assignments[task[:id]] = result
|
592
|
-
Logger.info("β
|
593
|
-
|
658
|
+
Logger.info("β
AGENT SUCCESS: #{task[:role].upcase} Agent completed in #{execution_time}s")
|
659
|
+
Logger.info(" π Work completed in isolated environment, ready for integration")
|
660
|
+
{
|
661
|
+
task_id: task[:id],
|
662
|
+
role: task[:role],
|
663
|
+
success: true,
|
664
|
+
agent_info: result,
|
665
|
+
execution_time: execution_time,
|
666
|
+
summary: "Specialized #{task[:role]} work completed successfully"
|
667
|
+
}
|
594
668
|
else
|
595
669
|
# Fallback to direct execution
|
596
|
-
Logger.warn("β οΈ
|
670
|
+
Logger.warn("β οΈ AGENT FALLBACK: #{task[:role]} agent spawn failed, using control agent")
|
597
671
|
direct_result = execute_task_directly(task)
|
598
672
|
|
599
673
|
if direct_result
|
600
|
-
Logger.info("β
|
674
|
+
Logger.info("β
CONTROL AGENT: Completed #{task[:role]} task directly in #{execution_time}s")
|
601
675
|
else
|
602
|
-
Logger.error("β Control agent
|
676
|
+
Logger.error("β AGENT FAILURE: Control agent could not complete #{task[:role]} task")
|
603
677
|
end
|
604
678
|
|
605
|
-
{
|
679
|
+
{
|
680
|
+
task_id: task[:id],
|
681
|
+
role: task[:role],
|
682
|
+
success: direct_result,
|
683
|
+
executed_directly: true,
|
684
|
+
execution_time: execution_time,
|
685
|
+
summary: direct_result ? "Control agent handled task" : "Task failed"
|
686
|
+
}
|
606
687
|
end
|
607
688
|
rescue StandardError => e
|
608
689
|
Logger.error("π₯ Task #{task[:id]} failed: #{e.message}")
|