lex-agentic-social 0.1.3 → 0.1.5

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.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +9 -1
  3. data/LICENSE +201 -21
  4. data/README.md +2 -2
  5. data/lex-agentic-social.gemspec +1 -0
  6. data/lib/legion/extensions/agentic/social/apprenticeship/runners/cognitive_apprenticeship.rb +2 -2
  7. data/lib/legion/extensions/agentic/social/conflict/helpers/llm_enhancer.rb +2 -2
  8. data/lib/legion/extensions/agentic/social/conflict/runners/conflict.rb +2 -2
  9. data/lib/legion/extensions/agentic/social/conscience/runners/conscience.rb +2 -2
  10. data/lib/legion/extensions/agentic/social/consent/helpers/consent_map.rb +3 -3
  11. data/lib/legion/extensions/agentic/social/consent/runners/consent.rb +2 -2
  12. data/lib/legion/extensions/agentic/social/entrainment/runners/cognitive_entrainment.rb +2 -2
  13. data/lib/legion/extensions/agentic/social/governance/actors/shadow_ai_scan.rb +1 -1
  14. data/lib/legion/extensions/agentic/social/governance/runners/governance.rb +2 -2
  15. data/lib/legion/extensions/agentic/social/governance/runners/shadow_ai.rb +3 -3
  16. data/lib/legion/extensions/agentic/social/joint_attention/runners/joint_attention.rb +2 -2
  17. data/lib/legion/extensions/agentic/social/mentalizing/helpers/mental_model.rb +2 -2
  18. data/lib/legion/extensions/agentic/social/mentalizing/runners/mentalizing.rb +2 -2
  19. data/lib/legion/extensions/agentic/social/mirror/runners/observe.rb +2 -2
  20. data/lib/legion/extensions/agentic/social/mirror/runners/resonance.rb +2 -2
  21. data/lib/legion/extensions/agentic/social/mirror/runners/simulate.rb +2 -2
  22. data/lib/legion/extensions/agentic/social/mirror_system/runners/mirror.rb +2 -2
  23. data/lib/legion/extensions/agentic/social/moral_reasoning/helpers/llm_enhancer.rb +2 -2
  24. data/lib/legion/extensions/agentic/social/moral_reasoning/runners/moral_reasoning.rb +2 -2
  25. data/lib/legion/extensions/agentic/social/perspective_shifting/runners/perspective_shifting.rb +2 -2
  26. data/lib/legion/extensions/agentic/social/social/runners/social.rb +2 -2
  27. data/lib/legion/extensions/agentic/social/social_learning/runners/social_learning.rb +2 -2
  28. data/lib/legion/extensions/agentic/social/theory_of_mind/runners/theory_of_mind.rb +2 -2
  29. data/lib/legion/extensions/agentic/social/trust/helpers/trust_map.rb +2 -2
  30. data/lib/legion/extensions/agentic/social/trust/runners/trust.rb +2 -2
  31. data/lib/legion/extensions/agentic/social/version.rb +1 -1
  32. data/lib/legion/extensions/agentic/social.rb +2 -2
  33. metadata +15 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5697e725733d706e2b69cd199a9e0273701f0f59dd0a6a1c0e8f2c40c39d172f
4
- data.tar.gz: c361f2c7a29468c82d9802fa4c2f61e24f9ab4b1d9da7f6897088801d2ff8760
3
+ metadata.gz: 3a01aa481409269257996188227484fe5ad8f1bd8e4c16abd0a8922ce3b312b8
4
+ data.tar.gz: 4ecb04ebefef8d08763f840c3233da964592c58216597d42963da27f44f1d8a7
5
5
  SHA512:
6
- metadata.gz: 5dee7abcb56cafcd0800d40e486f71a9ccd4325addd41802db7f6681aae6f9edb4c9bd5ab8ef54aff88782881d708c77725e101f82dd94ff8a30e86c3fda79d8
7
- data.tar.gz: 4632fc3115f9227dcd7875e377cf65ecb99e4ffcad5763daa8f84bb46cf3905019213ecf6daa429a9d7e8b385d47d2ecde198752ef91bcfb9a99010a75dfecf6
6
+ metadata.gz: d2372a7bfab7f4f52b9389ef120e7f851e81755b71f07272ba63c572704424eef92045201815e93b55866cced472cfa3a06d00e2343c33b9523e5b0adc0a7732
7
+ data.tar.gz: 50ef5117fe9183f54c6b02ef84df4f130c010701d266156820bed6e4654755009c7772202ab84a39588691879096fd68e9301ee63ce5b28bf471bb26e781c15d
data/CHANGELOG.md CHANGED
@@ -1,6 +1,14 @@
1
1
  # Changelog
