lex-agentic-social 0.1.14 → 0.1.15
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4ae718ace3eafb04ea8f811bb5cf0d9ef384e6b63887f1423c8461b04269a524
|
|
4
|
+
data.tar.gz: 84e78ce21707ba78c4f90dc5168a99ca494fa4610d12cc609a72f5664cf43bee
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 14f3884ae4814a76e9872081d132cd4b9b3fbf5a3dcf247541a67e5cf6c4d3a152e071753de8fc45a50a99cdb83df78dc2a8019f1fb949dea1f628a4da7870af
|
|
7
|
+
data.tar.gz: 3f991289c88888c67ddb146e094ea07f39f7fd79698c35c1b8b4bbb01cf29c74e6b256238c4b0f6b2c411eab6a070893db5350a99c8c1f0e7775461eca2c0ce4
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.1.15] - 2026-04-27
|
|
4
|
+
### Fixed
|
|
5
|
+
- Stop social calibration partner-knowledge promotion when Legion is shutting down or Apollo Local becomes unavailable between promotable tag groups
|
|
6
|
+
|
|
3
7
|
## [0.1.14] - 2026-04-22
|
|
4
8
|
### Added
|
|
5
9
|
- `Governance#review_transition` method — API expected by lex-extinction for containment governance gate
|
|
@@ -79,10 +79,14 @@ module Legion
|
|
|
79
79
|
end
|
|
80
80
|
|
|
81
81
|
def promote_partner_knowledge(**)
|
|
82
|
+
return { success: true, skipped: :shutting_down } if shutting_down?
|
|
82
83
|
return { success: true, skipped: :local_unavailable } unless apollo_local_available?
|
|
83
84
|
|
|
84
85
|
total = 0
|
|
85
86
|
Helpers::Constants::PROMOTABLE_TAGS.each do |tags|
|
|
87
|
+
return { success: true, promoted: total, stopped: :shutting_down } if shutting_down?
|
|
88
|
+
return { success: true, promoted: total, stopped: :local_unavailable } unless apollo_local_available?
|
|
89
|
+
|
|
86
90
|
result = Legion::Apollo::Local.promote_to_global(tags: tags, min_confidence: Helpers::Constants::PROMOTION_MIN_CONFIDENCE)
|
|
87
91
|
total += result[:promoted] if result[:success]
|
|
88
92
|
end
|
|
@@ -112,6 +116,14 @@ module Legion
|
|
|
112
116
|
defined?(Legion::Apollo::Local) && Legion::Apollo::Local.started?
|
|
113
117
|
end
|
|
114
118
|
|
|
119
|
+
def shutting_down?
|
|
120
|
+
return Legion.shutting_down? if defined?(Legion) && Legion.respond_to?(:shutting_down?)
|
|
121
|
+
|
|
122
|
+
defined?(Legion::Settings) && Legion::Settings.dig(:client, :shutting_down) == true
|
|
123
|
+
rescue StandardError => _e
|
|
124
|
+
false
|
|
125
|
+
end
|
|
126
|
+
|
|
115
127
|
def retrieve_interaction_traces
|
|
116
128
|
traces = retrieve_from_memory
|
|
117
129
|
return traces if traces.any?
|
|
@@ -146,6 +146,32 @@ RSpec.describe Legion::Extensions::Agentic::Social::Calibration::Runners::Calibr
|
|
|
146
146
|
result = client.promote_partner_knowledge
|
|
147
147
|
expect(result[:skipped]).to eq(:local_unavailable)
|
|
148
148
|
end
|
|
149
|
+
|
|
150
|
+
it 'skips when Legion is shutting down' do
|
|
151
|
+
allow(Legion::Settings).to receive(:dig).with(:client, :shutting_down).and_return(true)
|
|
152
|
+
|
|
153
|
+
result = client.promote_partner_knowledge
|
|
154
|
+
expect(result[:skipped]).to eq(:shutting_down)
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
it 'stops when Apollo Local becomes unavailable between tag groups' do
|
|
158
|
+
mock_local = double('apollo_local')
|
|
159
|
+
stub_const('Legion::Apollo', Module.new)
|
|
160
|
+
stub_const('Legion::Apollo::Local', mock_local)
|
|
161
|
+
allow(Legion::Settings).to receive(:dig).with(:client, :shutting_down).and_return(false)
|
|
162
|
+
allow(mock_local).to receive(:started?).and_return(true, true, false)
|
|
163
|
+
expect(mock_local).to receive(:promote_to_global)
|
|
164
|
+
.with(
|
|
165
|
+
tags: Legion::Extensions::Agentic::Social::Calibration::Helpers::Constants::PROMOTABLE_TAGS.first,
|
|
166
|
+
min_confidence: Legion::Extensions::Agentic::Social::Calibration::Helpers::Constants::PROMOTION_MIN_CONFIDENCE
|
|
167
|
+
)
|
|
168
|
+
.once
|
|
169
|
+
.and_return({ success: true, promoted: 2 })
|
|
170
|
+
|
|
171
|
+
result = client.promote_partner_knowledge
|
|
172
|
+
expect(result[:promoted]).to eq(2)
|
|
173
|
+
expect(result[:stopped]).to eq(:local_unavailable)
|
|
174
|
+
end
|
|
149
175
|
end
|
|
150
176
|
|
|
151
177
|
describe '#sync_partner_knowledge' do
|