ingestion: group oversize and binary rejections in the report

This commit is contained in:
Paperclip Builder
2026-10-26 22:36:34 +11:00
parent 720feddfcc
commit 0b910d216e

View File

@@ -54,7 +54,14 @@ class Harvest:
def rejection_summary(self) -> dict:
counts = {}
for row in self.rejections:
key = f"{row.get('platform')}/{row.get('reason')}"
reason = str(row.get("reason") or "unknown")
# Keep the summary readable: 200 distinct oversize byte counts are
# one finding, not two hundred.
if reason.startswith("oversize"):
reason = "oversize"
elif reason.startswith("binary"):
reason = "binary"
key = f"{row.get('platform')}/{reason}"
counts[key] = counts.get(key, 0) + 1
return dict(sorted(counts.items()))