legionio 1.4.130 → 1.4.184

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 (61) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +3 -0
  3. data/CHANGELOG.md +391 -0
  4. data/CLAUDE.md +8 -4
  5. data/Gemfile +10 -0
  6. data/exe/legionio +10 -10
  7. data/lib/legion/api/apollo.rb +211 -0
  8. data/lib/legion/api/costs.rb +116 -0
  9. data/lib/legion/api/gaia.rb +75 -1
  10. data/lib/legion/api/helpers.rb +6 -0
  11. data/lib/legion/api/llm.rb +37 -1
  12. data/lib/legion/api/openapi.rb +215 -1
  13. data/lib/legion/api/traces.rb +61 -0
  14. data/lib/legion/api.rb +6 -0
  15. data/lib/legion/cli/apollo_command.rb +154 -0
  16. data/lib/legion/cli/chat/context.rb +70 -0
  17. data/lib/legion/cli/chat/context_manager.rb +136 -0
  18. data/lib/legion/cli/chat/session_store.rb +42 -6
  19. data/lib/legion/cli/chat/tool_registry.rb +59 -1
  20. data/lib/legion/cli/chat/tools/arbitrage_status.rb +79 -0
  21. data/lib/legion/cli/chat/tools/budget_status.rb +107 -0
  22. data/lib/legion/cli/chat/tools/consolidate_memory.rb +99 -0
  23. data/lib/legion/cli/chat/tools/cost_summary.rb +122 -0
  24. data/lib/legion/cli/chat/tools/detect_anomalies.rb +83 -0
  25. data/lib/legion/cli/chat/tools/entity_extract.rb +77 -0
  26. data/lib/legion/cli/chat/tools/escalation_status.rb +77 -0
  27. data/lib/legion/cli/chat/tools/generate_insights.rb +262 -0
  28. data/lib/legion/cli/chat/tools/graph_explore.rb +160 -0
  29. data/lib/legion/cli/chat/tools/ingest_knowledge.rb +98 -0
  30. data/lib/legion/cli/chat/tools/knowledge_maintenance.rb +99 -0
  31. data/lib/legion/cli/chat/tools/knowledge_stats.rb +79 -0
  32. data/lib/legion/cli/chat/tools/list_extensions.rb +116 -0
  33. data/lib/legion/cli/chat/tools/manage_schedules.rb +135 -0
  34. data/lib/legion/cli/chat/tools/manage_tasks.rb +186 -0
  35. data/lib/legion/cli/chat/tools/memory_status.rb +186 -0
  36. data/lib/legion/cli/chat/tools/model_comparison.rb +97 -0
  37. data/lib/legion/cli/chat/tools/provider_health.rb +84 -0
  38. data/lib/legion/cli/chat/tools/query_knowledge.rb +81 -0
  39. data/lib/legion/cli/chat/tools/reflect.rb +138 -0
  40. data/lib/legion/cli/chat/tools/relate_knowledge.rb +85 -0
  41. data/lib/legion/cli/chat/tools/save_memory.rb +43 -1
  42. data/lib/legion/cli/chat/tools/scheduling_status.rb +100 -0
  43. data/lib/legion/cli/chat/tools/search_memory.rb +50 -6
  44. data/lib/legion/cli/chat/tools/search_traces.rb +50 -3
  45. data/lib/legion/cli/chat/tools/shadow_eval_status.rb +84 -0
  46. data/lib/legion/cli/chat/tools/summarize_traces.rb +73 -0
  47. data/lib/legion/cli/chat/tools/system_status.rb +120 -0
  48. data/lib/legion/cli/chat/tools/trigger_dream.rb +118 -0
  49. data/lib/legion/cli/chat/tools/view_events.rb +89 -0
  50. data/lib/legion/cli/chat/tools/view_trends.rb +136 -0
  51. data/lib/legion/cli/chat/tools/worker_status.rb +136 -0
  52. data/lib/legion/cli/chat_command.rb +32 -16
  53. data/lib/legion/cli/gaia_command.rb +82 -9
  54. data/lib/legion/cli/trace_command.rb +122 -6
  55. data/lib/legion/cli.rb +8 -0
  56. data/lib/legion/extensions/actors/every.rb +9 -9
  57. data/lib/legion/extensions/actors/subscription.rb +10 -10
  58. data/lib/legion/extensions/builders/actors.rb +1 -1
  59. data/lib/legion/trace_search.rb +196 -18
  60. data/lib/legion/version.rb +1 -1
  61. metadata +35 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fd71477dacc37c257449f96ad968188e7eb7efe4e09b4c98eb20d25932e74db4
