setName('followup-audio:cleanup')->setDescription('清理过期音频与全文,不清除已采用的正式记录'); } protected function execute(Input $input, Output $output): int { try { $counts = FollowupAudioStore::cleanupExpired(); // Count fields only: no patient identifiers, paths, or clinical bodies. $public = []; foreach ($counts as $key => $value) { if (is_int($value) && preg_match('/^[a-z_]+$/D', (string) $key)) { $public[$key] = $value; } } $output->writeln('FOLLOWUP_AUDIO_CLEANUP ' . json_encode($public)); return (int) ($counts['errors'] ?? 0) > 0 ? 1 : 0; } catch (\Throwable $e) { $output->writeln('FOLLOWUP_AUDIO_CLEANUP storage_or_configuration_error'); return 1; } } }