2
2
 
3
- ## [Unreleased]
3
+ ## [0.1.5] - 2026-03-30
4
+
5
+ ### Changed
6
+ - update to rubocop-legion 0.1.7, resolve all offenses
7
+
8
+ ## [0.1.4] - 2026-03-26
9
+
10
+ ### Changed
11
+ - fix remote_invocable? to use class method for local dispatch
4
12
 
5
13
  ## [0.1.3] - 2026-03-23
6
14
 
data/LICENSE CHANGED
@@ -1,21 +1,201 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Matthew Iverson
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2021 Esity
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
data/README.md CHANGED
@@ -5,7 +5,7 @@ Domain consolidation gem for social cognition, governance, and multi-agent inter
5
5
  ## Overview
6
6
 
7
7
  **Gem**: `lex-agentic-social`
8
- **Version**: 0.1.1
8
+ **Version**: 0.1.0
9
9
  **Namespace**: `Legion::Extensions::Agentic::Social`
10
10
 
11
11
  ## Sub-Modules
@@ -51,7 +51,7 @@ gem 'lex-agentic-social'
51
51
 
52
52
  ```bash
53
53
  bundle install
54
- bundle exec rspec # 1646 examples, 0 failures
54
+ bundle exec rspec # 1673 examples, 0 failures
55
55
  bundle exec rubocop # 0 offenses
56
56
  ```
57
57
 
@@ -34,5 +34,6 @@ Gem::Specification.new do |spec|
34
34
 
35
35
  spec.add_development_dependency 'rspec', '~> 3.13'
36
36
  spec.add_development_dependency 'rubocop', '~> 1.60'
37
+ spec.add_development_dependency 'rubocop-legion', '~> 0.1'
37
38
  spec.add_development_dependency 'rubocop-rspec', '~> 2.26'
38
39
  end
@@ -7,8 +7,8 @@ module Legion
7
7
  module Apprenticeship
8
8
  module Runners
9
9
  module CognitiveApprenticeship
10
- include Legion::Extensions::Helpers::Lex if Legion::Extensions.const_defined?(:Helpers) &&
11
- Legion::Extensions::Helpers.const_defined?(:Lex)
10
+ include Legion::Extensions::Helpers::Lex if Legion::Extensions.const_defined?(:Helpers, false) &&
11
+ Legion::Extensions::Helpers.const_defined?(:Lex, false)
12
12
 
13
13
  def create_apprenticeship(skill_name:, domain:, mentor_id:, apprentice_id:, **)
14
14
  return { success: false, reason: :param_too_short } if [skill_name, domain, mentor_id, apprentice_id].any? { |p| p.to_s.length < 3 }
@@ -18,7 +18,7 @@ module Legion
18
18
 
19
19
  def available?
20
20
  defined?(Legion::LLM) && Legion::LLM.respond_to?(:started?) && Legion::LLM.started?
21
- rescue StandardError
21
+ rescue StandardError => _e
22
22
  false
23
23
  end
24
24
 
@@ -68,7 +68,7 @@ module Legion
68
68
  !!(defined?(Legion::LLM::Pipeline::GaiaCaller) &&
69
69
  Legion::LLM.respond_to?(:pipeline_enabled?) &&
70
70
  Legion::LLM.pipeline_enabled?)
71
- rescue StandardError
71
+ rescue StandardError => _e
72
72
  false
73
73
  end
74
74
  private_class_method :pipeline_available?
@@ -7,8 +7,8 @@ module Legion
7
7
  module Conflict
8
8
  module Runners
9
9
  module Conflict
10
- include Legion::Extensions::Helpers::Lex if Legion::Extensions.const_defined?(:Helpers) &&
11
- Legion::Extensions::Helpers.const_defined?(:Lex)
10
+ include Legion::Extensions::Helpers::Lex if Legion::Extensions.const_defined?(:Helpers, false) &&
11
+ Legion::Extensions::Helpers.const_defined?(:Lex, false)
12
12
 
13
13
  def register_conflict(parties:, severity:, description:, **)
14
14
  return { error: :invalid_severity, valid: Helpers::Severity::LEVELS } unless Helpers::Severity.valid_level?(severity)
