lex-agentic-imagination 0.1.0 → 0.1.3

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: 0b20e2342a0aa0fda9926d3c23410f918230481cb5add0095a098511e434756a
4
- data.tar.gz: 0105f7cdf9636df8db506367dde12346db7aeb54699ef6e5c2e022c7d326e6ce
3
+ metadata.gz: 3af7d0d34493b7ea8b8d0fa72ac77bf3fbd4bad997c082f3f18a6ec061b1c9b8
4
+ data.tar.gz: c951351daa2a467697fcf162bced6dc603c8e5730230eed56ab1ee8e0e0a1bd9
5
5
  SHA512:
6
- metadata.gz: 9ae7d8d4b5acbfcaadadbee2b7620434ab4f0c097fe4c91918b6fecf9f9bd0318a4f7b4989f9f67612d4ec3e5750ace3a0dff232bd1c9a6c5c4af4ff2032bcd3
7
- data.tar.gz: 8ecba0c2c73bb641c8adb60aec34491ccff21a9b32d02d6c55a80c7ed4ec16a964ad5984c4f0a7930fcf7a0b9f5073bd1cf76f2345ddedccf7c5685c439d3d9d
6
+ metadata.gz: 02a8b50a581717b1a59aa587a3326739bc8736d70accce42ce142714f09f6b24d4d20604a3b735af26967568579ab3e96abb840a65f92cfb7ddc90ae701affff
7
+ data.tar.gz: ce6b5146992776ffdf6c8c7af4f3db4a19c368b10ed7eda0299ad8a1bc7c5e9282d4f2c18cd4492071c055026922cce2bad7b0ae7a9beee1a730335382e28118
data/CHANGELOG.md CHANGED
@@ -2,6 +2,24 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.1.3] - 2026-03-21
6
+
7
+ ### Changed
8
+ - Spec suite expanded to 1897 examples (0 failures)
9
+
10
+ ## [0.1.2] - 2026-03-18
11
+
12
+ ### Changed
13
+ - Enforce MODES enum validation in Imagery::Runners::Imagination#simulate (returns nil for invalid mode)
14
+ - Enforce RISK_TOLERANCES enum validation in Imagery::Runners::Imagination#simulate (returns nil for invalid risk_tolerance)
15
+
16
+ ## [0.1.1] - 2026-03-18
17
+
18
+ ### Changed
19
+ - Enforce AURORA_TYPES enum validation in AuroraEngine#detect_aurora (returns nil for invalid type)
20
+ - Enforce DOMAINS enum validation in AuroraEngine#detect_aurora (returns nil for invalid domain)
21
+ - Enforce SPECTRAL_CLASSES enum validation in SkyEngine#discover_star (returns nil for invalid spectral_class)
22
+
5
23
  ## [0.1.0] - 2026-03-18
6
24
 
7
25
  ### Added
data/README.md CHANGED
@@ -1,13 +1,54 @@
1
1
  # lex-agentic-imagination
2
2
 
3
- LEX agentic imagination domain: mental simulation, creativity, prospection
3
+ Domain consolidation gem for imagination, creativity, and offline simulation. Bundles 17 source extensions into one loadable unit under `Legion::Extensions::Agentic::Imagination`.
4
4
 
5
- ## Sub-modules
5
+ ## Overview
6
6
 
