lex-agentic-imagination 0.1.0
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 +7 -0
- data/CHANGELOG.md +12 -0
- data/Gemfile +5 -0
- data/LICENSE +21 -0
- data/README.md +13 -0
- data/lex-agentic-imagination.gemspec +34 -0
- data/lib/legion/extensions/agentic/imagination/alchemy/client.rb +15 -0
- data/lib/legion/extensions/agentic/imagination/alchemy/helpers/alchemy_engine.rb +140 -0
- data/lib/legion/extensions/agentic/imagination/alchemy/helpers/constants.rb +76 -0
- data/lib/legion/extensions/agentic/imagination/alchemy/helpers/crucible.rb +80 -0
- data/lib/legion/extensions/agentic/imagination/alchemy/helpers/substance.rb +118 -0
- data/lib/legion/extensions/agentic/imagination/alchemy/runners/cognitive_alchemy.rb +88 -0
- data/lib/legion/extensions/agentic/imagination/alchemy/version.rb +13 -0
- data/lib/legion/extensions/agentic/imagination/alchemy.rb +22 -0
- data/lib/legion/extensions/agentic/imagination/aurora/client.rb +25 -0
- data/lib/legion/extensions/agentic/imagination/aurora/helpers/aurora_engine.rb +123 -0
- data/lib/legion/extensions/agentic/imagination/aurora/helpers/aurora_event.rb +85 -0
- data/lib/legion/extensions/agentic/imagination/aurora/helpers/constants.rb +91 -0
- data/lib/legion/extensions/agentic/imagination/aurora/helpers/spectral_band.rb +79 -0
- data/lib/legion/extensions/agentic/imagination/aurora/runners/cognitive_aurora.rb +84 -0
- data/lib/legion/extensions/agentic/imagination/aurora/version.rb +13 -0
- data/lib/legion/extensions/agentic/imagination/aurora.rb +22 -0
- data/lib/legion/extensions/agentic/imagination/constellation/client.rb +15 -0
- data/lib/legion/extensions/agentic/imagination/constellation/helpers/constants.rb +59 -0
- data/lib/legion/extensions/agentic/imagination/constellation/helpers/constellation.rb +90 -0
- data/lib/legion/extensions/agentic/imagination/constellation/helpers/sky_engine.rb +131 -0
- data/lib/legion/extensions/agentic/imagination/constellation/helpers/star.rb +92 -0
- data/lib/legion/extensions/agentic/imagination/constellation/runners/cognitive_constellation.rb +76 -0
- data/lib/legion/extensions/agentic/imagination/constellation/version.rb +13 -0
- data/lib/legion/extensions/agentic/imagination/constellation.rb +22 -0
- data/lib/legion/extensions/agentic/imagination/creativity/client.rb +27 -0
- data/lib/legion/extensions/agentic/imagination/creativity/helpers/constants.rb +50 -0
- data/lib/legion/extensions/agentic/imagination/creativity/helpers/creative_engine.rb +151 -0
- data/lib/legion/extensions/agentic/imagination/creativity/helpers/idea.rb +106 -0
- data/lib/legion/extensions/agentic/imagination/creativity/helpers/idea_store.rb +103 -0
- data/lib/legion/extensions/agentic/imagination/creativity/runners/creativity.rb +176 -0
- data/lib/legion/extensions/agentic/imagination/creativity/version.rb +13 -0
- data/lib/legion/extensions/agentic/imagination/creativity.rb +20 -0
- data/lib/legion/extensions/agentic/imagination/dream/actors/dream_cycle.rb +45 -0
- data/lib/legion/extensions/agentic/imagination/dream/client.rb +29 -0
- data/lib/legion/extensions/agentic/imagination/dream/helpers/agenda.rb +74 -0
- data/lib/legion/extensions/agentic/imagination/dream/helpers/association_walker.rb +59 -0
- data/lib/legion/extensions/agentic/imagination/dream/helpers/constants.rb +34 -0
- data/lib/legion/extensions/agentic/imagination/dream/helpers/contradiction_detector.rb +86 -0
- data/lib/legion/extensions/agentic/imagination/dream/helpers/dream_journal.rb +231 -0
- data/lib/legion/extensions/agentic/imagination/dream/helpers/dream_store.rb +91 -0
- data/lib/legion/extensions/agentic/imagination/dream/helpers/llm_enhancer.rb +273 -0
- data/lib/legion/extensions/agentic/imagination/dream/runners/dream_cycle.rb +328 -0
- data/lib/legion/extensions/agentic/imagination/dream/version.rb +13 -0
- data/lib/legion/extensions/agentic/imagination/dream.rb +23 -0
- data/lib/legion/extensions/agentic/imagination/embodied_simulation/client.rb +19 -0
- data/lib/legion/extensions/agentic/imagination/embodied_simulation/helpers/constants.rb +49 -0
- data/lib/legion/extensions/agentic/imagination/embodied_simulation/helpers/simulation.rb +136 -0
- data/lib/legion/extensions/agentic/imagination/embodied_simulation/helpers/simulation_engine.rb +180 -0
- data/lib/legion/extensions/agentic/imagination/embodied_simulation/helpers/simulation_step.rb +49 -0
- data/lib/legion/extensions/agentic/imagination/embodied_simulation/runners/embodied_simulation.rb +99 -0
- data/lib/legion/extensions/agentic/imagination/embodied_simulation/version.rb +13 -0
- data/lib/legion/extensions/agentic/imagination/embodied_simulation.rb +21 -0
- data/lib/legion/extensions/agentic/imagination/garden/client.rb +15 -0
- data/lib/legion/extensions/agentic/imagination/garden/helpers/constants.rb +49 -0
- data/lib/legion/extensions/agentic/imagination/garden/helpers/garden_engine.rb +138 -0
- data/lib/legion/extensions/agentic/imagination/garden/helpers/plant.rb +116 -0
- data/lib/legion/extensions/agentic/imagination/garden/helpers/plot.rb +95 -0
- data/lib/legion/extensions/agentic/imagination/garden/runners/cognitive_garden.rb +75 -0
- data/lib/legion/extensions/agentic/imagination/garden/version.rb +13 -0
- data/lib/legion/extensions/agentic/imagination/garden.rb +22 -0
- data/lib/legion/extensions/agentic/imagination/genesis/client.rb +27 -0
- data/lib/legion/extensions/agentic/imagination/genesis/helpers/concept.rb +86 -0
- data/lib/legion/extensions/agentic/imagination/genesis/helpers/constants.rb +132 -0
- data/lib/legion/extensions/agentic/imagination/genesis/helpers/genesis_engine.rb +251 -0
- data/lib/legion/extensions/agentic/imagination/genesis/helpers/seed.rb +70 -0
- data/lib/legion/extensions/agentic/imagination/genesis/runners/genesis.rb +105 -0
- data/lib/legion/extensions/agentic/imagination/genesis/version.rb +13 -0
- data/lib/legion/extensions/agentic/imagination/genesis.rb +20 -0
- data/lib/legion/extensions/agentic/imagination/greenhouse/client.rb +24 -0
- data/lib/legion/extensions/agentic/imagination/greenhouse/helpers/constants.rb +89 -0
- data/lib/legion/extensions/agentic/imagination/greenhouse/helpers/greenhouse.rb +116 -0
- data/lib/legion/extensions/agentic/imagination/greenhouse/helpers/greenhouse_engine.rb +121 -0
- data/lib/legion/extensions/agentic/imagination/greenhouse/helpers/seedling.rb +155 -0
- data/lib/legion/extensions/agentic/imagination/greenhouse/runners/cognitive_greenhouse.rb +87 -0
- data/lib/legion/extensions/agentic/imagination/greenhouse/version.rb +13 -0
- data/lib/legion/extensions/agentic/imagination/greenhouse.rb +21 -0
- data/lib/legion/extensions/agentic/imagination/imagery/client.rb +21 -0
- data/lib/legion/extensions/agentic/imagination/imagery/helpers/constants.rb +55 -0
- data/lib/legion/extensions/agentic/imagination/imagery/helpers/scenario.rb +123 -0
- data/lib/legion/extensions/agentic/imagination/imagery/helpers/simulation_store.rb +80 -0
- data/lib/legion/extensions/agentic/imagination/imagery/runners/imagination.rb +210 -0
- data/lib/legion/extensions/agentic/imagination/imagery/version.rb +13 -0
- data/lib/legion/extensions/agentic/imagination/imagery.rb +20 -0
- data/lib/legion/extensions/agentic/imagination/liminal/client.rb +19 -0
- data/lib/legion/extensions/agentic/imagination/liminal/helpers/constants.rb +79 -0
- data/lib/legion/extensions/agentic/imagination/liminal/helpers/liminal_engine.rb +115 -0
- data/lib/legion/extensions/agentic/imagination/liminal/helpers/threshold_crossing.rb +136 -0
- data/lib/legion/extensions/agentic/imagination/liminal/runners/cognitive_liminal.rb +72 -0
- data/lib/legion/extensions/agentic/imagination/liminal/version.rb +13 -0
- data/lib/legion/extensions/agentic/imagination/liminal.rb +19 -0
- data/lib/legion/extensions/agentic/imagination/lucidity/client.rb +25 -0
- data/lib/legion/extensions/agentic/imagination/lucidity/helpers/constants.rb +48 -0
- data/lib/legion/extensions/agentic/imagination/lucidity/helpers/dream_state.rb +135 -0
- data/lib/legion/extensions/agentic/imagination/lucidity/helpers/journal_entry.rb +68 -0
- data/lib/legion/extensions/agentic/imagination/lucidity/helpers/lucidity_engine.rb +181 -0
- data/lib/legion/extensions/agentic/imagination/lucidity/runners/cognitive_lucidity.rb +95 -0
- data/lib/legion/extensions/agentic/imagination/lucidity/version.rb +13 -0
- data/lib/legion/extensions/agentic/imagination/lucidity.rb +22 -0
- data/lib/legion/extensions/agentic/imagination/mental_simulation/helpers/client.rb +23 -0
- data/lib/legion/extensions/agentic/imagination/mental_simulation/helpers/constants.rb +43 -0
- data/lib/legion/extensions/agentic/imagination/mental_simulation/helpers/simulation.rb +116 -0
- data/lib/legion/extensions/agentic/imagination/mental_simulation/helpers/simulation_engine.rb +141 -0
- data/lib/legion/extensions/agentic/imagination/mental_simulation/helpers/simulation_step.rb +53 -0
- data/lib/legion/extensions/agentic/imagination/mental_simulation/runners/mental_simulation.rb +92 -0
- data/lib/legion/extensions/agentic/imagination/mental_simulation/version.rb +13 -0
- data/lib/legion/extensions/agentic/imagination/mental_simulation.rb +20 -0
- data/lib/legion/extensions/agentic/imagination/origami/client.rb +41 -0
- data/lib/legion/extensions/agentic/imagination/origami/helpers/constants.rb +29 -0
- data/lib/legion/extensions/agentic/imagination/origami/helpers/crease.rb +53 -0
- data/lib/legion/extensions/agentic/imagination/origami/helpers/figure.rb +106 -0
- data/lib/legion/extensions/agentic/imagination/origami/helpers/origami_engine.rb +116 -0
- data/lib/legion/extensions/agentic/imagination/origami/runners/cognitive_origami.rb +71 -0
- data/lib/legion/extensions/agentic/imagination/origami/version.rb +13 -0
- data/lib/legion/extensions/agentic/imagination/origami.rb +22 -0
- data/lib/legion/extensions/agentic/imagination/prospection/actors/decay.rb +45 -0
- data/lib/legion/extensions/agentic/imagination/prospection/client.rb +26 -0
- data/lib/legion/extensions/agentic/imagination/prospection/helpers/constants.rb +41 -0
- data/lib/legion/extensions/agentic/imagination/prospection/helpers/prospection_engine.rb +129 -0
- data/lib/legion/extensions/agentic/imagination/prospection/helpers/scenario.rb +120 -0
- data/lib/legion/extensions/agentic/imagination/prospection/runners/prospection.rb +127 -0
- data/lib/legion/extensions/agentic/imagination/prospection/version.rb +13 -0
- data/lib/legion/extensions/agentic/imagination/prospection.rb +20 -0
- data/lib/legion/extensions/agentic/imagination/time_travel/client.rb +27 -0
- data/lib/legion/extensions/agentic/imagination/time_travel/helpers/constants.rb +37 -0
- data/lib/legion/extensions/agentic/imagination/time_travel/helpers/mental_journey.rb +149 -0
- data/lib/legion/extensions/agentic/imagination/time_travel/helpers/temporal_waypoint.rb +68 -0
- data/lib/legion/extensions/agentic/imagination/time_travel/helpers/time_traveler.rb +205 -0
- data/lib/legion/extensions/agentic/imagination/time_travel/runners/mental_time_travel.rb +145 -0
- data/lib/legion/extensions/agentic/imagination/time_travel/version.rb +13 -0
- data/lib/legion/extensions/agentic/imagination/time_travel.rb +20 -0
- data/lib/legion/extensions/agentic/imagination/version.rb +11 -0
- data/lib/legion/extensions/agentic/imagination/volcano/client.rb +47 -0
- data/lib/legion/extensions/agentic/imagination/volcano/helpers/chamber.rb +123 -0
- data/lib/legion/extensions/agentic/imagination/volcano/helpers/constants.rb +45 -0
- data/lib/legion/extensions/agentic/imagination/volcano/helpers/magma.rb +72 -0
- data/lib/legion/extensions/agentic/imagination/volcano/helpers/volcano_engine.rb +120 -0
- data/lib/legion/extensions/agentic/imagination/volcano/runners/cognitive_volcano.rb +108 -0
- data/lib/legion/extensions/agentic/imagination/volcano/version.rb +13 -0
- data/lib/legion/extensions/agentic/imagination/volcano.rb +21 -0
- data/lib/legion/extensions/agentic/imagination.rb +34 -0
- data/spec/legion/extensions/agentic/imagination/alchemy/client_spec.rb +16 -0
- data/spec/legion/extensions/agentic/imagination/alchemy/helpers/alchemy_engine_spec.rb +145 -0
- data/spec/legion/extensions/agentic/imagination/alchemy/helpers/constants_spec.rb +45 -0
- data/spec/legion/extensions/agentic/imagination/alchemy/helpers/crucible_spec.rb +111 -0
- data/spec/legion/extensions/agentic/imagination/alchemy/helpers/substance_spec.rb +174 -0
- data/spec/legion/extensions/agentic/imagination/alchemy/runners/cognitive_alchemy_spec.rb +99 -0
- data/spec/legion/extensions/agentic/imagination/aurora/client_spec.rb +164 -0
- data/spec/legion/extensions/agentic/imagination/aurora/helpers/aurora_engine_spec.rb +291 -0
- data/spec/legion/extensions/agentic/imagination/aurora/helpers/aurora_event_spec.rb +217 -0
- data/spec/legion/extensions/agentic/imagination/aurora/helpers/spectral_band_spec.rb +186 -0
- data/spec/legion/extensions/agentic/imagination/constellation/client_spec.rb +16 -0
- data/spec/legion/extensions/agentic/imagination/constellation/helpers/constants_spec.rb +35 -0
- data/spec/legion/extensions/agentic/imagination/constellation/helpers/constellation_spec.rb +116 -0
- data/spec/legion/extensions/agentic/imagination/constellation/helpers/sky_engine_spec.rb +136 -0
- data/spec/legion/extensions/agentic/imagination/constellation/helpers/star_spec.rb +126 -0
- data/spec/legion/extensions/agentic/imagination/constellation/runners/cognitive_constellation_spec.rb +86 -0
- data/spec/legion/extensions/agentic/imagination/creativity/client_spec.rb +68 -0
- data/spec/legion/extensions/agentic/imagination/creativity/helpers/constants_spec.rb +129 -0
- data/spec/legion/extensions/agentic/imagination/creativity/helpers/creative_engine_spec.rb +220 -0
- data/spec/legion/extensions/agentic/imagination/creativity/helpers/idea_store_spec.rb +232 -0
- data/spec/legion/extensions/agentic/imagination/creativity/runners/creativity_spec.rb +237 -0
- data/spec/legion/extensions/agentic/imagination/dream/actors/dream_cycle_spec.rb +51 -0
- data/spec/legion/extensions/agentic/imagination/dream/client_spec.rb +27 -0
- data/spec/legion/extensions/agentic/imagination/dream/helpers/agenda_spec.rb +148 -0
- data/spec/legion/extensions/agentic/imagination/dream/helpers/association_walker_spec.rb +123 -0
- data/spec/legion/extensions/agentic/imagination/dream/helpers/contradiction_detector_spec.rb +183 -0
- data/spec/legion/extensions/agentic/imagination/dream/helpers/dream_store_spec.rb +141 -0
- data/spec/legion/extensions/agentic/imagination/dream/integration_spec.rb +98 -0
- data/spec/legion/extensions/agentic/imagination/dream/runners/dream_cycle_spec.rb +116 -0
- data/spec/legion/extensions/agentic/imagination/embodied_simulation/client_spec.rb +44 -0
- data/spec/legion/extensions/agentic/imagination/embodied_simulation/helpers/simulation_engine_spec.rb +201 -0
- data/spec/legion/extensions/agentic/imagination/embodied_simulation/helpers/simulation_spec.rb +178 -0
- data/spec/legion/extensions/agentic/imagination/embodied_simulation/helpers/simulation_step_spec.rb +83 -0
- data/spec/legion/extensions/agentic/imagination/embodied_simulation/runners/embodied_simulation_spec.rb +124 -0
- data/spec/legion/extensions/agentic/imagination/garden/client_spec.rb +34 -0
- data/spec/legion/extensions/agentic/imagination/garden/helpers/constants_spec.rb +41 -0
- data/spec/legion/extensions/agentic/imagination/garden/helpers/garden_engine_spec.rb +119 -0
- data/spec/legion/extensions/agentic/imagination/garden/helpers/plant_spec.rb +147 -0
- data/spec/legion/extensions/agentic/imagination/garden/helpers/plot_spec.rb +92 -0
- data/spec/legion/extensions/agentic/imagination/garden/runners/cognitive_garden_spec.rb +75 -0
- data/spec/legion/extensions/agentic/imagination/genesis/client_spec.rb +110 -0
- data/spec/legion/extensions/agentic/imagination/genesis/cognitive_genesis_spec.rb +31 -0
- data/spec/legion/extensions/agentic/imagination/genesis/helpers/concept_spec.rb +221 -0
- data/spec/legion/extensions/agentic/imagination/genesis/helpers/constants_spec.rb +145 -0
- data/spec/legion/extensions/agentic/imagination/genesis/helpers/genesis_engine_spec.rb +339 -0
- data/spec/legion/extensions/agentic/imagination/genesis/helpers/seed_spec.rb +197 -0
- data/spec/legion/extensions/agentic/imagination/genesis/runners/genesis_spec.rb +177 -0
- data/spec/legion/extensions/agentic/imagination/greenhouse/client_spec.rb +89 -0
- data/spec/legion/extensions/agentic/imagination/greenhouse/helpers/constants_spec.rb +74 -0
- data/spec/legion/extensions/agentic/imagination/greenhouse/helpers/greenhouse_engine_spec.rb +163 -0
- data/spec/legion/extensions/agentic/imagination/greenhouse/helpers/greenhouse_spec.rb +193 -0
- data/spec/legion/extensions/agentic/imagination/greenhouse/helpers/seedling_spec.rb +224 -0
- data/spec/legion/extensions/agentic/imagination/greenhouse/runners/cognitive_greenhouse_spec.rb +139 -0
- data/spec/legion/extensions/agentic/imagination/imagery/client_spec.rb +20 -0
- data/spec/legion/extensions/agentic/imagination/imagery/helpers/constants_spec.rb +25 -0
- data/spec/legion/extensions/agentic/imagination/imagery/helpers/scenario_spec.rb +111 -0
- data/spec/legion/extensions/agentic/imagination/imagery/helpers/simulation_store_spec.rb +89 -0
- data/spec/legion/extensions/agentic/imagination/imagery/runners/imagination_spec.rb +99 -0
- data/spec/legion/extensions/agentic/imagination/liminal/client_spec.rb +21 -0
- data/spec/legion/extensions/agentic/imagination/liminal/cognitive_liminal_spec.rb +7 -0
- data/spec/legion/extensions/agentic/imagination/liminal/helpers/liminal_engine_spec.rb +130 -0
- data/spec/legion/extensions/agentic/imagination/liminal/helpers/threshold_crossing_spec.rb +155 -0
- data/spec/legion/extensions/agentic/imagination/liminal/runners_spec.rb +81 -0
- data/spec/legion/extensions/agentic/imagination/lucidity/client_spec.rb +76 -0
- data/spec/legion/extensions/agentic/imagination/lucidity/cognitive_lucidity_spec.rb +19 -0
- data/spec/legion/extensions/agentic/imagination/lucidity/helpers/constants_spec.rb +89 -0
- data/spec/legion/extensions/agentic/imagination/lucidity/helpers/dream_state_spec.rb +210 -0
- data/spec/legion/extensions/agentic/imagination/lucidity/helpers/journal_entry_spec.rb +103 -0
- data/spec/legion/extensions/agentic/imagination/lucidity/helpers/lucidity_engine_spec.rb +259 -0
- data/spec/legion/extensions/agentic/imagination/lucidity/runners/cognitive_lucidity_spec.rb +156 -0
- data/spec/legion/extensions/agentic/imagination/mental_simulation/helpers/constants_spec.rb +107 -0
- data/spec/legion/extensions/agentic/imagination/mental_simulation/helpers/simulation_engine_spec.rb +217 -0
- data/spec/legion/extensions/agentic/imagination/mental_simulation/helpers/simulation_spec.rb +223 -0
- data/spec/legion/extensions/agentic/imagination/mental_simulation/helpers/simulation_step_spec.rb +111 -0
- data/spec/legion/extensions/agentic/imagination/mental_simulation/runners/mental_simulation_spec.rb +184 -0
- data/spec/legion/extensions/agentic/imagination/origami/client_spec.rb +98 -0
- data/spec/legion/extensions/agentic/imagination/origami/helpers/constants_spec.rb +70 -0
- data/spec/legion/extensions/agentic/imagination/origami/helpers/crease_spec.rb +121 -0
- data/spec/legion/extensions/agentic/imagination/origami/helpers/figure_spec.rb +212 -0
- data/spec/legion/extensions/agentic/imagination/origami/helpers/origami_engine_spec.rb +239 -0
- data/spec/legion/extensions/agentic/imagination/origami/runners/cognitive_origami_spec.rb +112 -0
- data/spec/legion/extensions/agentic/imagination/prospection/client_spec.rb +107 -0
- data/spec/legion/extensions/agentic/imagination/prospection/helpers/prospection_engine_spec.rb +197 -0
- data/spec/legion/extensions/agentic/imagination/prospection/helpers/scenario_spec.rb +260 -0
- data/spec/legion/extensions/agentic/imagination/prospection/runners/prospection_spec.rb +156 -0
- data/spec/legion/extensions/agentic/imagination/time_travel/client_spec.rb +34 -0
- data/spec/legion/extensions/agentic/imagination/time_travel/helpers/constants_spec.rb +83 -0
- data/spec/legion/extensions/agentic/imagination/time_travel/helpers/mental_journey_spec.rb +274 -0
- data/spec/legion/extensions/agentic/imagination/time_travel/helpers/temporal_waypoint_spec.rb +177 -0
- data/spec/legion/extensions/agentic/imagination/time_travel/helpers/time_traveler_spec.rb +334 -0
- data/spec/legion/extensions/agentic/imagination/time_travel/runners/mental_time_travel_spec.rb +323 -0
- data/spec/legion/extensions/agentic/imagination/volcano/client_spec.rb +89 -0
- data/spec/legion/extensions/agentic/imagination/volcano/helpers/chamber_spec.rb +266 -0
- data/spec/legion/extensions/agentic/imagination/volcano/helpers/constants_spec.rb +83 -0
- data/spec/legion/extensions/agentic/imagination/volcano/helpers/magma_spec.rb +157 -0
- data/spec/legion/extensions/agentic/imagination/volcano/helpers/volcano_engine_spec.rb +191 -0
- data/spec/legion/extensions/agentic/imagination/volcano/integration_spec.rb +148 -0
- data/spec/legion/extensions/agentic/imagination/volcano/runners/cognitive_volcano_spec.rb +167 -0
- data/spec/spec_helper.rb +54 -0
- metadata +386 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
RSpec.describe Legion::Extensions::Agentic::Imagination::Garden::Runners::CognitiveGarden do
|
|
4
|
+
let(:runner) do
|
|
5
|
+
obj = Object.new
|
|
6
|
+
obj.extend(described_class)
|
|
7
|
+
obj
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
let(:engine) { Legion::Extensions::Agentic::Imagination::Garden::Helpers::GardenEngine.new }
|
|
11
|
+
|
|
12
|
+
describe '#plant_seed' do
|
|
13
|
+
it 'returns success' do
|
|
14
|
+
result = runner.plant_seed(plant_type: :idea, domain: :reasoning,
|
|
15
|
+
content: 'test', engine: engine)
|
|
16
|
+
expect(result[:success]).to be true
|
|
17
|
+
expect(result[:plant][:plant_type]).to eq(:idea)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
it 'returns failure for invalid type' do
|
|
21
|
+
result = runner.plant_seed(plant_type: :weed, domain: :t, content: 'x', engine: engine)
|
|
22
|
+
expect(result[:success]).to be false
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
describe '#create_plot' do
|
|
27
|
+
it 'returns success' do
|
|
28
|
+
result = runner.create_plot(engine: engine)
|
|
29
|
+
expect(result[:success]).to be true
|
|
30
|
+
expect(result[:plot]).to be_a(Hash)
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
describe '#grow' do
|
|
35
|
+
it 'grows a plant' do
|
|
36
|
+
p = engine.plant_seed(plant_type: :idea, domain: :t, content: 'x')
|
|
37
|
+
result = runner.grow(plant_id: p.id, engine: engine)
|
|
38
|
+
expect(result[:success]).to be true
|
|
39
|
+
expect(result[:plant][:health]).to be > 0.5
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
describe '#water' do
|
|
44
|
+
it 'waters a plant' do
|
|
45
|
+
p = engine.plant_seed(plant_type: :idea, domain: :t, content: 'x')
|
|
46
|
+
result = runner.water(plant_id: p.id, engine: engine)
|
|
47
|
+
expect(result[:success]).to be true
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
describe '#list_plants' do
|
|
52
|
+
before do
|
|
53
|
+
engine.plant_seed(plant_type: :idea, domain: :t, content: 'a')
|
|
54
|
+
engine.plant_seed(plant_type: :theory, domain: :t, content: 'b')
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
it 'returns all plants' do
|
|
58
|
+
result = runner.list_plants(engine: engine)
|
|
59
|
+
expect(result[:count]).to eq(2)
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
it 'filters by type' do
|
|
63
|
+
result = runner.list_plants(plant_type: :idea, engine: engine)
|
|
64
|
+
expect(result[:count]).to eq(1)
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
describe '#garden_status' do
|
|
69
|
+
it 'returns report' do
|
|
70
|
+
result = runner.garden_status(engine: engine)
|
|
71
|
+
expect(result[:success]).to be true
|
|
72
|
+
expect(result[:report]).to include(:total_plants)
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
end
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
RSpec.describe Legion::Extensions::Agentic::Imagination::Genesis::Client do
|
|
4
|
+
let(:engine) { Legion::Extensions::Agentic::Imagination::Genesis::Helpers::GenesisEngine.new }
|
|
5
|
+
let(:client) { described_class.new(engine: engine) }
|
|
6
|
+
|
|
7
|
+
describe '#initialize' do
|
|
8
|
+
it 'accepts injected engine' do
|
|
9
|
+
expect(client.engine).to eq(engine)
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
it 'creates a default engine when none injected' do
|
|
13
|
+
expect(described_class.new.engine).to be_a(Legion::Extensions::Agentic::Imagination::Genesis::Helpers::GenesisEngine)
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
describe 'runner method presence' do
|
|
18
|
+
%i[
|
|
19
|
+
plant_seed germinate_seed birth_concept nurture_concept prune_seed
|
|
20
|
+
cross_pollinate adopt_concept concept_fitness novelty_landscape
|
|
21
|
+
genesis_rate most_adopted orphan_concepts genesis_report
|
|
22
|
+
].each do |method|
|
|
23
|
+
it "responds to ##{method}" do
|
|
24
|
+
expect(client).to respond_to(method)
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
describe 'full lifecycle integration' do
|
|
30
|
+
it 'plants, germinates, and births a concept end-to-end' do
|
|
31
|
+
plant = client.plant_seed(raw_material: %w[awareness recursion boundary], domain: :abstract,
|
|
32
|
+
germination_potential: 0.6, novelty_score: 0.55, viability: 0.45)
|
|
33
|
+
expect(plant[:success]).to be true
|
|
34
|
+
sid = plant[:seed_id]
|
|
35
|
+
|
|
36
|
+
# Germinate
|
|
37
|
+
germ = client.germinate_seed(seed_id: sid, boost: 0.15)
|
|
38
|
+
expect(germ[:success]).to be true
|
|
39
|
+
|
|
40
|
+
# Push seed past all thresholds
|
|
41
|
+
seed = engine.seeds[sid]
|
|
42
|
+
seed.novelty_score = 0.8
|
|
43
|
+
seed.viability = 0.6
|
|
44
|
+
seed.germination_potential = 0.75
|
|
45
|
+
|
|
46
|
+
birth = client.birth_concept(seed_id: sid, name: 'reflexive dissolution',
|
|
47
|
+
definition: 'a boundary recognizing and dissolving itself')
|
|
48
|
+
expect(birth[:success]).to be true
|
|
49
|
+
cid = birth[:concept_id]
|
|
50
|
+
|
|
51
|
+
client.nurture_concept(concept_id: cid)
|
|
52
|
+
client.adopt_concept(concept_id: cid)
|
|
53
|
+
client.adopt_concept(concept_id: cid)
|
|
54
|
+
|
|
55
|
+
fitness = client.concept_fitness(concept_id: cid)
|
|
56
|
+
expect(fitness[:adoption_count]).to eq(2)
|
|
57
|
+
expect(fitness[:utility_score]).to be > 0.0
|
|
58
|
+
|
|
59
|
+
report = client.genesis_report
|
|
60
|
+
expect(report[:concepts]).to eq(1)
|
|
61
|
+
expect(report[:genesis_events]).to eq(1)
|
|
62
|
+
expect(report[:orphan_count]).to eq(0)
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
it 'cross-pollinates two seeds to form a more novel child' do
|
|
66
|
+
client.plant_seed(raw_material: %w[signal noise], domain: :emergent, novelty_score: 0.55)
|
|
67
|
+
client.plant_seed(raw_material: %w[pattern chaos], domain: :abstract, novelty_score: 0.65)
|
|
68
|
+
seeds = engine.seeds.values
|
|
69
|
+
result = client.cross_pollinate(seed_id_a: seeds[0].seed_id, seed_id_b: seeds[1].seed_id)
|
|
70
|
+
expect(result[:success]).to be true
|
|
71
|
+
child = engine.seeds[result[:seed_id]]
|
|
72
|
+
expect(child.novelty_score).to be >= 0.65
|
|
73
|
+
expect(child.raw_material).to include('signal', 'noise', 'pattern', 'chaos')
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
it 'tracks orphan concepts correctly' do
|
|
77
|
+
s = engine.plant(raw_material: %w[a b c], domain: :abstract,
|
|
78
|
+
germination_potential: 0.9, novelty_score: 0.8, viability: 0.6)
|
|
79
|
+
engine.birth(seed_id: s[:seed_id], name: 'orphan', definition: 'never used')
|
|
80
|
+
orphans = client.orphan_concepts
|
|
81
|
+
expect(orphans[:count]).to eq(1)
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
it 'novelty landscape reflects planted seeds' do
|
|
85
|
+
client.plant_seed(raw_material: %w[x y z], domain: :logical, novelty_score: 0.73)
|
|
86
|
+
landscape = client.novelty_landscape
|
|
87
|
+
expect(landscape[:seeds].size).to eq(1)
|
|
88
|
+
expect(landscape[:seeds].first[:score]).to eq(0.73)
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
it 'genesis_rate increases with each birth' do
|
|
92
|
+
s = engine.plant(raw_material: %w[q r s], domain: :abstract,
|
|
93
|
+
germination_potential: 0.9, novelty_score: 0.8, viability: 0.6)
|
|
94
|
+
engine.birth(seed_id: s[:seed_id], name: 'rate test', definition: 'checking rate')
|
|
95
|
+
rate = client.genesis_rate
|
|
96
|
+
expect(rate[:total_events]).to eq(1)
|
|
97
|
+
expect(rate[:rate]).to be > 0.0
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
it 'most_adopted returns concept with highest count' do
|
|
101
|
+
s1 = engine.plant(raw_material: %w[a], domain: :abstract, germination_potential: 0.9, novelty_score: 0.8, viability: 0.6)
|
|
102
|
+
cid1 = engine.birth(seed_id: s1[:seed_id], name: 'popular concept', definition: 'used often')[:concept_id]
|
|
103
|
+
s2 = engine.plant(raw_material: %w[b], domain: :abstract, germination_potential: 0.9, novelty_score: 0.8, viability: 0.6)
|
|
104
|
+
engine.birth(seed_id: s2[:seed_id], name: 'unknown concept', definition: 'never used')
|
|
105
|
+
client.adopt_concept(concept_id: cid1)
|
|
106
|
+
client.adopt_concept(concept_id: cid1)
|
|
107
|
+
expect(client.most_adopted[:concept][:name]).to eq('popular concept')
|
|
108
|
+
end
|
|
109
|
+
end
|
|
110
|
+
end
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
RSpec.describe Legion::Extensions::Agentic::Imagination::Genesis do
|
|
4
|
+
it 'exposes the correct version' do
|
|
5
|
+
expect(described_class::VERSION).to eq('0.1.0')
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
it 'exposes Helpers::Constants' do
|
|
9
|
+
expect(described_class::Helpers::Constants).to be_a(Module)
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
it 'exposes Helpers::Seed' do
|
|
13
|
+
expect(described_class::Helpers::Seed).to be_a(Class)
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
it 'exposes Helpers::Concept' do
|
|
17
|
+
expect(described_class::Helpers::Concept).to be_a(Class)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
it 'exposes Helpers::GenesisEngine' do
|
|
21
|
+
expect(described_class::Helpers::GenesisEngine).to be_a(Class)
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
it 'exposes Runners::Genesis' do
|
|
25
|
+
expect(described_class::Runners::Genesis).to be_a(Module)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
it 'exposes Client' do
|
|
29
|
+
expect(described_class::Client).to be_a(Class)
|
|
30
|
+
end
|
|
31
|
+
end
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
RSpec.describe Legion::Extensions::Agentic::Imagination::Genesis::Helpers::Concept do
|
|
4
|
+
let(:consts) { Legion::Extensions::Agentic::Imagination::Genesis::Helpers::Constants }
|
|
5
|
+
let(:parent_id) { SecureRandom.uuid }
|
|
6
|
+
let(:defaults) do
|
|
7
|
+
{ name: 'liminal cognition', definition: 'threshold state between frameworks',
|
|
8
|
+
parent_seed_id: parent_id, domain: :abstract }
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
describe '#initialize' do
|
|
12
|
+
it 'generates a unique UUID concept_id' do
|
|
13
|
+
expect(described_class.new(**defaults).concept_id).to match(/\A[0-9a-f-]{36}\z/)
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
it 'generates unique IDs for each instance' do
|
|
17
|
+
a = described_class.new(**defaults)
|
|
18
|
+
b = described_class.new(**defaults)
|
|
19
|
+
expect(a.concept_id).not_to eq(b.concept_id)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
it 'freezes name' do
|
|
23
|
+
expect(described_class.new(**defaults).name).to be_frozen
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
it 'freezes definition' do
|
|
27
|
+
expect(described_class.new(**defaults).definition).to be_frozen
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
it 'coerces domain to symbol' do
|
|
31
|
+
c = described_class.new(**defaults, domain: 'emergent')
|
|
32
|
+
expect(c.domain).to eq(:emergent)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
it 'raises ArgumentError for invalid domain' do
|
|
36
|
+
expect { described_class.new(**defaults, domain: :imaginary) }
|
|
37
|
+
.to raise_error(ArgumentError, /invalid domain/)
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
it 'clamps maturity to 1.0' do
|
|
41
|
+
expect(described_class.new(**defaults, maturity: 2.5).maturity).to eq(1.0)
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
it 'clamps maturity to 0.0' do
|
|
45
|
+
expect(described_class.new(**defaults, maturity: -0.1).maturity).to eq(0.0)
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
it 'clamps utility_score to 1.0' do
|
|
49
|
+
expect(described_class.new(**defaults, utility_score: 5.0).utility_score).to eq(1.0)
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
it 'defaults maturity to 0.0' do
|
|
53
|
+
expect(described_class.new(**defaults).maturity).to eq(0.0)
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
it 'defaults adoption_count to 0' do
|
|
57
|
+
expect(described_class.new(**defaults).adoption_count).to eq(0)
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
it 'defaults connections to empty array' do
|
|
61
|
+
expect(described_class.new(**defaults).connections).to eq([])
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
it 'sets born_at to UTC Time' do
|
|
65
|
+
before = Time.now.utc
|
|
66
|
+
c = described_class.new(**defaults)
|
|
67
|
+
after = Time.now.utc
|
|
68
|
+
expect(c.born_at).to be >= before
|
|
69
|
+
expect(c.born_at).to be <= after
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
describe '#maturity_label' do
|
|
74
|
+
it 'returns :nascent for maturity 0.0' do
|
|
75
|
+
expect(described_class.new(**defaults, maturity: 0.0).maturity_label).to eq(:nascent)
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
it 'returns :foundational for maturity 0.9' do
|
|
79
|
+
expect(described_class.new(**defaults, maturity: 0.9).maturity_label).to eq(:foundational)
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
it 'returns :establishing for maturity 0.5' do
|
|
83
|
+
expect(described_class.new(**defaults, maturity: 0.5).maturity_label).to eq(:establishing)
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
describe '#fitness_label' do
|
|
88
|
+
it 'returns :untested for utility 0.1' do
|
|
89
|
+
expect(described_class.new(**defaults, utility_score: 0.1).fitness_label).to eq(:untested)
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
it 'returns :essential for utility 0.9' do
|
|
93
|
+
expect(described_class.new(**defaults, utility_score: 0.9).fitness_label).to eq(:essential)
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
describe '#adopt!' do
|
|
98
|
+
it 'increments adoption_count' do
|
|
99
|
+
c = described_class.new(**defaults)
|
|
100
|
+
c.adopt!
|
|
101
|
+
expect(c.adoption_count).to eq(1)
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
it 'increases utility_score by ADOPTION_BONUS' do
|
|
105
|
+
c = described_class.new(**defaults, utility_score: 0.3)
|
|
106
|
+
c.adopt!
|
|
107
|
+
expect(c.utility_score).to be_within(0.0001).of(0.3 + consts::ADOPTION_BONUS)
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
it 'increases maturity by MATURITY_BOOST' do
|
|
111
|
+
c = described_class.new(**defaults, maturity: 0.2)
|
|
112
|
+
c.adopt!
|
|
113
|
+
expect(c.maturity).to be_within(0.0001).of(0.2 + consts::MATURITY_BOOST)
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
it 'clamps utility_score at 1.0' do
|
|
117
|
+
c = described_class.new(**defaults, utility_score: 0.98)
|
|
118
|
+
c.adopt!
|
|
119
|
+
expect(c.utility_score).to eq(1.0)
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
it 'accumulates over multiple calls' do
|
|
123
|
+
c = described_class.new(**defaults)
|
|
124
|
+
3.times { c.adopt! }
|
|
125
|
+
expect(c.adoption_count).to eq(3)
|
|
126
|
+
end
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
describe '#nurture!' do
|
|
130
|
+
it 'increases maturity by default MATURITY_BOOST' do
|
|
131
|
+
c = described_class.new(**defaults, maturity: 0.4)
|
|
132
|
+
c.nurture!
|
|
133
|
+
expect(c.maturity).to be_within(0.0001).of(0.4 + consts::MATURITY_BOOST)
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
it 'accepts a custom boost' do
|
|
137
|
+
c = described_class.new(**defaults, maturity: 0.3)
|
|
138
|
+
c.nurture!(boost: 0.2)
|
|
139
|
+
expect(c.maturity).to be_within(0.0001).of(0.5)
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
it 'clamps at 1.0' do
|
|
143
|
+
c = described_class.new(**defaults, maturity: 0.99)
|
|
144
|
+
c.nurture!
|
|
145
|
+
expect(c.maturity).to eq(1.0)
|
|
146
|
+
end
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
describe '#decay!' do
|
|
150
|
+
it 'decreases maturity by MATURITY_DECAY' do
|
|
151
|
+
c = described_class.new(**defaults, maturity: 0.5)
|
|
152
|
+
c.decay!
|
|
153
|
+
expect(c.maturity).to be_within(0.0001).of(0.5 - consts::MATURITY_DECAY)
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
it 'clamps at 0.0' do
|
|
157
|
+
c = described_class.new(**defaults, maturity: 0.01)
|
|
158
|
+
c.decay!
|
|
159
|
+
expect(c.maturity).to eq(0.0)
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
it 'accepts a custom rate' do
|
|
163
|
+
c = described_class.new(**defaults, maturity: 0.5)
|
|
164
|
+
c.decay!(rate: 0.1)
|
|
165
|
+
expect(c.maturity).to be_within(0.0001).of(0.4)
|
|
166
|
+
end
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
describe '#connect_to' do
|
|
170
|
+
it 'adds a concept_id to connections' do
|
|
171
|
+
c = described_class.new(**defaults)
|
|
172
|
+
id = SecureRandom.uuid
|
|
173
|
+
c.connect_to(id)
|
|
174
|
+
expect(c.connections).to include(id)
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
it 'does not add duplicates' do
|
|
178
|
+
c = described_class.new(**defaults)
|
|
179
|
+
id = SecureRandom.uuid
|
|
180
|
+
c.connect_to(id)
|
|
181
|
+
c.connect_to(id)
|
|
182
|
+
expect(c.connections.count(id)).to eq(1)
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
it 'supports multiple unique connections' do
|
|
186
|
+
c = described_class.new(**defaults)
|
|
187
|
+
3.times { c.connect_to(SecureRandom.uuid) }
|
|
188
|
+
expect(c.connections.size).to eq(3)
|
|
189
|
+
end
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
describe '#orphan?' do
|
|
193
|
+
it 'returns true when adoption_count is 0' do
|
|
194
|
+
expect(described_class.new(**defaults).orphan?).to be true
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
it 'returns false after one adoption' do
|
|
198
|
+
c = described_class.new(**defaults)
|
|
199
|
+
c.adopt!
|
|
200
|
+
expect(c.orphan?).to be false
|
|
201
|
+
end
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
describe '#to_h' do
|
|
205
|
+
subject(:hash) { described_class.new(**defaults).to_h }
|
|
206
|
+
|
|
207
|
+
it { expect(hash[:concept_id]).to match(/\A[0-9a-f-]{36}\z/) }
|
|
208
|
+
it { expect(hash[:name]).to eq('liminal cognition') }
|
|
209
|
+
it { expect(hash[:definition]).to include('threshold state') }
|
|
210
|
+
it { expect(hash[:parent_seed_id]).to be_a(String) }
|
|
211
|
+
it { expect(hash[:domain]).to eq(:abstract) }
|
|
212
|
+
it { expect(hash[:maturity]).to eq(0.0) }
|
|
213
|
+
it { expect(hash[:maturity_label]).to eq(:nascent) }
|
|
214
|
+
it { expect(hash[:connections]).to eq([]) }
|
|
215
|
+
it { expect(hash[:utility_score]).to eq(0.0) }
|
|
216
|
+
it { expect(hash[:fitness_label]).to eq(:untested) }
|
|
217
|
+
it { expect(hash[:adoption_count]).to eq(0) }
|
|
218
|
+
it { expect(hash[:orphan]).to be true }
|
|
219
|
+
it { expect(hash[:born_at]).to be_a(Time) }
|
|
220
|
+
end
|
|
221
|
+
end
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
RSpec.describe Legion::Extensions::Agentic::Imagination::Genesis::Helpers::Constants do
|
|
4
|
+
describe 'capacity constants' do
|
|
5
|
+
it 'defines MAX_SEEDS as 200' do
|
|
6
|
+
expect(described_class::MAX_SEEDS).to eq(200)
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
it 'defines MAX_CONCEPTS as 100' do
|
|
10
|
+
expect(described_class::MAX_CONCEPTS).to eq(100)
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
describe 'germination constants' do
|
|
15
|
+
it 'defines DEFAULT_GERMINATION as 0.3' do
|
|
16
|
+
expect(described_class::DEFAULT_GERMINATION).to eq(0.3)
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
it 'defines GERMINATION_BOOST as 0.1' do
|
|
20
|
+
expect(described_class::GERMINATION_BOOST).to eq(0.1)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
it 'defines GERMINATION_THRESHOLD as 0.7' do
|
|
24
|
+
expect(described_class::GERMINATION_THRESHOLD).to eq(0.7)
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
describe 'novelty and viability thresholds' do
|
|
29
|
+
it 'defines NOVELTY_THRESHOLD as 0.5' do
|
|
30
|
+
expect(described_class::NOVELTY_THRESHOLD).to eq(0.5)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
it 'defines VIABILITY_THRESHOLD as 0.4' do
|
|
34
|
+
expect(described_class::VIABILITY_THRESHOLD).to eq(0.4)
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
describe 'concept lifecycle constants' do
|
|
39
|
+
it 'defines MATURITY_BOOST as 0.08' do
|
|
40
|
+
expect(described_class::MATURITY_BOOST).to eq(0.08)
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
it 'defines MATURITY_DECAY as 0.02' do
|
|
44
|
+
expect(described_class::MATURITY_DECAY).to eq(0.02)
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
it 'defines ADOPTION_BONUS as 0.05' do
|
|
48
|
+
expect(described_class::ADOPTION_BONUS).to eq(0.05)
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
describe 'SEED_DOMAINS' do
|
|
53
|
+
it 'is frozen' do
|
|
54
|
+
expect(described_class::SEED_DOMAINS).to be_frozen
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
it 'contains exactly 8 domains' do
|
|
58
|
+
expect(described_class::SEED_DOMAINS.size).to eq(8)
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
it 'includes all expected domains' do
|
|
62
|
+
expected = %i[linguistic spatial logical interpersonal aesthetic procedural abstract emergent]
|
|
63
|
+
expect(described_class::SEED_DOMAINS).to match_array(expected)
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
it 'contains only symbols' do
|
|
67
|
+
expect(described_class::SEED_DOMAINS).to all(be_a(Symbol))
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
describe 'GERMINATION_LABELS' do
|
|
72
|
+
it 'is a hash' do
|
|
73
|
+
expect(described_class::GERMINATION_LABELS).to be_a(Hash)
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
it 'labels 0.1 as :dormant' do
|
|
77
|
+
expect(described_class.label_for(described_class::GERMINATION_LABELS, 0.1)).to eq(:dormant)
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
it 'labels 0.5 as :awakening' do
|
|
81
|
+
expect(described_class.label_for(described_class::GERMINATION_LABELS, 0.5)).to eq(:awakening)
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
it 'labels 0.9 as :ready' do
|
|
85
|
+
expect(described_class.label_for(described_class::GERMINATION_LABELS, 0.9)).to eq(:ready)
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
describe 'NOVELTY_LABELS' do
|
|
90
|
+
it 'labels 0.1 as :derivative' do
|
|
91
|
+
expect(described_class.label_for(described_class::NOVELTY_LABELS, 0.1)).to eq(:derivative)
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
it 'labels 0.7 as :novel' do
|
|
95
|
+
expect(described_class.label_for(described_class::NOVELTY_LABELS, 0.7)).to eq(:novel)
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
it 'labels 0.9 as :unprecedented' do
|
|
99
|
+
expect(described_class.label_for(described_class::NOVELTY_LABELS, 0.9)).to eq(:unprecedented)
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
describe 'MATURITY_LABELS' do
|
|
104
|
+
it 'labels 0.1 as :nascent' do
|
|
105
|
+
expect(described_class.label_for(described_class::MATURITY_LABELS, 0.1)).to eq(:nascent)
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
it 'labels 0.5 as :establishing' do
|
|
109
|
+
expect(described_class.label_for(described_class::MATURITY_LABELS, 0.5)).to eq(:establishing)
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
it 'labels 0.9 as :foundational' do
|
|
113
|
+
expect(described_class.label_for(described_class::MATURITY_LABELS, 0.9)).to eq(:foundational)
|
|
114
|
+
end
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
describe 'FITNESS_LABELS' do
|
|
118
|
+
it 'labels 0.1 as :untested' do
|
|
119
|
+
expect(described_class.label_for(described_class::FITNESS_LABELS, 0.1)).to eq(:untested)
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
it 'labels 0.5 as :promising' do
|
|
123
|
+
expect(described_class.label_for(described_class::FITNESS_LABELS, 0.5)).to eq(:promising)
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
it 'labels 0.85 as :essential' do
|
|
127
|
+
expect(described_class.label_for(described_class::FITNESS_LABELS, 0.85)).to eq(:essential)
|
|
128
|
+
end
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
describe '.label_for' do
|
|
132
|
+
it 'clamps values below 0.0 to 0.0' do
|
|
133
|
+
expect(described_class.label_for(described_class::NOVELTY_LABELS, -0.5)).to eq(:derivative)
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
it 'clamps values above 1.0 to 1.0' do
|
|
137
|
+
expect(described_class.label_for(described_class::NOVELTY_LABELS, 1.5)).to eq(:unprecedented)
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
it 'returns last label as fallback when no range matches' do
|
|
141
|
+
sparse = { (0.9..1.0) => :high }
|
|
142
|
+
expect(described_class.label_for(sparse, 0.5)).to eq(:high)
|
|
143
|
+
end
|
|
144
|
+
end
|
|
145
|
+
end
|