Skip to content

Commit c60f07a

Browse files
fix: align active no-signal output arrays
1 parent 07e1d46 commit c60f07a

2 files changed

Lines changed: 38 additions & 38 deletions

File tree

inc/Cli/Commands/WorkspaceCommand.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6049,20 +6049,20 @@ private function compact_worktree_bounded_cleanup_eligible_apply_json( array $re
60496049
);
60506050

60516051
$report = array(
6052-
'success' => (bool) ( $result['success'] ?? true ),
6053-
'mode' => (string) ( $result['mode'] ?? 'bounded_cleanup_eligible_apply' ),
6054-
'dry_run' => ! empty($result['dry_run']),
6055-
'destructive' => ! empty($result['destructive']),
6056-
'workspace_path' => $result['workspace_path'] ?? null,
6057-
'generated_at' => $result['generated_at'] ?? null,
6058-
'summary' => $compact_summary,
6059-
'blocker_buckets' => $buckets,
6060-
'next_actions' => $actions,
6052+
'success' => (bool) ( $result['success'] ?? true ),
6053+
'mode' => (string) ( $result['mode'] ?? 'bounded_cleanup_eligible_apply' ),
6054+
'dry_run' => ! empty($result['dry_run']),
6055+
'destructive' => ! empty($result['destructive']),
6056+
'workspace_path' => $result['workspace_path'] ?? null,
6057+
'generated_at' => $result['generated_at'] ?? null,
6058+
'summary' => $compact_summary,
6059+
'blocker_buckets' => $buckets,
6060+
'next_actions' => $actions,
60616061
'active_no_signal_triage' => (array) ( $result['active_no_signal_triage'] ?? array() ),
6062-
'candidates' => $this->compact_cleanup_rows($candidates, 25),
6063-
'removed' => $this->compact_cleanup_rows($removed, 25),
6064-
'continuation' => $this->compact_cleanup_continuation( (array) ( $result['continuation'] ?? $result['pagination'] ?? array() ) ),
6065-
'evidence' => $this->compact_cleanup_evidence( (array) ( $result['evidence'] ?? array() ), $skipped ),
6062+
'candidates' => $this->compact_cleanup_rows($candidates, 25),
6063+
'removed' => $this->compact_cleanup_rows($removed, 25),
6064+
'continuation' => $this->compact_cleanup_continuation( (array) ( $result['continuation'] ?? $result['pagination'] ?? array() ) ),
6065+
'evidence' => $this->compact_cleanup_evidence( (array) ( $result['evidence'] ?? array() ), $skipped ),
60666066
);
60676067

60686068
if ( ! empty($result['job_backed']) ) {

inc/Workspace/WorkspaceWorktreeCleanupEngine.php

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,7 +1012,7 @@ public function worktree_bounded_cleanup_eligible_apply( array $opts = array() )
10121012
$batch = array_slice($all_candidates, 0, $limit);
10131013
$deferred = array_slice($all_candidates, $limit);
10141014

1015-
$continuation = array(
1015+
$continuation = array(
10161016
'remaining_total' => count($deferred),
10171017
'remaining_handles' => array_values(array_filter(array_map(fn( $row ) => is_array($row) ? (string) ( $row['handle'] ?? '' ) : '', $deferred))),
10181018
'next_call_hint' => count($deferred) > 0 ? sprintf('Run the bounded cleanup-eligible apply again to drain the next %d candidate(s).', min($limit, count($deferred))) : null,
@@ -1024,25 +1024,25 @@ public function worktree_bounded_cleanup_eligible_apply( array $opts = array() )
10241024

10251025
if ( $dry_run ) {
10261026
return array(
1027-
'success' => true,
1028-
'mode' => 'bounded_cleanup_eligible_apply',
1029-
'dry_run' => true,
1030-
'destructive' => false,
1031-
'workspace_path' => $this->workspace_path,
1032-
'generated_at' => gmdate('c'),
1033-
'candidates' => $batch,
1034-
'removed' => array(),
1035-
'skipped' => $inventory_skipped,
1036-
'summary' => array(
1027+
'success' => true,
1028+
'mode' => 'bounded_cleanup_eligible_apply',
1029+
'dry_run' => true,
1030+
'destructive' => false,
1031+
'workspace_path' => $this->workspace_path,
1032+
'generated_at' => gmdate('c'),
1033+
'candidates' => $batch,
1034+
'removed' => array(),
1035+
'skipped' => $inventory_skipped,
1036+
'summary' => array(
10371037
'processed' => count($batch),
10381038
'removed' => 0,
10391039
'skipped' => count($inventory_skipped),
10401040
'bytes_reclaimed' => 0,
10411041
'limit' => $limit,
10421042
),
1043-
'continuation' => $continuation,
1043+
'continuation' => $continuation,
10441044
'active_no_signal_triage' => $active_no_signal_triage,
1045-
'evidence' => array(
1045+
'evidence' => array(
10461046
'elapsed_ms' => (int) round(( microtime(true) - $started_at ) * 1000),
10471047
'inventory_total' => count($all_candidates),
10481048
'planned_handles' => array_values(array_filter(array_map(fn( $row ) => is_array($row) ? (string) ( $row['handle'] ?? '' ) : '', $batch))),
@@ -1154,26 +1154,26 @@ function () use ( $repo, $branch, $wt_path, $force, $remove_timeout_seconds ) {
11541154
$this->worktree_prune();
11551155

11561156
return array(
1157-
'success' => true,
1158-
'mode' => 'bounded_cleanup_eligible_apply',
1159-
'dry_run' => false,
1160-
'destructive' => true,
1161-
'workspace_path' => $this->workspace_path,
1162-
'generated_at' => gmdate('c'),
1163-
'candidates' => $batch,
1164-
'removed' => $removed,
1165-
'skipped' => $skipped,
1166-
'summary' => array(
1157+
'success' => true,
1158+
'mode' => 'bounded_cleanup_eligible_apply',
1159+
'dry_run' => false,
1160+
'destructive' => true,
1161+
'workspace_path' => $this->workspace_path,
1162+
'generated_at' => gmdate('c'),
1163+
'candidates' => $batch,
1164+
'removed' => $removed,
1165+
'skipped' => $skipped,
1166+
'summary' => array(
11671167
'processed' => $processed,
11681168
'removed' => count($removed),
11691169
'skipped' => count($skipped),
11701170
'bytes_reclaimed' => $bytes_reclaimed,
11711171
'limit' => $limit,
11721172
'discarded_unpushed' => count($discarded_unpushed),
11731173
),
1174-
'continuation' => $continuation,
1174+
'continuation' => $continuation,
11751175
'active_no_signal_triage' => $active_no_signal_triage,
1176-
'evidence' => array(
1176+
'evidence' => array(
11771177
'elapsed_ms' => (int) round(( microtime(true) - $started_at ) * 1000),
11781178
'inventory_total' => count($all_candidates),
11791179
'removed_handles' => array_values(array_filter(array_map(fn( $row ) => (string) $row['handle'], $removed))),

0 commit comments

Comments
 (0)