4
- data.tar.gz: c6194b9746e888e03318515c50f931519dbacf70ec192b8560a56f3accfff270
3
+ metadata.gz: 2c694550903fcfcd9a2903bdc1036668d7e08587b02311abc07893b6695c9ff4
4
+ data.tar.gz: 889d14b5e592ac288fdcebe66db37341eda954c77df717d063920c223ed357a9
5
5
  SHA512:
6
- metadata.gz: e62483eef383aa17cad6c99f59fa574652eca9fd47f723a8fe7244b1133468e9d4dc464539d4f2fe6adb69d27511809284a44c3f2ebe73cf8c92cff996c5cca3
7
- data.tar.gz: d31609c26d67de4a7c5cdbd50ba894f64d5b394e1723e6109871f4ae97c0d01d1ef422c368585336affe4db559035b269e320054e5077bff81dd209d2fdf1039
6
+ metadata.gz: eb3d703112e2471be760793607fd341f1648ae132cd99168606cc565bbc0f0130d5e26dea8857f6387d775bf2cc55377a146f12ccf8c014be38e51ab1dda9ca4
7
+ data.tar.gz: 2c2c609e51998c432ddb3e66c8319d0bdcf1a39c1efd2f29c965d300772d0edc646ab49f701eb44402d015be51cf5ab2ea912f67738e47543b659d2b8702aa76
data/.rubocop.yml CHANGED
@@ -25,6 +25,8 @@ Metrics/ClassLength:
25
25
 
26
26
  Metrics/ModuleLength:
27
27
  Max: 1500
28
+ Exclude:
29
+ - 'lib/legion/api/openapi.rb'
28
30
 
29
31
  Metrics/BlockLength:
30
32
  Max: 40
@@ -49,6 +51,7 @@ Metrics/BlockLength:
49
51
  - 'lib/legion/api/auth_saml.rb'
50
52
  - 'lib/legion/cli/failover_command.rb'
51
53
  - 'lib/legion/cli/setup_command.rb'
54
+ - 'lib/legion/cli/trace_command.rb'
52
55
 
53
56
  Metrics/AbcSize:
54
57
  Max: 60
data/CHANGELOG.md CHANGED
@@ -1,5 +1,396 @@
1
1
  # Legion Changelog
2
2
 
