lex-agentic-social 0.1.0 → 0.1.1
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 +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +50 -3
- data/lib/legion/extensions/agentic/social/perspective_shifting/helpers/shifting_engine.rb +4 -0
- data/lib/legion/extensions/agentic/social/perspective_shifting/version.rb +1 -1
- data/lib/legion/extensions/agentic/social/version.rb +1 -1
- data/spec/legion/extensions/agentic/social/perspective_shifting/helpers/shifting_engine_spec.rb +11 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0d2b8d0e9bed537ff039356f4233ec634fceccd71d0d8f7c2cc0c6b4f6ee5460
|
|
4
|
+
data.tar.gz: d519aae044f338a2513b3b4da84cce41c8ae82642a0088db2dbb4f01a2969bcf
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 82feaa18dd902800c7d1012adbd37f2cb13c589c06184029e25171e3f816451ccff8c41257f68fd681dd406f696ae657643d382056508ccd21cc1509959bb3a3
|
|
7
|
+
data.tar.gz: f23a587d9b7825cce9b3ae304e9769dfa8e65fd47cfd9a38aa225def5d1e2f2e7c70c506df3cc3b7b6c5d6bacc6330d627ea90ba41a85a17ad86f1f4b6f1068e
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
|
@@ -1,13 +1,60 @@
|
|
|
1
1
|
# lex-agentic-social
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Domain consolidation gem for social cognition, governance, and multi-agent interaction. Bundles 17 source extensions into one loadable unit under `Legion::Extensions::Agentic::Social`.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Overview
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
**Gem**: `lex-agentic-social`
|
|
8
|
+
**Version**: 0.1.1
|
|
9
|
+
**Namespace**: `Legion::Extensions::Agentic::Social`
|
|
10
|
+
|
|
11
|
+
## Sub-Modules
|
|
12
|
+
|
|
13
|
+
| Sub-Module | Source Gem | Purpose |
|
|
14
|
+
|---|---|---|
|
|
15
|
+
| `Social::Social` | `lex-social` | Group membership, multi-dimensional reputation, reciprocity, norm violations |
|
|
16
|
+
| `Social::TheoryOfMind` | `lex-theory-of-mind` | BDI model — belief/desire/intention tracking, false-belief detection |
|
|
17
|
+
| `Social::Mentalizing` | `lex-mentalizing` | Mentalizing network — tracking of mentalizing capacity |
|
|
18
|
+
| `Social::SocialLearning` | `lex-social-learning` | Learning by observation — vicarious reinforcement |
|
|
19
|
+
| `Social::PerspectiveShifting` | `lex-perspective-shifting` | Deliberate perspective adoption |
|
|
20
|
+
| `Social::Trust` | `lex-trust` | Domain-scoped trust scores — asymmetric reinforcement and decay |
|
|
21
|
+
| `Social::Conflict` | `lex-conflict` | Conflict registration, severity-based posture, optional LLM resolution |
|
|
22
|
+
| `Social::Conscience` | `lex-conscience` | Internalized moral compass — guilt/pride signal generation |
|
|
23
|
+
| `Social::Consent` | `lex-consent` | Four-tier consent gradient with earned autonomy, HITL gate |
|
|
24
|
+
| `Social::MoralReasoning` | `lex-moral-reasoning` | Six Haidt foundations, six Kohlberg stages, six ethical frameworks |
|
|
25
|
+
| `Social::Governance` | `lex-governance` | Four-layer governance — council proposals, quorum voting, action validation |
|
|
26
|
+
| `Social::JointAttention` | `lex-joint-attention` | Shared attention between agents — coordinating focus |
|
|
27
|
+
| `Social::Mirror` | `lex-mirror` | Mirror neuron analog — action observation and imitation |
|
|
28
|
+
| `Social::MirrorSystem` | `lex-mirror` | Extended mirror system |
|
|
29
|
+
| `Social::Entrainment` | `lex-cognitive-entrainment` | Rhythmic synchronization between agents |
|
|
30
|
+
| `Social::Symbiosis` | `lex-cognitive-symbiosis` | Mutually beneficial cognitive partnerships |
|
|
31
|
+
| `Social::Apprenticeship` | `lex-cognitive-apprenticeship` | Expert-novice learning relationships |
|
|
32
|
+
|
|
33
|
+
## Actors
|
|
34
|
+
|
|
35
|
+
- `Social::Conflict::Actors::StaleCheck` — runs every 3600s, checks for stale conflicts
|
|
36
|
+
- `Social::Consent::Actors::TierEvaluation` — runs every 3600s, evaluates and applies consent tiers
|
|
37
|
+
- `Social::Governance::Actors::ShadowAiScan` — interval actor, scans for shadow AI activity
|
|
38
|
+
- `Social::Governance::Actors::VoteTimeout` — runs every 300s, times out expired proposals
|
|
39
|
+
- `Social::JointAttention::Actors::Decay` — interval actor, decays joint attention focus
|
|
40
|
+
- `Social::Mentalizing::Actors::Decay` — interval actor, decays mentalizing model confidence
|
|
41
|
+
- `Social::MirrorSystem::Actors::Decay` — interval actor, decays mirror system activation
|
|
42
|
+
- `Social::Trust::Actors::Decay` — runs every 300s, decays all trust scores
|
|
8
43
|
|
|
9
44
|
## Installation
|
|
10
45
|
|
|
11
46
|
```ruby
|
|
12
47
|
gem 'lex-agentic-social'
|
|
13
48
|
```
|
|
49
|
+
|
|
50
|
+
## Development
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
bundle install
|
|
54
|
+
bundle exec rspec # 1646 examples, 0 failures
|
|
55
|
+
bundle exec rubocop # 0 offenses
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## License
|
|
59
|
+
|
|
60
|
+
MIT
|
|
@@ -21,6 +21,10 @@ module Legion
|
|
|
21
21
|
return { error: :too_many_perspectives } if @perspectives.size >= Constants::MAX_PERSPECTIVES
|
|
22
22
|
return { error: :invalid_type } unless Constants::PERSPECTIVE_TYPES.include?(type)
|
|
23
23
|
|
|
24
|
+
sym_priorities = Array(priorities).map(&:to_sym)
|
|
25
|
+
invalid = sym_priorities - Constants::PRIORITY_TYPES
|
|
26
|
+
return { error: :invalid_priorities, invalid: invalid } unless invalid.empty?
|
|
27
|
+
|
|
24
28
|
p = Perspective.new(
|
|
25
29
|
name: name,
|
|
26
30
|
perspective_type: type,
|
data/spec/legion/extensions/agentic/social/perspective_shifting/helpers/shifting_engine_spec.rb
CHANGED
|
@@ -35,6 +35,17 @@ RSpec.describe Legion::Extensions::Agentic::Social::PerspectiveShifting::Helpers
|
|
|
35
35
|
result = engine.add_perspective(name: 'overflow', type: :stakeholder)
|
|
36
36
|
expect(result[:error]).to eq(:too_many_perspectives)
|
|
37
37
|
end
|
|
38
|
+
|
|
39
|
+
it 'rejects invalid priorities' do
|
|
40
|
+
result = engine.add_perspective(name: 'x', type: :stakeholder, priorities: %i[telepathy])
|
|
41
|
+
expect(result[:error]).to eq(:invalid_priorities)
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
it 'accepts all valid PRIORITY_TYPES' do
|
|
45
|
+
constants = Legion::Extensions::Agentic::Social::PerspectiveShifting::Helpers::Constants
|
|
46
|
+
result = engine.add_perspective(name: 'all', type: :stakeholder, priorities: constants::PRIORITY_TYPES.dup)
|
|
47
|
+
expect(result).to be_a(Legion::Extensions::Agentic::Social::PerspectiveShifting::Helpers::Perspective)
|
|
48
|
+
end
|
|
38
49
|
end
|
|
39
50
|
|
|
40
51
|
describe '#add_situation' do
|