File tree Expand file tree Collapse file tree
extensions/levelcode-ai/test Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -63,10 +63,10 @@ test('extension.js does NOT re-snapshot the cap from the goal-start cfg (the ori
6363
6464test ( 'agent.js gates the loop on ctx.maxSteps directly, and never hoists it into a local' , ( ) => {
6565 const ag = read ( 'agent.js' ) ;
66- assert . match ( ag , / w h i l e \s * \( \s * s t e p \+ \+ \s * < \s * c t x \ .m a x S t e p s \s * \) / , 'the step loop must read ctx.maxSteps live' ) ;
66+ assert . match ( ag , / w h i l e \s * \( [ ^ ) ] * \b c t x \ .m a x S t e p s \b [ ^ ) ] * \) / , 'the step loop must read ctx.maxSteps live' ) ;
6767 // A copy (`const max = ctx.maxSteps`) or a destructure (`const { maxSteps } = ctx`) taken before the
6868 // loop would evaluate the getter exactly once — reintroducing the snapshot from the other side.
69- assert . ok ( ! / = \s * c t x \. m a x S t e p s \b / . test ( ag ) , 'ctx.maxSteps must not be assigned into a variable' ) ;
69+ assert . ok ( ! / \b (?: c o n s t | l e t | v a r ) \s + \w + \s * = \s * c t x \. m a x S t e p s \b / . test ( ag ) , 'ctx.maxSteps must not be assigned into a variable' ) ;
7070 assert . ok (
7171 ! / \b (?: c o n s t | l e t | v a r ) \s * \{ [ ^ } ] * \b m a x S t e p s \b [ ^ } ] * \} \s * = \s * c t x \b / . test ( ag ) ,
7272 'maxSteps must not be destructured off ctx'
You can’t perform that action at this time.
0 commit comments