From 2732c50e6385fc1c0195375203820fa79ee4f14e Mon Sep 17 00:00:00 2001 From: Varun Poojari <83573233+Varunpoojari@users.noreply.github.com> Date: Wed, 21 Oct 2026 04:46:41 +0100 Subject: [PATCH] Label what the dashboard's two severity panels count (SECFOO-36) "Findings by severity" sums the severity written in each run's report across all runs, while "Top findings" lists open, de-duplicated items with SAST findings banded by CVSS. They legitimately differ, so each panel now says what it counts. Adds a test that checks both captions render. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01E2g1gSvhdvPtBcKPvSBRqw --- src/secfoo/web/templates/overview.html | 33 ++++++++++++++++++++++++++ tests/test_web/test_routes.py | 11 +++++++++ 2 files changed, 44 insertions(+) diff --git a/src/secfoo/web/templates/overview.html b/src/secfoo/web/templates/overview.html index 09f5556..8af8144 100644 --- a/src/secfoo/web/templates/overview.html +++ b/src/secfoo/web/templates/overview.html @@ -25,12 +25,18 @@

AI Security & Assessment Hub

{{ responsible_ai_count }} Responsible AI coverage +
+ {{ total_cost | fmt_cost }} + AI spend +

Top findings across the program

The highest-severity items across every activity — SAST, SCA, third-party vendor assessments, secret scanning, past-due architecture exceptions, and unmitigated threat-model gaps — not just this activity's own coverage. + Open, de-duplicated Critical and High items only; SAST findings are banded by CVSS score, so a finding written as High + in a report can appear here as Critical.

{% if top_findings %}
@@ -58,6 +64,10 @@

Top findings across the program

Findings by severity

+

+ Counts the severity written in each run's report, summed across all runs (repeat scans count again). + It can differ from "Top findings", which lists open, de-duplicated items scored by CVSS. +

{% for row in severity_rows %}
@@ -92,6 +102,29 @@

Responsible AI risk mix

Open Responsible AI view
+ +
+

AI spend by agent

+ {% if cost_by_agent %} + + + + {% for row in cost_by_agent %} + + + + {% set priced = row.unpriced_runs < row.runs %} + + + + {% endfor %} + +
AgentRunsTokensCost
{{ row.label }}{{ row.runs }}{{ ((row.input_tokens + row.output_tokens) | fmt_tokens) if (priced or row.input_tokens or row.output_tokens) else '-' }}{{ (row.cost_usd | fmt_cost) if priced else '-' }}
+

"-" means no cost was recorded: the agent doesn't report it (cursor, agy), or the runs predate cost tracking.

+ {% else %} +

No runs yet.

+ {% endif %} +

Recent assessments

diff --git a/tests/test_web/test_routes.py b/tests/test_web/test_routes.py index 27c7b0e..99fb0f0 100644 --- a/tests/test_web/test_routes.py +++ b/tests/test_web/test_routes.py @@ -75,6 +75,17 @@ def test_overview_lists_recent_assessment(client, tmp_path): assert "org/repo" in resp.text +def test_overview_severity_panels_explain_what_they_count(client): + """SECFOO-36: 'Findings by severity' (report-heading counts, all runs) and + 'Top findings' (open, de-duplicated, CVSS-banded) legitimately differ, so + each panel must say what it counts.""" + resp = client.get("/") + assert resp.status_code == 200 + assert "summed across all runs" in resp.text + assert "scored by CVSS" in resp.text + assert "banded by CVSS score" in resp.text + + def test_project_detail(client, tmp_path): project_id, _ = _seed_run(tmp_path) resp = client.get(f"/projects/{project_id}")