legion-llm 0.4.1 → 0.4.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2337a94da9139d5ba6bb4ddbc4ee3d11a7caab4b5502e85c1fe08c5822d9bd7c
4
- data.tar.gz: bab4d942d0845165167fbc15bed8bd07b7e52b3475f6b328b49bb6a2fde0d9a5
3
+ metadata.gz: 8402009cad8567d64881d1ab4bab1c05b863a0cfa606b4d43da55f412ab04e3c
4
+ data.tar.gz: '0588be98c5a45fd930a5e668ec6ce1789bb9e927ef0c8748208b5dd211b89326'
5
5
  SHA512:
6
- metadata.gz: c685d7db577f7be3ea567c7fd79eb09faaa4f9f6907ddd86c460e3c640a5573e0c15658fe7eb9b89500383a00b0d65e2a99aac7e1a454d1f2caa3877d835f261
7
- data.tar.gz: 9439839a44b57f05e45b310ba6b1bcbb49a115f959292a6c31a2943d22f11584d2cd092963a9f79a625e25794cf6bb21506e0709da64a0e4d8f11413878497a1
6
+ metadata.gz: ad633666c8e5d3b25d140f9be94741997b28704a84e35aba33b87eac334a99ae2c6c4829a9caf32aae855eef510d82cb401451f9717a3f64ecef62c649ba8fba
7
+ data.tar.gz: 7947ea6547260b4e16c65fe92bd4154da6b2cd892dcf7097de240f97fc0e851f0fccc416224305ab6220bfd7317bb540babaa89f5c554303fe095d3f122513c7
data/CHANGELOG.md CHANGED
@@ -1,5 +1,34 @@
1
1
  # Legion LLM Changelog
2
2
 
3
+ ## [0.4.5] - 2026-03-23
4
+
5
+ ### Fixed
6
+ - `llm_chat` and `llm_session` helpers now accept and forward `caller:` to pipeline (unblocks consumer migration)
7
+
8
+ ## [0.4.4] - 2026-03-23
9
+
10
+ ### Added
11
+ - `Pipeline::Steps::Rbac`: real RBAC enforcement using `Legion::Rbac.authorize!`, graceful degradation when unavailable
12
+ - `Pipeline::Steps::Classification`: real PII/PHI scan (SSN, email, phone regex + PHI keyword list); upgrade-only classification levels
13
+ - `Pipeline::Steps::Billing`: real budget enforcement via `CostEstimator`; spending cap rejection
14
+
15
+ ### Changed
16
+ - Extracted all three governance stubs from Executor into dedicated step modules
17
+
18
+ ## [0.4.2] - 2026-03-23
19
+
20
+ ### Added
21
+ - `Pipeline::Steps::RagContext` (step 8): context strategy selector (full/rag_hybrid/rag/none) based on utilization, queries Apollo via `retrieve_relevant`
22
+ - `Pipeline::Steps::RagGuard`: post-response faithfulness check against retrieved RAG context via `Hooks::RagGuard`
23
+ - `Pipeline::EnrichmentInjector`: converts RAG and GAIA enrichments into system prompt text before provider call
24
+ - `Pipeline::GaiaCaller`: privileged helper for GAIA/GAS LLM calls with system profile (skips governance steps)
25
+ - `Pipeline::AuditPublisher`: publishes audit events to `llm.audit` exchange for GAS subscriber consumption
26
+ - RAG/GAS full cycle integration test (4 examples: enrichment, injection, degradation, feedback loop prevention)
27
+ - `OverrideConfidence` module with 4-tier degrading storage (L0 memory, L1 cache, L2 SQLite, L3 Apollo)
28
+ - Catalog-driven auto-override in `ToolDispatcher`: settings override first, then Catalog + confidence gate
29
+ - Shadow mode execution: when confidence is 0.5-0.8, execute both MCP and LEX, compare results, update confidence
30
+ - `hydrate_from_l2` and `hydrate_from_apollo` for override confidence persistence across restarts
31
+
3
32
  ## [0.4.1] - 2026-03-23
4
33
 
5
34
  ### Added
data/CLAUDE.md CHANGED
@@ -325,7 +325,7 @@ In-memory signal consumer with pluggable handlers. Adjusts effective priorities
325
325
  | `lib/legion/llm/structured_output.rb` | JSON schema enforcement with native response_format and prompt fallback |
