@@ -664,13 +664,13 @@ private function summarize_workspace_worktrees( array $worktrees, ?array $cleanu
664664 $ summary ['duplicates ' ] = $ duplicates ;
665665
666666 if ( null !== $ cleanup ) {
667- $ by_reason = (array ) ( $ cleanup ['summary ' ]['skipped_by_reason ' ] ?? array () );
668- $ dirty_blockers = (int ) ( $ by_reason ['dirty_worktree ' ] ?? 0 );
669- $ unpushed_blockers = (int ) ( $ by_reason ['unpushed_commits ' ] ?? 0 );
670- $ summary ['protected_dirty ' ] = $ dirty_blockers ;
671- $ summary ['protected_unpushed ' ] = $ unpushed_blockers ;
672- $ summary ['missing_metadata ' ] = (int ) ( $ by_reason ['missing_metadata ' ] ?? 0 );
673- $ summary ['external ' ] = max ($ summary ['external ' ], (int ) ( $ by_reason ['external_worktree ' ] ?? 0 ));
667+ $ by_reason = (array ) ( $ cleanup ['summary ' ]['skipped_by_reason ' ] ?? array () );
668+ $ dirty_blockers = (int ) ( $ by_reason ['dirty_worktree ' ] ?? 0 );
669+ $ unpushed_blockers = (int ) ( $ by_reason ['unpushed_commits ' ] ?? 0 );
670+ $ summary ['protected_dirty ' ] = $ dirty_blockers ;
671+ $ summary ['protected_unpushed ' ] = $ unpushed_blockers ;
672+ $ summary ['missing_metadata ' ] = (int ) ( $ by_reason ['missing_metadata ' ] ?? 0 );
673+ $ summary ['external ' ] = max ($ summary ['external ' ], (int ) ( $ by_reason ['external_worktree ' ] ?? 0 ));
674674
675675 $ probe_source = ! empty ($ cleanup ['inventory_only ' ]) ? 'inventory_known ' : 'fresh_probe ' ;
676676 $ summary ['protected_count_probe_source ' ] = $ probe_source ;
@@ -721,23 +721,23 @@ private function summarize_workspace_cleanup( ?array $cleanup, ?array $error, ar
721721 }
722722 unset($ candidate );
723723 usort ($ candidates , fn ( $ a , $ b ) => (int ) ( $ b ['size_bytes ' ] ?? 0 ) <=> (int ) ( $ a ['size_bytes ' ] ?? 0 ));
724- $ summary = (array ) ( $ cleanup ['summary ' ] ?? array () );
725- $ skipped_reason = (array ) ( $ summary ['skipped_by_reason ' ] ?? array () );
726- $ probe_source = ! empty ($ cleanup ['inventory_only ' ]) ? 'inventory_known ' : 'fresh_probe ' ;
727- $ candidates = $ this ->annotate_workspace_cleanup_candidates_for_hygiene ($ candidates , $ probe_source );
728- $ empty_blockers = array (
724+ $ summary = (array ) ( $ cleanup ['summary ' ] ?? array () );
725+ $ skipped_reason = (array ) ( $ summary ['skipped_by_reason ' ] ?? array () );
726+ $ probe_source = ! empty ($ cleanup ['inventory_only ' ]) ? 'inventory_known ' : 'fresh_probe ' ;
727+ $ candidates = $ this ->annotate_workspace_cleanup_candidates_for_hygiene ($ candidates , $ probe_source );
728+ $ empty_blockers = array (
729729 'dirty_worktree ' => 0 ,
730730 'unpushed_commits ' => 0 ,
731731 );
732- $ blocker_counts = array (
732+ $ blocker_counts = array (
733733 'inventory_known ' => $ empty_blockers ,
734734 'fresh_probe ' => $ empty_blockers ,
735735 );
736736 $ blocker_counts [ $ probe_source ] = array (
737737 'dirty_worktree ' => (int ) ( $ skipped_reason ['dirty_worktree ' ] ?? 0 ),
738738 'unpushed_commits ' => (int ) ( $ skipped_reason ['unpushed_commits ' ] ?? 0 ),
739739 );
740- $ result = array (
740+ $ result = array (
741741 'included ' => true ,
742742 'dry_run ' => true ,
743743 'skip_github ' => true ,
@@ -750,7 +750,7 @@ private function summarize_workspace_cleanup( ?array $cleanup, ?array $error, ar
750750 'candidates_by_signal ' => $ summary ['candidates_by_signal ' ] ?? array (),
751751 );
752752
753- $ expected_outcome = $ this ->workspace_cleanup_expected_outcome ($ summary , ! empty ($ cleanup ['inventory_only ' ]));
753+ $ expected_outcome = $ this ->workspace_cleanup_expected_outcome ($ summary , ! empty ($ cleanup ['inventory_only ' ]));
754754 if ( '' !== $ expected_outcome ) {
755755 $ result ['expected_outcome ' ] = $ expected_outcome ;
756756 }
@@ -817,18 +817,18 @@ private function build_workspace_fast_stats( array $worktrees, ?array $cleanup,
817817 $ cleanup_summary = (array ) ( $ cleanup ['summary ' ] ?? array () );
818818
819819 $ counts = array (
820- 'total_candidates ' => count ($ worktrees ),
821- 'cleanup_eligible_unprobed_count ' => count ($ cleanup_candidates ),
822- 'valid_clean_count ' => 0 ,
823- 'valid_dirty_count ' => 0 ,
824- 'inventory_known_dirty_count ' => 0 ,
825- 'inventory_known_blocker_count ' => 0 ,
826- 'fresh_probed_blocker_count ' => 0 ,
827- 'invalid_broken_orphan_count ' => 0 ,
828- 'unmanaged_skipped_count ' => 0 ,
829- 'dirty_probe_skipped_count ' => 0 ,
830- 'known_worktree_count ' => 0 ,
831- 'known_primary_count ' => 0 ,
820+ 'total_candidates ' => count ($ worktrees ),
821+ 'cleanup_eligible_unprobed_count ' => count ($ cleanup_candidates ),
822+ 'valid_clean_count ' => 0 ,
823+ 'valid_dirty_count ' => 0 ,
824+ 'inventory_known_dirty_count ' => 0 ,
825+ 'inventory_known_blocker_count ' => 0 ,
826+ 'fresh_probed_blocker_count ' => 0 ,
827+ 'invalid_broken_orphan_count ' => 0 ,
828+ 'unmanaged_skipped_count ' => 0 ,
829+ 'dirty_probe_skipped_count ' => 0 ,
830+ 'known_worktree_count ' => 0 ,
831+ 'known_primary_count ' => 0 ,
832832 );
833833
834834 foreach ( $ worktrees as $ row ) {
@@ -896,8 +896,8 @@ private function build_workspace_fast_stats( array $worktrees, ?array $cleanup,
896896 return array (
897897 'mode ' => $ include_worktree_status ? 'full_git_status ' : 'cheap_metadata_first ' ,
898898 'partial ' => ! $ include_worktree_status || empty ($ size_report ['scan_complete ' ]),
899- 'safety_probe_status ' => $ safety_probe_status ,
900- 'safety_probe_note ' => $ safety_probe_note ,
899+ 'safety_probe_status ' => $ safety_probe_status ,
900+ 'safety_probe_note ' => $ safety_probe_note ,
901901 'status_probe_required_for_summary ' => ! $ include_worktree_status ,
902902 'counts ' => $ counts ,
903903 'estimated_reclaimable_bytes ' => $ estimated_reclaimable ,
0 commit comments