3
+ ## [1.4.184] - 2026-03-23
4
+
5
+ ### Added
6
+ - MemoryStatus chat tool: shows persistent memory entries, Apollo knowledge store stats, and saved session overview
7
+ - Supports "overview", "memories", "apollo", and "sessions" actions
8
+ - 40th built-in chat tool registered in ToolRegistry
9
+
10
+ ## [1.4.183] - 2026-03-23
11
+
12
+ ### Added
13
+ - ContextManager: conversation context window management with dedup, compression, and summarization strategies
14
+ - `/compact [strategy]` now supports auto, dedup, and summarize strategies (was LLM-only)
15
+ - `/context` slash command shows message count, estimated tokens, and auto-compact status
16
+ - Integrates with Legion::LLM::Compressor for Jaccard deduplication and stopword compression
17
+
18
+ ## [1.4.182] - 2026-03-23
19
+
20
+ ### Changed
21
+ - GenerateInsights now includes Apollo graph topology, LLM scheduling status, escalation count, and shadow eval count
22
+ - Insights report provides a more comprehensive system overview
23
+
24
+ ## [1.4.181] - 2026-03-23
25
+
26
+ ### Added
27
+ - SchedulingStatus chat tool: view LLM peak/off-peak scheduling and batch queue state
28
+ - Supports "overview", "scheduling" (detail), and "batch" (queue detail) actions
29
+ - 39th built-in chat tool registered in ToolRegistry
30
+
31
+ ## [1.4.180] - 2026-03-23
32
+
33
+ ### Added
34
+ - GraphExplore chat tool: explore Apollo knowledge graph topology, agent expertise, and disputed entries
35
+ - Apollo API endpoints: GET /api/apollo/graph (topology) and GET /api/apollo/expertise (expertise map)
36
+ - 38th built-in chat tool registered in ToolRegistry
37
+
38
+ ## [1.4.179] - 2026-03-23
39
+
40
+ ### Added
41
+ - EscalationStatus chat tool: show model escalation history and upgrade frequency
42
+ - Supports "summary" (by reason, target model, recent entries) and "rate" (escalation frequency) actions
43
+ - 37th built-in chat tool registered in ToolRegistry
44
+
45
+ ## [1.4.178] - 2026-03-23
46
+
47
+ ### Added
48
+ - ArbitrageStatus chat tool: view LLM cost arbitrage table, cheapest model per capability tier
49
+ - Supports overview mode (full cost table + tier picks) and per-tier detail mode
50
+ - 36th built-in chat tool registered in ToolRegistry
51
+
52
+ ## [1.4.177] - 2026-03-23
53
+
54
+ ### Added
55
+ - EntityExtract chat tool: extract named entities (people, services, repos, concepts) from text via Apollo
56
+ - Supports entity type filtering and configurable confidence thresholds
57
+ - Groups results by type with confidence percentages
58
+ - 35th built-in chat tool registered in ToolRegistry
59
+
60
+ ## [1.4.176] - 2026-03-23
61
+
62
+ ### Added
63
+ - ShadowEvalStatus chat tool: view shadow evaluation results comparing primary vs cheaper models
64
+ - Supports "summary" (cost savings, length ratios) and "history" (recent comparisons) actions
65
+ - 34th built-in chat tool registered in ToolRegistry
66
+
67
+ ## [1.4.175] - 2026-03-23
68
+
69
+ ### Added
70
+ - ModelComparison chat tool: compare LLM model pricing side-by-side with cost projections
71
+ - Supports filtering by model name, custom token count estimates, and price ratio analysis
72
+ - Uses CostTracker pricing when available, falls back to built-in defaults
73
+ - 33rd built-in chat tool registered in ToolRegistry
74
+
75
+ ## [1.4.174] - 2026-03-23
76
+
77
+ ### Added
78
+ - REST API endpoints for LLM provider health: GET /api/llm/providers and GET /api/llm/providers/:name
79
+ - Returns circuit breaker state, health status, routing adjustments, and circuit summary
80
+ - 4 new specs covering gateway unavailable, health report, and single provider detail
81
+
82
+ ## [1.4.173] - 2026-03-23
83
+
84
+ ### Added
85
+ - ProviderHealth chat tool: displays LLM provider circuit breaker state, health status, and routing adjustments
86
+ - Supports all-provider report and single-provider detail views
87
+ - 33rd built-in chat tool registered in ToolRegistry
88
+
89
+ ## [1.4.172] - 2026-03-23
90
+
91
+ ### Added
92
+ - BudgetStatus chat tool: shows session cost budget status, spending, remaining, and per-model breakdown
93
+ - Works locally via in-memory CostTracker (no daemon required)
94
+ - Supports "status" and "summary" actions
95
+ - 32nd built-in chat tool registered in ToolRegistry
96
+
97
+ ## [1.4.171] - 2026-03-23
98
+
99
+ ### Added
100
+ - SearchTraces chat tool: natural language search across cognitive memory traces (people, conversations, meetings)
101
+ - Person name variant matching, fuzzy search, keyword ranking, and structured field extraction
102
+ - 11th built-in chat tool registered in ToolRegistry
103
+
104
+ ## [1.4.170] - 2026-03-23
105
+
106
+ ### Added
107
+ - Costs REST API: GET /api/costs/summary, /api/costs/workers, /api/costs/extensions
108
+ - Aggregates metering_records cost_usd by time period, worker, and extension
109
+ - 8 specs with in-memory SQLite for realistic query testing
110
+
111
+ ## [1.4.169] - 2026-03-23
112
+
113
+ ### Fixed
114
+ - TraceSearch column name mismatches: `created_at` to `recorded_at`, `tokens_in` to `input_tokens`, `tokens_out` to `output_tokens` to match metering_records schema
115
+ - SCHEMA_TEMPLATE and ALLOWED_COLUMNS now reference correct database column names
116
+
117
+ ## [1.4.168] - 2026-03-23
118
+
119
+ ### Added
120
+ - GenerateInsights chat tool: combines anomaly detection, trends, Apollo stats, and worker health into actionable report
121
+ - Automatic recommendations based on detected anomalies and trend patterns
122
+ - 7 specs covering comprehensive report generation, anomaly details, recommendations, and error handling
123
+ - Chat tool registry now has 30 built-in tools
124
+
125
+ ## [1.4.167] - 2026-03-23
126
+
127
+ ### Added
128
+ - TriggerDream chat tool: trigger dream cycles on daemon and view latest dream journal entries
129
+ - Searches gem path, project, and user directories for dream journal markdown files
130
+ - 6 specs covering trigger, journal, error handling, truncation, and connection refused
131
+ - Chat tool registry now has 29 built-in tools
132
+
133
+ ## [1.4.166] - 2026-03-23
134
+
135
+ ### Added
136
+ - ViewTrends chat tool: tabular trend visualization with direction indicators (rising/falling/stable)
137
+ - Shows cost, latency, volume, and failure rate trends over configurable time ranges
138
+ - 6 specs covering trend formatting, direction labels, empty data, API errors, and connection handling
139
+ - Chat tool registry now has 28 built-in tools
140
+
141
+ ## [1.4.165] - 2026-03-23
142
+
143
+ ### Added
144
+ - TraceSearch.trend: time-bucketed metrics trend analysis over configurable time ranges
145
+ - GET /api/traces/trend endpoint with hours and buckets parameters
146
+ - 7 new specs covering trend data structure, bucket contents, defaults, and API endpoint
147
+
148
+ ## [1.4.164] - 2026-03-23
149
+
150
+ ### Added
151
+ - DetectAnomalies chat tool: proactive anomaly detection via daemon API with configurable threshold
152
+ - Reports cost spikes, latency increases, and failure rate changes with severity levels
153
+ - 6 specs covering healthy system, anomaly detection, custom threshold, API errors, connection refused, and singular grammar
154
+ - Chat tool registry now has 27 built-in tools
155
+
156
+ ## [1.4.163] - 2026-03-23
157
+
158
+ ### Added
159
+ - Traces REST API: POST /api/traces/search, POST /api/traces/summary, GET /api/traces/anomalies
160
+ - require_trace_search! API helper guards routes when LLM subsystem is unavailable
161
+ - SearchTraces chat tool for natural language memory trace search via lex-agentic-memory
162
+ - 10 new API specs covering all trace endpoints with availability guards and parameter handling
163
+
164
+ ## [1.4.162] - 2026-03-23
165
+
166
+ ### Added
167
+ - TraceSearch.detect_anomalies: compares last-hour metrics against 24h baseline to detect cost, latency, and failure rate spikes
168
+ - Anomaly detection uses configurable threshold (default 2x) with severity levels (warning/critical)
169
+ - 4 new TraceSearch specs covering anomaly report structure, cost spike detection, normal metrics, and zero baseline handling
170
+
171
+ ## [1.4.161] - 2026-03-23
172
+
173
+ ### Added
174
+ - WorkerStatus chat tool: list digital workers, show details, and health summary via daemon API
175
+ - WorkerStatus spec with 7 examples covering list, filter, show, health, empty state, and connection errors
176
+ - Chat tool registry now has 26 built-in tools
177
+
178
+ ## [1.4.160] - 2026-03-23
179
+
180
+ ### Added
181
+ - ManageSchedules chat tool: list, show, logs, and create scheduled tasks via daemon API
182
+ - ManageSchedules spec with 10 examples covering all actions, validation, empty states, and connection errors
183
+ - Chat tool registry now has 25 built-in tools
184
+
185
+ ## [1.4.159] - 2026-03-23
186
+
187
+ ### Added
188
+ - Reflect chat tool: extracts key learnings from conversation text using LLM, ingests into Apollo knowledge graph and project memory
189
+ - Reflect spec with 5 examples covering raw text ingest, LLM extraction, Apollo-down fallback, no entries, and domain passthrough
190
+ - Chat tool registry now has 24 built-in tools
191
+
192
+ ## [1.4.158] - 2026-03-23
193
+
194
+ ### Added
195
+ - CostSummary chat tool: query cost/token usage from daemon (summary, top consumers, per-worker)
196
+ - CostSummary spec with 7 examples covering summary, top, worker, missing worker_id, empty workers, daemon down, API errors
197
+ - Chat tool registry now has 23 built-in tools
198
+
199
+ ## [1.4.157] - 2026-03-23
200
+
201
+ ### Added
202
+ - ViewEvents chat tool: view recent events from the Legion event bus ring buffer with count control
203
+ - ViewEvents spec with 7 examples covering formatted output, empty events, count parameter, clamping, connection refused, API errors, and events without details
204
+ - Chat tool registry now has 22 built-in tools
205
+
206
+ ## [1.4.156] - 2026-03-23
207
+
208
+ ### Changed
209
+ - Session store now saves summary (first user message, truncated to 120 chars), message count, and model in session metadata
210
+ - Session list includes summary, message_count, and model for at-a-glance session browsing
211
+ - 4 new session_store specs covering message count, summary generation, long summary truncation, and list metadata
212
+
213
+ ## [1.4.155] - 2026-03-23
214
+
215
+ ### Changed
216
+ - SaveMemory tool now auto-ingests entries into Apollo knowledge graph when daemon is running
217
+ - Apollo ingest includes type (memory), source (chat:project/global), and tags for categorization
218
+ - Updated save_memory specs with 6 examples covering apollo integration, confirmation, and fallback
219
+
220
+ ## [1.4.154] - 2026-03-23
221
+
222
+ ### Changed
223
+ - SearchMemory tool now also queries Apollo knowledge graph when available, combining file-based memory with semantic knowledge
224
+ - Apollo results include type, content, and confidence score for richer context retrieval
225
+ - Updated search_memory specs with 6 examples covering combined memory+apollo, apollo-only, memory-only, and error handling
226
+
227
+ ## [1.4.153] - 2026-03-23
228
+
229
+ ### Changed
230
+ - TraceSearch schema context now injects current date/time dynamically for accurate time-relative queries
231
+ - Added guidance for "today", "last hour", "this week", "yesterday" relative time references in LLM prompt
232
+ - 2 new trace_search specs covering schema_context current date injection and relative time guidance
233
+
234
+ ## [1.4.152] - 2026-03-23
235
+
236
+ ### Added
237
+ - Daemon awareness in chat context: system prompt now includes running daemon version and port when healthy
238
+ - daemon_hint method probes /api/health with 1-second timeout for non-blocking detection
239
+ - 5 new context specs covering daemon hint and cognitive awareness with daemon running
240
+
241
+ ## [1.4.151] - 2026-03-23
242
+
243
+ ### Added
244
+ - SystemStatus chat tool: check daemon health, component readiness, uptime, version, and extension count from chat
245
+ - SystemStatus spec with 6 examples covering full status, daemon down, endpoints failing, uptime formatting, and empty components
246
+ - Chat tool registry now has 21 built-in tools
247
+
248
+ ## [1.4.150] - 2026-03-23
249
+
250
+ ### Added
251
+ - ManageTasks chat tool: list, show, logs, and trigger tasks through the Legion Ingress pipeline with metering data display
252
+ - ManageTasks spec with 15 examples covering list/show/logs/trigger actions, validation, filters, payload forwarding, and error handling
253
+ - Chat tool registry now has 20 built-in tools
254
+
255
+ ## [1.4.149] - 2026-03-23
256
+
257
+ ### Added
258
+ - ListExtensions chat tool: discover loaded extensions and their runners/functions via REST API with active filtering and detail views
259
+ - ListExtensions spec with 7 examples covering list, empty, active_only filter, detail with runners, no runners, connection refused, and API errors
260
+ - Chat tool registry now has 19 built-in tools
261
+
262
+ ## [1.4.148] - 2026-03-23
263
+
264
+ ### Added
265
+ - Cognitive awareness in chat context: system prompt now includes memory entry counts and Apollo knowledge graph status when available
266
+ - Context cognitive_awareness, memory_hint, and apollo_hint methods with 1-second timeout for non-blocking probes
267
+ - 8 new context specs covering cognitive awareness, memory hints, and apollo availability detection
268
+
269
+ ## [1.4.147] - 2026-03-23
270
+
271
+ ### Added
272
+ - SummarizeTraces chat tool: aggregate metering database analytics with token usage, cost, latency, status breakdown, and top extensions/workers via natural language queries
273
+ - SummarizeTraces spec with 5 examples covering formatted output, error handling, empty data, and unavailable dependencies
274
+ - Chat tool registry now has 18 built-in tools
275
+
276
+ ## [1.4.146] - 2026-03-23
277
+
278
+ ### Added
279
+ - KnowledgeStats chat tool: inspect Apollo knowledge graph health with entry counts, status/type breakdowns, recent activity, and average confidence
280
+ - KnowledgeStats spec with 5 examples covering formatted output, empty breakdowns, API errors, connection refused, and missing fields
281
+ - Chat tool registry now has 17 built-in tools
282
+
283
+ ## [1.4.145] - 2026-03-23
284
+
285
+ ### Added
286
+ - KnowledgeMaintenance chat tool: trigger Apollo knowledge graph decay cycles and corroboration checks from chat sessions
287
+ - KnowledgeMaintenance spec with 8 examples covering decay, corroboration, invalid actions, API errors, and edge cases
288
+ - Chat tool registry now has 16 built-in tools
289
+
290
+ ## [1.4.144] - 2026-03-23
291
+
292
+ ### Added
293
+ - RelateKnowledge chat tool: find related entries in the Apollo knowledge graph with depth traversal, relation type filtering, and confidence scoring
294
+ - RelateKnowledge spec with 7 examples covering formatted results, empty results, API errors, connection refused, depth clamping, and relation type passthrough
295
+ - SearchTraces chat tool registered in tool registry (15 built-in tools)
296
+
297
+ ## [1.4.143] - 2026-03-23
298
+
299
+ ### Added
300
+ - TraceSearch.summarize: aggregate statistics for trace queries (total cost, tokens, latency, status breakdown, top extensions/workers)
301
+ - `legion trace summarize` CLI subcommand with formatted output and JSON mode
302
+ - Trace command spec expanded with 8 summarize examples
303
+
304
+ ## [1.4.142] - 2026-03-23
305
+
306
+ ### Added
307
+ - ConsolidateMemory chat tool: LLM-powered memory consolidation that deduplicates, merges related entries, and cleans up cluttered memory files with dry-run preview support
308
+ - ConsolidateMemory spec with 10 examples covering consolidation, dry-run, global scope, LLM unavailable, and error handling
309
+ - Task command spec with 13 examples covering list, show, logs, purge, and helper methods
310
+ - Chain command spec with 6 examples covering list, create, delete, and confirmation flow
311
+ - Generate command spec with 14 examples covering runner, actor, exchange, queue, message, and tool scaffolding
312
+ - Audit command spec with 6 examples covering list filters, JSON output, and chain verification
313
+ - RBAC command spec with 9 examples covering roles, show, assignments, assign, revoke, and access check
314
+
315
+ ## [1.4.141] - 2026-03-23
316
+
317
+ ### Added
318
+ - IngestKnowledge chat tool: save facts, observations, concepts, procedures, and decisions to the Apollo knowledge graph from within chat sessions
319
+ - IngestKnowledge spec with 9 examples covering success, content types, tags, API errors, and daemon unavailability
320
+ - Extension tool loader spec with 13 examples covering discovery, permission tiers, and tool collection
321
+ - Skill command spec with 14 examples covering list, show, create, and run
322
+ - Swarm command spec with 16 examples covering list, show, start, and pipeline failures
323
+ - Graph command, builder, and exporter specs with 37 examples covering mermaid/dot rendering, filters, and empty graphs
324
+ - Cost command spec with 16 examples covering summary, worker, top, and export
325
+
326
+ ## [1.4.140] - 2026-03-23
327
+
328
+ ### Added
329
+ - SearchTraces chat tool: search cognitive memory traces for Teams messages, conversations, meetings, and people with keyword ranking, person name variants, and fuzzy matching
330
+ - SearchTraces spec with 15 examples covering keyword search, person/domain/type filters, payload parsing, age formatting, and limit clamping
331
+ - TraceSearch spec expanded from 8 to 20 examples: `.search` entry point, `.apply_date_filters`, `.apply_ordering` (ascending/descending), `.safe_parse_time` edge cases, `FILTER_SCHEMA` properties
332
+
333
+ ## [1.4.139] - 2026-03-23
334
+
335
+ ### Added
336
+ - Gaia API: `GET /api/gaia/channels`, `GET /api/gaia/buffer`, `GET /api/gaia/sessions` endpoints
337
+ - Gaia CLI: `legion gaia channels`, `legion gaia buffer`, `legion gaia sessions` subcommands
338
+ - Gaia spec coverage expanded from 12 to 25 examples
339
+
340
+ ## [1.4.138] - 2026-03-23
341
+
342
+ ### Added
343
+ - QueryKnowledge chat tool: query Apollo knowledge graph from chat sessions for facts, concepts, and observations
344
+ - QueryKnowledge spec with 11 examples covering results, errors, filters, and limit clamping
345
+
346
+ ## [1.4.137] - 2026-03-23
347
+
348
+ ### Changed
349
+ - Rewrite `legion trace search` with formatter support, JSON mode, truncation display, detailed output (cost, tokens, wall clock, worker)
350
+ - Register trace subcommand in main CLI (`legion trace search QUERY`)
351
+
352
+ ### Added
353
+ - Trace command spec with 13 examples covering all output paths
354
+
355
+ ## [1.4.136] - 2026-03-23
356
+
357
+ ### Added
358
+ - Apollo CLI command: `legion apollo status`, `stats`, `query`, `ingest`, `maintain` subcommands
359
+ - SearchTraces chat tool for natural language trace search within chat sessions
360
+
361
+ ## [1.4.135] - 2026-03-23
362
+
363
+ ### Added
364
+ - Apollo maintenance endpoint: `POST /api/apollo/maintenance` triggers decay_cycle or corroboration check
365
+ - Apollo maintenance in OpenAPI spec with action validation
366
+
367
+ ## [1.4.134] - 2026-03-23
368
+
369
+ ### Added
370
+ - Apollo stats endpoint: `GET /api/apollo/stats` returns entry counts by status, content type, 24h activity, and average confidence
371
+ - Apollo stats in OpenAPI spec
372
+
373
+ ## [1.4.133] - 2026-03-23
374
+
375
+ ### Changed
376
+ - TraceSearch: add safe date coercion via `Time.parse` with fallback for unparseable LLM-generated date strings
377
+ - TraceSearch: add `total` and `truncated` fields to response when results exceed limit
378
+ - Extract `apply_date_filters`, `safe_parse_time`, and `apply_ordering` helpers from `execute_filter`
379
+
380
+ ## [1.4.132] - 2026-03-23
381
+
382
+ ### Added
383
+ - Apollo knowledge graph REST API: status, query, ingest, and related entries endpoints
384
+ - Apollo API spec with 11 examples covering all routes and parameter passing
385
+
386
+ ## [1.4.131] - 2026-03-23
387
+
388
+ ### Changed
389
+ - Add logging to Every actor tick cycle and Subscription actor message processing
390
+ - Add logging to actor builder discovery
391
+ - Register SearchTraces tool with LLM ToolRegistry via API llm routes
392
+ - Comment out bootsnap setup in legionio executable for local development
393
+
3
394
  ## [1.4.130] - 2026-03-22
