lex-agentic-executive 0.2.0 → 0.2.1
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 +5 -0
- data/lib/legion/extensions/agentic/executive/goal_management/helpers/decomposer.rb +22 -3
- data/lib/legion/extensions/agentic/executive/version.rb +1 -1
- data/spec/legion/extensions/agentic/executive/goal_management/helpers/decomposer_spec.rb +15 -0
- data/spec/legion/extensions/agentic/executive/goal_management/helpers/task_dispatcher_spec.rb +8 -0
- 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: a52da834db3ad024167228f957b019bfc33bb0a1cc86cc1cb58feabe4aa1bec4
|
|
4
|
+
data.tar.gz: 16f3a79dee77a608932cb3b837ee55aac9bc4cfbd596beb42f29582b530c1b54
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e44439bae29cbf8793b0f69ece036bb097051f0434b4d33f4e373f661c5203b51beabb58d9b9f78f17ab9b0fc0041c0565dfbd7d6b11804707e39aa0ef78784a
|
|
7
|
+
data.tar.gz: 596a167041a980a4151babe00df9b876a0ebe647929fcea48e0cebe8b9b6704621a5499fcebde0494a8a9c3fff3000b22b2e29ce2da658f481a3ad1350400cd3
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.2.1] - 2026-05-07
|
|
4
|
+
### Fixed
|
|
5
|
+
- Goal decomposer LLM strategy now parses native `Legion::LLM.chat` hash responses without requiring a legacy chat session.
|
|
6
|
+
- Added regression coverage for cognition-domain dispatch to the MindGrowth analyzer.
|
|
7
|
+
|
|
3
8
|
## [0.2.0] - 2026-04-21
|
|
4
9
|
### Added
|
|
5
10
|
- **Autonomous Goal-Setting Pipeline (G1-G5)** — GAIA can now convert intentions into goals, decompose them, dispatch execution, and receive feedback with no human intervention
|
|
@@ -48,9 +48,10 @@ module Legion
|
|
|
48
48
|
|
|
49
49
|
prompt = build_decomposition_prompt(goal)
|
|
50
50
|
response = Legion::LLM.chat(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
message: prompt,
|
|
52
|
+
caller: { extension: 'lex-agentic-executive', operation: 'decompose' }
|
|
53
|
+
)
|
|
54
|
+
parse_sub_goals(extract_response_content(response, prompt), goal[:domain])
|
|
54
55
|
rescue StandardError => e
|
|
55
56
|
log.error "Decomposer#decompose_with_llm: #{e.message}"
|
|
56
57
|
nil
|
|
@@ -83,6 +84,8 @@ module Legion
|
|
|
83
84
|
end
|
|
84
85
|
|
|
85
86
|
def parse_sub_goals(content, domain)
|
|
87
|
+
return nil unless content
|
|
88
|
+
|
|
86
89
|
cleaned = content.gsub(/```(?:json)?\s*\n?/, '').strip
|
|
87
90
|
data = json_load(cleaned)
|
|
88
91
|
return nil unless data.is_a?(Array) && !data.empty?
|
|
@@ -98,6 +101,22 @@ module Legion
|
|
|
98
101
|
log.error "Decomposer#parse_sub_goals: #{e.message}"
|
|
99
102
|
nil
|
|
100
103
|
end
|
|
104
|
+
|
|
105
|
+
def extract_response_content(response, prompt)
|
|
106
|
+
return response.strip if response.is_a?(String)
|
|
107
|
+
return response.content if response.respond_to?(:content)
|
|
108
|
+
|
|
109
|
+
if response.respond_to?(:ask)
|
|
110
|
+
asked = response.ask(prompt)
|
|
111
|
+
return extract_response_content(asked, prompt)
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
return nil unless response.is_a?(Hash)
|
|
115
|
+
|
|
116
|
+
response[:content] || response['content'] ||
|
|
117
|
+
response.dig(:message, :content) || response.dig('message', 'content') ||
|
|
118
|
+
response[:response] || response['response']
|
|
119
|
+
end
|
|
101
120
|
end
|
|
102
121
|
end
|
|
103
122
|
end
|
|
@@ -33,6 +33,21 @@ RSpec.describe Legion::Extensions::Agentic::Executive::GoalManagement::Helpers::
|
|
|
33
33
|
expect(result[:success]).to be true
|
|
34
34
|
expect(result[:strategy_used]).to eq(:heuristic)
|
|
35
35
|
end
|
|
36
|
+
|
|
37
|
+
it 'parses native hash responses from Legion::LLM.chat' do
|
|
38
|
+
llm = Module.new
|
|
39
|
+
llm.define_singleton_method(:chat) do |message:, **|
|
|
40
|
+
raise 'missing prompt' if message.to_s.empty?
|
|
41
|
+
|
|
42
|
+
{ content: '[{"content":"inspect controls","domain":"safety","priority":0.8}]' }
|
|
43
|
+
end
|
|
44
|
+
stub_const('Legion::LLM', llm)
|
|
45
|
+
|
|
46
|
+
result = described_class.decompose(goal: goal_hash, strategy: :llm)
|
|
47
|
+
|
|
48
|
+
expect(result[:strategy_used]).to eq(:llm)
|
|
49
|
+
expect(result[:sub_goals].first[:content]).to eq('inspect controls')
|
|
50
|
+
end
|
|
36
51
|
end
|
|
37
52
|
|
|
38
53
|
context 'with default strategy' do
|
data/spec/legion/extensions/agentic/executive/goal_management/helpers/task_dispatcher_spec.rb
CHANGED
|
@@ -80,6 +80,14 @@ RSpec.describe Legion::Extensions::Agentic::Executive::GoalManagement::Helpers::
|
|
|
80
80
|
expect(result[:runner_mapping]).to eq('Legion::Extensions::MindGrowth::Runners::Monitor')
|
|
81
81
|
end
|
|
82
82
|
|
|
83
|
+
it 'dispatches cognition goals to the current MindGrowth analyzer runner' do
|
|
84
|
+
stub_const('Legion::Extensions::MindGrowth::Runners::Analyzer', Module.new)
|
|
85
|
+
result = dispatcher.dispatch_goal(goal: goal_hash.merge(domain: :cognition))
|
|
86
|
+
|
|
87
|
+
expect(result[:dispatched]).to be true
|
|
88
|
+
expect(result[:runner_mapping]).to eq('Legion::Extensions::MindGrowth::Runners::Analyzer')
|
|
89
|
+
end
|
|
90
|
+
|
|
83
91
|
it 'includes goal_id in the response' do
|
|
84
92
|
result = dispatcher.dispatch_goal(goal: goal_hash)
|
|
85
93
|
expect(result[:goal_id]).to eq('goal-123')
|