@@ -7,8 +7,8 @@ module Legion
7
7
  module Conscience
8
8
  module Runners
9
9
  module Conscience
10
- include Legion::Extensions::Helpers::Lex if Legion::Extensions.const_defined?(:Helpers) &&
11
- Legion::Extensions::Helpers.const_defined?(:Lex)
10
+ include Legion::Extensions::Helpers::Lex if Legion::Extensions.const_defined?(:Helpers, false) &&
11
+ Legion::Extensions::Helpers.const_defined?(:Lex, false)
12
12
 
13
13
  # Full moral assessment of a proposed action.
14
14
  # action: string or symbol describing what is about to happen
@@ -154,7 +154,7 @@ module Legion
154
154
  end
155
155
  end
156
156
  rescue StandardError => e
157
- Legion::Logging.warn "[consent] save_to_local failed: #{e.message}" if defined?(Legion::Logging)
157
+ Legion::Logging.warn "[consent] save_to_local failed: #{e.message}"
158
158
  end
159
159
 
160
160
  def load_from_local
@@ -166,7 +166,7 @@ module Legion
166
166
  ::JSON.parse(row[:history] || '[]', symbolize_names: false).map do |h|
167
167
  { from: h['from'].to_sym, to: h['to'].to_sym, at: h['at'] }
168
168
  end
169
- rescue StandardError
169
+ rescue StandardError => _e
170
170
  []
171
171
  end
172
172
 
@@ -180,7 +180,7 @@ module Legion
180
180
  }
181
181
  end
182
182
  rescue StandardError => e
183
- Legion::Logging.warn "[consent] load_from_local failed: #{e.message}" if defined?(Legion::Logging)
183
+ Legion::Logging.warn "[consent] load_from_local failed: #{e.message}"
184
184
  end
185
185
 
186
186
  private
@@ -7,8 +7,8 @@ module Legion
7
7
  module Consent
8
8
  module Runners
9
9
  module Consent
10
- include Legion::Extensions::Helpers::Lex if Legion::Extensions.const_defined?(:Helpers) &&
11
- Legion::Extensions::Helpers.const_defined?(:Lex)
10
+ include Legion::Extensions::Helpers::Lex if Legion::Extensions.const_defined?(:Helpers, false) &&
11
+ Legion::Extensions::Helpers.const_defined?(:Lex, false)
12
12
 
13
13
  def check_consent(domain:, _action_type: :general, **)
14
14
  tier = consent_map.get_tier(domain)
@@ -7,8 +7,8 @@ module Legion
7
7
  module Entrainment
8
8
  module Runners
9
9
  module CognitiveEntrainment
10
- include Legion::Extensions::Helpers::Lex if Legion::Extensions.const_defined?(:Helpers) &&
11
- Legion::Extensions::Helpers.const_defined?(:Lex)
10
+ include Legion::Extensions::Helpers::Lex if Legion::Extensions.const_defined?(:Helpers, false) &&
11
+ Legion::Extensions::Helpers.const_defined?(:Lex, false)
12
12
 
13
13
  def create_entrainment_pairing(agent_a:, agent_b:, domain:, **)
14
14
  pairing = engine.create_pairing(agent_a: agent_a, agent_b: agent_b, domain: domain)
@@ -5,7 +5,7 @@ module Legion
5
5
  module Agentic
6
6
  module Social
7
7
  module Governance
8
- module Actors
8
+ module Actor
9
9
  class ShadowAiScan < Legion::Extensions::Actors::Every
10
10
  def runner_class = Runners::ShadowAi
11
11
  def runner_function = 'full_scan'
@@ -7,8 +7,8 @@ module Legion
7
7
  module Governance
8
8
  module Runners
9
9
  module Governance
10
- include Legion::Extensions::Helpers::Lex if Legion::Extensions.const_defined?(:Helpers) &&
11
- Legion::Extensions::Helpers.const_defined?(:Lex)
10
+ include Legion::Extensions::Helpers::Lex if Legion::Extensions.const_defined?(:Helpers, false) &&
11
+ Legion::Extensions::Helpers.const_defined?(:Lex, false)
12
12
 
13
13
  def create_proposal(category:, description:, proposer:, council_size: nil, **)
14
14
  return { error: :invalid_category, valid: Helpers::Layers::PROPOSAL_CATEGORIES } unless Helpers::Layers.valid_category?(category)
@@ -6,7 +6,7 @@ module Legion
6
6
  module Social