4
395
 
5
396
  ### Changed
data/CLAUDE.md CHANGED
@@ -194,7 +194,7 @@ Legion (lib/legion.rb)
194
194
  │ ├── Session # Multi-turn chat session with streaming
195
195
  │ ├── SessionStore # Persistent session save/load/list/resume/fork
196
196
  │ ├── Permissions # Tool permission model (interactive/auto_approve/read_only)
197
- │ ├── ToolRegistry # Chat tool discovery and registration (10 built-in + extension tools)
197
+ │ ├── ToolRegistry # Chat tool discovery and registration (22 built-in + extension tools)
198
198
  │ ├── ExtensionTool # permission_tier DSL module for LEX chat tools (:read/:write/:shell)
199
199
  │ ├── ExtensionToolLoader # Lazy discovery of tools/ directories from loaded extensions
200
200
  │ ├── Context # Project awareness (git, language, instructions, extra dirs)
@@ -209,7 +209,11 @@ Legion (lib/legion.rb)
209
209
  │ ├── ChatLogger # Chat-specific logging
210
210
  │ └── Tools/ # Built-in tools: read_file, write_file, edit_file,
211
211
  │ # search_files, search_content, run_command,
212
- │ # save_memory, search_memory, web_search, spawn_agent
212
+ │ # save_memory, search_memory, web_search, spawn_agent,
213
+ │ # search_traces, query_knowledge, ingest_knowledge,
214
+ │ # consolidate_memory, relate_knowledge, knowledge_maintenance,
215
+ │ # knowledge_stats, summarize_traces, list_extensions,
216
+ │ # manage_tasks, system_status, view_events
213
217
  ├── Memory # `legion memory` - persistent memory CLI (list/add/forget/search)
