@@ -6025,6 +6025,8 @@ private function render_worktree_bounded_cleanup_eligible_apply_result( array $r
60256025 }
60266026 }
60276027
6028+ $ this ->render_active_no_signal_triage_preview ( (array ) ( $ result ['active_no_signal_triage ' ] ?? array () ) );
6029+
60286030 WP_CLI ::log ('' );
60296031 $ remaining = (int ) ( $ continuation ['remaining_total ' ] ?? 0 );
60306032 if ( $ remaining > 0 ) {
@@ -6074,19 +6076,20 @@ private function compact_worktree_bounded_cleanup_eligible_apply_json( array $re
60746076 );
60756077
60766078 $ report = array (
6077- 'success ' => (bool ) ( $ result ['success ' ] ?? true ),
6078- 'mode ' => (string ) ( $ result ['mode ' ] ?? 'bounded_cleanup_eligible_apply ' ),
6079- 'dry_run ' => ! empty ($ result ['dry_run ' ]),
6080- 'destructive ' => ! empty ($ result ['destructive ' ]),
6081- 'workspace_path ' => $ result ['workspace_path ' ] ?? null ,
6082- 'generated_at ' => $ result ['generated_at ' ] ?? null ,
6083- 'summary ' => $ compact_summary ,
6084- 'blocker_buckets ' => $ buckets ,
6085- 'next_actions ' => $ actions ,
6086- 'candidates ' => $ this ->compact_cleanup_rows ($ candidates , 25 ),
6087- 'removed ' => $ this ->compact_cleanup_rows ($ removed , 25 ),
6088- 'continuation ' => $ this ->compact_cleanup_continuation ( (array ) ( $ result ['continuation ' ] ?? $ result ['pagination ' ] ?? array () ) ),
6089- 'evidence ' => $ this ->compact_cleanup_evidence ( (array ) ( $ result ['evidence ' ] ?? array () ), $ skipped ),
6079+ 'success ' => (bool ) ( $ result ['success ' ] ?? true ),
6080+ 'mode ' => (string ) ( $ result ['mode ' ] ?? 'bounded_cleanup_eligible_apply ' ),
6081+ 'dry_run ' => ! empty ($ result ['dry_run ' ]),
6082+ 'destructive ' => ! empty ($ result ['destructive ' ]),
6083+ 'workspace_path ' => $ result ['workspace_path ' ] ?? null ,
6084+ 'generated_at ' => $ result ['generated_at ' ] ?? null ,
6085+ 'summary ' => $ compact_summary ,
6086+ 'blocker_buckets ' => $ buckets ,
6087+ 'next_actions ' => $ actions ,
6088+ 'active_no_signal_triage ' => (array ) ( $ result ['active_no_signal_triage ' ] ?? array () ),
6089+ 'candidates ' => $ this ->compact_cleanup_rows ($ candidates , 25 ),
6090+ 'removed ' => $ this ->compact_cleanup_rows ($ removed , 25 ),
6091+ 'continuation ' => $ this ->compact_cleanup_continuation ( (array ) ( $ result ['continuation ' ] ?? $ result ['pagination ' ] ?? array () ) ),
6092+ 'evidence ' => $ this ->compact_cleanup_evidence ( (array ) ( $ result ['evidence ' ] ?? array () ), $ skipped ),
60906093 );
60916094
60926095 if ( ! empty ($ result ['job_backed ' ]) ) {
@@ -6096,6 +6099,55 @@ private function compact_worktree_bounded_cleanup_eligible_apply_json( array $re
60966099 return array_filter ($ report , fn ( $ value ) => null !== $ value );
60976100 }
60986101
6102+ /**
6103+ * Render concise active/no-signal triage preview from bounded cleanup output.
6104+ *
6105+ * @param array<string,mixed> $preview Triage preview payload.
6106+ * @return void
6107+ */
6108+ private function render_active_no_signal_triage_preview ( array $ preview ): void {
6109+ $ total = (int ) ( $ preview ['total ' ] ?? 0 );
6110+ if ( $ total <= 0 ) {
6111+ return ;
6112+ }
6113+
6114+ WP_CLI ::log ('' );
6115+ WP_CLI ::log (sprintf ('Active/no-signal triage preview: %d unresolved active worktree(s). ' , $ total ));
6116+ $ summary_rows = array ();
6117+ foreach ( (array ) ( $ preview ['by_age ' ] ?? array () ) as $ bucket => $ count ) {
6118+ if ( (int ) $ count > 0 ) {
6119+ $ summary_rows [] = array (
6120+ 'dimension ' => 'age ' ,
6121+ 'bucket ' => (string ) $ bucket ,
6122+ 'count ' => (int ) $ count ,
6123+ );
6124+ }
6125+ }
6126+ foreach ( (array ) ( $ preview ['by_liveness ' ] ?? array () ) as $ bucket => $ count ) {
6127+ $ summary_rows [] = array (
6128+ 'dimension ' => 'liveness ' ,
6129+ 'bucket ' => (string ) $ bucket ,
6130+ 'count ' => (int ) $ count ,
6131+ );
6132+ }
6133+ foreach ( (array ) ( $ preview ['by_repo ' ] ?? array () ) as $ bucket => $ count ) {
6134+ $ summary_rows [] = array (
6135+ 'dimension ' => 'repo ' ,
6136+ 'bucket ' => (string ) $ bucket ,
6137+ 'count ' => (int ) $ count ,
6138+ );
6139+ }
6140+ $ this ->format_items ($ summary_rows , array ( 'dimension ' , 'bucket ' , 'count ' ), array ( 'format ' => 'table ' ), 'dimension ' );
6141+
6142+ WP_CLI ::log ('Non-destructive next commands: ' );
6143+ foreach ( (array ) ( $ preview ['commands ' ] ?? array () ) as $ label => $ command ) {
6144+ WP_CLI ::log (sprintf (' %s: %s ' , (string ) $ label , (string ) $ command ));
6145+ }
6146+ if ( ! empty ($ preview ['safety ' ]) ) {
6147+ WP_CLI ::log ('Safety: ' . (string ) $ preview ['safety ' ]);
6148+ }
6149+ }
6150+
60996151 /**
61006152 * Build skipped blocker buckets with bounded examples.
61016153 *
0 commit comments