build_session_report_data
def build_session_report_data(
session, events
):Return session metadata, summary metrics, and event breakdowns as a report dictionary.
Return session metadata, summary metrics, and event breakdowns as a report dictionary.
_clean_events derives app_name from window_title rather than using the existing event app field. Confirm that this is intentional." - " becomes the complete app_name, while its clean_title becomes "Unknown". Titles containing several separators retain only the final two components._clean_events assumes every event has non-null, parseable start_time, end_time, and string window_title values. Confirm that the database layer guarantees these conditions._session_data assumes both session timestamps are present and parseable. It cannot directly process an open session with end_time=None.app_switch_count is calculated after idle rows are removed. Consequently, App A → Idle → App A is treated as no application switch.top_n_apps or top_n_titles value means “include all,” not “include none.” Confirm that this matches the intended configuration semantics.