*/ public function collectRollupFreshness(): array { $logsRepo = function_exists('abj_service_optional') ? abj_service_optional('logs_repository') : null; if (!$logsRepo instanceof ABJ_404_Solution_LogHitsLifecycleInterface || !$logsRepo instanceof ABJ_404_Solution_LogHitsRebuildInterface) { throw new \RuntimeException('logs_repository service unavailable for view_build_state probe'); } $lastUpdated = $logsRepo->getLogsHitsTableLastUpdated(); $lastScheduled = $logsRepo->getLogsHitsTableLastScheduledAt(); return array( 'rollup_table_exists' => (bool)$logsRepo->logsHitsTableExists(), 'rollup_needs_rebuild' => (bool)$logsRepo->hitsTableNeedsRebuild(), 'rollup_last_updated_at' => ABJ_404_Solution_ExactInteger::readOr($lastUpdated, 0, 0), 'rollup_last_scheduled_at' => ABJ_404_Solution_ExactInteger::readOr($lastScheduled, 0, 0), 'rollup_stored_max_log_id' => (int)$logsRepo->getStoredMaxLogId(), 'logsv2_max_log_id' => (int)$logsRepo->getMaxLogId(), ); } }