@@ -289,43 +289,41 @@ it.effect("still requires the prior checkpoint when no start ref exists", () =>
289289 } ) . pipe ( Effect . provide ( layer ) ) ;
290290} ) ;
291291
292- for ( const hasStartSnapshot of [ false , true ] ) {
293- it . effect (
294- `uses ${ hasStartSnapshot ? "fresh" : "legacy" } baseline for an individual V2 turn` ,
295- ( ) => {
296- const projection = makeProjection ( ) ;
297- const firstRef = checkpointRefForScopeOrdinal ( {
298- scopeId : firstScopeId ,
299- ordinalWithinScope : 1 ,
300- } ) ;
301- const diffCheckpoints = vi . fn ( ( _input : CheckpointStore . DiffCheckpointsInput ) =>
302- Effect . succeed ( "patch" ) ,
292+ it . effect . each ( [ false , true ] ) (
293+ "uses the fresh baseline for an individual V2 turn when it has a start snapshot: %s" ,
294+ ( hasStartSnapshot ) => {
295+ const projection = makeProjection ( ) ;
296+ const firstRef = checkpointRefForScopeOrdinal ( {
297+ scopeId : firstScopeId ,
298+ ordinalWithinScope : 1 ,
299+ } ) ;
300+ const diffCheckpoints = vi . fn ( ( _input : CheckpointStore . DiffCheckpointsInput ) =>
301+ Effect . succeed ( "patch" ) ,
302+ ) ;
303+ const layer = makeLayer ( {
304+ hasStartSnapshot,
305+ diffCheckpoints,
306+ projection : Effect . succeed ( {
307+ ...projection ,
308+ checkpoints : [
309+ ...projection . checkpoints ,
310+ {
311+ scopeId : firstScopeId ,
312+ runId : firstRunId ,
313+ appRunOrdinal : 1 ,
314+ status : "ready" ,
315+ ref : firstRef ,
316+ } ,
317+ ] ,
318+ } ) ,
319+ } ) ;
320+ return Effect . gen ( function * ( ) {
321+ const query = yield * CheckpointDiffQuery . CheckpointDiffQuery ;
322+ yield * query . getTurnDiff ( { threadId, fromTurnCount : 1 , toTurnCount : 2 } ) ;
323+ assert . equal (
324+ diffCheckpoints . mock . calls [ 0 ] ?. [ 0 ] . fromCheckpointRef ,
325+ hasStartSnapshot ? checkpointStartRef ( secondRef ) : firstRef ,
303326 ) ;
304- const layer = makeLayer ( {
305- hasStartSnapshot,
306- diffCheckpoints,
307- projection : Effect . succeed ( {
308- ...projection ,
309- checkpoints : [
310- ...projection . checkpoints ,
311- {
312- scopeId : firstScopeId ,
313- runId : firstRunId ,
314- appRunOrdinal : 1 ,
315- status : "ready" ,
316- ref : firstRef ,
317- } ,
318- ] ,
319- } ) ,
320- } ) ;
321- return Effect . gen ( function * ( ) {
322- const query = yield * CheckpointDiffQuery . CheckpointDiffQuery ;
323- yield * query . getTurnDiff ( { threadId, fromTurnCount : 1 , toTurnCount : 2 } ) ;
324- assert . equal (
325- diffCheckpoints . mock . calls [ 0 ] ?. [ 0 ] . fromCheckpointRef ,
326- hasStartSnapshot ? checkpointStartRef ( secondRef ) : firstRef ,
327- ) ;
328- } ) . pipe ( Effect . provide ( layer ) ) ;
329- } ,
330- ) ;
331- }
327+ } ) . pipe ( Effect . provide ( layer ) ) ;
328+ } ,
329+ ) ;
0 commit comments