From b1750cfd20f71165ab84cc63fdfbbc34bb7a2b0e Mon Sep 17 00:00:00 2001 From: justin Date: Thu, 7 May 2026 12:10:03 -0500 Subject: [PATCH] Fix compliance check logging: use status (red/yellow/green) not severity Check objects use status field (red/yellow/green), not severity (critical/major/minor). Logging was always recording 0 issues. Co-Authored-By: Claude Opus 4.6 (1M context) --- api/src/routes/fcc-lookup.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/api/src/routes/fcc-lookup.ts b/api/src/routes/fcc-lookup.ts index 1c1c85d..f9da0c0 100644 --- a/api/src/routes/fcc-lookup.ts +++ b/api/src/routes/fcc-lookup.ts @@ -831,12 +831,12 @@ router.get("/api/v1/fcc/lookup", async (req, res) => { // Log the check for analytics (non-blocking) try { - const issueCount = checks?.filter((c: any) => c.severity === "critical" || c.severity === "major").length || 0; - const worstSeverity = checks?.some((c: any) => c.severity === "critical") ? "critical" - : checks?.some((c: any) => c.severity === "major") ? "major" - : checks?.some((c: any) => c.severity === "minor") ? "minor" : "clean"; + const issueCount = checks?.filter((c: any) => c.status === "red" || c.status === "yellow").length || 0; + const worstSeverity = checks?.some((c: any) => c.status === "red") ? "critical" + : checks?.some((c: any) => c.status === "yellow") ? "major" + : checks?.some((c: any) => c.status === "green") ? "clean" : "clean"; const flaggedSlugs = checks - ?.filter((c: any) => c.severity === "critical" || c.severity === "major") + ?.filter((c: any) => c.status === "red" || c.status === "yellow") .map((c: any) => c.id || c.slug || "") .filter(Boolean) || []; const elapsed = Date.now() - startMs;