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
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'legion/extensions/agentic/integration/global_workspace/helpers/constants'
|
|
4
|
+
require 'legion/extensions/agentic/integration/global_workspace/helpers/broadcast'
|
|
5
|
+
require 'legion/extensions/agentic/integration/global_workspace/helpers/competitor'
|
|
6
|
+
require 'legion/extensions/agentic/integration/global_workspace/helpers/workspace'
|
|
7
|
+
require 'legion/extensions/agentic/integration/global_workspace/runners/global_workspace'
|
|
8
|
+
|
|
9
|
+
module Legion
|
|
10
|
+
module Extensions
|
|
11
|
+
module Agentic
|
|
12
|
+
module Integration
|
|
13
|
+
module GlobalWorkspace
|
|
14
|
+
class Client
|
|
15
|
+
include Runners::GlobalWorkspace
|
|
16
|
+
|
|
17
|
+
def initialize(workspace: nil, **)
|
|
18
|
+
@workspace = workspace || Helpers::Workspace.new
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
private
|
|
22
|
+
|
|
23
|
+
attr_reader :workspace
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Legion
|
|
4
|
+
module Extensions
|
|
5
|
+
module Agentic
|
|
6
|
+
module Integration
|
|
7
|
+
module GlobalWorkspace
|
|
8
|
+
module Helpers
|
|
9
|
+
class Broadcast
|
|
10
|
+
include Constants
|
|
11
|
+
|
|
12
|
+
attr_reader :content, :source, :domain, :salience, :coalition,
|
|
13
|
+
:broadcast_at, :received_by
|
|
14
|
+
|
|
15
|
+
def initialize(content:, source:, domain:, salience:, coalition: [])
|
|
16
|
+
@content = content
|
|
17
|
+
@source = source
|
|
18
|
+
@domain = domain
|
|
19
|
+
@salience = salience.to_f.clamp(0.0, 1.0)
|
|
20
|
+
@coalition = Array(coalition).first(MAX_COALITION_SIZE)
|
|
21
|
+
@broadcast_at = Time.now.utc
|
|
22
|
+
@received_by = []
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def acknowledge(subscriber_id)
|
|
26
|
+
@received_by << subscriber_id unless @received_by.include?(subscriber_id)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def expired?
|
|
30
|
+
(Time.now.utc - @broadcast_at) > BROADCAST_TTL
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def age
|
|
34
|
+
Time.now.utc - @broadcast_at
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def label
|
|
38
|
+
SALIENCE_LABELS.each { |range, lbl| return lbl if range.cover?(@salience) }
|
|
39
|
+
:subliminal
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def to_h
|
|
43
|
+
{
|
|
44
|
+
content: @content,
|
|
45
|
+
source: @source,
|
|
46
|
+
domain: @domain,
|
|
47
|
+
salience: @salience.round(4),
|
|
48
|
+
label: label,
|
|
49
|
+
coalition: @coalition,
|
|
50
|
+
broadcast_at: @broadcast_at,
|
|
51
|
+
age: age.round(2),
|
|
52
|
+
received_by: @received_by.dup,
|
|
53
|
+
expired: expired?
|
|
54
|
+
}
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Legion
|
|
4
|
+
module Extensions
|
|
5
|
+
module Agentic
|
|
6
|
+
module Integration
|
|
7
|
+
module GlobalWorkspace
|
|
8
|
+
module Helpers
|
|
9
|
+
class Competitor
|
|
10
|
+
include Constants
|
|
11
|
+
|
|
12
|
+
attr_reader :content, :source, :domain, :coalition, :submitted_at
|
|
13
|
+
attr_accessor :salience, :urgency
|
|
14
|
+
|
|
15
|
+
def initialize(content:, source:, domain:, salience:, coalition: [])
|
|
16
|
+
@content = content
|
|
17
|
+
@source = source
|
|
18
|
+
@domain = domain
|
|
19
|
+
@salience = salience.to_f.clamp(0.0, 1.0)
|
|
20
|
+
@coalition = Array(coalition).first(MAX_COALITION_SIZE)
|
|
21
|
+
@urgency = 0.0
|
|
22
|
+
@submitted_at = Time.now.utc
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def effective_salience
|
|
26
|
+
(@salience + @urgency).clamp(0.0, 1.0)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def decay
|
|
30
|
+
@salience = [@salience - SALIENCE_DECAY, 0.0].max
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def boost_urgency
|
|
34
|
+
@urgency = [@urgency + URGENCY_BOOST, MAX_URGENCY].min
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def below_threshold?
|
|
38
|
+
effective_salience < COMPETITION_THRESHOLD
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def to_h
|
|
42
|
+
{
|
|
43
|
+
content: @content,
|
|
44
|
+
source: @source,
|
|
45
|
+
domain: @domain,
|
|
46
|
+
salience: @salience.round(4),
|
|
47
|
+
urgency: @urgency.round(4),
|
|
48
|
+
effective_salience: effective_salience.round(4),
|
|
49
|
+
coalition: @coalition,
|
|
50
|
+
submitted_at: @submitted_at
|
|
51
|
+
}
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Legion
|
|
4
|
+
module Extensions
|
|
5
|
+
module Agentic
|
|
6
|
+
module Integration
|
|
7
|
+
module GlobalWorkspace
|
|
8
|
+
module Helpers
|
|
9
|
+
module Constants
|
|
10
|
+
# Maximum items that can compete for the workspace in one cycle
|
|
11
|
+
MAX_COMPETITORS = 50
|
|
12
|
+
|
|
13
|
+
# Maximum broadcasts retained in history
|
|
14
|
+
MAX_BROADCAST_HISTORY = 200
|
|
15
|
+
|
|
16
|
+
# Maximum number of coalition members per broadcast
|
|
17
|
+
MAX_COALITION_SIZE = 10
|
|
18
|
+
|
|
19
|
+
# Minimum salience to enter competition
|
|
20
|
+
COMPETITION_THRESHOLD = 0.2
|
|
21
|
+
|
|
22
|
+
# Winner takes all — top competitor must exceed runner-up by this margin
|
|
23
|
+
DOMINANCE_MARGIN = 0.05
|
|
24
|
+
|
|
25
|
+
# How long a broadcast remains "conscious" (seconds)
|
|
26
|
+
BROADCAST_TTL = 10
|
|
27
|
+
|
|
28
|
+
# Salience decay per tick for waiting competitors
|
|
29
|
+
SALIENCE_DECAY = 0.02
|
|
30
|
+
|
|
31
|
+
# Urgency boost per tick for items that keep losing competition
|
|
32
|
+
URGENCY_BOOST = 0.01
|
|
33
|
+
|
|
34
|
+
# Maximum urgency accumulation
|
|
35
|
+
MAX_URGENCY = 0.5
|
|
36
|
+
|
|
37
|
+
# EMA alpha for workspace utilization tracking
|
|
38
|
+
UTILIZATION_ALPHA = 0.1
|
|
39
|
+
|
|
40
|
+
# Maximum registered subscribers
|
|
41
|
+
MAX_SUBSCRIBERS = 50
|
|
42
|
+
|
|
43
|
+
# Labels for workspace state
|
|
44
|
+
WORKSPACE_STATE_LABELS = {
|
|
45
|
+
broadcasting: 'actively broadcasting content',
|
|
46
|
+
idle: 'workspace empty, awaiting input',
|
|
47
|
+
contention: 'multiple items competing for access',
|
|
48
|
+
saturated: 'high utilization, processing backlog'
|
|
49
|
+
}.freeze
|
|
50
|
+
|
|
51
|
+
# Labels for broadcast salience
|
|
52
|
+
SALIENCE_LABELS = {
|
|
53
|
+
(0.8..) => :dominant,
|
|
54
|
+
(0.6...0.8) => :salient,
|
|
55
|
+
(0.4...0.6) => :moderate,
|
|
56
|
+
(0.2...0.4) => :marginal,
|
|
57
|
+
(..0.2) => :subliminal
|
|
58
|
+
}.freeze
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
end
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Legion
|
|
4
|
+
module Extensions
|
|
5
|
+
module Agentic
|
|
6
|
+
module Integration
|
|
7
|
+
module GlobalWorkspace
|
|
8
|
+
module Helpers
|
|
9
|
+
class Workspace
|
|
10
|
+
include Constants
|
|
11
|
+
|
|
12
|
+
attr_reader :competitors, :broadcast_history, :subscribers, :current_broadcast, :utilization
|
|
13
|
+
|
|
14
|
+
def initialize
|
|
15
|
+
@competitors = []
|
|
16
|
+
@broadcast_history = []
|
|
17
|
+
@subscribers = {} # id => { name:, domains: [] }
|
|
18
|
+
@current_broadcast = nil
|
|
19
|
+
@utilization = 0.0 # EMA of workspace usage
|
|
20
|
+
@competition_count = 0
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# --- Subscriber Management ---
|
|
24
|
+
|
|
25
|
+
def register_subscriber(id:, name:, domains: [])
|
|
26
|
+
return false if @subscribers.size >= MAX_SUBSCRIBERS && !@subscribers.key?(id)
|
|
27
|
+
|
|
28
|
+
@subscribers[id] = { name: name, domains: Array(domains), registered_at: Time.now.utc }
|
|
29
|
+
true
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def unregister_subscriber(id:)
|
|
33
|
+
!@subscribers.delete(id).nil?
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# --- Competition ---
|
|
37
|
+
|
|
38
|
+
def submit(content:, source:, domain:, salience:, coalition: [])
|
|
39
|
+
return nil if salience.to_f < COMPETITION_THRESHOLD
|
|
40
|
+
|
|
41
|
+
@competitors.shift while @competitors.size >= MAX_COMPETITORS
|
|
42
|
+
competitor = Competitor.new(
|
|
43
|
+
content: content,
|
|
44
|
+
source: source,
|
|
45
|
+
domain: domain,
|
|
46
|
+
salience: salience,
|
|
47
|
+
coalition: coalition
|
|
48
|
+
)
|
|
49
|
+
@competitors << competitor
|
|
50
|
+
competitor
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def compete
|
|
54
|
+
@competition_count += 1
|
|
55
|
+
expire_current_broadcast
|
|
56
|
+
prune_weak_competitors
|
|
57
|
+
|
|
58
|
+
return nil if @competitors.empty?
|
|
59
|
+
|
|
60
|
+
sorted = @competitors.sort_by { |c| -c.effective_salience }
|
|
61
|
+
winner = sorted.first
|
|
62
|
+
|
|
63
|
+
if sorted.size > 1
|
|
64
|
+
runner_up = sorted[1]
|
|
65
|
+
unless (winner.effective_salience - runner_up.effective_salience) >= DOMINANCE_MARGIN
|
|
66
|
+
boost_losers
|
|
67
|
+
update_utilization(busy: true)
|
|
68
|
+
return nil
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
@competitors.delete(winner)
|
|
73
|
+
broadcast = create_broadcast(winner)
|
|
74
|
+
@current_broadcast = broadcast
|
|
75
|
+
|
|
76
|
+
boost_losers
|
|
77
|
+
update_utilization(busy: true)
|
|
78
|
+
|
|
79
|
+
broadcast
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# --- Query ---
|
|
83
|
+
|
|
84
|
+
def conscious?(content)
|
|
85
|
+
return false unless @current_broadcast && !@current_broadcast.expired?
|
|
86
|
+
|
|
87
|
+
@current_broadcast.content == content
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
def current_content
|
|
91
|
+
return nil unless @current_broadcast && !@current_broadcast.expired?
|
|
92
|
+
|
|
93
|
+
@current_broadcast.to_h
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
def acknowledge(subscriber_id:)
|
|
97
|
+
return false unless @current_broadcast && !@current_broadcast.expired?
|
|
98
|
+
|
|
99
|
+
@current_broadcast.acknowledge(subscriber_id)
|
|
100
|
+
true
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# --- Workspace State ---
|
|
104
|
+
|
|
105
|
+
def state
|
|
106
|
+
if @current_broadcast && !@current_broadcast.expired?
|
|
107
|
+
:broadcasting
|
|
108
|
+
elsif @competitors.size > 1
|
|
109
|
+
:contention
|
|
110
|
+
elsif @utilization > 0.7
|
|
111
|
+
:saturated
|
|
112
|
+
else
|
|
113
|
+
:idle
|
|
114
|
+
end
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
def subscriber_count
|
|
118
|
+
@subscribers.size
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
def competitor_count
|
|
122
|
+
@competitors.size
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
# --- Tick / Maintenance ---
|
|
126
|
+
|
|
127
|
+
def tick
|
|
128
|
+
expire_current_broadcast
|
|
129
|
+
decay_competitors
|
|
130
|
+
prune_weak_competitors
|
|
131
|
+
update_utilization(busy: !@competitors.empty? || (@current_broadcast && !@current_broadcast.expired?))
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
def to_h
|
|
135
|
+
{
|
|
136
|
+
state: state,
|
|
137
|
+
state_label: WORKSPACE_STATE_LABELS[state],
|
|
138
|
+
subscribers: @subscribers.size,
|
|
139
|
+
competitors: @competitors.size,
|
|
140
|
+
broadcast_history: @broadcast_history.size,
|
|
141
|
+
utilization: @utilization.round(4),
|
|
142
|
+
competitions: @competition_count,
|
|
143
|
+
current_broadcast: @current_broadcast&.expired? == false ? @current_broadcast.to_h : nil
|
|
144
|
+
}
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
private
|
|
148
|
+
|
|
149
|
+
def create_broadcast(winner)
|
|
150
|
+
broadcast = Broadcast.new(
|
|
151
|
+
content: winner.content,
|
|
152
|
+
source: winner.source,
|
|
153
|
+
domain: winner.domain,
|
|
154
|
+
salience: winner.effective_salience,
|
|
155
|
+
coalition: winner.coalition
|
|
156
|
+
)
|
|
157
|
+
@broadcast_history << broadcast
|
|
158
|
+
@broadcast_history.shift while @broadcast_history.size > MAX_BROADCAST_HISTORY
|
|
159
|
+
broadcast
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
def expire_current_broadcast
|
|
163
|
+
@current_broadcast = nil if @current_broadcast&.expired?
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
def prune_weak_competitors
|
|
167
|
+
@competitors.reject!(&:below_threshold?)
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
def decay_competitors
|
|
171
|
+
@competitors.each(&:decay)
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
def boost_losers
|
|
175
|
+
@competitors.each(&:boost_urgency)
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
def update_utilization(busy:)
|
|
179
|
+
sample = busy ? 1.0 : 0.0
|
|
180
|
+
@utilization += (UTILIZATION_ALPHA * (sample - @utilization))
|
|
181
|
+
end
|
|
182
|
+
end
|
|
183
|
+
end
|
|
184
|
+
end
|
|
185
|
+
end
|
|
186
|
+
end
|
|
187
|
+
end
|
|
188
|
+
end
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Legion
|
|
4
|
+
module Extensions
|
|
5
|
+
module Agentic
|
|
6
|
+
module Integration
|
|
7
|
+
module GlobalWorkspace
|
|
8
|
+
module Runners
|
|
9
|
+
module GlobalWorkspace
|
|
10
|
+
include Legion::Extensions::Helpers::Lex if Legion::Extensions.const_defined?(:Helpers) &&
|
|
11
|
+
Legion::Extensions::Helpers.const_defined?(:Lex)
|
|
12
|
+
|
|
13
|
+
def submit_for_broadcast(content:, source:, domain:, salience:, coalition: [], **)
|
|
14
|
+
Legion::Logging.debug "[global_workspace] submit: source=#{source} domain=#{domain} salience=#{salience}"
|
|
15
|
+
competitor = workspace.submit(
|
|
16
|
+
content: content,
|
|
17
|
+
source: source,
|
|
18
|
+
domain: domain,
|
|
19
|
+
salience: salience,
|
|
20
|
+
coalition: coalition
|
|
21
|
+
)
|
|
22
|
+
if competitor
|
|
23
|
+
{ success: true, effective_salience: competitor.effective_salience.round(4),
|
|
24
|
+
competitors: workspace.competitor_count }
|
|
25
|
+
else
|
|
26
|
+
{ success: false, reason: :below_threshold, competitors: workspace.competitor_count }
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def run_competition(**)
|
|
31
|
+
Legion::Logging.debug '[global_workspace] run_competition'
|
|
32
|
+
broadcast = workspace.compete
|
|
33
|
+
if broadcast
|
|
34
|
+
{
|
|
35
|
+
success: true,
|
|
36
|
+
broadcast: broadcast.to_h,
|
|
37
|
+
state: workspace.state,
|
|
38
|
+
remaining: workspace.competitor_count
|
|
39
|
+
}
|
|
40
|
+
else
|
|
41
|
+
{ success: false, reason: :no_winner, state: workspace.state, competitors: workspace.competitor_count }
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def register_subscriber(id:, name:, domains: [], **)
|
|
46
|
+
Legion::Logging.debug "[global_workspace] register_subscriber: id=#{id} name=#{name}"
|
|
47
|
+
registered = workspace.register_subscriber(id: id, name: name, domains: domains)
|
|
48
|
+
{ success: registered, subscriber_count: workspace.subscriber_count }
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def unregister_subscriber(id:, **)
|
|
52
|
+
Legion::Logging.debug "[global_workspace] unregister_subscriber: id=#{id}"
|
|
53
|
+
removed = workspace.unregister_subscriber(id: id)
|
|
54
|
+
{ success: removed, subscriber_count: workspace.subscriber_count }
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def acknowledge_broadcast(subscriber_id:, **)
|
|
58
|
+
Legion::Logging.debug "[global_workspace] acknowledge: subscriber=#{subscriber_id}"
|
|
59
|
+
ack = workspace.acknowledge(subscriber_id: subscriber_id)
|
|
60
|
+
{ success: ack }
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def query_consciousness(content:, **)
|
|
64
|
+
is_conscious = workspace.conscious?(content)
|
|
65
|
+
Legion::Logging.debug "[global_workspace] conscious?(#{content}): #{is_conscious}"
|
|
66
|
+
{ success: true, conscious: is_conscious }
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
def current_broadcast(**)
|
|
70
|
+
content = workspace.current_content
|
|
71
|
+
Legion::Logging.debug "[global_workspace] current_broadcast: #{content ? 'active' : 'none'}"
|
|
72
|
+
{ success: true, broadcast: content }
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
def broadcast_history(limit: 10, **)
|
|
76
|
+
history = workspace.broadcast_history.last(limit.to_i).map(&:to_h)
|
|
77
|
+
Legion::Logging.debug "[global_workspace] history: #{history.size} entries"
|
|
78
|
+
{ success: true, history: history, total: workspace.broadcast_history.size }
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
def update_global_workspace(**)
|
|
82
|
+
Legion::Logging.debug '[global_workspace] tick'
|
|
83
|
+
workspace.tick
|
|
84
|
+
{ success: true, state: workspace.state, competitors: workspace.competitor_count,
|
|
85
|
+
utilization: workspace.utilization.round(4) }
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
def workspace_stats(**)
|
|
89
|
+
Legion::Logging.debug '[global_workspace] stats'
|
|
90
|
+
{ success: true, stats: workspace.to_h }
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
private
|
|
94
|
+
|
|
95
|
+
def workspace
|
|
96
|
+
@workspace ||= Helpers::Workspace.new
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'legion/extensions/agentic/integration/global_workspace/version'
|
|
4
|
+
require 'legion/extensions/agentic/integration/global_workspace/helpers/constants'
|
|
5
|
+
require 'legion/extensions/agentic/integration/global_workspace/helpers/broadcast'
|
|
6
|
+
require 'legion/extensions/agentic/integration/global_workspace/helpers/competitor'
|
|
7
|
+
require 'legion/extensions/agentic/integration/global_workspace/helpers/workspace'
|
|
8
|
+
require 'legion/extensions/agentic/integration/global_workspace/runners/global_workspace'
|
|
9
|
+
require 'legion/extensions/agentic/integration/global_workspace/client'
|
|
10
|
+
|
|
11
|
+
module Legion
|
|
12
|
+
module Extensions
|
|
13
|
+
module Agentic
|
|
14
|
+
module Integration
|
|
15
|
+
module GlobalWorkspace
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Legion
|
|
4
|
+
module Extensions
|
|
5
|
+
module Agentic
|
|
6
|
+
module Integration
|
|
7
|
+
module Integration
|
|
8
|
+
class Client
|
|
9
|
+
include Runners::CognitiveIntegration
|
|
10
|
+
|
|
11
|
+
def initialize(engine: nil)
|
|
12
|
+
@default_engine = engine || Helpers::IntegrationEngine.new
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,62 @@
|
|
|
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
|
+
module Constants
|
|
10
|
+
MAX_SIGNALS = 500
|
|
11
|
+
MAX_REPRESENTATIONS = 200
|
|
12
|
+
MIN_SIGNALS_FOR_BINDING = 2
|
|
13
|
+
|
|
14
|
+
# Modality types
|
|
15
|
+
MODALITIES = %i[
|
|
16
|
+
visual auditory semantic emotional motor
|
|
17
|
+
proprioceptive temporal spatial contextual
|
|
18
|
+
].freeze
|
|
19
|
+
|
|
20
|
+
# Binding dynamics
|
|
21
|
+
DEFAULT_BINDING_STRENGTH = 0.5
|
|
22
|
+
BINDING_DECAY_RATE = 0.03
|
|
23
|
+
REINFORCEMENT_RATE = 0.08
|
|
24
|
+
CONFLICT_PENALTY = 0.15
|
|
25
|
+
|
|
26
|
+
# Thresholds
|
|
27
|
+
COHERENT_THRESHOLD = 0.6
|
|
28
|
+
FRAGMENTED_THRESHOLD = 0.3
|
|
29
|
+
|
|
30
|
+
# Binding strength labels
|
|
31
|
+
BINDING_LABELS = {
|
|
32
|
+
(0.8..) => :tightly_bound,
|
|
33
|
+
(0.6...0.8) => :bound,
|
|
34
|
+
(0.4...0.6) => :loosely_bound,
|
|
35
|
+
(0.2...0.4) => :fragmentary,
|
|
36
|
+
(..0.2) => :unbound
|
|
37
|
+
}.freeze
|
|
38
|
+
|
|
39
|
+
# Signal confidence labels
|
|
40
|
+
CONFIDENCE_LABELS = {
|
|
41
|
+
(0.8..) => :certain,
|
|
42
|
+
(0.6...0.8) => :confident,
|
|
43
|
+
(0.4...0.6) => :moderate,
|
|
44
|
+
(0.2...0.4) => :low,
|
|
45
|
+
(..0.2) => :uncertain
|
|
46
|
+
}.freeze
|
|
47
|
+
|
|
48
|
+
# Integration quality labels
|
|
49
|
+
QUALITY_LABELS = {
|
|
50
|
+
(0.8..) => :excellent,
|
|
51
|
+
(0.6...0.8) => :good,
|
|
52
|
+
(0.4...0.6) => :adequate,
|
|
53
|
+
(0.2...0.4) => :poor,
|
|
54
|
+
(..0.2) => :failed
|
|
55
|
+
}.freeze
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|