lex-agentic-defense 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-defense.gemspec +30 -0
- data/lib/legion/extensions/agentic/defense/avalanche/client.rb +22 -0
- data/lib/legion/extensions/agentic/defense/avalanche/helpers/avalanche_engine.rb +132 -0
- data/lib/legion/extensions/agentic/defense/avalanche/helpers/cascade.rb +76 -0
- data/lib/legion/extensions/agentic/defense/avalanche/helpers/constants.rb +44 -0
- data/lib/legion/extensions/agentic/defense/avalanche/helpers/snowpack.rb +86 -0
- data/lib/legion/extensions/agentic/defense/avalanche/runners/cognitive_avalanche.rb +75 -0
- data/lib/legion/extensions/agentic/defense/avalanche/version.rb +13 -0
- data/lib/legion/extensions/agentic/defense/avalanche.rb +22 -0
- data/lib/legion/extensions/agentic/defense/bias/actors/update.rb +45 -0
- data/lib/legion/extensions/agentic/defense/bias/client.rb +30 -0
- data/lib/legion/extensions/agentic/defense/bias/helpers/bias_detector.rb +107 -0
- data/lib/legion/extensions/agentic/defense/bias/helpers/bias_event.rb +44 -0
- data/lib/legion/extensions/agentic/defense/bias/helpers/bias_store.rb +84 -0
- data/lib/legion/extensions/agentic/defense/bias/helpers/constants.rb +28 -0
- data/lib/legion/extensions/agentic/defense/bias/runners/bias.rb +151 -0
- data/lib/legion/extensions/agentic/defense/bias/version.rb +13 -0
- data/lib/legion/extensions/agentic/defense/bias.rb +20 -0
- data/lib/legion/extensions/agentic/defense/confabulation/actors/decay.rb +45 -0
- data/lib/legion/extensions/agentic/defense/confabulation/client.rb +28 -0
- data/lib/legion/extensions/agentic/defense/confabulation/helpers/claim.rb +67 -0
- data/lib/legion/extensions/agentic/defense/confabulation/helpers/confabulation_engine.rb +120 -0
- data/lib/legion/extensions/agentic/defense/confabulation/helpers/constants.rb +29 -0
- data/lib/legion/extensions/agentic/defense/confabulation/runners/confabulation.rb +74 -0
- data/lib/legion/extensions/agentic/defense/confabulation/version.rb +13 -0
- data/lib/legion/extensions/agentic/defense/confabulation.rb +19 -0
- data/lib/legion/extensions/agentic/defense/dissonance/client.rb +32 -0
- data/lib/legion/extensions/agentic/defense/dissonance/helpers/belief.rb +46 -0
- data/lib/legion/extensions/agentic/defense/dissonance/helpers/constants.rb +27 -0
- data/lib/legion/extensions/agentic/defense/dissonance/helpers/dissonance_event.rb +52 -0
- data/lib/legion/extensions/agentic/defense/dissonance/helpers/dissonance_model.rb +159 -0
- data/lib/legion/extensions/agentic/defense/dissonance/runners/dissonance.rb +163 -0
- data/lib/legion/extensions/agentic/defense/dissonance/version.rb +13 -0
- data/lib/legion/extensions/agentic/defense/dissonance.rb +20 -0
- data/lib/legion/extensions/agentic/defense/epistemic_vigilance/actors/update.rb +45 -0
- data/lib/legion/extensions/agentic/defense/epistemic_vigilance/client.rb +27 -0
- data/lib/legion/extensions/agentic/defense/epistemic_vigilance/helpers/claim.rb +78 -0
- data/lib/legion/extensions/agentic/defense/epistemic_vigilance/helpers/client.rb +23 -0
- data/lib/legion/extensions/agentic/defense/epistemic_vigilance/helpers/constants.rb +37 -0
- data/lib/legion/extensions/agentic/defense/epistemic_vigilance/helpers/source.rb +64 -0
- data/lib/legion/extensions/agentic/defense/epistemic_vigilance/helpers/vigilance_engine.rb +195 -0
- data/lib/legion/extensions/agentic/defense/epistemic_vigilance/runners/epistemic_vigilance.rb +91 -0
- data/lib/legion/extensions/agentic/defense/epistemic_vigilance/version.rb +13 -0
- data/lib/legion/extensions/agentic/defense/epistemic_vigilance.rb +20 -0
- data/lib/legion/extensions/agentic/defense/erosion/client.rb +23 -0
- data/lib/legion/extensions/agentic/defense/erosion/helpers/channel.rb +84 -0
- data/lib/legion/extensions/agentic/defense/erosion/helpers/constants.rb +47 -0
- data/lib/legion/extensions/agentic/defense/erosion/helpers/erosion_engine.rb +134 -0
- data/lib/legion/extensions/agentic/defense/erosion/helpers/formation.rb +100 -0
- data/lib/legion/extensions/agentic/defense/erosion/runners/cognitive_erosion.rb +93 -0
- data/lib/legion/extensions/agentic/defense/erosion/version.rb +13 -0
- data/lib/legion/extensions/agentic/defense/erosion.rb +21 -0
- data/lib/legion/extensions/agentic/defense/error_monitoring/actors/tick.rb +45 -0
- data/lib/legion/extensions/agentic/defense/error_monitoring/client.rb +28 -0
- data/lib/legion/extensions/agentic/defense/error_monitoring/helpers/constants.rb +50 -0
- data/lib/legion/extensions/agentic/defense/error_monitoring/helpers/error_monitor.rb +174 -0
- data/lib/legion/extensions/agentic/defense/error_monitoring/helpers/error_signal.rb +60 -0
- data/lib/legion/extensions/agentic/defense/error_monitoring/runners/error_monitoring.rb +102 -0
- data/lib/legion/extensions/agentic/defense/error_monitoring/version.rb +13 -0
- data/lib/legion/extensions/agentic/defense/error_monitoring.rb +19 -0
- data/lib/legion/extensions/agentic/defense/extinction/actors/protocol_monitor.rb +45 -0
- data/lib/legion/extensions/agentic/defense/extinction/client.rb +27 -0
- data/lib/legion/extensions/agentic/defense/extinction/helpers/levels.rb +43 -0
- data/lib/legion/extensions/agentic/defense/extinction/helpers/protocol_state.rb +125 -0
- data/lib/legion/extensions/agentic/defense/extinction/local_migrations/20260316000040_create_extinction_state.rb +13 -0
- data/lib/legion/extensions/agentic/defense/extinction/runners/extinction.rb +130 -0
- data/lib/legion/extensions/agentic/defense/extinction/version.rb +13 -0
- data/lib/legion/extensions/agentic/defense/extinction.rb +25 -0
- data/lib/legion/extensions/agentic/defense/friction/client.rb +15 -0
- data/lib/legion/extensions/agentic/defense/friction/helpers/constants.rb +38 -0
- data/lib/legion/extensions/agentic/defense/friction/helpers/friction_engine.rb +131 -0
- data/lib/legion/extensions/agentic/defense/friction/helpers/state_transition.rb +73 -0
- data/lib/legion/extensions/agentic/defense/friction/runners/cognitive_friction.rb +82 -0
- data/lib/legion/extensions/agentic/defense/friction/version.rb +13 -0
- data/lib/legion/extensions/agentic/defense/friction.rb +19 -0
- data/lib/legion/extensions/agentic/defense/immune_response/client.rb +19 -0
- data/lib/legion/extensions/agentic/defense/immune_response/helpers/antibody.rb +72 -0
- data/lib/legion/extensions/agentic/defense/immune_response/helpers/antigen.rb +87 -0
- data/lib/legion/extensions/agentic/defense/immune_response/helpers/constants.rb +75 -0
- data/lib/legion/extensions/agentic/defense/immune_response/helpers/immune_engine.rb +184 -0
- data/lib/legion/extensions/agentic/defense/immune_response/helpers/immune_response.rb +76 -0
- data/lib/legion/extensions/agentic/defense/immune_response/runners/cognitive_immune_response.rb +114 -0
- data/lib/legion/extensions/agentic/defense/immune_response/version.rb +13 -0
- data/lib/legion/extensions/agentic/defense/immune_response.rb +21 -0
- data/lib/legion/extensions/agentic/defense/immunology/client.rb +29 -0
- data/lib/legion/extensions/agentic/defense/immunology/helpers/antibody.rb +55 -0
- data/lib/legion/extensions/agentic/defense/immunology/helpers/constants.rb +43 -0
- data/lib/legion/extensions/agentic/defense/immunology/helpers/immune_engine.rb +187 -0
- data/lib/legion/extensions/agentic/defense/immunology/helpers/threat.rb +67 -0
- data/lib/legion/extensions/agentic/defense/immunology/runners/cognitive_immunology.rb +92 -0
- data/lib/legion/extensions/agentic/defense/immunology/version.rb +13 -0
- data/lib/legion/extensions/agentic/defense/immunology.rb +20 -0
- data/lib/legion/extensions/agentic/defense/phantom/client.rb +29 -0
- data/lib/legion/extensions/agentic/defense/phantom/helpers/constants.rb +54 -0
- data/lib/legion/extensions/agentic/defense/phantom/helpers/phantom_engine.rb +106 -0
- data/lib/legion/extensions/agentic/defense/phantom/helpers/phantom_limb.rb +103 -0
- data/lib/legion/extensions/agentic/defense/phantom/helpers/phantom_signal.rb +40 -0
- data/lib/legion/extensions/agentic/defense/phantom/runners/cognitive_phantom.rb +79 -0
- data/lib/legion/extensions/agentic/defense/phantom/version.rb +13 -0
- data/lib/legion/extensions/agentic/defense/phantom.rb +21 -0
- data/lib/legion/extensions/agentic/defense/quicksand/client.rb +15 -0
- data/lib/legion/extensions/agentic/defense/quicksand/helpers/constants.rb +48 -0
- data/lib/legion/extensions/agentic/defense/quicksand/helpers/pit.rb +82 -0
- data/lib/legion/extensions/agentic/defense/quicksand/helpers/quicksand_engine.rb +137 -0
- data/lib/legion/extensions/agentic/defense/quicksand/helpers/trap.rb +101 -0
- data/lib/legion/extensions/agentic/defense/quicksand/runners/cognitive_quicksand.rb +84 -0
- data/lib/legion/extensions/agentic/defense/quicksand/version.rb +13 -0
- data/lib/legion/extensions/agentic/defense/quicksand.rb +22 -0
- data/lib/legion/extensions/agentic/defense/quicksilver/client.rb +29 -0
- data/lib/legion/extensions/agentic/defense/quicksilver/helpers/constants.rb +50 -0
- data/lib/legion/extensions/agentic/defense/quicksilver/helpers/droplet.rb +126 -0
- data/lib/legion/extensions/agentic/defense/quicksilver/helpers/pool.rb +83 -0
- data/lib/legion/extensions/agentic/defense/quicksilver/helpers/quicksilver_engine.rb +124 -0
- data/lib/legion/extensions/agentic/defense/quicksilver/runners/cognitive_quicksilver.rb +130 -0
- data/lib/legion/extensions/agentic/defense/quicksilver/version.rb +13 -0
- data/lib/legion/extensions/agentic/defense/quicksilver.rb +21 -0
- data/lib/legion/extensions/agentic/defense/version.rb +11 -0
- data/lib/legion/extensions/agentic/defense/whirlpool/client.rb +65 -0
- data/lib/legion/extensions/agentic/defense/whirlpool/helpers/captured_thought.rb +67 -0
- data/lib/legion/extensions/agentic/defense/whirlpool/helpers/constants.rb +45 -0
- data/lib/legion/extensions/agentic/defense/whirlpool/helpers/vortex.rb +91 -0
- data/lib/legion/extensions/agentic/defense/whirlpool/helpers/whirlpool_engine.rb +92 -0
- data/lib/legion/extensions/agentic/defense/whirlpool/runners/cognitive_whirlpool.rb +117 -0
- data/lib/legion/extensions/agentic/defense/whirlpool/version.rb +13 -0
- data/lib/legion/extensions/agentic/defense/whirlpool.rb +22 -0
- data/lib/legion/extensions/agentic/defense.rb +32 -0
- data/spec/legion/extensions/agentic/defense/avalanche/client_spec.rb +96 -0
- data/spec/legion/extensions/agentic/defense/avalanche/helpers/avalanche_engine_spec.rb +276 -0
- data/spec/legion/extensions/agentic/defense/avalanche/helpers/cascade_spec.rb +190 -0
- data/spec/legion/extensions/agentic/defense/avalanche/helpers/constants_spec.rb +129 -0
- data/spec/legion/extensions/agentic/defense/avalanche/helpers/snowpack_spec.rb +197 -0
- data/spec/legion/extensions/agentic/defense/avalanche/runners/cognitive_avalanche_spec.rb +211 -0
- data/spec/legion/extensions/agentic/defense/bias/client_spec.rb +16 -0
- data/spec/legion/extensions/agentic/defense/bias/helpers/bias_detector_spec.rb +160 -0
- data/spec/legion/extensions/agentic/defense/bias/helpers/bias_event_spec.rb +64 -0
- data/spec/legion/extensions/agentic/defense/bias/helpers/bias_store_spec.rb +143 -0
- data/spec/legion/extensions/agentic/defense/bias/runners/bias_spec.rb +155 -0
- data/spec/legion/extensions/agentic/defense/confabulation/client_spec.rb +34 -0
- data/spec/legion/extensions/agentic/defense/confabulation/helpers/claim_spec.rb +119 -0
- data/spec/legion/extensions/agentic/defense/confabulation/helpers/confabulation_engine_spec.rb +163 -0
- data/spec/legion/extensions/agentic/defense/confabulation/helpers/constants_spec.rb +55 -0
- data/spec/legion/extensions/agentic/defense/confabulation/runners/confabulation_spec.rb +119 -0
- data/spec/legion/extensions/agentic/defense/dissonance/client_spec.rb +51 -0
- data/spec/legion/extensions/agentic/defense/dissonance/helpers/belief_spec.rb +103 -0
- data/spec/legion/extensions/agentic/defense/dissonance/helpers/constants_spec.rb +60 -0
- data/spec/legion/extensions/agentic/defense/dissonance/helpers/dissonance_event_spec.rb +113 -0
- data/spec/legion/extensions/agentic/defense/dissonance/helpers/dissonance_model_spec.rb +252 -0
- data/spec/legion/extensions/agentic/defense/dissonance/runners/dissonance_spec.rb +323 -0
- data/spec/legion/extensions/agentic/defense/epistemic_vigilance/client_spec.rb +28 -0
- data/spec/legion/extensions/agentic/defense/epistemic_vigilance/helpers/claim_spec.rb +135 -0
- data/spec/legion/extensions/agentic/defense/epistemic_vigilance/helpers/constants_spec.rb +59 -0
- data/spec/legion/extensions/agentic/defense/epistemic_vigilance/helpers/source_spec.rb +117 -0
- data/spec/legion/extensions/agentic/defense/epistemic_vigilance/helpers/vigilance_engine_spec.rb +273 -0
- data/spec/legion/extensions/agentic/defense/epistemic_vigilance/runners/epistemic_vigilance_spec.rb +157 -0
- data/spec/legion/extensions/agentic/defense/erosion/client_spec.rb +90 -0
- data/spec/legion/extensions/agentic/defense/erosion/helpers/channel_spec.rb +173 -0
- data/spec/legion/extensions/agentic/defense/erosion/helpers/constants_spec.rb +137 -0
- data/spec/legion/extensions/agentic/defense/erosion/helpers/erosion_engine_spec.rb +263 -0
- data/spec/legion/extensions/agentic/defense/erosion/helpers/formation_spec.rb +206 -0
- data/spec/legion/extensions/agentic/defense/erosion/runners/cognitive_erosion_spec.rb +153 -0
- data/spec/legion/extensions/agentic/defense/error_monitoring/client_spec.rb +40 -0
- data/spec/legion/extensions/agentic/defense/error_monitoring/helpers/error_monitor_spec.rb +178 -0
- data/spec/legion/extensions/agentic/defense/error_monitoring/helpers/error_signal_spec.rb +76 -0
- data/spec/legion/extensions/agentic/defense/error_monitoring/runners/error_monitoring_spec.rb +87 -0
- data/spec/legion/extensions/agentic/defense/extinction/actors/protocol_monitor_spec.rb +45 -0
- data/spec/legion/extensions/agentic/defense/extinction/client_spec.rb +13 -0
- data/spec/legion/extensions/agentic/defense/extinction/helpers/levels_spec.rb +180 -0
- data/spec/legion/extensions/agentic/defense/extinction/helpers/protocol_state_spec.rb +291 -0
- data/spec/legion/extensions/agentic/defense/extinction/local_persistence_spec.rb +188 -0
- data/spec/legion/extensions/agentic/defense/extinction/runners/extinction_spec.rb +114 -0
- data/spec/legion/extensions/agentic/defense/friction/helpers/constants_spec.rb +46 -0
- data/spec/legion/extensions/agentic/defense/friction/helpers/friction_engine_spec.rb +175 -0
- data/spec/legion/extensions/agentic/defense/friction/helpers/state_transition_spec.rb +124 -0
- data/spec/legion/extensions/agentic/defense/friction/runners/cognitive_friction_spec.rb +89 -0
- data/spec/legion/extensions/agentic/defense/immune_response/client_spec.rb +32 -0
- data/spec/legion/extensions/agentic/defense/immune_response/cognitive_immune_response_spec.rb +7 -0
- data/spec/legion/extensions/agentic/defense/immune_response/helpers/antibody_spec.rb +117 -0
- data/spec/legion/extensions/agentic/defense/immune_response/helpers/antigen_spec.rb +125 -0
- data/spec/legion/extensions/agentic/defense/immune_response/helpers/constants_spec.rb +45 -0
- data/spec/legion/extensions/agentic/defense/immune_response/helpers/immune_engine_spec.rb +222 -0
- data/spec/legion/extensions/agentic/defense/immune_response/helpers/immune_response_spec.rb +84 -0
- data/spec/legion/extensions/agentic/defense/immune_response/runners_spec.rb +141 -0
- data/spec/legion/extensions/agentic/defense/immunology/client_spec.rb +61 -0
- data/spec/legion/extensions/agentic/defense/immunology/helpers/antibody_spec.rb +98 -0
- data/spec/legion/extensions/agentic/defense/immunology/helpers/constants_spec.rb +86 -0
- data/spec/legion/extensions/agentic/defense/immunology/helpers/immune_engine_spec.rb +275 -0
- data/spec/legion/extensions/agentic/defense/immunology/helpers/threat_spec.rb +133 -0
- data/spec/legion/extensions/agentic/defense/immunology/runners/cognitive_immunology_spec.rb +177 -0
- data/spec/legion/extensions/agentic/defense/phantom/client_spec.rb +53 -0
- data/spec/legion/extensions/agentic/defense/phantom/helpers/constants_spec.rb +87 -0
- data/spec/legion/extensions/agentic/defense/phantom/helpers/phantom_engine_spec.rb +222 -0
- data/spec/legion/extensions/agentic/defense/phantom/helpers/phantom_limb_spec.rb +180 -0
- data/spec/legion/extensions/agentic/defense/phantom/helpers/phantom_signal_spec.rb +59 -0
- data/spec/legion/extensions/agentic/defense/phantom/runners/cognitive_phantom_spec.rb +193 -0
- data/spec/legion/extensions/agentic/defense/quicksand/client_spec.rb +35 -0
- data/spec/legion/extensions/agentic/defense/quicksand/helpers/constants_spec.rb +58 -0
- data/spec/legion/extensions/agentic/defense/quicksand/helpers/pit_spec.rb +103 -0
- data/spec/legion/extensions/agentic/defense/quicksand/helpers/quicksand_engine_spec.rb +153 -0
- data/spec/legion/extensions/agentic/defense/quicksand/helpers/trap_spec.rb +166 -0
- data/spec/legion/extensions/agentic/defense/quicksand/runners/cognitive_quicksand_spec.rb +90 -0
- data/spec/legion/extensions/agentic/defense/quicksilver/client_spec.rb +72 -0
- data/spec/legion/extensions/agentic/defense/quicksilver/helpers/constants_spec.rb +105 -0
- data/spec/legion/extensions/agentic/defense/quicksilver/helpers/droplet_spec.rb +310 -0
- data/spec/legion/extensions/agentic/defense/quicksilver/helpers/pool_spec.rb +174 -0
- data/spec/legion/extensions/agentic/defense/quicksilver/helpers/quicksilver_engine_spec.rb +226 -0
- data/spec/legion/extensions/agentic/defense/quicksilver/runners/cognitive_quicksilver_spec.rb +227 -0
- data/spec/legion/extensions/agentic/defense/whirlpool/client_spec.rb +63 -0
- data/spec/legion/extensions/agentic/defense/whirlpool/helpers/captured_thought_spec.rb +171 -0
- data/spec/legion/extensions/agentic/defense/whirlpool/helpers/constants_spec.rb +65 -0
- data/spec/legion/extensions/agentic/defense/whirlpool/helpers/vortex_spec.rb +189 -0
- data/spec/legion/extensions/agentic/defense/whirlpool/helpers/whirlpool_engine_spec.rb +227 -0
- data/spec/legion/extensions/agentic/defense/whirlpool/runners/cognitive_whirlpool_spec.rb +226 -0
- data/spec/spec_helper.rb +46 -0
- metadata +303 -0
|
@@ -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 Defense
|
|
9
|
+
module ErrorMonitoring
|
|
10
|
+
module Actor
|
|
11
|
+
class Tick < Legion::Extensions::Actors::Every
|
|
12
|
+
def runner_class
|
|
13
|
+
Legion::Extensions::Agentic::Defense::ErrorMonitoring::Runners::ErrorMonitoring
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def runner_function
|
|
17
|
+
'update_error_monitoring'
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def time
|
|
21
|
+
15
|
|
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,28 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'legion/extensions/agentic/defense/error_monitoring/helpers/constants'
|
|
4
|
+
require 'legion/extensions/agentic/defense/error_monitoring/helpers/error_signal'
|
|
5
|
+
require 'legion/extensions/agentic/defense/error_monitoring/helpers/error_monitor'
|
|
6
|
+
require 'legion/extensions/agentic/defense/error_monitoring/runners/error_monitoring'
|
|
7
|
+
|
|
8
|
+
module Legion
|
|
9
|
+
module Extensions
|
|
10
|
+
module Agentic
|
|
11
|
+
module Defense
|
|
12
|
+
module ErrorMonitoring
|
|
13
|
+
class Client
|
|
14
|
+
include Runners::ErrorMonitoring
|
|
15
|
+
|
|
16
|
+
def initialize(monitor: nil, **)
|
|
17
|
+
@monitor = monitor || Helpers::ErrorMonitor.new
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
private
|
|
21
|
+
|
|
22
|
+
attr_reader :monitor
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Legion
|
|
4
|
+
module Extensions
|
|
5
|
+
module Agentic
|
|
6
|
+
module Defense
|
|
7
|
+
module ErrorMonitoring
|
|
8
|
+
module Helpers
|
|
9
|
+
module Constants
|
|
10
|
+
MAX_ERROR_LOG = 500
|
|
11
|
+
MAX_CONFLICT_LOG = 200
|
|
12
|
+
MAX_CORRECTIONS = 200
|
|
13
|
+
|
|
14
|
+
ERROR_RATE_ALPHA = 0.12
|
|
15
|
+
CONFLICT_ALPHA = 0.1
|
|
16
|
+
CONFIDENCE_ALPHA = 0.1
|
|
17
|
+
|
|
18
|
+
DEFAULT_ERROR_RATE = 0.1
|
|
19
|
+
DEFAULT_CONFLICT_LEVEL = 0.0
|
|
20
|
+
DEFAULT_CONFIDENCE = 0.7
|
|
21
|
+
|
|
22
|
+
POST_ERROR_SLOWDOWN = 0.3
|
|
23
|
+
SLOWDOWN_DECAY = 0.05
|
|
24
|
+
MAX_SLOWDOWN = 1.0
|
|
25
|
+
|
|
26
|
+
CONFLICT_THRESHOLD = 0.5
|
|
27
|
+
SEVERE_ERROR_THRESHOLD = 0.7
|
|
28
|
+
CORRECTION_BOOST = 0.05
|
|
29
|
+
|
|
30
|
+
ERROR_SEVERITY_LABELS = {
|
|
31
|
+
(0.8..) => :critical,
|
|
32
|
+
(0.6...0.8) => :major,
|
|
33
|
+
(0.4...0.6) => :moderate,
|
|
34
|
+
(0.2...0.4) => :minor,
|
|
35
|
+
(..0.2) => :trivial
|
|
36
|
+
}.freeze
|
|
37
|
+
|
|
38
|
+
MONITORING_STATE_LABELS = {
|
|
39
|
+
vigilant: 'heightened error sensitivity after recent errors',
|
|
40
|
+
normal: 'standard monitoring',
|
|
41
|
+
relaxed: 'low error rate, reduced monitoring',
|
|
42
|
+
overwhelmed: 'error rate too high, system stressed'
|
|
43
|
+
}.freeze
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Legion
|
|
4
|
+
module Extensions
|
|
5
|
+
module Agentic
|
|
6
|
+
module Defense
|
|
7
|
+
module ErrorMonitoring
|
|
8
|
+
module Helpers
|
|
9
|
+
class ErrorMonitor
|
|
10
|
+
include Constants
|
|
11
|
+
|
|
12
|
+
attr_reader :error_log, :conflict_log, :corrections,
|
|
13
|
+
:error_rate, :conflict_level, :confidence, :slowdown
|
|
14
|
+
|
|
15
|
+
def initialize
|
|
16
|
+
@error_log = []
|
|
17
|
+
@conflict_log = []
|
|
18
|
+
@corrections = []
|
|
19
|
+
@error_rate = DEFAULT_ERROR_RATE
|
|
20
|
+
@conflict_level = DEFAULT_CONFLICT_LEVEL
|
|
21
|
+
@confidence = DEFAULT_CONFIDENCE
|
|
22
|
+
@slowdown = 0.0
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def register_error(action:, domain:, intended:, actual:, severity:)
|
|
26
|
+
signal = ErrorSignal.new(
|
|
27
|
+
action: action, domain: domain,
|
|
28
|
+
intended: intended, actual: actual, severity: severity
|
|
29
|
+
)
|
|
30
|
+
@error_log << signal
|
|
31
|
+
@error_log.shift while @error_log.size > MAX_ERROR_LOG
|
|
32
|
+
|
|
33
|
+
update_error_rate(severity.to_f)
|
|
34
|
+
apply_post_error_slowdown(severity.to_f)
|
|
35
|
+
update_confidence(correct: false)
|
|
36
|
+
signal
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def register_success(action:, domain:)
|
|
40
|
+
update_error_rate(0.0)
|
|
41
|
+
update_confidence(correct: true)
|
|
42
|
+
decay_slowdown
|
|
43
|
+
{ action: action, domain: domain, error_rate: @error_rate.round(4) }
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def register_conflict(action_a:, action_b:, domain:, intensity:)
|
|
47
|
+
entry = {
|
|
48
|
+
action_a: action_a, action_b: action_b,
|
|
49
|
+
domain: domain, intensity: intensity.to_f.clamp(0.0, 1.0),
|
|
50
|
+
detected_at: Time.now.utc
|
|
51
|
+
}
|
|
52
|
+
@conflict_log << entry
|
|
53
|
+
@conflict_log.shift while @conflict_log.size > MAX_CONFLICT_LOG
|
|
54
|
+
|
|
55
|
+
update_conflict_level(intensity.to_f)
|
|
56
|
+
entry
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def register_correction(action:, domain:, original_error:, correction:)
|
|
60
|
+
entry = {
|
|
61
|
+
action: action, domain: domain,
|
|
62
|
+
original_error: original_error, correction: correction,
|
|
63
|
+
applied_at: Time.now.utc
|
|
64
|
+
}
|
|
65
|
+
@corrections << entry
|
|
66
|
+
@corrections.shift while @corrections.size > MAX_CORRECTIONS
|
|
67
|
+
|
|
68
|
+
mark_error_corrected(action, domain)
|
|
69
|
+
update_confidence_boost
|
|
70
|
+
entry
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
def recent_errors(limit: 10)
|
|
74
|
+
@error_log.last(limit)
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
def errors_in(domain:)
|
|
78
|
+
@error_log.select { |e| e.domain == domain }
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
def uncorrected_errors
|
|
82
|
+
@error_log.reject(&:corrected)
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
def conflict_active?
|
|
86
|
+
@conflict_level >= CONFLICT_THRESHOLD
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
def monitoring_state
|
|
90
|
+
if @error_rate > 0.5
|
|
91
|
+
:overwhelmed
|
|
92
|
+
elsif @slowdown > 0.1
|
|
93
|
+
:vigilant
|
|
94
|
+
elsif @error_rate < 0.05
|
|
95
|
+
:relaxed
|
|
96
|
+
else
|
|
97
|
+
:normal
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
def tick
|
|
102
|
+
decay_slowdown
|
|
103
|
+
decay_conflict
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
def error_count
|
|
107
|
+
@error_log.size
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
def correction_rate
|
|
111
|
+
return 0.0 if @error_log.empty?
|
|
112
|
+
|
|
113
|
+
corrected = @error_log.count(&:corrected)
|
|
114
|
+
corrected.to_f / @error_log.size
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
def to_h
|
|
118
|
+
{
|
|
119
|
+
error_rate: @error_rate.round(4),
|
|
120
|
+
conflict_level: @conflict_level.round(4),
|
|
121
|
+
confidence: @confidence.round(4),
|
|
122
|
+
slowdown: @slowdown.round(4),
|
|
123
|
+
state: monitoring_state,
|
|
124
|
+
state_label: MONITORING_STATE_LABELS[monitoring_state],
|
|
125
|
+
total_errors: @error_log.size,
|
|
126
|
+
uncorrected: uncorrected_errors.size,
|
|
127
|
+
correction_rate: correction_rate.round(4),
|
|
128
|
+
conflict_active: conflict_active?
|
|
129
|
+
}
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
private
|
|
133
|
+
|
|
134
|
+
def update_error_rate(severity)
|
|
135
|
+
@error_rate += ERROR_RATE_ALPHA * (severity - @error_rate)
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
def update_conflict_level(intensity)
|
|
139
|
+
@conflict_level += CONFLICT_ALPHA * (intensity - @conflict_level)
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
def update_confidence(correct:)
|
|
143
|
+
target = correct ? 1.0 : 0.0
|
|
144
|
+
@confidence += CONFIDENCE_ALPHA * (target - @confidence)
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
def update_confidence_boost
|
|
148
|
+
@confidence = [@confidence + CORRECTION_BOOST, 1.0].min
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
def apply_post_error_slowdown(severity)
|
|
152
|
+
increase = POST_ERROR_SLOWDOWN * severity
|
|
153
|
+
@slowdown = [@slowdown + increase, MAX_SLOWDOWN].min
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
def decay_slowdown
|
|
157
|
+
@slowdown = [@slowdown - SLOWDOWN_DECAY, 0.0].max
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
def decay_conflict
|
|
161
|
+
@conflict_level = [@conflict_level * 0.95, 0.0].max
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
def mark_error_corrected(action, domain)
|
|
165
|
+
match = @error_log.reverse.find { |e| e.action == action && e.domain == domain && !e.corrected }
|
|
166
|
+
match&.mark_corrected
|
|
167
|
+
end
|
|
168
|
+
end
|
|
169
|
+
end
|
|
170
|
+
end
|
|
171
|
+
end
|
|
172
|
+
end
|
|
173
|
+
end
|
|
174
|
+
end
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Legion
|
|
4
|
+
module Extensions
|
|
5
|
+
module Agentic
|
|
6
|
+
module Defense
|
|
7
|
+
module ErrorMonitoring
|
|
8
|
+
module Helpers
|
|
9
|
+
class ErrorSignal
|
|
10
|
+
include Constants
|
|
11
|
+
|
|
12
|
+
attr_reader :action, :domain, :intended, :actual, :severity, :detected_at, :corrected
|
|
13
|
+
|
|
14
|
+
def initialize(action:, domain:, intended:, actual:, severity:)
|
|
15
|
+
@action = action
|
|
16
|
+
@domain = domain
|
|
17
|
+
@intended = intended
|
|
18
|
+
@actual = actual
|
|
19
|
+
@severity = severity.to_f.clamp(0.0, 1.0)
|
|
20
|
+
@detected_at = Time.now.utc
|
|
21
|
+
@corrected = false
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def mark_corrected
|
|
25
|
+
@corrected = true
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def severe?
|
|
29
|
+
@severity >= SEVERE_ERROR_THRESHOLD
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def age
|
|
33
|
+
Time.now.utc - @detected_at
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def label
|
|
37
|
+
ERROR_SEVERITY_LABELS.each { |range, lbl| return lbl if range.cover?(@severity) }
|
|
38
|
+
:trivial
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def to_h
|
|
42
|
+
{
|
|
43
|
+
action: @action,
|
|
44
|
+
domain: @domain,
|
|
45
|
+
intended: @intended,
|
|
46
|
+
actual: @actual,
|
|
47
|
+
severity: @severity.round(4),
|
|
48
|
+
label: label,
|
|
49
|
+
detected_at: @detected_at,
|
|
50
|
+
corrected: @corrected,
|
|
51
|
+
age: age.round(2)
|
|
52
|
+
}
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Legion
|
|
4
|
+
module Extensions
|
|
5
|
+
module Agentic
|
|
6
|
+
module Defense
|
|
7
|
+
module ErrorMonitoring
|
|
8
|
+
module Runners
|
|
9
|
+
module ErrorMonitoring
|
|
10
|
+
include Legion::Extensions::Helpers::Lex if Legion::Extensions.const_defined?(:Helpers) &&
|
|
11
|
+
Legion::Extensions::Helpers.const_defined?(:Lex)
|
|
12
|
+
|
|
13
|
+
def report_error(action:, domain:, intended:, actual:, severity:, **)
|
|
14
|
+
Legion::Logging.debug "[error_monitor] error: action=#{action} domain=#{domain} severity=#{severity}"
|
|
15
|
+
signal = monitor.register_error(
|
|
16
|
+
action: action, domain: domain,
|
|
17
|
+
intended: intended, actual: actual, severity: severity
|
|
18
|
+
)
|
|
19
|
+
{
|
|
20
|
+
success: true, error: signal.to_h,
|
|
21
|
+
error_rate: monitor.error_rate.round(4),
|
|
22
|
+
slowdown: monitor.slowdown.round(4),
|
|
23
|
+
state: monitor.monitoring_state
|
|
24
|
+
}
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def report_success(action:, domain:, **)
|
|
28
|
+
Legion::Logging.debug "[error_monitor] success: action=#{action} domain=#{domain}"
|
|
29
|
+
result = monitor.register_success(action: action, domain: domain)
|
|
30
|
+
{ success: true, action: action, domain: domain, error_rate: result[:error_rate] }
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def report_conflict(action_a:, action_b:, domain:, intensity:, **)
|
|
34
|
+
Legion::Logging.debug "[error_monitor] conflict: #{action_a} vs #{action_b} domain=#{domain}"
|
|
35
|
+
entry = monitor.register_conflict(
|
|
36
|
+
action_a: action_a, action_b: action_b,
|
|
37
|
+
domain: domain, intensity: intensity
|
|
38
|
+
)
|
|
39
|
+
{ success: true, conflict: entry, conflict_active: monitor.conflict_active? }
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def apply_correction(action:, domain:, original_error:, correction:, **)
|
|
43
|
+
Legion::Logging.debug "[error_monitor] correction: action=#{action} domain=#{domain}"
|
|
44
|
+
entry = monitor.register_correction(
|
|
45
|
+
action: action, domain: domain,
|
|
46
|
+
original_error: original_error, correction: correction
|
|
47
|
+
)
|
|
48
|
+
{ success: true, correction: entry, confidence: monitor.confidence.round(4) }
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def recent_errors(limit: 10, **)
|
|
52
|
+
errors = monitor.recent_errors(limit: limit.to_i).map(&:to_h)
|
|
53
|
+
Legion::Logging.debug "[error_monitor] recent_errors: #{errors.size}"
|
|
54
|
+
{ success: true, errors: errors, count: errors.size }
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def errors_in_domain(domain:, **)
|
|
58
|
+
errors = monitor.errors_in(domain: domain).map(&:to_h)
|
|
59
|
+
Legion::Logging.debug "[error_monitor] errors_in: domain=#{domain} count=#{errors.size}"
|
|
60
|
+
{ success: true, domain: domain, errors: errors, count: errors.size }
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def uncorrected_errors(**)
|
|
64
|
+
errors = monitor.uncorrected_errors.map(&:to_h)
|
|
65
|
+
Legion::Logging.debug "[error_monitor] uncorrected: #{errors.size}"
|
|
66
|
+
{ success: true, errors: errors, count: errors.size }
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
def monitoring_state(**)
|
|
70
|
+
state = monitor.monitoring_state
|
|
71
|
+
Legion::Logging.debug "[error_monitor] state: #{state}"
|
|
72
|
+
{
|
|
73
|
+
success: true, state: state,
|
|
74
|
+
label: Helpers::Constants::MONITORING_STATE_LABELS[state],
|
|
75
|
+
slowdown: monitor.slowdown.round(4),
|
|
76
|
+
confidence: monitor.confidence.round(4)
|
|
77
|
+
}
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
def update_error_monitoring(**)
|
|
81
|
+
Legion::Logging.debug '[error_monitor] tick'
|
|
82
|
+
monitor.tick
|
|
83
|
+
{ success: true, state: monitor.monitoring_state, slowdown: monitor.slowdown.round(4) }
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
def error_monitoring_stats(**)
|
|
87
|
+
Legion::Logging.debug '[error_monitor] stats'
|
|
88
|
+
{ success: true, stats: monitor.to_h }
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
private
|
|
92
|
+
|
|
93
|
+
def monitor
|
|
94
|
+
@monitor ||= Helpers::ErrorMonitor.new
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'legion/extensions/agentic/defense/error_monitoring/version'
|
|
4
|
+
require 'legion/extensions/agentic/defense/error_monitoring/helpers/constants'
|
|
5
|
+
require 'legion/extensions/agentic/defense/error_monitoring/helpers/error_signal'
|
|
6
|
+
require 'legion/extensions/agentic/defense/error_monitoring/helpers/error_monitor'
|
|
7
|
+
require 'legion/extensions/agentic/defense/error_monitoring/runners/error_monitoring'
|
|
8
|
+
require 'legion/extensions/agentic/defense/error_monitoring/client'
|
|
9
|
+
|
|
10
|
+
module Legion
|
|
11
|
+
module Extensions
|
|
12
|
+
module Agentic
|
|
13
|
+
module Defense
|
|
14
|
+
module ErrorMonitoring
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
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 Defense
|
|
9
|
+
module Extinction
|
|
10
|
+
module Actor
|
|
11
|
+
class ProtocolMonitor < Legion::Extensions::Actors::Every
|
|
12
|
+
def runner_class
|
|
13
|
+
Legion::Extensions::Agentic::Defense::Extinction::Runners::Extinction
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def runner_function
|
|
17
|
+
'monitor_protocol'
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def time
|
|
21
|
+
300
|
|
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,27 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'legion/extensions/agentic/defense/extinction/helpers/levels'
|
|
4
|
+
require 'legion/extensions/agentic/defense/extinction/helpers/protocol_state'
|
|
5
|
+
require 'legion/extensions/agentic/defense/extinction/runners/extinction'
|
|
6
|
+
|
|
7
|
+
module Legion
|
|
8
|
+
module Extensions
|
|
9
|
+
module Agentic
|
|
10
|
+
module Defense
|
|
11
|
+
module Extinction
|
|
12
|
+
class Client
|
|
13
|
+
include Runners::Extinction
|
|
14
|
+
|
|
15
|
+
def initialize(**)
|
|
16
|
+
@protocol_state = Helpers::ProtocolState.new
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
private
|
|
20
|
+
|
|
21
|
+
attr_reader :protocol_state
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Legion
|
|
4
|
+
module Extensions
|
|
5
|
+
module Agentic
|
|
6
|
+
module Defense
|
|
7
|
+
module Extinction
|
|
8
|
+
module Helpers
|
|
9
|
+
module Levels
|
|
10
|
+
# Four escalation levels (spec: extinction-protocol-spec.md)
|
|
11
|
+
ESCALATION_LEVELS = {
|
|
12
|
+
1 => { name: :mesh_isolation, reversible: true, authority: :governance_council },
|
|
13
|
+
2 => { name: :forced_sentinel, reversible: true, authority: :governance_council },
|
|
14
|
+
3 => { name: :full_suspension, reversible: true, authority: :council_plus_executive },
|
|
15
|
+
4 => { name: :cryptographic_erasure, reversible: false, authority: :physical_keyholders }
|
|
16
|
+
}.freeze
|
|
17
|
+
|
|
18
|
+
VALID_LEVELS = [1, 2, 3, 4].freeze
|
|
19
|
+
|
|
20
|
+
module_function
|
|
21
|
+
|
|
22
|
+
def valid_level?(level)
|
|
23
|
+
VALID_LEVELS.include?(level)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def level_info(level)
|
|
27
|
+
ESCALATION_LEVELS[level]
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def reversible?(level)
|
|
31
|
+
ESCALATION_LEVELS.dig(level, :reversible) || false
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def required_authority(level)
|
|
35
|
+
ESCALATION_LEVELS.dig(level, :authority)
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|