lex-agentic-integration 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-integration.gemspec +30 -0
- data/lib/legion/extensions/agentic/integration/boundary/client.rb +15 -0
- data/lib/legion/extensions/agentic/integration/boundary/helpers/boundary.rb +90 -0
- data/lib/legion/extensions/agentic/integration/boundary/helpers/boundary_engine.rb +123 -0
- data/lib/legion/extensions/agentic/integration/boundary/helpers/constants.rb +44 -0
- data/lib/legion/extensions/agentic/integration/boundary/runners/cognitive_boundary.rb +100 -0
- data/lib/legion/extensions/agentic/integration/boundary/version.rb +13 -0
- data/lib/legion/extensions/agentic/integration/boundary.rb +19 -0
- data/lib/legion/extensions/agentic/integration/context/client.rb +26 -0
- data/lib/legion/extensions/agentic/integration/context/helpers/constants.rb +34 -0
- data/lib/legion/extensions/agentic/integration/context/helpers/context_manager.rb +150 -0
- data/lib/legion/extensions/agentic/integration/context/helpers/frame.rb +99 -0
- data/lib/legion/extensions/agentic/integration/context/runners/context.rb +94 -0
- data/lib/legion/extensions/agentic/integration/context/version.rb +13 -0
- data/lib/legion/extensions/agentic/integration/context.rb +19 -0
- data/lib/legion/extensions/agentic/integration/distributed_cognition/client.rb +19 -0
- data/lib/legion/extensions/agentic/integration/distributed_cognition/helpers/constants.rb +51 -0
- data/lib/legion/extensions/agentic/integration/distributed_cognition/helpers/distribution_engine.rb +159 -0
- data/lib/legion/extensions/agentic/integration/distributed_cognition/helpers/participant.rb +100 -0
- data/lib/legion/extensions/agentic/integration/distributed_cognition/runners/distributed_cognition.rb +107 -0
- data/lib/legion/extensions/agentic/integration/distributed_cognition/version.rb +13 -0
- data/lib/legion/extensions/agentic/integration/distributed_cognition.rb +19 -0
- data/lib/legion/extensions/agentic/integration/gestalt/client.rb +21 -0
- data/lib/legion/extensions/agentic/integration/gestalt/helpers/constants.rb +51 -0
- data/lib/legion/extensions/agentic/integration/gestalt/helpers/pattern.rb +90 -0
- data/lib/legion/extensions/agentic/integration/gestalt/helpers/pattern_store.rb +123 -0
- data/lib/legion/extensions/agentic/integration/gestalt/runners/gestalt.rb +82 -0
- data/lib/legion/extensions/agentic/integration/gestalt/version.rb +13 -0
- data/lib/legion/extensions/agentic/integration/gestalt.rb +19 -0
- data/lib/legion/extensions/agentic/integration/global_workspace/actors/competition.rb +45 -0
- data/lib/legion/extensions/agentic/integration/global_workspace/client.rb +29 -0
- data/lib/legion/extensions/agentic/integration/global_workspace/helpers/broadcast.rb +62 -0
- data/lib/legion/extensions/agentic/integration/global_workspace/helpers/competitor.rb +59 -0
- data/lib/legion/extensions/agentic/integration/global_workspace/helpers/constants.rb +65 -0
- data/lib/legion/extensions/agentic/integration/global_workspace/helpers/workspace.rb +188 -0
- data/lib/legion/extensions/agentic/integration/global_workspace/runners/global_workspace.rb +104 -0
- data/lib/legion/extensions/agentic/integration/global_workspace/version.rb +13 -0
- data/lib/legion/extensions/agentic/integration/global_workspace.rb +20 -0
- data/lib/legion/extensions/agentic/integration/integration/client.rb +19 -0
- data/lib/legion/extensions/agentic/integration/integration/helpers/constants.rb +62 -0
- data/lib/legion/extensions/agentic/integration/integration/helpers/integrated_representation.rb +106 -0
- data/lib/legion/extensions/agentic/integration/integration/helpers/integration_engine.rb +163 -0
- data/lib/legion/extensions/agentic/integration/integration/helpers/modal_signal.rb +62 -0
- data/lib/legion/extensions/agentic/integration/integration/runners/cognitive_integration.rb +105 -0
- data/lib/legion/extensions/agentic/integration/integration/version.rb +13 -0
- data/lib/legion/extensions/agentic/integration/integration.rb +20 -0
- data/lib/legion/extensions/agentic/integration/labyrinth/actors/thread_walker.rb +45 -0
- data/lib/legion/extensions/agentic/integration/labyrinth/client.rb +23 -0
- data/lib/legion/extensions/agentic/integration/labyrinth/helpers/constants.rb +39 -0
- data/lib/legion/extensions/agentic/integration/labyrinth/helpers/labyrinth.rb +138 -0
- data/lib/legion/extensions/agentic/integration/labyrinth/helpers/labyrinth_engine.rb +177 -0
- data/lib/legion/extensions/agentic/integration/labyrinth/helpers/node.rb +64 -0
- data/lib/legion/extensions/agentic/integration/labyrinth/runners/cognitive_labyrinth.rb +128 -0
- data/lib/legion/extensions/agentic/integration/labyrinth/version.rb +13 -0
- data/lib/legion/extensions/agentic/integration/labyrinth.rb +22 -0
- data/lib/legion/extensions/agentic/integration/map/actors/decay.rb +45 -0
- data/lib/legion/extensions/agentic/integration/map/client.rb +29 -0
- data/lib/legion/extensions/agentic/integration/map/helpers/cognitive_map_store.rb +179 -0
- data/lib/legion/extensions/agentic/integration/map/helpers/constants.rb +71 -0
- data/lib/legion/extensions/agentic/integration/map/helpers/graph_traversal.rb +124 -0
- data/lib/legion/extensions/agentic/integration/map/helpers/location.rb +71 -0
- data/lib/legion/extensions/agentic/integration/map/runners/cognitive_map.rb +95 -0
- data/lib/legion/extensions/agentic/integration/map/version.rb +13 -0
- data/lib/legion/extensions/agentic/integration/map.rb +20 -0
- data/lib/legion/extensions/agentic/integration/mosaic/client.rb +15 -0
- data/lib/legion/extensions/agentic/integration/mosaic/helpers/constants.rb +55 -0
- data/lib/legion/extensions/agentic/integration/mosaic/helpers/mosaic.rb +111 -0
- data/lib/legion/extensions/agentic/integration/mosaic/helpers/mosaic_engine.rb +124 -0
- data/lib/legion/extensions/agentic/integration/mosaic/helpers/tessera.rb +86 -0
- data/lib/legion/extensions/agentic/integration/mosaic/runners/cognitive_mosaic.rb +76 -0
- data/lib/legion/extensions/agentic/integration/mosaic/version.rb +13 -0
- data/lib/legion/extensions/agentic/integration/mosaic.rb +22 -0
- data/lib/legion/extensions/agentic/integration/mycelium/client.rb +19 -0
- data/lib/legion/extensions/agentic/integration/mycelium/helpers/constants.rb +52 -0
- data/lib/legion/extensions/agentic/integration/mycelium/helpers/fruiting_body.rb +50 -0
- data/lib/legion/extensions/agentic/integration/mycelium/helpers/hypha.rb +76 -0
- data/lib/legion/extensions/agentic/integration/mycelium/helpers/mycelial_node.rb +72 -0
- data/lib/legion/extensions/agentic/integration/mycelium/helpers/mycelium_engine.rb +151 -0
- data/lib/legion/extensions/agentic/integration/mycelium/runners/cognitive_mycelium.rb +73 -0
- data/lib/legion/extensions/agentic/integration/mycelium/version.rb +13 -0
- data/lib/legion/extensions/agentic/integration/mycelium.rb +23 -0
- data/lib/legion/extensions/agentic/integration/phenomenal_binding/client.rb +25 -0
- data/lib/legion/extensions/agentic/integration/phenomenal_binding/helpers/binding_engine.rb +156 -0
- data/lib/legion/extensions/agentic/integration/phenomenal_binding/helpers/binding_unit.rb +72 -0
- data/lib/legion/extensions/agentic/integration/phenomenal_binding/helpers/constants.rb +35 -0
- data/lib/legion/extensions/agentic/integration/phenomenal_binding/helpers/stream.rb +51 -0
- data/lib/legion/extensions/agentic/integration/phenomenal_binding/runners/phenomenal_binding.rb +110 -0
- data/lib/legion/extensions/agentic/integration/phenomenal_binding/version.rb +13 -0
- data/lib/legion/extensions/agentic/integration/phenomenal_binding.rb +20 -0
- data/lib/legion/extensions/agentic/integration/qualia/client.rb +19 -0
- data/lib/legion/extensions/agentic/integration/qualia/helpers/constants.rb +74 -0
- data/lib/legion/extensions/agentic/integration/qualia/helpers/quale.rb +103 -0
- data/lib/legion/extensions/agentic/integration/qualia/helpers/qualia_engine.rb +142 -0
- data/lib/legion/extensions/agentic/integration/qualia/runners/qualia.rb +67 -0
- data/lib/legion/extensions/agentic/integration/qualia/version.rb +13 -0
- data/lib/legion/extensions/agentic/integration/qualia.rb +19 -0
- data/lib/legion/extensions/agentic/integration/situation_model/client.rb +28 -0
- data/lib/legion/extensions/agentic/integration/situation_model/helpers/client.rb +23 -0
- data/lib/legion/extensions/agentic/integration/situation_model/helpers/constants.rb +40 -0
- data/lib/legion/extensions/agentic/integration/situation_model/helpers/situation_engine.rb +73 -0
- data/lib/legion/extensions/agentic/integration/situation_model/helpers/situation_event.rb +56 -0
- data/lib/legion/extensions/agentic/integration/situation_model/helpers/situation_model.rb +90 -0
- data/lib/legion/extensions/agentic/integration/situation_model/runners/situation_model.rb +99 -0
- data/lib/legion/extensions/agentic/integration/situation_model/version.rb +13 -0
- data/lib/legion/extensions/agentic/integration/situation_model.rb +21 -0
- data/lib/legion/extensions/agentic/integration/synthesis/client.rb +29 -0
- data/lib/legion/extensions/agentic/integration/synthesis/helpers/constants.rb +41 -0
- data/lib/legion/extensions/agentic/integration/synthesis/helpers/synthesis.rb +63 -0
- data/lib/legion/extensions/agentic/integration/synthesis/helpers/synthesis_engine.rb +213 -0
- data/lib/legion/extensions/agentic/integration/synthesis/helpers/synthesis_stream.rb +67 -0
- data/lib/legion/extensions/agentic/integration/synthesis/runners/cognitive_synthesis.rb +82 -0
- data/lib/legion/extensions/agentic/integration/synthesis/version.rb +13 -0
- data/lib/legion/extensions/agentic/integration/synthesis.rb +20 -0
- data/lib/legion/extensions/agentic/integration/tapestry/client.rb +15 -0
- data/lib/legion/extensions/agentic/integration/tapestry/helpers/constants.rb +46 -0
- data/lib/legion/extensions/agentic/integration/tapestry/helpers/loom_engine.rb +125 -0
- data/lib/legion/extensions/agentic/integration/tapestry/helpers/tapestry.rb +144 -0
- data/lib/legion/extensions/agentic/integration/tapestry/helpers/thread.rb +112 -0
- data/lib/legion/extensions/agentic/integration/tapestry/runners/cognitive_tapestry.rb +81 -0
- data/lib/legion/extensions/agentic/integration/tapestry/version.rb +13 -0
- data/lib/legion/extensions/agentic/integration/tapestry.rb +22 -0
- data/lib/legion/extensions/agentic/integration/tessellation/client.rb +19 -0
- data/lib/legion/extensions/agentic/integration/tessellation/helpers/constants.rb +72 -0
- data/lib/legion/extensions/agentic/integration/tessellation/helpers/mosaic.rb +99 -0
- data/lib/legion/extensions/agentic/integration/tessellation/helpers/tessellation_engine.rb +141 -0
- data/lib/legion/extensions/agentic/integration/tessellation/helpers/tile.rb +76 -0
- data/lib/legion/extensions/agentic/integration/tessellation/runners/cognitive_tessellation.rb +58 -0
- data/lib/legion/extensions/agentic/integration/tessellation/version.rb +13 -0
- data/lib/legion/extensions/agentic/integration/tessellation.rb +22 -0
- data/lib/legion/extensions/agentic/integration/version.rb +11 -0
- data/lib/legion/extensions/agentic/integration/zeitgeist/helpers/client.rb +17 -0
- data/lib/legion/extensions/agentic/integration/zeitgeist/helpers/cognitive_signal.rb +38 -0
- data/lib/legion/extensions/agentic/integration/zeitgeist/helpers/constants.rb +64 -0
- data/lib/legion/extensions/agentic/integration/zeitgeist/helpers/trend_window.rb +80 -0
- data/lib/legion/extensions/agentic/integration/zeitgeist/helpers/zeitgeist_engine.rb +157 -0
- data/lib/legion/extensions/agentic/integration/zeitgeist/runners/cognitive_zeitgeist.rb +99 -0
- data/lib/legion/extensions/agentic/integration/zeitgeist/version.rb +13 -0
- data/lib/legion/extensions/agentic/integration/zeitgeist.rb +22 -0
- data/lib/legion/extensions/agentic/integration.rb +34 -0
- data/spec/legion/extensions/agentic/integration/boundary/helpers/boundary_engine_spec.rb +165 -0
- data/spec/legion/extensions/agentic/integration/boundary/helpers/boundary_spec.rb +168 -0
- data/spec/legion/extensions/agentic/integration/boundary/helpers/constants_spec.rb +65 -0
- data/spec/legion/extensions/agentic/integration/boundary/runners/cognitive_boundary_spec.rb +111 -0
- data/spec/legion/extensions/agentic/integration/context/client_spec.rb +58 -0
- data/spec/legion/extensions/agentic/integration/context/helpers/constants_spec.rb +32 -0
- data/spec/legion/extensions/agentic/integration/context/helpers/context_manager_spec.rb +190 -0
- data/spec/legion/extensions/agentic/integration/context/helpers/frame_spec.rb +164 -0
- data/spec/legion/extensions/agentic/integration/context/runners/context_spec.rb +142 -0
- data/spec/legion/extensions/agentic/integration/distributed_cognition/client_spec.rb +21 -0
- data/spec/legion/extensions/agentic/integration/distributed_cognition/helpers/distribution_engine_spec.rb +149 -0
- data/spec/legion/extensions/agentic/integration/distributed_cognition/helpers/participant_spec.rb +116 -0
- data/spec/legion/extensions/agentic/integration/distributed_cognition/runners/distributed_cognition_spec.rb +102 -0
- data/spec/legion/extensions/agentic/integration/gestalt/client_spec.rb +53 -0
- data/spec/legion/extensions/agentic/integration/gestalt/helpers/constants_spec.rb +27 -0
- data/spec/legion/extensions/agentic/integration/gestalt/helpers/pattern_spec.rb +128 -0
- data/spec/legion/extensions/agentic/integration/gestalt/helpers/pattern_store_spec.rb +155 -0
- data/spec/legion/extensions/agentic/integration/gestalt/runners/gestalt_spec.rb +114 -0
- data/spec/legion/extensions/agentic/integration/global_workspace/client_spec.rb +49 -0
- data/spec/legion/extensions/agentic/integration/global_workspace/helpers/broadcast_spec.rb +83 -0
- data/spec/legion/extensions/agentic/integration/global_workspace/helpers/competitor_spec.rb +84 -0
- data/spec/legion/extensions/agentic/integration/global_workspace/helpers/workspace_spec.rb +174 -0
- data/spec/legion/extensions/agentic/integration/global_workspace/runners/global_workspace_spec.rb +118 -0
- data/spec/legion/extensions/agentic/integration/integration/cognitive_integration_spec.rb +7 -0
- data/spec/legion/extensions/agentic/integration/integration/helpers/integrated_representation_spec.rb +149 -0
- data/spec/legion/extensions/agentic/integration/integration/helpers/integration_engine_spec.rb +191 -0
- data/spec/legion/extensions/agentic/integration/integration/helpers/modal_signal_spec.rb +81 -0
- data/spec/legion/extensions/agentic/integration/labyrinth/client_spec.rb +122 -0
- data/spec/legion/extensions/agentic/integration/labyrinth/cognitive_labyrinth_spec.rb +19 -0
- data/spec/legion/extensions/agentic/integration/labyrinth/helpers/constants_spec.rb +72 -0
- data/spec/legion/extensions/agentic/integration/labyrinth/helpers/labyrinth_engine_spec.rb +222 -0
- data/spec/legion/extensions/agentic/integration/labyrinth/helpers/labyrinth_spec.rb +235 -0
- data/spec/legion/extensions/agentic/integration/labyrinth/helpers/node_spec.rb +157 -0
- data/spec/legion/extensions/agentic/integration/labyrinth/runners/cognitive_labyrinth_spec.rb +209 -0
- data/spec/legion/extensions/agentic/integration/map/client_spec.rb +89 -0
- data/spec/legion/extensions/agentic/integration/map/helpers/cognitive_map_store_spec.rb +321 -0
- data/spec/legion/extensions/agentic/integration/map/helpers/location_spec.rb +165 -0
- data/spec/legion/extensions/agentic/integration/map/runners/cognitive_map_spec.rb +190 -0
- data/spec/legion/extensions/agentic/integration/mosaic/client_spec.rb +16 -0
- data/spec/legion/extensions/agentic/integration/mosaic/helpers/constants_spec.rb +37 -0
- data/spec/legion/extensions/agentic/integration/mosaic/helpers/mosaic_engine_spec.rb +108 -0
- data/spec/legion/extensions/agentic/integration/mosaic/helpers/mosaic_spec.rb +120 -0
- data/spec/legion/extensions/agentic/integration/mosaic/helpers/tessera_spec.rb +92 -0
- data/spec/legion/extensions/agentic/integration/mosaic/runners/cognitive_mosaic_spec.rb +88 -0
- data/spec/legion/extensions/agentic/integration/mycelium/client_spec.rb +25 -0
- data/spec/legion/extensions/agentic/integration/mycelium/cognitive_mycelium_spec.rb +7 -0
- data/spec/legion/extensions/agentic/integration/mycelium/helpers/constants_spec.rb +28 -0
- data/spec/legion/extensions/agentic/integration/mycelium/helpers/fruiting_body_spec.rb +33 -0
- data/spec/legion/extensions/agentic/integration/mycelium/helpers/hypha_spec.rb +69 -0
- data/spec/legion/extensions/agentic/integration/mycelium/helpers/mycelial_node_spec.rb +79 -0
- data/spec/legion/extensions/agentic/integration/mycelium/helpers/mycelium_engine_spec.rb +136 -0
- data/spec/legion/extensions/agentic/integration/mycelium/runners/cognitive_mycelium_spec.rb +61 -0
- data/spec/legion/extensions/agentic/integration/phenomenal_binding/client_spec.rb +52 -0
- data/spec/legion/extensions/agentic/integration/phenomenal_binding/helpers/binding_engine_spec.rb +290 -0
- data/spec/legion/extensions/agentic/integration/phenomenal_binding/helpers/binding_unit_spec.rb +195 -0
- data/spec/legion/extensions/agentic/integration/phenomenal_binding/helpers/constants_spec.rb +92 -0
- data/spec/legion/extensions/agentic/integration/phenomenal_binding/helpers/stream_spec.rb +128 -0
- data/spec/legion/extensions/agentic/integration/phenomenal_binding/runners/phenomenal_binding_spec.rb +174 -0
- data/spec/legion/extensions/agentic/integration/qualia/client_spec.rb +21 -0
- data/spec/legion/extensions/agentic/integration/qualia/helpers/quale_spec.rb +168 -0
- data/spec/legion/extensions/agentic/integration/qualia/helpers/qualia_engine_spec.rb +174 -0
- data/spec/legion/extensions/agentic/integration/qualia/qualia_spec.rb +7 -0
- data/spec/legion/extensions/agentic/integration/qualia/runners_spec.rb +70 -0
- data/spec/legion/extensions/agentic/integration/situation_model/client_spec.rb +51 -0
- data/spec/legion/extensions/agentic/integration/situation_model/helpers/constants_spec.rb +56 -0
- data/spec/legion/extensions/agentic/integration/situation_model/helpers/situation_engine_spec.rb +203 -0
- data/spec/legion/extensions/agentic/integration/situation_model/helpers/situation_event_spec.rb +94 -0
- data/spec/legion/extensions/agentic/integration/situation_model/helpers/situation_model_spec.rb +235 -0
- data/spec/legion/extensions/agentic/integration/situation_model/runners/situation_model_spec.rb +204 -0
- data/spec/legion/extensions/agentic/integration/synthesis/client_spec.rb +26 -0
- data/spec/legion/extensions/agentic/integration/synthesis/helpers/constants_spec.rb +87 -0
- data/spec/legion/extensions/agentic/integration/synthesis/helpers/synthesis_engine_spec.rb +233 -0
- data/spec/legion/extensions/agentic/integration/synthesis/helpers/synthesis_spec.rb +101 -0
- data/spec/legion/extensions/agentic/integration/synthesis/helpers/synthesis_stream_spec.rb +116 -0
- data/spec/legion/extensions/agentic/integration/synthesis/runners/cognitive_synthesis_spec.rb +181 -0
- data/spec/legion/extensions/agentic/integration/tapestry/client_spec.rb +55 -0
- data/spec/legion/extensions/agentic/integration/tapestry/helpers/constants_spec.rb +88 -0
- data/spec/legion/extensions/agentic/integration/tapestry/helpers/loom_engine_spec.rb +225 -0
- data/spec/legion/extensions/agentic/integration/tapestry/helpers/tapestry_spec.rb +229 -0
- data/spec/legion/extensions/agentic/integration/tapestry/helpers/thread_spec.rb +211 -0
- data/spec/legion/extensions/agentic/integration/tapestry/runners/cognitive_tapestry_spec.rb +171 -0
- data/spec/legion/extensions/agentic/integration/tessellation/client_spec.rb +40 -0
- data/spec/legion/extensions/agentic/integration/tessellation/helpers/mosaic_spec.rb +99 -0
- data/spec/legion/extensions/agentic/integration/tessellation/helpers/tessellation_engine_spec.rb +145 -0
- data/spec/legion/extensions/agentic/integration/tessellation/helpers/tile_spec.rb +138 -0
- data/spec/legion/extensions/agentic/integration/zeitgeist/helpers/cognitive_signal_spec.rb +62 -0
- data/spec/legion/extensions/agentic/integration/zeitgeist/helpers/constants_spec.rb +73 -0
- data/spec/legion/extensions/agentic/integration/zeitgeist/helpers/trend_window_spec.rb +100 -0
- data/spec/legion/extensions/agentic/integration/zeitgeist/helpers/zeitgeist_engine_spec.rb +163 -0
- data/spec/legion/extensions/agentic/integration/zeitgeist/runners/cognitive_zeitgeist_spec.rb +165 -0
- data/spec/spec_helper.rb +46 -0
- metadata +320 -0
data/lib/legion/extensions/agentic/integration/integration/helpers/integrated_representation.rb
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'securerandom'
|
|
4
|
+
|
|
5
|
+
module Legion
|
|
6
|
+
module Extensions
|
|
7
|
+
module Agentic
|
|
8
|
+
module Integration
|
|
9
|
+
module Integration
|
|
10
|
+
module Helpers
|
|
11
|
+
class IntegratedRepresentation
|
|
12
|
+
include Constants
|
|
13
|
+
|
|
14
|
+
attr_reader :id, :signal_ids, :modalities, :binding_strength,
|
|
15
|
+
:coherence, :created_at
|
|
16
|
+
|
|
17
|
+
def initialize(signals:)
|
|
18
|
+
@id = SecureRandom.uuid
|
|
19
|
+
@signal_ids = signals.map(&:id)
|
|
20
|
+
@modalities = signals.map(&:modality).uniq
|
|
21
|
+
@binding_strength = compute_binding(signals)
|
|
22
|
+
@coherence = compute_coherence(signals)
|
|
23
|
+
@reinforcement_count = 0
|
|
24
|
+
@created_at = Time.now.utc
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def reinforce!
|
|
28
|
+
@binding_strength = (@binding_strength + REINFORCEMENT_RATE).clamp(0.0, 1.0).round(10)
|
|
29
|
+
@reinforcement_count += 1
|
|
30
|
+
self
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def decay!
|
|
34
|
+
@binding_strength = (@binding_strength - BINDING_DECAY_RATE).clamp(0.0, 1.0).round(10)
|
|
35
|
+
self
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def disrupt!(amount: CONFLICT_PENALTY)
|
|
39
|
+
@binding_strength = (@binding_strength - amount).clamp(0.0, 1.0).round(10)
|
|
40
|
+
@coherence = (@coherence - (amount * 0.5)).clamp(0.0, 1.0).round(10)
|
|
41
|
+
self
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def modal_count = @modalities.size
|
|
45
|
+
def multi_modal? = @modalities.size > 1
|
|
46
|
+
def coherent? = @coherence >= COHERENT_THRESHOLD
|
|
47
|
+
def fragmented? = @coherence < FRAGMENTED_THRESHOLD
|
|
48
|
+
|
|
49
|
+
def binding_label
|
|
50
|
+
match = BINDING_LABELS.find { |range, _| range.cover?(@binding_strength) }
|
|
51
|
+
match ? match.last : :unbound
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def quality_label
|
|
55
|
+
score = ((@binding_strength * 0.6) + (@coherence * 0.4)).round(10)
|
|
56
|
+
match = QUALITY_LABELS.find { |range, _| range.cover?(score) }
|
|
57
|
+
match ? match.last : :failed
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
def quality_score
|
|
61
|
+
((@binding_strength * 0.6) + (@coherence * 0.4)).round(10)
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
def to_h
|
|
65
|
+
{
|
|
66
|
+
id: @id,
|
|
67
|
+
signal_ids: @signal_ids,
|
|
68
|
+
modalities: @modalities,
|
|
69
|
+
modal_count: modal_count,
|
|
70
|
+
multi_modal: multi_modal?,
|
|
71
|
+
binding_strength: @binding_strength,
|
|
72
|
+
binding_label: binding_label,
|
|
73
|
+
coherence: @coherence,
|
|
74
|
+
coherent: coherent?,
|
|
75
|
+
fragmented: fragmented?,
|
|
76
|
+
quality_score: quality_score,
|
|
77
|
+
quality_label: quality_label,
|
|
78
|
+
reinforcement_count: @reinforcement_count,
|
|
79
|
+
created_at: @created_at
|
|
80
|
+
}
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
private
|
|
84
|
+
|
|
85
|
+
def compute_binding(signals)
|
|
86
|
+
return DEFAULT_BINDING_STRENGTH if signals.empty?
|
|
87
|
+
|
|
88
|
+
weights = signals.map(&:effective_weight)
|
|
89
|
+
(weights.sum / weights.size).round(10)
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
def compute_coherence(signals)
|
|
93
|
+
return 0.0 if signals.size < 2
|
|
94
|
+
|
|
95
|
+
confidences = signals.map(&:confidence)
|
|
96
|
+
mean = confidences.sum / confidences.size
|
|
97
|
+
variance = confidences.sum { |c| (c - mean)**2 } / confidences.size
|
|
98
|
+
(1.0 - Math.sqrt(variance)).clamp(0.0, 1.0).round(10)
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
end
|
|
105
|
+
end
|
|
106
|
+
end
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Legion
|
|
4
|
+
module Extensions
|
|
5
|
+
module Agentic
|
|
6
|
+
module Integration
|
|
7
|
+
module Integration
|
|
8
|
+
module Helpers
|
|
9
|
+
class IntegrationEngine
|
|
10
|
+
include Constants
|
|
11
|
+
|
|
12
|
+
def initialize
|
|
13
|
+
@signals = {}
|
|
14
|
+
@representations = {}
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def add_signal(modality:, content:, confidence: 0.5, salience: 0.5)
|
|
18
|
+
prune_signals_if_needed
|
|
19
|
+
signal = ModalSignal.new(modality: modality, content: content,
|
|
20
|
+
confidence: confidence, salience: salience)
|
|
21
|
+
@signals[signal.id] = signal
|
|
22
|
+
signal
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def remove_signal(signal_id:)
|
|
26
|
+
@signals.delete(signal_id)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def integrate(signal_ids:)
|
|
30
|
+
signals = signal_ids.filter_map { |sid| @signals[sid] }
|
|
31
|
+
return nil if signals.size < MIN_SIGNALS_FOR_BINDING
|
|
32
|
+
|
|
33
|
+
prune_representations_if_needed
|
|
34
|
+
rep = IntegratedRepresentation.new(signals: signals)
|
|
35
|
+
@representations[rep.id] = rep
|
|
36
|
+
rep
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def integrate_by_modalities(modalities:)
|
|
40
|
+
mods = modalities.map(&:to_sym)
|
|
41
|
+
matching = @signals.values.select { |s| mods.include?(s.modality) }
|
|
42
|
+
return nil if matching.size < MIN_SIGNALS_FOR_BINDING
|
|
43
|
+
|
|
44
|
+
integrate(signal_ids: matching.map(&:id))
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def integrate_all_salient
|
|
48
|
+
salient = @signals.values.select(&:salient?)
|
|
49
|
+
return nil if salient.size < MIN_SIGNALS_FOR_BINDING
|
|
50
|
+
|
|
51
|
+
integrate(signal_ids: salient.map(&:id))
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def reinforce(representation_id:)
|
|
55
|
+
rep = @representations[representation_id]
|
|
56
|
+
return nil unless rep
|
|
57
|
+
|
|
58
|
+
rep.reinforce!
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
def disrupt(representation_id:, amount: CONFLICT_PENALTY)
|
|
62
|
+
rep = @representations[representation_id]
|
|
63
|
+
return nil unless rep
|
|
64
|
+
|
|
65
|
+
rep.disrupt!(amount: amount)
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
def decay_all!
|
|
69
|
+
@representations.each_value(&:decay!)
|
|
70
|
+
prune_weak_representations
|
|
71
|
+
{ representations_remaining: @representations.size }
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
def signals_by_modality(modality:)
|
|
75
|
+
m = modality.to_sym
|
|
76
|
+
@signals.values.select { |s| s.modality == m }
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
def multi_modal_representations
|
|
80
|
+
@representations.values.select(&:multi_modal?)
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
def coherent_representations
|
|
84
|
+
@representations.values.select(&:coherent?)
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
def fragmented_representations
|
|
88
|
+
@representations.values.select(&:fragmented?)
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
def strongest_representations(limit: 5)
|
|
92
|
+
@representations.values.sort_by { |r| -r.binding_strength }.first(limit)
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
def average_binding_strength
|
|
96
|
+
return DEFAULT_BINDING_STRENGTH if @representations.empty?
|
|
97
|
+
|
|
98
|
+
vals = @representations.values.map(&:binding_strength)
|
|
99
|
+
(vals.sum / vals.size).round(10)
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
def average_coherence
|
|
103
|
+
return 0.5 if @representations.empty?
|
|
104
|
+
|
|
105
|
+
vals = @representations.values.map(&:coherence)
|
|
106
|
+
(vals.sum / vals.size).round(10)
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
def modality_coverage
|
|
110
|
+
@signals.values.map(&:modality).uniq
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
def integration_report
|
|
114
|
+
{
|
|
115
|
+
total_signals: @signals.size,
|
|
116
|
+
total_representations: @representations.size,
|
|
117
|
+
multi_modal_count: multi_modal_representations.size,
|
|
118
|
+
coherent_count: coherent_representations.size,
|
|
119
|
+
fragmented_count: fragmented_representations.size,
|
|
120
|
+
average_binding_strength: average_binding_strength,
|
|
121
|
+
average_coherence: average_coherence,
|
|
122
|
+
modality_coverage: modality_coverage,
|
|
123
|
+
strongest: strongest_representations(limit: 3).map(&:to_h)
|
|
124
|
+
}
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
def to_h
|
|
128
|
+
{
|
|
129
|
+
total_signals: @signals.size,
|
|
130
|
+
total_representations: @representations.size,
|
|
131
|
+
multi_modal_count: multi_modal_representations.size,
|
|
132
|
+
coherent_count: coherent_representations.size,
|
|
133
|
+
average_binding_strength: average_binding_strength,
|
|
134
|
+
average_coherence: average_coherence
|
|
135
|
+
}
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
private
|
|
139
|
+
|
|
140
|
+
def prune_signals_if_needed
|
|
141
|
+
return if @signals.size < MAX_SIGNALS
|
|
142
|
+
|
|
143
|
+
oldest = @signals.values.min_by(&:created_at)
|
|
144
|
+
@signals.delete(oldest.id) if oldest
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
def prune_representations_if_needed
|
|
148
|
+
return if @representations.size < MAX_REPRESENTATIONS
|
|
149
|
+
|
|
150
|
+
weakest = @representations.values.min_by(&:binding_strength)
|
|
151
|
+
@representations.delete(weakest.id) if weakest
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
def prune_weak_representations
|
|
155
|
+
@representations.reject! { |_, r| r.binding_strength <= 0.0 }
|
|
156
|
+
end
|
|
157
|
+
end
|
|
158
|
+
end
|
|
159
|
+
end
|
|
160
|
+
end
|
|
161
|
+
end
|
|
162
|
+
end
|
|
163
|
+
end
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'securerandom'
|
|
4
|
+
|
|
5
|
+
module Legion
|
|
6
|
+
module Extensions
|
|
7
|
+
module Agentic
|
|
8
|
+
module Integration
|
|
9
|
+
module Integration
|
|
10
|
+
module Helpers
|
|
11
|
+
class ModalSignal
|
|
12
|
+
include Constants
|
|
13
|
+
|
|
14
|
+
attr_reader :id, :modality, :content, :confidence, :salience,
|
|
15
|
+
:created_at
|
|
16
|
+
|
|
17
|
+
def initialize(modality:, content:, confidence: 0.5, salience: 0.5)
|
|
18
|
+
@id = SecureRandom.uuid
|
|
19
|
+
@modality = modality.to_sym
|
|
20
|
+
@content = content
|
|
21
|
+
@confidence = confidence.to_f.clamp(0.0, 1.0).round(10)
|
|
22
|
+
@salience = salience.to_f.clamp(0.0, 1.0).round(10)
|
|
23
|
+
@created_at = Time.now.utc
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def effective_weight
|
|
27
|
+
(@confidence * @salience).round(10)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def salient?
|
|
31
|
+
@salience >= 0.6
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def confident?
|
|
35
|
+
@confidence >= 0.6
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def confidence_label
|
|
39
|
+
match = CONFIDENCE_LABELS.find { |range, _| range.cover?(@confidence) }
|
|
40
|
+
match ? match.last : :uncertain
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def to_h
|
|
44
|
+
{
|
|
45
|
+
id: @id,
|
|
46
|
+
modality: @modality,
|
|
47
|
+
content: @content,
|
|
48
|
+
confidence: @confidence,
|
|
49
|
+
confidence_label: confidence_label,
|
|
50
|
+
salience: @salience,
|
|
51
|
+
effective_weight: effective_weight,
|
|
52
|
+
salient: salient?,
|
|
53
|
+
created_at: @created_at
|
|
54
|
+
}
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Legion
|
|
4
|
+
module Extensions
|
|
5
|
+
module Agentic
|
|
6
|
+
module Integration
|
|
7
|
+
module Integration
|
|
8
|
+
module Runners
|
|
9
|
+
module CognitiveIntegration
|
|
10
|
+
include Legion::Extensions::Helpers::Lex if defined?(Legion::Extensions::Helpers::Lex)
|
|
11
|
+
|
|
12
|
+
def add_signal(modality:, content:, confidence: 0.5, salience: 0.5, engine: nil, **)
|
|
13
|
+
eng = engine || default_engine
|
|
14
|
+
signal = eng.add_signal(modality: modality, content: content,
|
|
15
|
+
confidence: confidence, salience: salience)
|
|
16
|
+
{ success: true, signal: signal.to_h }
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def remove_signal(signal_id:, engine: nil, **)
|
|
20
|
+
eng = engine || default_engine
|
|
21
|
+
signal = eng.remove_signal(signal_id: signal_id)
|
|
22
|
+
return { success: false, error: 'signal not found' } unless signal
|
|
23
|
+
|
|
24
|
+
{ success: true, removed: signal.to_h }
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def integrate(signal_ids:, engine: nil, **)
|
|
28
|
+
eng = engine || default_engine
|
|
29
|
+
rep = eng.integrate(signal_ids: signal_ids)
|
|
30
|
+
return { success: false, error: 'insufficient signals for binding' } unless rep
|
|
31
|
+
|
|
32
|
+
{ success: true, representation: rep.to_h }
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def integrate_by_modalities(modalities:, engine: nil, **)
|
|
36
|
+
eng = engine || default_engine
|
|
37
|
+
rep = eng.integrate_by_modalities(modalities: modalities)
|
|
38
|
+
return { success: false, error: 'insufficient matching signals' } unless rep
|
|
39
|
+
|
|
40
|
+
{ success: true, representation: rep.to_h }
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def integrate_all_salient(engine: nil, **)
|
|
44
|
+
eng = engine || default_engine
|
|
45
|
+
rep = eng.integrate_all_salient
|
|
46
|
+
return { success: false, error: 'insufficient salient signals' } unless rep
|
|
47
|
+
|
|
48
|
+
{ success: true, representation: rep.to_h }
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def reinforce(representation_id:, engine: nil, **)
|
|
52
|
+
eng = engine || default_engine
|
|
53
|
+
rep = eng.reinforce(representation_id: representation_id)
|
|
54
|
+
return { success: false, error: 'representation not found' } unless rep
|
|
55
|
+
|
|
56
|
+
{ success: true, representation: rep.to_h }
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def disrupt(representation_id:, amount: nil, engine: nil, **)
|
|
60
|
+
eng = engine || default_engine
|
|
61
|
+
amt = amount || Helpers::Constants::CONFLICT_PENALTY
|
|
62
|
+
rep = eng.disrupt(representation_id: representation_id, amount: amt)
|
|
63
|
+
return { success: false, error: 'representation not found' } unless rep
|
|
64
|
+
|
|
65
|
+
{ success: true, representation: rep.to_h }
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
def decay(engine: nil, **)
|
|
69
|
+
eng = engine || default_engine
|
|
70
|
+
result = eng.decay_all!
|
|
71
|
+
{ success: true, **result }
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
def signals_by_modality(modality:, engine: nil, **)
|
|
75
|
+
eng = engine || default_engine
|
|
76
|
+
{ success: true, signals: eng.signals_by_modality(modality: modality).map(&:to_h) }
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
def coherent_representations(engine: nil, **)
|
|
80
|
+
eng = engine || default_engine
|
|
81
|
+
{ success: true, representations: eng.coherent_representations.map(&:to_h) }
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
def integration_report(engine: nil, **)
|
|
85
|
+
eng = engine || default_engine
|
|
86
|
+
{ success: true, report: eng.integration_report }
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
def status(engine: nil, **)
|
|
90
|
+
eng = engine || default_engine
|
|
91
|
+
{ success: true, **eng.to_h }
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
private
|
|
95
|
+
|
|
96
|
+
def default_engine
|
|
97
|
+
@default_engine ||= Helpers::IntegrationEngine.new
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
end
|
|
105
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative 'integration/version'
|
|
4
|
+
require_relative 'integration/helpers/constants'
|
|
5
|
+
require_relative 'integration/helpers/modal_signal'
|
|
6
|
+
require_relative 'integration/helpers/integrated_representation'
|
|
7
|
+
require_relative 'integration/helpers/integration_engine'
|
|
8
|
+
require_relative 'integration/runners/cognitive_integration'
|
|
9
|
+
require_relative 'integration/client'
|
|
10
|
+
|
|
11
|
+
module Legion
|
|
12
|
+
module Extensions
|
|
13
|
+
module Agentic
|
|
14
|
+
module Integration
|
|
15
|
+
module Integration
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'legion/extensions/actors/every'
|
|
4
|
+
|
|
5
|
+
module Legion
|
|
6
|
+
module Extensions
|
|
7
|
+
module Agentic
|
|
8
|
+
module Integration
|
|
9
|
+
module Labyrinth
|
|
10
|
+
module Actor
|
|
11
|
+
class ThreadWalker < Legion::Extensions::Actors::Every
|
|
12
|
+
def runner_class
|
|
13
|
+
Legion::Extensions::Agentic::Integration::Labyrinth::Runners::CognitiveLabyrinth
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def runner_function
|
|
17
|
+
'list_labyrinths'
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def time
|
|
21
|
+
600
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def run_now?
|
|
25
|
+
false
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def use_runner?
|
|
29
|
+
false
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def check_subtask?
|
|
33
|
+
false
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def generate_task?
|
|
37
|
+
false
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Legion
|
|
4
|
+
module Extensions
|
|
5
|
+
module Agentic
|
|
6
|
+
module Integration
|
|
7
|
+
module Labyrinth
|
|
8
|
+
class Client
|
|
9
|
+
include Runners::CognitiveLabyrinth
|
|
10
|
+
|
|
11
|
+
def initialize(**)
|
|
12
|
+
@labyrinth_engine = Helpers::LabyrinthEngine.new
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
private
|
|
16
|
+
|
|
17
|
+
attr_reader :labyrinth_engine
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Legion
|
|
4
|
+
module Extensions
|
|
5
|
+
module Agentic
|
|
6
|
+
module Integration
|
|
7
|
+
module Labyrinth
|
|
8
|
+
module Helpers
|
|
9
|
+
module Constants
|
|
10
|
+
NODE_TYPES = %i[corridor junction dead_end entrance exit minotaur_lair].freeze
|
|
11
|
+
|
|
12
|
+
MAX_LABYRINTHS = 20
|
|
13
|
+
MAX_NODES = 200
|
|
14
|
+
|
|
15
|
+
COMPLEXITY_LABELS = {
|
|
16
|
+
(0.0...0.2) => :trivial,
|
|
17
|
+
(0.2...0.4) => :simple,
|
|
18
|
+
(0.4...0.6) => :moderate,
|
|
19
|
+
(0.6...0.8) => :complex,
|
|
20
|
+
(0.8..1.0) => :labyrinthine
|
|
21
|
+
}.freeze
|
|
22
|
+
|
|
23
|
+
DANGER_LABELS = {
|
|
24
|
+
(0.0...0.25) => :safe,
|
|
25
|
+
(0.25...0.5) => :uncertain,
|
|
26
|
+
(0.5...0.75) => :hazardous,
|
|
27
|
+
(0.75..1.0) => :lethal
|
|
28
|
+
}.freeze
|
|
29
|
+
|
|
30
|
+
DEFAULT_DANGER_LEVEL = 0.0
|
|
31
|
+
MINOTAUR_DANGER_LEVEL = 0.9
|
|
32
|
+
DEAD_END_COMPLEXITY_HIT = 0.1
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|