@@ -149,13 +149,13 @@ class TestRetentionPolicyChainedDeltas:
149149
150150 def test_keeps_entire_active_chain (self ) -> None :
151151 """Should keep all windows from current anchor to now."""
152- from grail .trainer . checkpoint_publisher import _compute_keep_windows
152+ from grail .shared . retention_utils import compute_retention_windows
153153
154- with patch ("grail.trainer.checkpoint_publisher .DELTA_BASE_INTERVAL" , 5 ):
155- with patch ("grail.trainer.checkpoint_publisher .WINDOW_LENGTH" , 30 ):
154+ with patch ("grail.shared.retention_utils .DELTA_BASE_INTERVAL" , 5 ):
155+ with patch ("grail.shared.retention_utils .WINDOW_LENGTH" , 30 ):
156156 # Anchor stride = 5 * 30 = 150
157157 # Current window 180: anchor at 150
158- result = _compute_keep_windows (180 )
158+ result = compute_retention_windows (180 )
159159
160160 # Should keep: 150, 180 (chain from 150 to 180)
161161 # Also 0 (previous anchor) and 0-150 chain
@@ -164,14 +164,14 @@ def test_keeps_entire_active_chain(self) -> None:
164164
165165 def test_keeps_previous_anchor_chain (self ) -> None :
166166 """Should keep previous anchor's chain for transition."""
167- from grail .trainer . checkpoint_publisher import _compute_keep_windows
167+ from grail .shared . retention_utils import compute_retention_windows
168168
169- with patch ("grail.trainer.checkpoint_publisher .DELTA_BASE_INTERVAL" , 3 ):
170- with patch ("grail.trainer.checkpoint_publisher .WINDOW_LENGTH" , 30 ):
169+ with patch ("grail.shared.retention_utils .DELTA_BASE_INTERVAL" , 3 ):
170+ with patch ("grail.shared.retention_utils .WINDOW_LENGTH" , 30 ):
171171 # Anchor stride = 3 * 30 = 90
172172 # Current window 120: anchor at 90
173173 # Previous anchor at 0
174- result = _compute_keep_windows (120 )
174+ result = compute_retention_windows (120 )
175175
176176 # Current chain: 90, 120
177177 assert 90 in result
@@ -190,8 +190,8 @@ def test_consumer_retention_keeps_chain(self) -> None:
190190 keep_limit = 3 ,
191191 )
192192
193- with patch ("grail.infrastructure.checkpoint_consumer .DELTA_BASE_INTERVAL" , 5 ):
194- with patch ("grail.infrastructure.checkpoint_consumer .WINDOW_LENGTH" , 30 ):
193+ with patch ("grail.shared.retention_utils .DELTA_BASE_INTERVAL" , 5 ):
194+ with patch ("grail.shared.retention_utils .WINDOW_LENGTH" , 30 ):
195195 result = manager ._compute_keep_windows (180 )
196196
197197 # Should keep chain from anchor (150) to now (180)
0 commit comments