7
7
  module Governance
8
8
  module Runners
9
- module ShadowAi
9
+ module ShadowAi # rubocop:disable Legion/Extension/RunnerIncludeHelpers
10
10
  def scan_unregistered_extensions(**)
11
11
  installed = Bundler.load.specs.select { |s| s.name.start_with?('lex-') }.map(&:name)
12
12
  registered = registered_extension_names
@@ -59,7 +59,7 @@ module Legion
59
59
  return [] unless conn&.table_exists?(:extension_registry)
60
60
 
61
61
  conn[:extension_registry].select_map(:gem_name)
62
- rescue StandardError
62
+ rescue StandardError => _e
63
63
  []
64
64
  end
65
65
 
@@ -71,7 +71,7 @@ module Legion
71
71
  return false unless providers.is_a?(Hash)
72
72
 
73
73
  providers.dig(provider, :enabled) == true
74
- rescue StandardError
74
+ rescue StandardError => _e
75
75
  false
76
76
  end
77
77
 
@@ -7,8 +7,8 @@ module Legion
7
7
  module JointAttention
8
8
  module Runners
9
9
  module JointAttention
10
- include Legion::Extensions::Helpers::Lex if Legion::Extensions.const_defined?(:Helpers) &&
11
- Legion::Extensions::Helpers.const_defined?(:Lex)
10
+ include Legion::Extensions::Helpers::Lex if Legion::Extensions.const_defined?(:Helpers, false) &&
11
+ Legion::Extensions::Helpers.const_defined?(:Lex, false)
12
12
 
13
13
  def create_attention_target(name:, domain:, creator:, priority: 0.5, **)
14
14
  target = joint_focus_manager.create_target(name: name, domain: domain, priority: priority, creator: creator)
@@ -59,8 +59,8 @@ module Legion
59
59
  beliefs_b = beliefs_on_subject(agent_b, subject)
60
60
  return 0.0 if beliefs_a.empty? || beliefs_b.empty?
61
61
 
62
- conf_a = beliefs_a.map(&:confidence).sum / beliefs_a.size
63
- conf_b = beliefs_b.map(&:confidence).sum / beliefs_b.size
62
+ conf_a = beliefs_a.sum(&:confidence) / beliefs_a.size
63
+ conf_b = beliefs_b.sum(&:confidence) / beliefs_b.size
64
64
  1.0 - (conf_a - conf_b).abs
65
65
  end
66
66
 
@@ -7,8 +7,8 @@ module Legion
7
7
  module Mentalizing
8
8
  module Runners
9
9
  module Mentalizing
10
- include Legion::Extensions::Helpers::Lex if Legion::Extensions.const_defined?(:Helpers) &&
11
- Legion::Extensions::Helpers.const_defined?(:Lex)
10
+ include Legion::Extensions::Helpers::Lex if Legion::Extensions.const_defined?(:Helpers, false) &&
11
+ Legion::Extensions::Helpers.const_defined?(:Lex, false)
12
12
 
13
13
  def attribute_belief(agent_id:, subject:, content:, confidence: nil, depth: 0, about_agent_id: nil, **)
14
14
  depth = [depth.to_i, Helpers::Constants::MAX_RECURSION_DEPTH].min
@@ -7,8 +7,8 @@ module Legion
7
7
  module Mirror
8
8
  module Runners
9
9
  module Observe
10
- include Legion::Extensions::Helpers::Lex if Legion::Extensions.const_defined?(:Helpers) &&
11
- Legion::Extensions::Helpers.const_defined?(:Lex)
10
+ include Legion::Extensions::Helpers::Lex if Legion::Extensions.const_defined?(:Helpers, false) &&
11
+ Legion::Extensions::Helpers.const_defined?(:Lex, false)
12
12
 
13
13
  def observe_action(agent_id:, action_type:, context: {}, emotional_valence: 0.0, engine: nil, **)
14
14
  eng = engine || mirror_engine
@@ -7,8 +7,8 @@ module Legion
7
7
  module Mirror
8
8
  module Runners
9
9
  module Resonance
10
- include Legion::Extensions::Helpers::Lex if Legion::Extensions.const_defined?(:Helpers) &&
11
- Legion::Extensions::Helpers.const_defined?(:Lex)
10
+ include Legion::Extensions::Helpers::Lex if Legion::Extensions.const_defined?(:Helpers, false) &&
11
+ Legion::Extensions::Helpers.const_defined?(:Lex, false)
12
12
 
