From 79238c8f1da1abdc2988b6255f758511b4670fe5 Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Thu, 5 Nov 2026 12:35:05 +0100 Subject: [PATCH] fix: read a gap report without its entry tally --- scripts/cross_reference.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/scripts/cross_reference.py b/scripts/cross_reference.py index f3d9daaee..211ef00aa 100644 --- a/scripts/cross_reference.py +++ b/scripts/cross_reference.py @@ -684,11 +684,14 @@ def profile_breakdown(data: dict) -> str: others were nowhere: the versions a slot accepts, the entries the platform never opens and the ones no pack carries. """ - parts = [f"{data['declared_files']} declared by platforms", - f"{data['undeclared_files']} undeclared"] - if data["unsourceable_files"]: - parts.append(f"{data['unsourceable_files']} unsourceable") - aside = data["set_aside"] + # A report built without the per-entry tally (a fixture, a saved --json + # of an earlier run) falls back to its row counts. + parts = [f"{data.get('declared_files', data['platform_covered'])} declared by platforms", + f"{data.get('undeclared_files', data['gaps'])} undeclared"] + unsourceable = data.get("unsourceable_files", len(data.get("unsourceable") or [])) + if unsourceable: + parts.append(f"{unsourceable} unsourceable") + aside = data.get("set_aside") or {} detail = [f"{aside[key]} {label}" for key, label in SET_ASIDE.items() if aside.get(key)] if detail: parts.append(f"{sum(aside.values())} set aside ({', '.join(detail)})")