214
218
  ├── Plan # `legion plan` - read-only exploration mode
215
219
  ├── Swarm # `legion swarm` - multi-agent workflow orchestration
@@ -628,7 +632,7 @@ rack-test, rake, rspec, rubocop, rubocop-rspec, simplecov
628
632
  | `lib/legion/cli/chat/session.rb` | Chat session: multi-turn conversation, streaming, tool use |
629
633
  | `lib/legion/cli/chat/session_store.rb` | Session persistence: save, load, list, resume, fork |
630
634
  | `lib/legion/cli/chat/permissions.rb` | Tool permission model (interactive/auto_approve/read_only) |
631
- | `lib/legion/cli/chat/tool_registry.rb` | Chat tool discovery and registration (10 tools) |
635
+ | `lib/legion/cli/chat/tool_registry.rb` | Chat tool discovery and registration (22 tools) |
632
636
  | `lib/legion/cli/chat/extension_tool.rb` | permission_tier DSL module for extension chat tools |
633
637
  | `lib/legion/cli/chat/extension_tool_loader.rb` | Lazy discovery engine: scans loaded extensions for tools/ directories |
634
638
  | `lib/legion/cli/chat/context.rb` | Project awareness: git info, language detection, instructions, extra dirs |
@@ -644,7 +648,7 @@ rack-test, rake, rspec, rubocop, rubocop-rspec, simplecov
644
648
  | `lib/legion/cli/chat/progress_bar.rb` | Progress bar rendering for long operations |
