@@ -195,7 +195,7 @@ public static function status( string $workspace_path ): array {
195195 */
196196 public static function prune_stale ( string $ workspace_path , bool $ dry_run = false ): array {
197197 $ before = self ::status ($ workspace_path );
198- $ protected = self ::active_filesystem_lock_keys ((array ) ( $ before ['filesystem ' ] ?? array () ));
198+ $ protected = self ::active_filesystem_lock_keys ( (array ) ( $ before ['filesystem ' ] ?? array () ) );
199199 $ db_pruned = $ dry_run ? array (
200200 'dry_run ' => true ,
201201 'protected_active ' => count ($ protected ),
@@ -282,24 +282,24 @@ private static function stale_lock_report( array $database, array $filesystem ):
282282 $ live_flock_present = in_array ($ lock_key , $ active_filesystem_keys , true );
283283 $ owner_context = (array ) ( $ lock ['metadata ' ]['owner_context ' ] ?? array () );
284284 $ database_rows [] = array (
285- 'source ' => 'database ' ,
286- 'lock_key ' => $ lock_key ,
287- 'scope ' => (string ) ( $ lock ['scope ' ] ?? '' ),
288- 'state ' => 'stale ' ,
289- 'owner ' => (string ) ( $ lock ['owner ' ] ?? '' ),
290- 'session ' => self ::owner_context_session_id ($ owner_context ),
291- 'run_id ' => (string ) ( $ lock ['run_id ' ] ?? '' ),
292- 'job_id ' => $ lock ['job_id ' ] ?? null ,
293- 'acquired_at ' => (string ) ( $ lock ['acquired_at ' ] ?? '' ),
294- 'heartbeat_at ' => (string ) ( $ lock ['heartbeat_at ' ] ?? '' ),
295- 'expires_at ' => (string ) ( $ lock ['expires_at ' ] ?? '' ),
296- 'age_seconds ' => $ lock ['age_seconds ' ] ?? null ,
297- 'heartbeat_age_seconds ' => $ lock ['heartbeat_age_seconds ' ] ?? null ,
298- 'expires_age_seconds ' => $ lock ['expires_age_seconds ' ] ?? null ,
299- 'live_flock_present ' => $ live_flock_present ,
300- 'safe_to_prune ' => ! $ live_flock_present ,
301- 'preview_command ' => 'wp datamachine-code workspace worktree locks --prune-stale --dry-run --format=json ' ,
302- 'apply_command ' => 'wp datamachine-code workspace worktree locks --prune-stale --format=json ' ,
285+ 'source ' => 'database ' ,
286+ 'lock_key ' => $ lock_key ,
287+ 'scope ' => (string ) ( $ lock ['scope ' ] ?? '' ),
288+ 'state ' => 'stale ' ,
289+ 'owner ' => (string ) ( $ lock ['owner ' ] ?? '' ),
290+ 'session ' => self ::owner_context_session_id ($ owner_context ),
291+ 'run_id ' => (string ) ( $ lock ['run_id ' ] ?? '' ),
292+ 'job_id ' => $ lock ['job_id ' ] ?? null ,
293+ 'acquired_at ' => (string ) ( $ lock ['acquired_at ' ] ?? '' ),
294+ 'heartbeat_at ' => (string ) ( $ lock ['heartbeat_at ' ] ?? '' ),
295+ 'expires_at ' => (string ) ( $ lock ['expires_at ' ] ?? '' ),
296+ 'age_seconds ' => $ lock ['age_seconds ' ] ?? null ,
297+ 'heartbeat_age_seconds ' => $ lock ['heartbeat_age_seconds ' ] ?? null ,
298+ 'expires_age_seconds ' => $ lock ['expires_age_seconds ' ] ?? null ,
299+ 'live_flock_present ' => $ live_flock_present ,
300+ 'safe_to_prune ' => ! $ live_flock_present ,
301+ 'preview_command ' => 'wp datamachine-code workspace worktree locks --prune-stale --dry-run --format=json ' ,
302+ 'apply_command ' => 'wp datamachine-code workspace worktree locks --prune-stale --format=json ' ,
303303 'active_lock_refusal_note ' => $ live_flock_present ? 'Matching filesystem lock has a live flock; DB row is reported but protected from stale pruning. ' : '' ,
304304 );
305305 }
0 commit comments