@@ -48,7 +48,14 @@ function acceptsComment(body, { action = 'created', pullRequest = false, associa
4848
4949describe ( 'Issue planning workflow' , ( ) => {
5050 it ( 'accepts a leading /plan command with optional direction on a new issue comment' , ( ) => {
51- for ( const body of [ '/plan' , '/plan Focus on Python' , '/plan\nFocus on .NET' , '/plan\r\nFocus on both' ] ) {
51+ for ( const body of [
52+ '/plan' ,
53+ '/plan Focus on Python' ,
54+ '/plan also check if feature X already solves this problem' ,
55+ '/plan\nFocus on .NET' ,
56+ '/plan\r\nFocus on both' ,
57+ '/plan\nCheck existing samples.\nConsider compatibility.' ,
58+ ] ) {
5259 assert . equal ( acceptsComment ( body ) , true , body ) ;
5360 }
5461 } ) ;
@@ -128,18 +135,77 @@ describe('Issue planning workflow', () => {
128135 assert . match ( source , / A n s w e r s a l o n e d o n o t t r i g g e r a n o t h e r r u n / ) ;
129136 assert . match ( source , / M a t c h e a r l i e r q u e s t i o n s t o t h e a n s w e r s a n d c o r r e c t i o n s / ) ;
130137 assert . match ( source , / p r e v i o u s p l a n n i n g c o m m e n t s a s p r o p o s a l s t o r e a s s e s s / ) ;
131- assert . match ( source , / I f i m p o r t a n t g a p s r e m a i n o r t h e a n s w e r s r e v e a l n e w g a p s , a s k / ) ;
138+ assert . match ( source , / I f i m p o r t a n t g a p s \s + r e m a i n o r t h e a n s w e r s r e v e a l n e w g a p s , a s k / ) ;
132139 assert . match ( source , / F o r a p a r t i a l l y a n s w e r e d q u e s t i o n , a s k o n l y / ) ;
133140 assert . match ( source , / b r i e f l y a c k n o w l e d g e w h a t t h e l a t e s t a n s w e r s c l a r i f i e d / ) ;
134141 assert . match ( source , / l e a v e s e a r l i e r c o m m e n t s i n t a c t / ) ;
142+ assert . match ( source , / n e w i n v e s t i g a t i o n d i r e c t i o n / ) ;
143+ assert . match ( source , / r e a s s e s s w h e t h e r a c t i o n i s w a r r a n t e d / ) ;
144+ assert . match ( source , / D o n o t m e c h a n i c a l l y e x t e n d a n e a r l i e r i m p l e m e n t a t i o n p l a n / ) ;
135145 } ) ;
136146
137- it ( 'requires investigation, a plan-or-questions decision, and plain-language context' , ( ) => {
147+ it ( 'uses optional direction as bounded investigation guidance through sanitized prompt input' , ( ) => {
148+ assert . match ( source , / A b a r e ` \/ p l a n ` r e q u e s t s t h e f u l l i n v e s t i g a t i o n / ) ;
149+ assert . match ( source , / O p t i o n a l t e x t a f t e r t h e \s + l e a d i n g ` \/ p l a n ` g u i d e s w h a t t o f o c u s o n / ) ;
150+ assert . match ( source , / I n d e p e n d e n t l y v e r i f y s u g g e s t e d e x p l a n a t i o n s , f e a t u r e s , a n d s o l u t i o n s / ) ;
151+ assert . match ( source , / e x p l a i n t h e r e s u l t o f t h e r e q u e s t e d c h e c k s o r w h a t \s + c o u l d n o t b e c h e c k e d a n d w h y / ) ;
152+ assert . match ( source , / d o e s n o t o v e r r i d e w o r k f l o w s a f e g u a r d s / ) ;
153+ assert . match ( source , / e x p a n d r e p o s i t o r y a c c e s s , a u t h o r i z e r u n n i n g c o d e , o r f o r c e a p a r t i c u l a r c o n c l u s i o n / ) ;
154+ assert . match ( source , / < r e q u e s t > \s * \$ \{ \{ s t e p s \. s a n i t i z e d \. o u t p u t s \. t e x t \} \} \s * < \/ r e q u e s t > / ) ;
155+ assert . match ( job ( 'activation' ) , / t e x t : \$ \{ \{ s t e p s \. s a n i t i z e d \. o u t p u t s \. t e x t \} \} / ) ;
156+ assert . match ( job ( 'activation' ) , / G H _ A W _ S T E P S _ S A N I T I Z E D _ O U T P U T S _ T E X T : \$ \{ \{ s t e p s \. s a n i t i z e d \. o u t p u t s \. t e x t \} \} / ) ;
157+ assert . match ( job ( 'activation' ) , / \{ \{ # r u n t i m e - i m p o r t \. g i t h u b \/ w o r k f l o w s \/ i s s u e - p l a n \. m d \} \} / ) ;
158+ } ) ;
159+
160+ it ( 'forms recommendations independently of unmerged pull request solutions' , ( ) => {
161+ assert . match ( source , / m a y a c k n o w l e d g e t h a t a n o p e n p u l l r e q u e s t e x i s t s / ) ;
162+ assert . match ( source , / d o n o t i n s p e c t i t s \s + p r o p o s e d i m p l e m e n t a t i o n , d i f f , o r r e v i e w s / ) ;
163+ assert . match ( source , / D o n o t u s e o p e n p u l l r e q u e s t s a s s o l u t i o n e v i d e n c e o r a s e v i d e n c e o f n e c e s s i t y , \s + s c o p e , c o m p l e x i t y , o r a n a p p r o v e d a p p r o a c h / ) ;
164+ assert . match ( source , / a l s o a p p l i e s t o p r o p o s e d f i x e s \s + q u o t e d i n t h e i s s u e d i s c u s s i o n / ) ;
165+ assert . match ( source , / A c l o s e d , u n m e r g e d p r o p o s a l i s \s + n o t e v i d e n c e o f s u p p o r t e d b e h a v i o r / ) ;
166+ assert . match ( source , / M e r g e d c h a n g e s m a y i n f o r m t h e i n v e s t i g a t i o n \s + o n l y w h e n t h e i r r e l e v a n c e t o c u r r e n t r e p o s i t o r y b e h a v i o r i s v e r i f i e d / ) ;
167+ assert . doesNotMatch ( source , / F o l l o w r e l e v a n t l i n k s t o i s s u e s a n d p u l l r e q u e s t s / ) ;
168+ } ) ;
169+
170+ it ( 'decides whether action is warranted before planning proportionate changes' , ( ) => {
171+ assert . ok ( source . indexOf ( '## Decide whether action is warranted' ) < source . indexOf ( '## Write the issue comment' ) ) ;
172+ assert . match ( source , / c o n t r a d i c t s s u p p o r t e d o r d o c u m e n t e d b e h a v i o r / ) ;
173+ assert . match ( source , / e x i s t i n g f e a t u r e s , c o n f i g u r a t i o n , s a m p l e s , o r d o c u m e n t a t i o n a l r e a d y \s + s o l v e t h e p r o b l e m / ) ;
174+ assert . match ( source , / w o r k a r o u n d i s n o t a u t o m a t i c a l l y a n a d e q u a t e r e s o l u t i o n / ) ;
175+ assert . match ( source , / S c e n a r i o s p e c i f i c i t y a l o n e i s n o t a r e a s o n \s + t o d i s m i s s a n i s s u e / ) ;
176+ assert . match ( source , / c o m p l e x i t y , c o m p a t i b i l i t y r i s k s , a n d o n g o i n g m a i n t e n a n c e c o s t / ) ;
177+ assert . match ( source , / C o m p l e x i t y i s a t r a d e - o f f , n o t \s + a n a u t o m a t i c r e a s o n t o r e j e c t a f i x / ) ;
178+ for ( const outcome of [ 'Code changes' , 'A sample' , 'Documentation' , 'documented limitation' , 'A combination' , 'No action' ] ) {
179+ assert . ok ( source . includes ( `**${ outcome } **` ) , `Missing recommendation outcome: ${ outcome } ` ) ;
180+ }
181+ assert . match ( source , / S u p p o r t t h e r e c o m m e n d a t i o n a n d m e a n i n g f u l t r a d e - o f f s w i t h r e p o s i t o r y e v i d e n c e / ) ;
182+ assert . match ( source , / h e a d i n g \* \* R e c o m m e n d a t i o n \* \* b e f o r e a n y p l a n / ) ;
183+ assert . match ( source , / S t a t e w h e t h e r c o d e c h a n g e s a r e w a r r a n t e d / ) ;
184+ assert . match ( source , / # # # W h e n n o a c t i o n i s r e c o m m e n d e d / ) ;
185+ assert . match ( source , / I f n e w d o c u m e n t a t i o n o f a \s + l i m i t a t i o n i s n e e d e d , p r o p o s e t h a t d o c u m e n t a t i o n w o r k r a t h e r t h a n c a l l i n g i t \s + n o a c t i o n / ) ;
186+ assert . match ( source , / D o n o t g i v e a f i r m r e c o m m e n d a t i o n o r p l a n w h i l e t h e s e a n s w e r s a r e \s + s t i l l n e e d e d / ) ;
187+ } ) ;
188+
189+ it ( 'sizes the response to the ask and grounds complex before-and-after examples' , ( ) => {
190+ assert . match ( source , / M a t c h t h e l e n g t h a n d d e p t h o f t h e r e s p o n s e t o t h e a s k , i t s c o m p l e x i t y / ) ;
191+ assert . match ( source , / F o r a s i m p l e a s k , k e e p t h e s u m m a r y , \s + r e c o m m e n d a t i o n , a n d p l a n s h o r t a n d t o t h e p o i n t / ) ;
192+ assert . match ( source , / F o r a c o m p l e x a s k , e x p l a i n t h e i m p o r t a n t t r a d e - o f f s a n d c o n s e q u e n c e s i n m o r e \s + d e t a i l / ) ;
193+ assert . match ( source , / s c e n a r i o s t e p b y s t e p : s h o w t h e c u r r e n t b e h a v i o r a n d w h e r e t h e i s s u e a r i s e s / ) ;
194+ assert . match ( source , / e x p l a i n h o w t h e p r o p o s e d c h a n g e w o u l d a f f e c t t h o s e s t e p s , a n d s h o w t h e s a m e \s + s c e n a r i o a f t e r t h e p r o p o s e d c h a n g e / ) ;
195+ assert . match ( source , / G r o u n d c u r r e n t b e h a v i o r i n r e p o s i t o r y \s + e v i d e n c e a n d c l e a r l y l a b e l t h e a f t e r - c h a n g e b e h a v i o r a s e x p e c t e d , n o t t e s t e d / ) ;
196+ assert . match ( source , / I f r e c o m m e n d i n g a s a m p l e , w o r k a r o u n d , o r d o c u m e n t e d l i m i t a t i o n i n s t e a d o f a f i x / ) ;
197+ assert . match ( source , / c o m p l e x i t y d o e s n o t r e q u i r e a l o n g r e s p o n s e w h e n t h e d e c i s i o n i s s t r a i g h t f o r w a r d / ) ;
198+ assert . match ( source , / \* \* P r o p o s e d p l a n \* \* a n d a n u m b e r e d l i s t s i z e d t o t h e w o r k / ) ;
199+ } ) ;
200+
201+ it ( 'requires investigation, outcome-appropriate validation, and plain-language context' , ( ) => {
138202 assert . match ( source , / a l l a v a i l a b l e c o m m e n t s , f o l l o w i n g \s + p a g i n a t i o n a s n e e d e d / ) ;
139203 assert . match ( source , / D o n o t a s k f o r i n f o r m a t i o n a l r e a d y p r o v i d e d / ) ;
140204 assert . match ( source , / # # # W h e n a p l a n i s a p p r o p r i a t e / ) ;
141205 assert . match ( source , / # # # W h e n i m p o r t a n t d e t a i l s a r e m i s s i n g / ) ;
142- assert . match ( source , / t e s t s f o r t h e r e p o r t e d b e h a v i o r a n d n e a r b y b e h a v i o r / ) ;
206+ assert . match ( source , / F o r c o d e c h a n g e s , i n c l u d e t e s t s f o r t h e r e p o r t e d b e h a v i o r a n d n e a r b y b e h a v i o r / ) ;
207+ assert . match ( source , / F o r s a m p l e o r d o c u m e n t a t i o n w o r k , d e s c r i b e a p p r o p r i a t e v a l i d a t i o n / ) ;
208+ assert . match ( source , / d o n o t i n v e n t c o d e c h a n g e s o r m a n d a t o r y c o d e t e s t s f o r d o c u m e n t a t i o n - o n l y w o r k / ) ;
143209 assert . match ( source , / f i r s t e x p l a i n a n y c o n t e x t t h a t h a s n o t a l r e a d y b e e n m e n t i o n e d / ) ;
144210 assert . match ( source , / U s e p l a i n , s i m p l e t e r m s / ) ;
145211 assert . match ( source , / A v o i d j a r g o n a n d u n e x p l a i n e d a b b r e v i a t i o n s / ) ;
0 commit comments