645
649
  | `lib/legion/cli/chat/status_indicator.rb` | Status indicator (spinner, checkmark, cross) |
646
650
  | `lib/legion/cli/chat/team.rb` | Multi-user team support for chat sessions |
647
- | `lib/legion/cli/chat/tools/` | Built-in tools: read_file, write_file, edit_file (string + line-number mode), search_files, search_content, run_command, save_memory, search_memory, web_search, spawn_agent |
651
+ | `lib/legion/cli/chat/tools/` | Built-in tools: read_file, write_file, edit_file, search_files, search_content, run_command, save_memory, search_memory, web_search, spawn_agent, search_traces, query_knowledge, ingest_knowledge, consolidate_memory, relate_knowledge, knowledge_maintenance, knowledge_stats, summarize_traces, list_extensions, manage_tasks, system_status, view_events |
648
652
  | `lib/legion/chat/skills.rb` | Skill discovery: parses `.legion/skills/` and `~/.legionio/skills/` YAML frontmatter files |
649
653
  | `lib/legion/cli/graph_command.rb` | `legion graph` subcommands (show with --format mermaid\|dot, --chain, --output) |
650
654
  | `lib/legion/cli/trace_command.rb` | `legion trace search` — NL trace search via LLM |
data/Gemfile CHANGED
@@ -4,7 +4,17 @@ source 'https://rubygems.org'
4
4
 
