lex-agentic-imagination 0.1.0 → 0.1.4

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: 5d1c420bf77f0a7f266c585dc6b6cc245484f823115554f387960f33ba26bd97
4
+ data.tar.gz: d421248b241fb86b415b6c79b25fd980cee726fcd48a52d452d2f0aaf848e39c
5
5
  SHA512:
6
- metadata.gz: 9ae7d8d4b5acbfcaadadbee2b7620434ab4f0c097fe4c91918b6fecf9f9bd0318a4f7b4989f9f67612d4ec3e5750ace3a0dff232bd1c9a6c5c4af4ff2032bcd3
7
- data.tar.gz: 8ecba0c2c73bb641c8adb60aec34491ccff21a9b32d02d6c55a80c7ed4ec16a964ad5984c4f0a7930fcf7a0b9f5073bd1cf76f2345ddedccf7c5685c439d3d9d
6
+ metadata.gz: 6ceddfaf49c2bb89968722016637b1c3f07eb6da051dc828971679eec5e2a58f62a3fb5129d6c569e16bdc5d0eeb3d8d5d7981247322c4cd64fa823c66165fc5
7
+ data.tar.gz: 19939451cd833bbb94d7bda5e87072614e9b3453a41fd2375cde5fa3606cad0ee7708ca074eeaaf2b4e20eb7931a24ee7e0df41808f442ba496a0c164a2882cc
data/CHANGELOG.md CHANGED
@@ -2,6 +2,30 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.1.4] - 2026-03-22
6
+
7
+ ### Changed
8
+ - Add 7 legion-* runtime dependencies to gemspec (legion-cache, legion-crypt, legion-data, legion-json, legion-logging, legion-settings, legion-transport)
9
+ - Update spec_helper to use real sub-gem helpers with Helpers::Lex including all 7 helper modules
10
+
11
+ ## [0.1.3] - 2026-03-21
12
+
13
+ ### Changed
14
+ - Spec suite expanded to 1897 examples (0 failures)
15
+
16
+ ## [0.1.2] - 2026-03-18
17
+
18
+ ### Changed
19
+ - Enforce MODES enum validation in Imagery::Runners::Imagination#simulate (returns nil for invalid mode)
20
+ - Enforce RISK_TOLERANCES enum validation in Imagery::Runners::Imagination#simulate (returns nil for invalid risk_tolerance)
21
+
22
+ ## [0.1.1] - 2026-03-18
23
+
24
+ ### Changed
25
+ - Enforce AURORA_TYPES enum validation in AuroraEngine#detect_aurora (returns nil for invalid type)
26
+ - Enforce DOMAINS enum validation in AuroraEngine#detect_aurora (returns nil for invalid domain)
27
+ - Enforce SPECTRAL_CLASSES enum validation in SkyEngine#discover_star (returns nil for invalid spectral_class)
28
+
5
29
  ## [0.1.0] - 2026-03-18
6
30
 
7
31
  ### 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
@@ -24,6 +24,14 @@ Gem::Specification.new do |spec|
24
24
  end
25
25
  spec.require_paths = ['lib']
26
26
 
27
+ spec.add_dependency 'legion-cache', '>= 1.3.11'
28
+ spec.add_dependency 'legion-crypt', '>= 1.4.9'
29
+ spec.add_dependency 'legion-data', '>= 1.4.17'
30
+ spec.add_dependency 'legion-json', '>= 1.2.1'
31
+ spec.add_dependency 'legion-logging', '>= 1.3.2'
32
+ spec.add_dependency 'legion-settings', '>= 1.3.14'
33
+ spec.add_dependency 'legion-transport', '>= 1.3.9'
34
+
27
35
  spec.add_development_dependency 'lex-emotion'
28
36
  spec.add_development_dependency 'lex-identity'
29
37
  spec.add_development_dependency 'lex-memory'