13
13
  def empathic_resonance(agent_id:, engine: nil, **)
14
14
  eng = engine || mirror_engine
@@ -7,8 +7,8 @@ module Legion
7
7
  module Mirror
8
8
  module Runners
9
9
  module Simulate
10
- include Legion::Extensions::Helpers::Lex if Legion::Extensions.const_defined?(:Helpers) &&
11
- Legion::Extensions::Helpers.const_defined?(:Lex)
10
+ include Legion::Extensions::Helpers::Lex if Legion::Extensions.const_defined?(:Helpers, false) &&
11
+ Legion::Extensions::Helpers.const_defined?(:Lex, false)
12
12
 
13
13
  def simulate_action(event_id:, confidence: Helpers::Constants::SIMULATION_CONFIDENCE_DEFAULT,
14
14
  engine: nil, **)
@@ -7,8 +7,8 @@ module Legion
7
7
  module MirrorSystem
8
8
  module Runners
9
9
  module Mirror
10
- include Legion::Extensions::Helpers::Lex if Legion::Extensions.const_defined?(:Helpers) &&
11
- Legion::Extensions::Helpers.const_defined?(:Lex)
10
+ include Legion::Extensions::Helpers::Lex if Legion::Extensions.const_defined?(:Helpers, false) &&
11
+ Legion::Extensions::Helpers.const_defined?(:Lex, false)
12
12
 
13
13
  def observe_behavior(agent_id:, action:, domain:, context: nil, outcome: nil, **)
14
14
  obs = mirror_system.observe(agent_id: agent_id, action: action, domain: domain, context: context, outcome: outcome)
@@ -18,7 +18,7 @@ module Legion
18
18
 
19
19
  def available?
20
20
  !!(defined?(Legion::LLM) && Legion::LLM.respond_to?(:started?) && Legion::LLM.started?)
21
- rescue StandardError
21
+ rescue StandardError => _e
22
22
  false
23
23
  end
24
24
 
@@ -61,7 +61,7 @@ module Legion
61
61
  !!(defined?(Legion::LLM::Pipeline::GaiaCaller) &&
62
62
  Legion::LLM.respond_to?(:pipeline_enabled?) &&
63
63
  Legion::LLM.pipeline_enabled?)
64
- rescue StandardError
64
+ rescue StandardError => _e
65
65
  false
66
66
  end
67
67
  private_class_method :pipeline_available?
@@ -7,8 +7,8 @@ module Legion
7
7
  module MoralReasoning
8
8
  module Runners
9
9
  module MoralReasoning
10
- include Legion::Extensions::Helpers::Lex if Legion::Extensions.const_defined?(:Helpers) &&
11
- Legion::Extensions::Helpers.const_defined?(:Lex)
10
+ include Legion::Extensions::Helpers::Lex if Legion::Extensions.const_defined?(:Helpers, false) &&
11
+ Legion::Extensions::Helpers.const_defined?(:Lex, false)
12
12
 
13
13
  def evaluate_moral_action(action:, affected_foundations:, domain: :general, description: nil, **)
14
14
  log.debug "[moral_reasoning] evaluate_action: action=#{action} domain=#{domain}"
@@ -9,8 +9,8 @@ module Legion
9
9
  module PerspectiveShifting
10
10
  module Runners
11
11
  module PerspectiveShifting
12
- include Legion::Extensions::Helpers::Lex if Legion::Extensions.const_defined?(:Helpers) &&
13
- Legion::Extensions::Helpers.const_defined?(:Lex)
12
+ include Legion::Extensions::Helpers::Lex if Legion::Extensions.const_defined?(:Helpers, false) &&
13
+ Legion::Extensions::Helpers.const_defined?(:Lex, false)
14
14
 
15
15
  # --- Perspective management ---
16
16
 
@@ -7,8 +7,8 @@ module Legion
7
7
  module Social
8
8
  module Runners
9
9
  module Social
10
- include Legion::Extensions::Helpers::Lex if Legion::Extensions.const_defined?(:Helpers) &&
11
- Legion::Extensions::Helpers.const_defined?(:Lex)
10
+ include Legion::Extensions::Helpers::Lex if Legion::Extensions.const_defined?(:Helpers, false) &&
11
+ Legion::Extensions::Helpers.const_defined?(:Lex, false)
12
12
 
13
13
  def update_social(tick_results: {}, **)
14
14
  extract_social_signals(tick_results)
