lex-codegen 0.2.0 → 0.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6644f9f1492424c85216d97970dd24e0d03911babc8fe17ee716429845e77431
4
- data.tar.gz: 74a171c789a2707332a8386ec70367490306feff3dd8bf52fdd2545e3efc2772
3
+ metadata.gz: f2e30c960afc4038c2b8f08bf3d24d10885fff4337bee37dd9801d7d20c34472
4
+ data.tar.gz: e304453e246016cc9103929ac502163c3b00cd3b1c1362cea2948b016a16c6ba
5
5
  SHA512:
6
- metadata.gz: 10d39b6c2b81b3c070fff0f9851e7e1982ef7a317eb55a4876341af644a67d0cf8ebadf329c5c56279411fe0cbc5a7d8f9f04edab317b21a717c0473159e1273
7
- data.tar.gz: 52ee4e3f212a9f5a8fba59fb35fa32b2708f50ccf437bdf8743079d85d1fecdfab6c11d611fbd9e67304e57a79ede0d52222f70c765d0771ed1861724a6041d3
6
+ metadata.gz: ed9d68924f40f3cfe096c5f6e5588afabdfe4e4aa746ec1b321343021e9cf51b694d59ebe058f84835c680fe375ff59a98d13393847b5c9215b456db78a0c760
7
+ data.tar.gz: 1fb2feefe815838c4e9211f7b1b3eb463afd2dc644d19a9a5cafa4a2f9821822c3d251fcef377ca25d37f40d713f5fb3879f2ba82762f817c504bbf7d0071da4
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.2.1] - 2026-03-26
4
+
5
+ ### Changed
6
+ - `Actor::GapSubscriber` now enforces `corroboration.min_agents` threshold before boosting gap priority (default 2)
7
+
8
+ ### Added
9
+ - Expanded Apollo corroboration test coverage: boost values, cap at 1.0, unique provider counting, and edge cases (17 specs)
10
+
3
11
  ## [0.2.0] - 2026-03-26
4
12
 
5
13
  ### Added
@@ -12,7 +12,7 @@ module Legion
12
12
 
13
13
  ingest_gap_to_apollo(gap)
14
14
  corroboration_count = query_corroboration(gap)
15
- gap = boost_priority(gap, corroboration_count) if corroboration_count.positive?
15
+ gap = boost_priority(gap, corroboration_count) if corroboration_count >= min_agents
16
16
 
17
17
  result = Runners::FromGap.generate(gap: gap)
18
18
 
@@ -20,7 +20,7 @@ module Legion
20
20
 
21
21
  result
22
22
  rescue StandardError => e
23
- Legion::Logging.warn("GapSubscriber failed: #{e.message}") if defined?(Legion::Logging)
23
+ log&.warn("GapSubscriber failed: #{e.message}")
24
24
  { success: false, error: e.message }
25
25
  end
26
26
 
@@ -47,7 +47,7 @@ module Legion
47
47
  source: { provider: node_name, channel: 'gap_detector' }
48
48
  )
49
49
  rescue StandardError => e
50
- Legion::Logging.debug("GapSubscriber: Apollo ingest failed: #{e.message}") if defined?(Legion::Logging)
50
+ log&.debug("GapSubscriber: Apollo ingest failed: #{e.message}")
51
51
  end
52
52
 
53
53
  def query_corroboration(gap)
@@ -62,7 +62,7 @@ module Legion
62
62
  results = result[:results] || []
63
63
  results.map { |r| r.dig(:source, :provider) }.compact.uniq.size
64
64
  rescue StandardError => e
65
- Legion::Logging.debug("GapSubscriber: Apollo query failed: #{e.message}") if defined?(Legion::Logging)
65
+ log&.debug("GapSubscriber: Apollo query failed: #{e.message}")
66
66
  0
67
67
  end
68
68
 
@@ -85,6 +85,14 @@ module Legion
85
85
  Legion::Settings.dig(:codegen, :self_generate, :corroboration, :apollo_query_before_generate) != false
86
86
  end
87
87
 
88
+ def min_agents
89
+ if defined?(Legion::Settings)
90
+ Legion::Settings.dig(:codegen, :self_generate, :corroboration, :min_agents) || 2
91
+ else
92
+ 2
93
+ end
94
+ end
95
+
88
96
  def priority_boost_per_agent
89
97
  if defined?(Legion::Settings)
90
98
  Legion::Settings.dig(:codegen, :self_generate, :corroboration, :priority_boost_per_agent) || 0.15
@@ -96,6 +104,12 @@ module Legion
96
104
  def node_name
97
105
  defined?(Legion::Settings) ? (Legion::Settings.dig(:node, :name) || 'unknown') : 'unknown'
98
106
  end
107
+
108
+ def log
109
+ return unless defined?(Legion::Logging)
110
+
111
+ Legion::Logging
112
+ end
99
113
  end
100
114
  end
101
115
  end
@@ -18,9 +18,17 @@ module Legion
18
18
 
19
19
  Runners::ReviewHandler.handle_verdict(review: review)
20
20
  rescue StandardError => e
21
- Legion::Logging.warn("ReviewSubscriber failed: #{e.message}") if defined?(Legion::Logging)
21
+ log&.warn("ReviewSubscriber failed: #{e.message}")
22
22
  { success: false, error: e.message }
23
23
  end
24
+
25
+ private
26
+
27
+ def log
28
+ return unless defined?(Legion::Logging)
29
+
30
+ Legion::Logging
31
+ end
24
32
  end
25
33
  end
26
34
  end
@@ -3,7 +3,7 @@
3
3
  module Legion
4
4
  module Extensions
5
5
  module Codegen
6
- VERSION = '0.2.0'
6
+ VERSION = '0.2.1'
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lex-codegen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esity