7
- *(populated as extensions are consolidated)*
7
+ **Gem**: `lex-agentic-imagination`
8
+ **Version**: 0.1.2
9
+ **Namespace**: `Legion::Extensions::Agentic::Imagination`
10
+
11
+ ## Sub-Modules
12
+
13
+ | Sub-Module | Source Gem | Purpose |
14
+ |---|---|---|
15
+ | `Imagination::Dream` | `lex-dream` | Autonomous eight-phase dream cycle: consolidation, association, contradiction resolution, agenda |
16
+ | `Imagination::Creativity` | `lex-creativity` | Creative ideation and novel combination generation |
17
+ | `Imagination::Imagery` | `lex-imagination` | Offline simulation and mental imagery of non-present scenarios |
18
+ | `Imagination::MentalSimulation` | `lex-mental-simulation` | Detailed mental simulation engine |
19
+ | `Imagination::TimeTravel` | `lex-mental-time-travel` | Episodic future thinking and past recollection |
20
+ | `Imagination::Prospection` | `lex-prospection` | Forward simulation for prospective thought |
21
+ | `Imagination::EmbodiedSimulation` | `lex-embodied-simulation` | Barsalou grounded cognition — sensorimotor concept simulation |
22
+ | `Imagination::Lucidity` | `lex-cognitive-lucidity` | Metacognitive clarity and lucid awareness |
23
+ | `Imagination::Origami` | `lex-cognitive-origami` | Folding and refolding knowledge structures |
24
+ | `Imagination::Alchemy` | `lex-cognitive-alchemy` | Transmutation of concepts into new forms |
25
+ | `Imagination::Genesis` | `lex-cognitive-genesis` | Concept origination and creation |
26
+ | `Imagination::Greenhouse` | `lex-cognitive-greenhouse` | Controlled growth environment for ideas |
27
+ | `Imagination::Garden` | `lex-cognitive-garden` | Seed-to-plant lifecycle — nurturing and wilting of ideas |
28
+ | `Imagination::Aurora` | `lex-cognitive-aurora` | Emergent illumination patterns |
29
+ | `Imagination::Volcano` | `lex-cognitive-volcano` | Pressure buildup and creative eruption |
30
+ | `Imagination::Liminal` | `lex-cognitive-liminal` | Threshold and transition states |
31
+ | `Imagination::Constellation` | `lex-cognitive-constellation` | Pattern recognition across dispersed concepts |
32
+
33
+ ## Actors
34
+
35
+ - `Imagination::Dream::Actors::DreamCycle` — runs every 300s, executes `execute_dream_cycle`
36
+ - `Imagination::Prospection::Actors::Decay` — runs every 300s, executes `update_prospection`
8
37
 
9
38
  ## Installation
10
39
 
11
40
  ```ruby
12
41
  gem 'lex-agentic-imagination'
13
42
  ```
43
+
44
+ ## Development
45
+
46
+ ```bash
47
+ bundle install
48
+ bundle exec rspec # 1855 examples, 0 failures
49
+ bundle exec rubocop # 0 offenses
50
+ ```
51
+
52
+ ## License
53
+
54
+ MIT
@@ -15,6 +15,9 @@ module Legion
15
15
  end
16
16
 
17
17
  def detect_aurora(type:, domain:, contributing_subsystems:, luminosity:, harmony_score:)
