lex-mesh 0.4.4 → 0.4.6
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/lib/legion/extensions/mesh/helpers/preference_profile.rb +2 -0
- data/lib/legion/extensions/mesh/transport/exchanges/fanout.rb +27 -0
- data/lib/legion/extensions/mesh/transport/messages/gossip.rb +1 -1
- data/lib/legion/extensions/mesh/transport/messages/mesh_conflict.rb +1 -1
- data/lib/legion/extensions/mesh/transport/messages/mesh_departure.rb +1 -1
- data/lib/legion/extensions/mesh/transport/queues/gossip.rb +1 -5
- data/lib/legion/extensions/mesh/version.rb +1 -1
- data/lib/legion/extensions/mesh.rb +1 -0
- data/spec/legion/extensions/mesh/helpers/preference_profile_spec.rb +21 -0
- data/spec/legion/extensions/mesh/transport/messages/gossip_spec.rb +5 -7
- data/spec/legion/extensions/mesh/transport/messages/mesh_conflict_spec.rb +5 -7
- data/spec/legion/extensions/mesh/transport/messages/mesh_departure_spec.rb +5 -7
- data/spec/legion/extensions/mesh/transport/queues/gossip_spec.rb +14 -12
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5e748e565682b21ecca099dff05a5192840b124d01697a572dcb34e4fd8ddf4b
|
|
4
|
+
data.tar.gz: 01ba8a7a0c658ef92be7bd39faa85e3d616e9b65ff8a05f8eb476816877a5e03
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5c13da093e85c3524da32a7415600c8e6f46376fa3b9c1f86fc64115ec9b44f375a304e799edf2bb0fcd19647fa9fadbb5bc669332cfc65d8094a2ed51cf8da2
|
|
7
|
+
data.tar.gz: f12094b18f644e91eca7fe9ac0cdd8d987ce41d910830d89bb149f9843368c76511f53a7e8aba0110d15918a0d7410053bf552bb0480101ab1227097bbe86011
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Legion
|
|
4
|
+
module Extensions
|
|
5
|
+
module Mesh
|
|
6
|
+
module Transport
|
|
7
|
+
module Exchanges
|
|
8
|
+
class Fanout < Legion::Transport::Exchange
|
|
9
|
+
def exchange_name
|
|
10
|
+
'amq.fanout'
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def default_type
|
|
14
|
+
'fanout'
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def default_options
|
|
18
|
+
hash = super
|
|
19
|
+
hash[:passive] = true
|
|
20
|
+
hash
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -14,6 +14,7 @@ require 'legion/extensions/mesh/runners/delegation'
|
|
|
14
14
|
require 'legion/extensions/mesh/runners/task_request'
|
|
15
15
|
|
|
16
16
|
if Legion.const_defined?(:Transport, false)
|
|
17
|
+
require 'legion/extensions/mesh/transport/exchanges/fanout'
|
|
17
18
|
require 'legion/extensions/mesh/transport/messages/preference_query'
|
|
18
19
|
require 'legion/extensions/mesh/transport/messages/preference_response'
|
|
19
20
|
require 'legion/extensions/mesh/transport/messages/mesh_departure'
|
|
@@ -286,4 +286,25 @@ RSpec.describe Legion::Extensions::Mesh::Helpers::PreferenceProfile do
|
|
|
286
286
|
expect(instructions).to be_nil
|
|
287
287
|
end
|
|
288
288
|
end
|
|
289
|
+
|
|
290
|
+
describe 'SOURCE_CONFIDENCE' do
|
|
291
|
+
it 'includes observation source' do
|
|
292
|
+
expect(described_class::SOURCE_CONFIDENCE).to have_key('observation')
|
|
293
|
+
expect(described_class::SOURCE_CONFIDENCE['observation']).to eq(0.55)
|
|
294
|
+
end
|
|
295
|
+
|
|
296
|
+
it 'includes llm_inference source' do
|
|
297
|
+
expect(described_class::SOURCE_CONFIDENCE).to have_key('llm_inference')
|
|
298
|
+
expect(described_class::SOURCE_CONFIDENCE['llm_inference']).to eq(0.65)
|
|
299
|
+
end
|
|
300
|
+
|
|
301
|
+
it 'maintains descending confidence order for all sources' do
|
|
302
|
+
conf = described_class::SOURCE_CONFIDENCE
|
|
303
|
+
expect(conf['explicit']).to be > conf['preference_learning']
|
|
304
|
+
expect(conf['preference_learning']).to be > conf['llm_inference']
|
|
305
|
+
expect(conf['llm_inference']).to be > conf['observation']
|
|
306
|
+
expect(conf['observation']).to be > conf['personality']
|
|
307
|
+
expect(conf['personality']).to be > conf['defaults']
|
|
308
|
+
end
|
|
309
|
+
end
|
|
289
310
|
end
|
|
@@ -14,17 +14,15 @@ unless defined?(Legion::Transport::Message)
|
|
|
14
14
|
end
|
|
15
15
|
end
|
|
16
16
|
|
|
17
|
-
unless defined?(Legion::Transport::
|
|
17
|
+
unless defined?(Legion::Transport::Exchange)
|
|
18
18
|
module Legion
|
|
19
19
|
module Transport
|
|
20
|
-
|
|
21
|
-
class Node # rubocop:disable Lint/EmptyClass
|
|
22
|
-
end
|
|
23
|
-
end
|
|
20
|
+
class Exchange; end # rubocop:disable Lint/EmptyClass
|
|
24
21
|
end
|
|
25
22
|
end
|
|
26
23
|
end
|
|
27
24
|
|
|
25
|
+
require 'legion/extensions/mesh/transport/exchanges/fanout'
|
|
28
26
|
require 'legion/extensions/mesh/transport/messages/gossip'
|
|
29
27
|
|
|
30
28
|
RSpec.describe Legion::Extensions::Mesh::Transport::Messages::Gossip do
|
|
@@ -36,8 +34,8 @@ RSpec.describe Legion::Extensions::Mesh::Transport::Messages::Gossip do
|
|
|
36
34
|
)
|
|
37
35
|
end
|
|
38
36
|
|
|
39
|
-
it 'uses the
|
|
40
|
-
expect(subject.exchange).to eq(Legion::Transport::Exchanges::
|
|
37
|
+
it 'uses the fanout exchange' do
|
|
38
|
+
expect(subject.exchange).to eq(Legion::Extensions::Mesh::Transport::Exchanges::Fanout)
|
|
41
39
|
end
|
|
42
40
|
|
|
43
41
|
it 'routes to mesh.gossip' do
|
|
@@ -14,17 +14,15 @@ unless defined?(Legion::Transport::Message)
|
|
|
14
14
|
end
|
|
15
15
|
end
|
|
16
16
|
|
|
17
|
-
unless defined?(Legion::Transport::
|
|
17
|
+
unless defined?(Legion::Transport::Exchange)
|
|
18
18
|
module Legion
|
|
19
19
|
module Transport
|
|
20
|
-
|
|
21
|
-
class Node # rubocop:disable Lint/EmptyClass
|
|
22
|
-
end
|
|
23
|
-
end
|
|
20
|
+
class Exchange; end # rubocop:disable Lint/EmptyClass
|
|
24
21
|
end
|
|
25
22
|
end
|
|
26
23
|
end
|
|
27
24
|
|
|
25
|
+
require 'legion/extensions/mesh/transport/exchanges/fanout'
|
|
28
26
|
require 'legion/extensions/mesh/transport/messages/mesh_conflict'
|
|
29
27
|
|
|
30
28
|
RSpec.describe Legion::Extensions::Mesh::Transport::Messages::MeshConflict do
|
|
@@ -37,8 +35,8 @@ RSpec.describe Legion::Extensions::Mesh::Transport::Messages::MeshConflict do
|
|
|
37
35
|
end
|
|
38
36
|
|
|
39
37
|
describe '#exchange' do
|
|
40
|
-
it 'returns the
|
|
41
|
-
expect(msg.exchange).to eq(Legion::Transport::Exchanges::
|
|
38
|
+
it 'returns the Fanout exchange' do
|
|
39
|
+
expect(msg.exchange).to eq(Legion::Extensions::Mesh::Transport::Exchanges::Fanout)
|
|
42
40
|
end
|
|
43
41
|
end
|
|
44
42
|
|
|
@@ -14,17 +14,15 @@ unless defined?(Legion::Transport::Message)
|
|
|
14
14
|
end
|
|
15
15
|
end
|
|
16
16
|
|
|
17
|
-
unless defined?(Legion::Transport::
|
|
17
|
+
unless defined?(Legion::Transport::Exchange)
|
|
18
18
|
module Legion
|
|
19
19
|
module Transport
|
|
20
|
-
|
|
21
|
-
class Node # rubocop:disable Lint/EmptyClass
|
|
22
|
-
end
|
|
23
|
-
end
|
|
20
|
+
class Exchange; end # rubocop:disable Lint/EmptyClass
|
|
24
21
|
end
|
|
25
22
|
end
|
|
26
23
|
end
|
|
27
24
|
|
|
25
|
+
require 'legion/extensions/mesh/transport/exchanges/fanout'
|
|
28
26
|
require 'legion/extensions/mesh/transport/messages/mesh_departure'
|
|
29
27
|
|
|
30
28
|
RSpec.describe Legion::Extensions::Mesh::Transport::Messages::MeshDeparture do
|
|
@@ -36,8 +34,8 @@ RSpec.describe Legion::Extensions::Mesh::Transport::Messages::MeshDeparture do
|
|
|
36
34
|
end
|
|
37
35
|
|
|
38
36
|
describe '#exchange' do
|
|
39
|
-
it 'returns the
|
|
40
|
-
expect(msg.exchange).to eq(Legion::Transport::Exchanges::
|
|
37
|
+
it 'returns the Fanout exchange' do
|
|
38
|
+
expect(msg.exchange).to eq(Legion::Extensions::Mesh::Transport::Exchanges::Fanout)
|
|
41
39
|
end
|
|
42
40
|
end
|
|
43
41
|
|
|
@@ -12,17 +12,25 @@ unless defined?(Legion::Transport::Queue)
|
|
|
12
12
|
end
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
-
unless defined?(Legion::Transport::
|
|
15
|
+
unless defined?(Legion::Transport::Queue)
|
|
16
16
|
module Legion
|
|
17
17
|
module Transport
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
end
|
|
18
|
+
class Queue
|
|
19
|
+
def initialize(**); end
|
|
21
20
|
end
|
|
22
21
|
end
|
|
23
22
|
end
|
|
24
23
|
end
|
|
25
24
|
|
|
25
|
+
unless defined?(Legion::Transport::Exchange)
|
|
26
|
+
module Legion
|
|
27
|
+
module Transport
|
|
28
|
+
class Exchange; end # rubocop:disable Lint/EmptyClass
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
require 'legion/extensions/mesh/transport/exchanges/fanout'
|
|
26
34
|
require 'legion/extensions/mesh/transport/queues/gossip'
|
|
27
35
|
|
|
28
36
|
RSpec.describe Legion::Extensions::Mesh::Transport::Queues::Gossip do
|
|
@@ -35,14 +43,8 @@ RSpec.describe Legion::Extensions::Mesh::Transport::Queues::Gossip do
|
|
|
35
43
|
end
|
|
36
44
|
|
|
37
45
|
describe '#exchange' do
|
|
38
|
-
it 'returns
|
|
39
|
-
expect(queue.exchange).to eq(Legion::Transport::Exchanges::
|
|
40
|
-
end
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
describe '#routing_key' do
|
|
44
|
-
it "returns 'mesh.gossip'" do
|
|
45
|
-
expect(queue.routing_key).to eq('mesh.gossip')
|
|
46
|
+
it 'returns the Fanout exchange' do
|
|
47
|
+
expect(queue.exchange).to eq(Legion::Extensions::Mesh::Transport::Exchanges::Fanout)
|
|
46
48
|
end
|
|
47
49
|
end
|
|
48
50
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: lex-mesh
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.
|
|
4
|
+
version: 0.4.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Esity
|
|
@@ -164,6 +164,7 @@ files:
|
|
|
164
164
|
- lib/legion/extensions/mesh/runners/mesh.rb
|
|
165
165
|
- lib/legion/extensions/mesh/runners/preferences.rb
|
|
166
166
|
- lib/legion/extensions/mesh/runners/task_request.rb
|
|
167
|
+
- lib/legion/extensions/mesh/transport/exchanges/fanout.rb
|
|
167
168
|
- lib/legion/extensions/mesh/transport/messages/gossip.rb
|
|
168
169
|
- lib/legion/extensions/mesh/transport/messages/mesh_conflict.rb
|
|
169
170
|
- lib/legion/extensions/mesh/transport/messages/mesh_departure.rb
|