326
326
  | `lib/legion/llm/errors.rb` | Typed error hierarchy: LLMError base + AuthError, RateLimitError, ContextOverflow, ProviderError, ProviderDown, UnsupportedCapability, PipelineError |
327
327
  | `lib/legion/llm/conversation_store.rb` | ConversationStore: in-memory LRU (256 slots) + optional Sequel DB persistence + spool fallback |
328
- | `lib/legion/llm/version.rb` | Version constant (0.4.1) |
328
+ | `lib/legion/llm/version.rb` | Version constant (0.4.2) |
329
329
  | `lib/legion/llm/quality_checker.rb` | QualityChecker module with QualityResult struct |
330
330
  | `lib/legion/llm/escalation_history.rb` | EscalationHistory mixin: `escalation_history`, `escalated?`, `final_resolution`, `escalation_chain` |
331
331
  | `lib/legion/llm/router/escalation_chain.rb` | EscalationChain value object |
@@ -339,6 +339,9 @@ In-memory signal consumer with pluggable handlers. Adjusts effective priorities
339
339
  | `lib/legion/llm/pipeline/timeline.rb` | Pipeline::Timeline: ordered event recording |
340
340
  | `lib/legion/llm/pipeline/executor.rb` | Pipeline::Executor: 18-step skeleton with profile-aware execution |
341
341
  | `lib/legion/llm/pipeline/steps/metering.rb` | Pipeline::Steps::Metering: metering event builder |
342
+ | `lib/legion/llm/pipeline/steps/rag_context.rb` | Pipeline::Steps::RagContext: context strategy selection and Apollo retrieval (step 8) |
343
+ | `lib/legion/llm/pipeline/steps/rag_guard.rb` | Pipeline::Steps::RagGuard: faithfulness check against retrieved RAG context |
344
+ | `lib/legion/llm/pipeline/enrichment_injector.rb` | Pipeline::EnrichmentInjector: converts RAG/GAIA enrichments into system prompt |
342
345
  | `lib/legion/llm/cost_estimator.rb` | CostEstimator: model cost estimation with fuzzy pricing |
343
346
  | `lib/legion/llm/fleet.rb` | Fleet module: requires dispatcher, handler, reply_dispatcher |
344
347
  | `lib/legion/llm/fleet/dispatcher.rb` | Fleet::Dispatcher: fleet RPC dispatch |
@@ -385,6 +388,10 @@ In-memory signal consumer with pluggable handlers. Adjusts effective priorities
385
388
  | `spec/legion/llm/pipeline/steps/metering_spec.rb` | Tests: Metering event building |
386
389
  | `spec/legion/llm/fleet/dispatcher_spec.rb` | Tests: Fleet dispatch, availability, timeout |
387
390
  | `spec/legion/llm/fleet/handler_spec.rb` | Tests: Fleet handler, auth, response building |
391
+ | `spec/legion/llm/pipeline/steps/rag_context_spec.rb` | Tests: RAG context strategy selection, Apollo retrieval, graceful degradation |
392
+ | `spec/legion/llm/pipeline/steps/rag_guard_spec.rb` | Tests: RAG faithfulness checking |
393
+ | `spec/legion/llm/pipeline/enrichment_injector_spec.rb` | Tests: enrichment injection into system prompt |
394
+ | `spec/legion/llm/pipeline/rag_gas_integration_spec.rb` | Tests: RAG/GAS full cycle integration |
388
395
  | `spec/spec_helper.rb` | Stubbed Legion::Logging and Legion::Settings for testing |
389
396
 
390
397
  ## Extension Integration
@@ -444,8 +451,8 @@ The legacy `vault_path` per-provider setting was removed in v0.3.1.
444
451
  Tests run without the full LegionIO stack. `spec/spec_helper.rb` stubs `Legion::Logging` and `Legion::Settings` with in-memory implementations. Each test resets settings to defaults via `before(:each)`.
445
452
 
446
453
  ```bash
447
- bundle exec rspec # 712 examples, 0 failures
448
- bundle exec rubocop # 113 files, 0 offenses
454
+ bundle exec rspec # 794 examples, 0 failures
455
+ bundle exec rubocop # 142 files, 0 offenses
449
456
  ```
450
457
 
451
458
  ## Design Documents