@@ -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.4'
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
data/spec/spec_helper.rb CHANGED
@@ -1,16 +1,15 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'bundler/setup'
4
+ require 'legion/logging'
5
+ require 'legion/settings'
6
+ require 'legion/cache/helper'
7
+ require 'legion/crypt/helper'
8
+ require 'legion/data/helper'
9
+ require 'legion/json/helper'
10
+ require 'legion/transport/helper'
4
11
 
5
12
  module Legion
6
- module Logging
7
- def self.debug(_msg); end
8
- def self.info(_msg); end
9
- def self.warn(_msg); end
10
- def self.error(_msg); end
11
- def self.fatal(_msg); end
12
- end
13
-
14
13
  module Extensions
15
14
  module Core
16
15
  def self.extended(_base); end
@@ -18,24 +17,30 @@ module Legion
18
17
 
19
18
  module Helpers
20
19
  module Lex
21
- def self.included(_base); end
20
+ include Legion::Logging::Helper
21
+ include Legion::Settings::Helper
22
+ include Legion::Cache::Helper
23
+ include Legion::Crypt::Helper
24
+ include Legion::Data::Helper
25
+ include Legion::JSON::Helper
26
+ include Legion::Transport::Helper
22
27
  end
23
28
  end
24
- end
25
- end
26
29
 
27
- # rubocop:disable Lint/EmptyClass, Style/OneClassPerFile
28
- module Legion
29
- module Extensions
30
30
  module Actors
31
- class Every; end
32
- class Once; end
31
+ class Every
32
+ include Helpers::Lex
33
+ end
34
+
35
+ class Once
36
+ include Helpers::Lex
37
+ end
33
38
  end
34
39
  end
35
40
  end
41
+
36
42
  $LOADED_FEATURES << 'legion/extensions/actors/every'
37
43
  $LOADED_FEATURES << 'legion/extensions/actors/once'
38
- # rubocop:enable Lint/EmptyClass, Style/OneClassPerFile
39
44
 
40
45
  require 'legion/extensions/memory'
41
46
  require 'legion/extensions/memory/client'
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.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esity
@@ -9,6 +9,104 @@ bindir: bin
9
9
  cert_chain: []
10
10
  date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: legion-cache
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ">="
17
+ - !ruby/object:Gem::Version
18
+ version: 1.3.11
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - ">="
24
+ - !ruby/object:Gem::Version
25
+ version: 1.3.11
26
+ - !ruby/object:Gem::Dependency
27
+ name: legion-crypt
28
+ requirement: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 1.4.9
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: 1.4.9
40
+ - !ruby/object:Gem::Dependency
41
+ name: legion-data
42
+ requirement: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: 1.4.17
47
+ type: :runtime
48
+ prerelease: false
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: 1.4.17
54
+ - !ruby/object:Gem::Dependency
55
+ name: legion-json
56
+ requirement: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: 1.2.1
61
+ type: :runtime
62
+ prerelease: false
63
+ version_requirements: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: 1.2.1
68
+ - !ruby/object:Gem::Dependency
69
+ name: legion-logging
70
+ requirement: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: 1.3.2
75
+ type: :runtime
76
+ prerelease: false
77
+ version_requirements: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: 1.3.2
82
+ - !ruby/object:Gem::Dependency
83
+ name: legion-settings
84
+ requirement: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: 1.3.14
89
+ type: :runtime
90
+ prerelease: false
91
+ version_requirements: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - ">="
94
+ - !ruby/object:Gem::Version
95
+ version: 1.3.14
96
+ - !ruby/object:Gem::Dependency
97
+ name: legion-transport
98
+ requirement: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - ">="
101
+ - !ruby/object:Gem::Version
102
+ version: 1.3.9
103
+ type: :runtime
104
+ prerelease: false
105
+ version_requirements: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ version: 1.3.9
12
110
  - !ruby/object:Gem::Dependency
13
111
  name: lex-emotion
14
112
  requirement: !ruby/object:Gem::Requirement