lex-agentic-homeostasis 0.1.8 → 0.1.9

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: e70864e92a5b67a9c47778e00cd9af8675c51bfcb0fe143eadddda1ba50c8941
4
- data.tar.gz: 7c3e45c009a7b7004620ffff85de9cc1aed3f85732037e20c214b45e9f2f02b0
3
+ metadata.gz: e05f1daa72277d2750d5861d359ca46521c428565f78c4b08df8c3b1ce08396f
4
+ data.tar.gz: 4bebd82aa5950f5644646b96a66743142a4fe3fea03ad1d4fb50a74103023c44
5
5
  SHA512:
6
- metadata.gz: 82da2ce2011f8b9becb15d3ea0b0468eff393adf3aa2111d0d1fa7ad37b2bd2f8088b396a95ccef451c0a8a84bb4dccbf23b4e208a1f5fb1a44b2906523e35b4
7
- data.tar.gz: 20d82bf609f2e3fbf1310591ab8a486d7aed2972ab45278aaf29c5e6bfc43ae134613a8e005a33c4cc6e76dde6db383deac49fb7acebc07eb32ee447b2e05e57
6
+ metadata.gz: d5d900d3c38061da7a56f1ff5622d7d17424f6d6b7361a7e460682c2f3f0d7dda8f094b418dac84e7d3eceb99aa08e21f7d69aed72843c956e7824301266f517
7
+ data.tar.gz: 0bb9cef731a2afab799139d833a75f5ca7094c793c486acb9de402ee7d4f90365d02269cd254da447b09290dc29a858ddbdb21038d2afac184e3f07bd56bc67f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.1.9] - 2026-06-01
4
+ ### Fixed
5
+ - HomeostasisEngine#prune_if_needed now removes the worst variable (min_by) instead of the best (max_by) — system was discarding healthiest variables and keeping the worst
6
+ - AllostaticLoad#reset now resets @peak_load alongside @load, preventing stale peak values after recovery
7
+ - FurnaceEngine#smelt now caps @alloy_history at MAX_ALLOY_HISTORY (500), preventing unbounded memory growth
8
+
3
9
  ## [0.1.8] - 2026-04-22
4
10
  ### Fixed
5
11
  - Tempo Adapt actor now calls `run_tempo_adaptation` instead of read-only `tempo_report`
@@ -69,6 +69,7 @@ module Legion
69
69
 
70
70
  def reset
71
71
  @load = 0.0
72
+ @peak_load = 0.0
72
73
  @history.clear
73
74
  end
74
75
 
@@ -10,8 +10,9 @@ module Legion
10
10
  ORE_TYPES = %i[experience observation hypothesis data intuition].freeze
11
11
  ALLOY_TYPES = %i[insight wisdom expertise synthesis theory].freeze
12
12
 
13
- MAX_ORES = 500
14
- MAX_CRUCIBLES = 50
13
+ MAX_ORES = 500
14
+ MAX_CRUCIBLES = 50
15
+ MAX_ALLOY_HISTORY = 500
15
16
 
16
17
  HEAT_RATE = 0.1
17
18
  COOL_RATE = 0.05
@@ -7,6 +7,8 @@ module Legion
7
7
  module Furnace
8
8
  module Helpers
9
9
  class FurnaceEngine
10
+ include Constants
11
+
10
12
  attr_reader :ores, :crucibles, :alloy_history
11
13
 
12
14
  def initialize
@@ -94,6 +96,7 @@ module Legion
94
96
  result = crucible.smelt!(@ores, alloy_type: alloy_type)
95
97
  if result[:smelted]
96
98
  @alloy_history << result[:alloy]
99
+ @alloy_history.shift while @alloy_history.size > MAX_ALLOY_HISTORY
97
100
  remove_smelted_ores!(result.dig(:alloy, :source_ore_ids) || [])
98
101
  end
99
102
  result.merge(crucible_id: crucible_id)
@@ -135,8 +135,8 @@ module Legion
135
135
  def prune_if_needed
136
136
  return if @variables.size < MAX_VARIABLES
137
137
 
138
- best = @variables.values.max_by(&:balance_score)
139
- @variables.delete(best.id) if best
138
+ worst = @variables.values.min_by(&:balance_score)
139
+ @variables.delete(worst.id) if worst
140
140
  end
141
141
  end
142
142
  end
@@ -4,7 +4,7 @@ module Legion
4
4
  module Extensions
5
5
  module Agentic
6
6
  module Homeostasis
7
- VERSION = '0.1.8'
7
+ VERSION = '0.1.9'
8
8
  end
9
9
  end
10
10
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lex-agentic-homeostasis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esity