18
+ return nil unless AURORA_TYPES.include?(type.to_sym)
19
+ return nil unless DOMAINS.include?(domain.to_sym)
20
+
18
21
  event = AuroraEvent.new(
19
22
  aurora_type: type,
20
23
  domain: domain,
@@ -14,6 +14,7 @@ module Legion
14
14
 
15
15
  def discover_star(name:, domain:, content:, magnitude: nil, spectral_class: nil)
16
16
  raise ArgumentError, 'sky catalog full' if @stars.size >= Constants::MAX_STARS
17
+ return nil if !spectral_class.nil? && !Constants::SPECTRAL_CLASSES.include?(spectral_class.to_sym)
17
18
 
18
19
  star = Star.new(name: name, domain: domain, content: content,
19
20
  magnitude: magnitude, spectral_class: spectral_class)
@@ -11,6 +11,9 @@ module Legion
11
11
  Legion::Extensions::Helpers.const_defined?(:Lex)
12
12
 
13
13
  def simulate(actions:, context: {}, mode: :prospective, risk_tolerance: :moderate, **)
14
+ return nil unless Helpers::Constants::MODES.include?(mode.to_sym)
15
+ return nil unless Helpers::Constants::RISK_TOLERANCES.include?(risk_tolerance.to_sym)
16
+
14
17
  scenarios = actions.first(Helpers::Constants::MAX_SCENARIOS).map do |action|
15
18
  build_scenario(action, context)
16
19
  end
@@ -5,7 +5,7 @@ module Legion
5
5
  module Agentic
6
6
  module Imagination
7
7
  module Imagery
8
- VERSION = '0.1.0'
8
+ VERSION = '0.1.1'
9
9
  end
10
10
  end
11
11
  end
@@ -4,7 +4,7 @@ module Legion
4
4
  module Extensions
5
5
  module Agentic
6
6
  module Imagination
7
- VERSION = '0.1.0'
7
+ VERSION = '0.1.3'
8
8
  end
9
9
  end
10
10
  end
@@ -15,6 +15,26 @@ RSpec.describe Legion::Extensions::Agentic::Imagination::Aurora::Helpers::Aurora
15
15
  end
16
16
 
17
17
  describe '#detect_aurora' do
18
+ it 'returns nil for an invalid aurora type' do
19
+ expect(detect(type: :unknown_type)).to be_nil
20
+ end
21
+
22
+ it 'accepts all valid AURORA_TYPES' do
23
+ Legion::Extensions::Agentic::Imagination::Aurora::Helpers::Constants::AURORA_TYPES.each do |t|
24
+ expect(detect(type: t)).to be_a(Legion::Extensions::Agentic::Imagination::Aurora::Helpers::AuroraEvent)
25
+ end
26
+ end
27
+
28
+ it 'returns nil for an invalid domain' do
29
+ expect(detect(domain: :invalid_domain)).to be_nil
30
+ end
31
+
32
+ it 'accepts all valid DOMAINS' do
33
+ Legion::Extensions::Agentic::Imagination::Aurora::Helpers::Constants::DOMAINS.each do |d|
34
+ expect(detect(domain: d)).to be_a(Legion::Extensions::Agentic::Imagination::Aurora::Helpers::AuroraEvent)
35
+ end
36
+ end
37
+
18
38
  it 'returns an AuroraEvent' do
19
39
  event = detect
20
40
  expect(event).to be_a(Legion::Extensions::Agentic::Imagination::Aurora::Helpers::AuroraEvent)
@@ -8,6 +8,17 @@ RSpec.describe Legion::Extensions::Agentic::Imagination::Constellation::Helpers:
8
8
  end
9
9
 
10
10
  describe '#discover_star' do
11
+ it 'returns nil for an invalid spectral_class' do
12
+ expect(engine.discover_star(name: 'X', domain: :memory, content: 'test', spectral_class: :Z)).to be_nil
13
+ end
14
+
15
+ it 'accepts all valid SPECTRAL_CLASSES' do
16
+ Legion::Extensions::Agentic::Imagination::Constellation::Helpers::Constants::SPECTRAL_CLASSES.each do |sc|
17
+ s = engine.discover_star(name: sc.to_s, domain: :memory, content: 'test', spectral_class: sc)
18
+ expect(s).to be_a(Legion::Extensions::Agentic::Imagination::Constellation::Helpers::Star)
19
+ end
20
+ end
21
+
11
22
  it 'creates and stores a star' do
12
23
  s = engine.discover_star(name: 'Vega', domain: :memory, content: 'bright')
13
24
  expect(s).to be_a(Legion::Extensions::Agentic::Imagination::Constellation::Helpers::Star)
@@ -37,6 +37,32 @@ RSpec.describe Legion::Extensions::Agentic::Imagination::Imagery::Runners::Imagi
37
37
  expect(conservative[:recommendation]).not_to be_nil
38
38
  expect(aggressive[:recommendation]).not_to be_nil
39
39
  end
40
+
41
+ it 'rejects invalid mode' do
42
+ result = client.simulate(actions: %w[deploy], mode: :nonexistent_value)
43
+ expect(result).to be_nil
44
+ end
45
+
46
+ it 'accepts all MODES' do
47
+ described_class_constants = Legion::Extensions::Agentic::Imagination::Imagery::Helpers::Constants::MODES
48
+ described_class_constants.each do |val|
49
+ result = client.simulate(actions: %w[deploy], mode: val)
50
+ expect(result).not_to be_nil, "Expected #{val.inspect} to be accepted"
51
+ end
52
+ end
53
+
54
+ it 'rejects invalid risk_tolerance' do
55
+ result = client.simulate(actions: %w[deploy], risk_tolerance: :nonexistent_value)
56
+ expect(result).to be_nil
57
+ end
58
+
59
+ it 'accepts all RISK_TOLERANCES' do
60
+ described_class_constants = Legion::Extensions::Agentic::Imagination::Imagery::Helpers::Constants::RISK_TOLERANCES
61
+ described_class_constants.each do |val|
62
+ result = client.simulate(actions: %w[deploy], risk_tolerance: val)
63
+ expect(result).not_to be_nil, "Expected #{val.inspect} to be accepted"
64
+ end
65
+ end
40
66
  end
41
67
 
42
68
  describe '#what_if' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lex-agentic-imagination
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esity