@@ -7,8 +7,8 @@ module Legion
7
7
  module SocialLearning
8
8
  module Runners
9
9
  module SocialLearning
10
- include Legion::Extensions::Helpers::Lex if Legion::Extensions.const_defined?(:Helpers) &&
11
- Legion::Extensions::Helpers.const_defined?(:Lex)
10
+ include Legion::Extensions::Helpers::Lex if Legion::Extensions.const_defined?(:Helpers, false) &&
11
+ Legion::Extensions::Helpers.const_defined?(:Lex, false)
12
12
 
13
13
  def register_model_agent(agent_id:, domain:, prestige: nil, **)
14
14
  init_prestige = prestige || Helpers::Constants::DEFAULT_PRESTIGE
@@ -7,8 +7,8 @@ module Legion
7
7
  module TheoryOfMind
8
8
  module Runners
9
9
  module TheoryOfMind
10
- include Legion::Extensions::Helpers::Lex if Legion::Extensions.const_defined?(:Helpers) &&
11
- Legion::Extensions::Helpers.const_defined?(:Lex)
10
+ include Legion::Extensions::Helpers::Lex if Legion::Extensions.const_defined?(:Helpers, false) &&
11
+ Legion::Extensions::Helpers.const_defined?(:Lex, false)
12
12
 
13
13
  def update_theory_of_mind(tick_results: {}, **)
14
14
  extract_social_observations(tick_results)
@@ -114,7 +114,7 @@ module Legion
114
114
  dataset.where(agent_id: pair[0], domain: pair[1]).delete unless memory_pairs.include?(pair)
115
115
  end
116
116
  rescue StandardError => e
117
- Legion::Logging.warn "[trust] save_to_local failed: #{e.message}" if defined?(Legion::Logging)
117
+ Legion::Logging.warn "[trust] save_to_local failed: #{e.message}"
118
118
  end
119
119
 
120
120
  def load_from_local
@@ -143,7 +143,7 @@ module Legion
143
143
  }
144
144
  end
145
145
  rescue StandardError => e
146
- Legion::Logging.warn "[trust] load_from_local failed: #{e.message}" if defined?(Legion::Logging)
146
+ Legion::Logging.warn "[trust] load_from_local failed: #{e.message}"
147
147
  end
148
148
 
149
149
  private
@@ -7,8 +7,8 @@ module Legion
7
7
  module Trust
8
8
  module Runners
9
9
  module Trust
10
- include Legion::Extensions::Helpers::Lex if Legion::Extensions.const_defined?(:Helpers) &&
11
- Legion::Extensions::Helpers.const_defined?(:Lex)
10
+ include Legion::Extensions::Helpers::Lex if Legion::Extensions.const_defined?(:Helpers, false) &&
11
+ Legion::Extensions::Helpers.const_defined?(:Lex, false)
12
12
 
13
13
  def get_trust(agent_id:, domain: :general, **)
14
14
  entry = trust_map.get(agent_id, domain: domain)
@@ -4,7 +4,7 @@ module Legion
4
4
  module Extensions
5
5
  module Agentic
6
6
  module Social
7
- VERSION = '0.1.3'
7
+ VERSION = '0.1.5'
8
8
  end
9
9
  end
10
10
  end
@@ -23,9 +23,9 @@ module Legion
23
23
  module Extensions
24
24
  module Agentic
25
25
  module Social
26
- extend Legion::Extensions::Core if Legion::Extensions.const_defined? :Core
26
+ extend Legion::Extensions::Core if Legion::Extensions.const_defined? :Core, false
27
27
 
28
- def remote_invocable?
28
+ def self.remote_invocable?
29
29
  false
30
30
  end
31
31
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lex-agentic-social
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esity
@@ -135,6 +135,20 @@ dependencies:
135
135
  - - "~>"
136
136
  - !ruby/object:Gem::Version
137
137
  version: '1.60'
138
+ - !ruby/object:Gem::Dependency
139
+ name: rubocop-legion
140
+ requirement: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - "~>"
143
+ - !ruby/object:Gem::Version
144
+ version: '0.1'
145
+ type: :development
146
+ prerelease: false
147
+ version_requirements: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - "~>"
150
+ - !ruby/object:Gem::Version
151
+ version: '0.1'
138
152
  - !ruby/object:Gem::Dependency
139
153
  name: rubocop-rspec
140
154
  requirement: !ruby/object:Gem::Requirement