@@ -186,6 +186,16 @@ test("workflow utilities summarize apply health with skip buckets and cursor", (
186186 { number : 20 , action : "review_comment_synced" } ,
187187 { number : 30 , action : "skipped_changed_since_review" } ,
188188 { number : 40 , action : "skipped_changed_since_review" } ,
189+ {
190+ number : 50 ,
191+ action : "skipped_comment_auth" ,
192+ reason : "GitHub rejected durable review comment write with Requires authentication" ,
193+ } ,
194+ {
195+ number : 60 ,
196+ action : "skipped_locked_conversation" ,
197+ reason : "conversation was locked while syncing review comment" ,
198+ } ,
189199 ] ) ,
190200 ) ;
191201 write (
@@ -208,13 +218,78 @@ test("workflow utilities summarize apply health with skip buckets and cursor", (
208218 } ) ;
209219
210220 assert . equal ( summary . status , "ok" ) ;
211- assert . equal ( summary . processed , 4 ) ;
221+ assert . equal ( summary . processed , 6 ) ;
212222 assert . equal ( summary . closed , 1 ) ;
213223 assert . equal ( summary . comment_synced , 1 ) ;
214- assert . deepEqual ( summary . skip_reasons , { skipped_changed_since_review : 2 } ) ;
224+ assert . deepEqual ( summary . skip_reasons , {
225+ skipped_changed_since_review : 2 ,
226+ skipped_comment_auth : 1 ,
227+ skipped_locked_conversation : 1 ,
228+ } ) ;
229+ assert . deepEqual ( summary . lanes . closure , {
230+ processed : 3 ,
231+ closed : 1 ,
232+ comment_synced : 0 ,
233+ skipped : 2 ,
234+ skip_reasons : { skipped_changed_since_review : 2 } ,
235+ } ) ;
236+ assert . deepEqual ( summary . lanes . comment_sync , {
237+ processed : 3 ,
238+ closed : 0 ,
239+ comment_synced : 1 ,
240+ skipped : 2 ,
241+ skip_reasons : {
242+ skipped_comment_auth : 1 ,
243+ skipped_locked_conversation : 1 ,
244+ } ,
245+ } ) ;
215246 assert . equal ( summary . cursor ?. next_after_number , 40 ) ;
216247} ) ;
217248
249+ test ( "workflow utilities summarize comment-sync apply reports separately from closure" , ( ) => {
250+ const root = fs . mkdtempSync ( path . join ( os . tmpdir ( ) , "clawsweeper-workflow-" ) ) ;
251+ const reportPath = path . join ( root , "apply-report.json" ) ;
252+ write (
253+ reportPath ,
254+ JSON . stringify ( [
255+ { number : 10 , action : "review_comment_synced" } ,
256+ { number : 20 , action : "skipped_stale_review_comment_sync" } ,
257+ { number : 30 , action : "skipped_pr_close_coverage_proof" } ,
258+ ] ) ,
259+ ) ;
260+
261+ const summary = summarizeApplyReport ( {
262+ reportPath,
263+ targetRepo : "openclaw/openclaw" ,
264+ mode : "comment_sync" ,
265+ processedLimit : 25 ,
266+ closeLimit : null ,
267+ cursorPath : path . join ( root , "missing-cursor.json" ) ,
268+ cursorRequired : false ,
269+ } ) ;
270+
271+ assert . equal ( summary . mode , "comment_sync" ) ;
272+ assert . equal ( summary . closed , 0 ) ;
273+ assert . equal ( summary . comment_synced , 1 ) ;
274+ assert . deepEqual ( summary . lanes . closure , {
275+ processed : 0 ,
276+ closed : 0 ,
277+ comment_synced : 0 ,
278+ skipped : 0 ,
279+ skip_reasons : { } ,
280+ } ) ;
281+ assert . deepEqual ( summary . lanes . comment_sync , {
282+ processed : 3 ,
283+ closed : 0 ,
284+ comment_synced : 1 ,
285+ skipped : 2 ,
286+ skip_reasons : {
287+ skipped_pr_close_coverage_proof : 1 ,
288+ skipped_stale_review_comment_sync : 1 ,
289+ } ,
290+ } ) ;
291+ } ) ;
292+
218293test ( "workflow utilities flag full-window close scans without the required cursor" , ( ) => {
219294 const root = fs . mkdtempSync ( path . join ( os . tmpdir ( ) , "clawsweeper-workflow-" ) ) ;
220295 const reportPath = path . join ( root , "apply-report.json" ) ;
@@ -323,6 +398,11 @@ test("workflow utilities flag operator-action skips when every result is blocked
323398 "skipped_protected_label" ,
324399 "skipped_same_author_pair" ,
325400 ] ) ;
401+ assert . equal ( summary . lanes . closure . skipped , 10 ) ;
402+ assert . equal ( summary . lanes . closure . comment_synced , 1 ) ;
403+ assert . equal ( summary . lanes . closure . skip_reasons . kept_open , 1 ) ;
404+ assert . equal ( summary . lanes . closure . skip_reasons . retry_pr_close_coverage_proof , 1 ) ;
405+ assert . equal ( summary . lanes . closure . skip_reasons . skipped_pr_close_coverage_proof , 1 ) ;
326406} ) ;
327407
328408test ( "workflow utilities keep all-benign skip windows quiet" , ( ) => {
@@ -352,6 +432,11 @@ test("workflow utilities keep all-benign skip windows quiet", () => {
352432 skipped_already_closed : 1 ,
353433 skipped_not_open : 1 ,
354434 } ) ;
435+ assert . equal ( summary . lanes . closure . skipped , 2 ) ;
436+ assert . deepEqual ( summary . lanes . closure . skip_reasons , {
437+ skipped_already_closed : 1 ,
438+ skipped_not_open : 1 ,
439+ } ) ;
355440 assert . deepEqual ( summary . attention_reasons , [ ] ) ;
356441} ) ;
357442
0 commit comments