5
5
  gemspec
6
6
 
7
+ gem 'legion-data', path: '../legion-data' if File.exist?(File.expand_path('../legion-data', __dir__))
8
+ gem 'legion-gaia', path: '../legion-gaia' if File.exist?(File.expand_path('../legion-gaia', __dir__))
9
+ gem 'legion-llm', path: '../legion-llm' if File.exist?(File.expand_path('../legion-llm', __dir__))
7
10
  gem 'legion-logging', path: '../legion-logging' if File.exist?(File.expand_path('../legion-logging', __dir__))
11
+ gem 'legion-mcp', path: '../legion-mcp' if File.exist?(File.expand_path('../legion-mcp', __dir__))
12
+
13
+ gem 'lex-agentic-memory', path: '../extensions-agentic/lex-agentic-memory' if File.exist?(File.expand_path('../extensions-agentic/lex-agentic-memory', __dir__))
14
+ gem 'lex-llm-gateway', path: '../extensions-core/lex-llm-gateway' if File.exist?(File.expand_path('../extensions-core/lex-llm-gateway', __dir__))
15
+ gem 'lex-microsoft_teams', path: '../extensions/lex-microsoft_teams' if File.exist?(File.expand_path('../extensions/lex-microsoft_teams', __dir__))
16
+
17
+ gem 'pg'
8
18
 
