legionio 1.5.19 → 1.5.21
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 +13 -0
- data/lib/legion/cli/knowledge_command.rb +103 -1
- data/lib/legion/cli/setup_command.rb +20 -2
- data/lib/legion/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: ff2178b95e28c31128ad05f307d30f9cc4eb805210144dd7b579e3e526046045
|
|
4
|
+
data.tar.gz: d49fdcfa4b32c25cb0757abdac503e26cac31b5f134e4764219d79afe7b1141b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d4636401d967346d0db79ed299ed6bcb0bccd854a1ff58af1f88dfba545610bca4d6ea1f95c992ad206a90091b8510f214392f236d9f35fca8e347f0f76d61c9
|
|
7
|
+
data.tar.gz: e477f818ab50a7edcbdf8be7b5e5e62ac4c65d9394f224401104cc646140d9dfa7e6ab356fdea1dc69c764ca3f1144a36e8c42998978b3fa73620358166b4e2d
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Legion Changelog
|
|
2
2
|
|
|
3
|
+
## [1.5.21] - 2026-03-26
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
- `legionio setup agentic` now installs the full cognitive stack (63 gems): core libs, all agentic domains, all AI providers, and key operational extensions
|
|
7
|
+
- Added `brains` and `give-me-all-the-brains` as aliases for the `agentic` subcommand
|
|
8
|
+
|
|
9
|
+
## [1.5.20] - 2026-03-26
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
- `legion knowledge health` — local/Apollo/sync health report
|
|
13
|
+
- `legion knowledge maintain` — orphan chunk detection and cleanup (dry-run by default)
|
|
14
|
+
- `legion knowledge quality` — hot/cold/low-confidence chunk quality report
|
|
15
|
+
|
|
3
16
|
## [1.5.19] - 2026-03-26
|
|
4
17
|
|
|
5
18
|
### Added
|
|
@@ -91,7 +91,77 @@ module Legion
|
|
|
91
91
|
end
|
|
92
92
|
end
|
|
93
93
|
|
|
94
|
-
|
|
94
|
+
desc 'health', 'Show knowledge base health report (local, Apollo, sync)'
|
|
95
|
+
option :corpus_path, type: :string, desc: 'Path to corpus directory (falls back to settings)'
|
|
96
|
+
def health
|
|
97
|
+
require_maintenance!
|
|
98
|
+
path = resolve_corpus_path
|
|
99
|
+
result = knowledge_maintenance.health(path: path)
|
|
100
|
+
out = formatter
|
|
101
|
+
if options[:json]
|
|
102
|
+
out.json(result)
|
|
103
|
+
elsif result[:success]
|
|
104
|
+
out.header('Knowledge Health')
|
|
105
|
+
out.spacer
|
|
106
|
+
out.header('Local')
|
|
107
|
+
out.detail(result[:local])
|
|
108
|
+
out.spacer
|
|
109
|
+
out.header('Apollo')
|
|
110
|
+
out.detail(result[:apollo])
|
|
111
|
+
out.spacer
|
|
112
|
+
out.header('Sync')
|
|
113
|
+
out.detail(result[:sync])
|
|
114
|
+
else
|
|
115
|
+
out.warn("Health check failed: #{result[:error]}")
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
desc 'maintain', 'Detect and clean up orphaned knowledge chunks'
|
|
120
|
+
option :corpus_path, type: :string, desc: 'Path to corpus directory (falls back to settings)'
|
|
121
|
+
option :dry_run, type: :boolean, default: true, desc: 'Preview without archiving (default: true)'
|
|
122
|
+
def maintain
|
|
123
|
+
require_maintenance!
|
|
124
|
+
path = resolve_corpus_path
|
|
125
|
+
result = knowledge_maintenance.cleanup_orphans(path: path, dry_run: options[:dry_run])
|
|
126
|
+
out = formatter
|
|
127
|
+
if options[:json]
|
|
128
|
+
out.json(result)
|
|
129
|
+
elsif result[:success]
|
|
130
|
+
out.header("Knowledge Maintain#{' (dry run)' if options[:dry_run]}")
|
|
131
|
+
out.detail({
|
|
132
|
+
'Orphan files' => (result[:orphan_files] || []).join(', '),
|
|
133
|
+
'Archived' => result[:archived].to_s,
|
|
134
|
+
'Files cleaned' => result[:files_cleaned].to_s,
|
|
135
|
+
'Dry run' => result[:dry_run].to_s
|
|
136
|
+
})
|
|
137
|
+
else
|
|
138
|
+
out.warn("Maintenance failed: #{result[:error]}")
|
|
139
|
+
end
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
desc 'quality', 'Show knowledge quality report (hot, cold, low-confidence chunks)'
|
|
143
|
+
option :limit, type: :numeric, default: 10, desc: 'Max entries per category'
|
|
144
|
+
def quality
|
|
145
|
+
require_maintenance!
|
|
146
|
+
result = knowledge_maintenance.quality_report(limit: options[:limit])
|
|
147
|
+
out = formatter
|
|
148
|
+
if options[:json]
|
|
149
|
+
out.json(result)
|
|
150
|
+
elsif result[:success]
|
|
151
|
+
out.header('Knowledge Quality Report')
|
|
152
|
+
out.spacer
|
|
153
|
+
print_chunk_section('Hot Chunks (most accessed)', result[:hot_chunks], out)
|
|
154
|
+
print_chunk_section('Cold Chunks (never accessed)', result[:cold_chunks], out)
|
|
155
|
+
print_chunk_section('Low Confidence', result[:low_confidence], out)
|
|
156
|
+
out.spacer
|
|
157
|
+
out.header('Summary')
|
|
158
|
+
out.detail(result[:summary])
|
|
159
|
+
else
|
|
160
|
+
out.warn("Quality report failed: #{result[:error]}")
|
|
161
|
+
end
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
no_commands do # rubocop:disable Metrics/BlockLength
|
|
95
165
|
def formatter
|
|
96
166
|
@formatter ||= Output::Formatter.new(json: options[:json], color: !options[:no_color])
|
|
97
167
|
end
|
|
@@ -108,6 +178,12 @@ module Legion
|
|
|
108
178
|
raise CLI::Error, 'lex-knowledge extension is not loaded. Install and enable it first.'
|
|
109
179
|
end
|
|
110
180
|
|
|
181
|
+
def require_maintenance!
|
|
182
|
+
return if defined?(Legion::Extensions::Knowledge::Runners::Maintenance)
|
|
183
|
+
|
|
184
|
+
raise CLI::Error, 'lex-knowledge extension is not loaded. Install and enable it first.'
|
|
185
|
+
end
|
|
186
|
+
|
|
111
187
|
def knowledge_query
|
|
112
188
|
Legion::Extensions::Knowledge::Runners::Query
|
|
113
189
|
end
|
|
@@ -116,6 +192,20 @@ module Legion
|
|
|
116
192
|
Legion::Extensions::Knowledge::Runners::Ingest
|
|
117
193
|
end
|
|
118
194
|
|
|
195
|
+
def knowledge_maintenance
|
|
196
|
+
Legion::Extensions::Knowledge::Runners::Maintenance
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
def resolve_corpus_path
|
|
200
|
+
if options[:corpus_path]
|
|
201
|
+
options[:corpus_path]
|
|
202
|
+
elsif defined?(Legion::Settings)
|
|
203
|
+
Legion::Settings.dig(:knowledge, :corpus_path) || ::Dir.pwd
|
|
204
|
+
else
|
|
205
|
+
::Dir.pwd
|
|
206
|
+
end
|
|
207
|
+
end
|
|
208
|
+
|
|
119
209
|
def print_sources(sources, out, verbose:)
|
|
120
210
|
return out.warn('No sources found') if sources.empty?
|
|
121
211
|
|
|
@@ -128,6 +218,18 @@ module Legion
|
|
|
128
218
|
end
|
|
129
219
|
end
|
|
130
220
|
|
|
221
|
+
def print_chunk_section(title, chunks, out)
|
|
222
|
+
out.header(title)
|
|
223
|
+
if chunks.empty?
|
|
224
|
+
out.warn(' (none)')
|
|
225
|
+
else
|
|
226
|
+
chunks.each do |c|
|
|
227
|
+
puts " id=#{c[:id]} confidence=#{c[:confidence]} #{c[:source_file]}"
|
|
228
|
+
end
|
|
229
|
+
end
|
|
230
|
+
out.spacer
|
|
231
|
+
end
|
|
232
|
+
|
|
131
233
|
def truncate(text, max)
|
|
132
234
|
return text if text.length <= max
|
|
133
235
|
return text[0, max] if max < 4
|
|
@@ -27,8 +27,24 @@ module Legion
|
|
|
27
27
|
|
|
28
28
|
PACKS = {
|
|
29
29
|
agentic: {
|
|
30
|
-
description: 'Full cognitive stack:
|
|
31
|
-
gems: %w[
|
|
30
|
+
description: 'Full cognitive stack: core libs, agentic domains, AI providers, and operational extensions',
|
|
31
|
+
gems: %w[
|
|
32
|
+
legion-apollo legion-gaia legion-llm legion-mcp legion-rbac
|
|
33
|
+
lex-acp lex-adapter lex-agentic-affect lex-agentic-attention
|
|
34
|
+
lex-agentic-defense lex-agentic-executive lex-agentic-homeostasis
|
|
35
|
+
lex-agentic-imagination lex-agentic-inference lex-agentic-integration
|
|
36
|
+
lex-agentic-language lex-agentic-learning lex-agentic-memory
|
|
37
|
+
lex-agentic-self lex-agentic-social lex-apollo lex-audit lex-autofix
|
|
38
|
+
lex-azure-ai lex-bedrock lex-claude lex-codegen lex-coldstart
|
|
39
|
+
lex-conditioner lex-cortex lex-cost-scanner lex-dataset lex-detect
|
|
40
|
+
lex-eval lex-exec lex-extinction lex-factory lex-finops lex-foundry
|
|
41
|
+
lex-gemini lex-governance lex-kerberos lex-knowledge lex-llm-gateway
|
|
42
|
+
lex-metering lex-mesh lex-microsoft_teams lex-mind-growth lex-node
|
|
43
|
+
lex-onboard lex-openai lex-pilot-infra-monitor
|
|
44
|
+
lex-pilot-knowledge-assist lex-privatecore lex-prompt lex-react
|
|
45
|
+
lex-swarm lex-swarm-github lex-synapse lex-telemetry lex-tick
|
|
46
|
+
lex-transformer lex-xai
|
|
47
|
+
]
|
|
32
48
|
},
|
|
33
49
|
llm: {
|
|
34
50
|
description: 'LLM routing and provider integration (no cognitive stack)',
|
|
@@ -114,6 +130,8 @@ module Legion
|
|
|
114
130
|
def agentic
|
|
115
131
|
install_pack(:agentic)
|
|
116
132
|
end
|
|
133
|
+
map 'give-me-all-the-brains' => :agentic
|
|
134
|
+
map 'brains' => :agentic
|
|
117
135
|
|
|
118
136
|
desc 'llm', 'Install LLM routing and provider integration'
|
|
119
137
|
option :dry_run, type: :boolean, default: false, desc: 'Show what would be installed without installing'
|
data/lib/legion/version.rb
CHANGED