9
19
  gem 'kramdown', '>= 2.0'
10
20
  gem 'mysql2'
data/exe/legionio CHANGED
@@ -3,20 +3,20 @@
3
3
 
4
4
  RubyVM::YJIT.enable if defined?(RubyVM::YJIT)
5
5
 
6
- ENV['RUBY_GC_HEAP_INIT_SLOTS'] ||= '600000'
6
+ ENV['RUBY_GC_HEAP_INIT_SLOTS'] ||= '600000'
7
7
  ENV['RUBY_GC_HEAP_FREE_SLOTS_MIN_RATIO'] ||= '0.20'
8
8
  ENV['RUBY_GC_HEAP_FREE_SLOTS_MAX_RATIO'] ||= '0.40'
9
- ENV['RUBY_GC_MALLOC_LIMIT'] ||= '64000000'
10
- ENV['RUBY_GC_MALLOC_LIMIT_MAX'] ||= '128000000'
9
+ ENV['RUBY_GC_MALLOC_LIMIT'] ||= '64000000'
10
+ ENV['RUBY_GC_MALLOC_LIMIT_MAX'] ||= '128000000'
11
11
 
12
12
  require 'bootsnap'
13
- Bootsnap.setup(
14
- cache_dir: File.expand_path('~/.legionio/cache/bootsnap'),
15
- development_mode: false,
16
- load_path_cache: true,
17
- compile_cache_iseq: true,
18
- compile_cache_yaml: true
19
- )
13
+ # Bootsnap.setup(
14
+ # cache_dir: File.expand_path('~/.legionio/cache/bootsnap'),
15
+ # development_mode: false,
16
+ # load_path_cache: true,
17
+ # compile_cache_iseq: true,
18
+ # compile_cache_yaml: true
19
+ # )
20
20
 
21
21
  $LOAD_PATH.unshift(File.expand_path('../lib', __dir__))
22
22