GET /api/v1/cve-history?days=30[&target=<id>][&project=<id>][&per_target=true]: per day (UTC, oldest first, today last) the open CVEs with a fixed version, by severity, for the tenant, one target or one project's targets (targets.project_ids), plus the open critical/high findings of the same scope. per_target=true adds every target's own series (used by the overview's cards and project headers, one request for the whole page).
GET /api/v1/targets/{id}/top-updates: the package updates that close the most of a target's open CVEs with a fix.
Pure logic in compliance-core/src/cve_history.rs (CveHistory::of, top_updates, open_before, window), shared types with the dashboard. Handlers in compliance-agent/src/api/handlers/cve_history.rs. open_findings_by_severity (health.rs) now takes a scope filter; the overview stats call it with {} as before.
Both routes are tenant-scoped (tenant_db) and go through the org-role middleware like the other target/CVE reads (GET: IT_ADMIN, USER, CXO, LEGAL; FINANCE / no role refused); not reachable with an API key (not in KEY_SCOPES, same as /targets/{id}/cves). Both added to the role-gate router test.
Dashboard
New components/cve_trend.rs (used by the overview, project headers, repo cards and the target page): CveDashboard (4 KPI tiles + chart card), CveBars (stacked HTML/CSS bars, critical bottom #7E2318, high top #B3452F, 2px gaps, y-axis 0/mid/top, legend, per-bar title tooltip, hover dims the other days), Sparkline (SVG polyline), TargetCveDashboard (target page section with the "Wo handeln" table). No JS, no chart lib.
Overview: tiles "Kritische CVE mit Fix" / "Hohe CVE mit Fix" (each with the 30-day change) and "Kritische Befunde" / "Hohe Befunde" (open); the 30-day chart; Prüfobjekte nach Projekt replaces "CRA-Stand je Prüfobjekt"; "Als Nächstes" unchanged.
Target page: one new section above the CRA/SBOM cards (one import + one component line in target.rs): the same tiles and chart scoped to the target, and Wo handeln (package, current version, highest fixed version from the alerts, CVEs closed, critical among them).
Tiles link to the existing lists with the existing target query param: CVE tiles to /sbom?target=, findings tiles to /findings?target= (empty = all).
Texts DE+EN in a new texts::cve_trend module; unused overview texts and CSS of the replaced list removed. Styles in one CVE trend block in main.css, existing tokens plus --cve-critical / --cve-high (the given hex in light; lightened in dark to stay readable on the dark panels).
A CVE counts on UTC day d when, at the end of d (i.e. before midnight of d+1):
created_at < midnight(d+1) (found by then),
resolved_at is unset or >= midnight(d+1) (an alert resolved on d does not count on d),
no VEX not_affected / fixed with vex.at < midnight(d+1) (affected / under_investigation do not settle),
fixed_versions is not empty (no fix version: never counted).
Unit = one CVE (CveAlert::cve(), i.e. the CVE alias of a GHSA) in one target: a GHSA and its CVE alias, or the CVE in two packages of one target, count once at the highest severity (parse_severity, CVSS first, then the advisory's label). The same CVE in two targets counts twice: tenant and project series are the sum over their targets ("fixes to do per repo", not distinct CVE ids tenant-wide). Today's bar is the live KPI value; the 30-day change is the last day minus the first day of the window.
On the issue's question (do withdrawn / VEX-settled alerts need their own timestamp?): VEX-settled alerts already carry vex.at (always set) and it is used. What the stored state cannot show, and would need a status-change log (not in this PR):
a withdrawn VEX statement is overwritten (the settled window is lost; the alert shows as open throughout),
vex_lifecycle::upsert_reported$unsets resolved_at when an alert is reported again (the gap shows as open),
fixed_versions is the current list (a fix published mid-window counts from the start of the window).
days clamped to 1..=90 (default 30); target wins over project; targets is omitted without per_target=true, and a target without alerts in the window is not listed (the UI draws it flat at zero).
Grouped by (package, version), distinct CVEs counted, highest fixed version via version::cmp_dotted; sorted by CVEs closed, then critical, then name; at most 10 (total counts all). 400 for a malformed id, 404 for a target the tenant does not have.
Where the repo grouping lives, and why
On the overview, replacing "CRA-Stand je Prüfobjekt": the overview already loads every target (all pages) and the CRA summary, the acceptance criterion starts "from the overview", and the targets list is server-paged (20/50/100) with a project filter, so a project's repos would straddle pages. The targets table stays the full list, unchanged. One header per portal project (registry order; projects without targets left out; a target in several projects under each; targets in none or only in deleted projects under "Ohne Projekt", last; without any project the single group is titled "Prüfobjekte"), with target count, open critical+high CVEs with a fix and a sparkline (sum of its targets' series). One card per target: open CVEs with a fix (critical · high) + sparkline (opens its SBOM), CRA Annex I bar (opens its CRA status), last scan, links to its findings and SBOM; the name opens the target page. Six cards per project, then "N weitere Prüfobjekte" to the targets list. Within a project: most open CVEs first, then most violated requirements, then name.
RUSTFLAGS="-D warnings" cargo clippy -p compliance-dashboard --features server --no-default-features --all-targets -- -D warnings: ok
RUSTFLAGS="-D warnings" cargo clippy -p compliance-dashboard --features web --no-default-features --all-targets -- -D warnings: ok
cargo test -p compliance-core --lib cve_history: 9 passed (window, never resolved, resolved same day, no fix version excluded, one CVE once per target at highest severity and twice across targets, VEX settles from vex.at and affected does not, medium/low apart, top-updates ranking with highest fix and GHSA alias not double-counted, tie-break by critical)
cargo test -p compliance-agent --lib -- cve_history role_gate: 11 passed (days clamped/defaulted, blank scope, role gate incl. the two new GET routes)
cargo test -p compliance-dashboard --features server --no-default-features --lib -- cve_trend overview i18n: axis top, sparkline points, 30-day change, project grouping (target in two projects, deleted project, empty project), project trend sums, texts DE/EN
The new CSS checked in headless Chrome on static markup at 1280 px and 390 px (light). Not run against a live agent.
What's left
Bucket counts (Heute handeln / Diese Woche / Später / KI) on the tiles and cards wait for #950.
"Update-Ticket anlegen" in "Wo handeln" is not here (issue creation is #948).
The findings and SBOM pages have no severity URL param, so tiles filter by target only.
"Change since the last scan" on the cards (from the issue) is not shown; the 30-day change is.
The target page's CVE section does not reload when a scan finishes on the page (a reload does); hooking it into ScanRunList's on_finished would need a non-additive edit of target.rs.
History accuracy limits listed above (withdrawn VEX, re-reported alerts, fixed_versions as of now).
Merge hotspots for the parallel PRs: one line each in components/mod.rs (after cra_bar), infrastructure/mod.rs, handlers/mod.rs, a block in routes.rs before /targets/{id}/vex, a module before texts::scans, a CSS block before "Targets list".
## What changed
**Agent**
- `GET /api/v1/cve-history?days=30[&target=<id>][&project=<id>][&per_target=true]`: per day (UTC, oldest first, today last) the open CVEs with a fixed version, by severity, for the tenant, one target or one project's targets (`targets.project_ids`), plus the open critical/high findings of the same scope. `per_target=true` adds every target's own series (used by the overview's cards and project headers, one request for the whole page).
- `GET /api/v1/targets/{id}/top-updates`: the package updates that close the most of a target's open CVEs with a fix.
- Pure logic in `compliance-core/src/cve_history.rs` (`CveHistory::of`, `top_updates`, `open_before`, `window`), shared types with the dashboard. Handlers in `compliance-agent/src/api/handlers/cve_history.rs`. `open_findings_by_severity` (health.rs) now takes a scope filter; the overview stats call it with `{}` as before.
- Both routes are tenant-scoped (`tenant_db`) and go through the org-role middleware like the other target/CVE reads (GET: IT_ADMIN, USER, CXO, LEGAL; FINANCE / no role refused); not reachable with an API key (not in `KEY_SCOPES`, same as `/targets/{id}/cves`). Both added to the role-gate router test.
**Dashboard**
- New `components/cve_trend.rs` (used by the overview, project headers, repo cards and the target page): `CveDashboard` (4 KPI tiles + chart card), `CveBars` (stacked HTML/CSS bars, critical bottom #7E2318, high top #B3452F, 2px gaps, y-axis 0/mid/top, legend, per-bar `title` tooltip, hover dims the other days), `Sparkline` (SVG polyline), `TargetCveDashboard` (target page section with the "Wo handeln" table). No JS, no chart lib.
- **Overview**: tiles "Kritische CVE mit Fix" / "Hohe CVE mit Fix" (each with the 30-day change) and "Kritische Befunde" / "Hohe Befunde" (open); the 30-day chart; **Prüfobjekte nach Projekt** replaces "CRA-Stand je Prüfobjekt"; "Als Nächstes" unchanged.
- **Target page**: one new section above the CRA/SBOM cards (one import + one component line in `target.rs`): the same tiles and chart scoped to the target, and **Wo handeln** (package, current version, highest fixed version from the alerts, CVEs closed, critical among them).
- Tiles link to the existing lists with the existing `target` query param: CVE tiles to `/sbom?target=`, findings tiles to `/findings?target=` (empty = all).
- Texts DE+EN in a new `texts::cve_trend` module; unused overview texts and CSS of the replaced list removed. Styles in one `CVE trend` block in `main.css`, existing tokens plus `--cve-critical` / `--cve-high` (the given hex in light; lightened in dark to stay readable on the dark panels).
- Docs: `docs/features/overview.md`, `docs/guide/repositories.md` (target page), getting-started (DE/EN), scanning.md, README API table.
## The "open on day d" rule
A CVE counts on UTC day d when, at the end of d (i.e. before midnight of d+1):
- `created_at < midnight(d+1)` (found by then),
- `resolved_at` is unset or `>= midnight(d+1)` (an alert resolved on d does not count on d),
- no VEX `not_affected` / `fixed` with `vex.at < midnight(d+1)` (`affected` / `under_investigation` do not settle),
- `fixed_versions` is not empty (no fix version: never counted).
Unit = one CVE (`CveAlert::cve()`, i.e. the CVE alias of a GHSA) in one target: a GHSA and its CVE alias, or the CVE in two packages of one target, count once at the highest severity (`parse_severity`, CVSS first, then the advisory's label). The same CVE in two targets counts twice: tenant and project series are the sum over their targets ("fixes to do per repo", not distinct CVE ids tenant-wide). Today's bar is the live KPI value; the 30-day change is the last day minus the first day of the window.
**On the issue's question (do withdrawn / VEX-settled alerts need their own timestamp?)**: VEX-settled alerts already carry `vex.at` (always set) and it is used. What the stored state cannot show, and would need a status-change log (not in this PR):
- a withdrawn VEX statement is overwritten (the settled window is lost; the alert shows as open throughout),
- `vex_lifecycle::upsert_reported` `$unset`s `resolved_at` when an alert is reported again (the gap shows as open),
- `fixed_versions` is the current list (a fix published mid-window counts from the start of the window).
## API shapes
```
GET /api/v1/cve-history?days=30&per_target=true
{"data": {
"days": [{"date": "2026-10-12", "critical": 2, "high": 5, "medium": 1, "low": 0}, ...],
"open_findings": {"critical": 3, "high": 7},
"targets": {"<target id>": [{"date": "2026-10-12", "critical": 1, ...}, ...]}
}}
```
`days` clamped to 1..=90 (default 30); `target` wins over `project`; `targets` is omitted without `per_target=true`, and a target without alerts in the window is not listed (the UI draws it flat at zero).
```
GET /api/v1/targets/{id}/top-updates
{"data": [{"package": "log4j-core", "current_version": "2.14.1", "fixed_version": "2.17.1", "cves": 2, "critical": 2}, ...],
"total": 4}
```
Grouped by (package, version), distinct CVEs counted, highest fixed version via `version::cmp_dotted`; sorted by CVEs closed, then critical, then name; at most 10 (`total` counts all). 400 for a malformed id, 404 for a target the tenant does not have.
## Where the repo grouping lives, and why
On the **overview**, replacing "CRA-Stand je Prüfobjekt": the overview already loads every target (all pages) and the CRA summary, the acceptance criterion starts "from the overview", and the targets list is server-paged (20/50/100) with a project filter, so a project's repos would straddle pages. The targets table stays the full list, unchanged. One header per portal project (registry order; projects without targets left out; a target in several projects under each; targets in none or only in deleted projects under "Ohne Projekt", last; without any project the single group is titled "Prüfobjekte"), with target count, open critical+high CVEs with a fix and a sparkline (sum of its targets' series). One card per target: open CVEs with a fix (critical · high) + sparkline (opens its SBOM), CRA Annex I bar (opens its CRA status), last scan, links to its findings and SBOM; the name opens the target page. Six cards per project, then "N weitere Prüfobjekte" to the targets list. Within a project: most open CVEs first, then most violated requirements, then name.
## How tested
- `cargo fmt --all --check`: ok
- `RUSTFLAGS="-D warnings" cargo clippy -p compliance-core --all-targets -- -D warnings`: ok
- `RUSTFLAGS="-D warnings" cargo clippy -p compliance-agent --all-targets -- -D warnings`: ok
- `RUSTFLAGS="-D warnings" cargo clippy -p compliance-dashboard --features server --no-default-features --all-targets -- -D warnings`: ok
- `RUSTFLAGS="-D warnings" cargo clippy -p compliance-dashboard --features web --no-default-features --all-targets -- -D warnings`: ok
- `cargo test -p compliance-core --lib cve_history`: 9 passed (window, never resolved, resolved same day, no fix version excluded, one CVE once per target at highest severity and twice across targets, VEX settles from `vex.at` and `affected` does not, medium/low apart, top-updates ranking with highest fix and GHSA alias not double-counted, tie-break by critical)
- `cargo test -p compliance-agent --lib -- cve_history role_gate`: 11 passed (days clamped/defaulted, blank scope, role gate incl. the two new GET routes)
- `cargo test -p compliance-dashboard --features server --no-default-features --lib -- cve_trend overview i18n`: axis top, sparkline points, 30-day change, project grouping (target in two projects, deleted project, empty project), project trend sums, texts DE/EN
- The new CSS checked in headless Chrome on static markup at 1280 px and 390 px (light). Not run against a live agent.
## What's left
- Bucket counts (Heute handeln / Diese Woche / Später / KI) on the tiles and cards wait for #950.
- "Update-Ticket anlegen" in "Wo handeln" is not here (issue creation is #948).
- The findings and SBOM pages have no severity URL param, so tiles filter by target only.
- "Change since the last scan" on the cards (from the issue) is not shown; the 30-day change is.
- The target page's CVE section does not reload when a scan finishes on the page (a reload does); hooking it into `ScanRunList`'s `on_finished` would need a non-additive edit of `target.rs`.
- History accuracy limits listed above (withdrawn VEX, re-reported alerts, `fixed_versions` as of now).
- Merge hotspots for the parallel PRs: one line each in `components/mod.rs` (after `cra_bar`), `infrastructure/mod.rs`, `handlers/mod.rs`, a block in `routes.rs` before `/targets/{id}/vex`, a module before `texts::scans`, a CSS block before "Targets list".
Closes #952
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Rebased onto #964 (findings link helper), #962 (target route with CVE-cell query), #961 and #956. Resolution:
Module registrations, routes and the target.rs import: both sides are kept.
overview.rs: this PR's new tiles replace the figures block whose links #964 had changed, so this PR's version is kept.
The links Route::FindingsPage { target } and Route::TargetPage { id } here (overview and cve_trend.rs) now use the helpers Route::findings(...) and Route::target(...) that #964 and #962 added.
Checked locally: fmt, clippy -D warnings (core, agent, dashboard server and web), dashboard lib tests (173), core cve_history (9) and agent cve_history + role_gate tests (11).
Rebased onto #964 (findings link helper), #962 (target route with CVE-cell query), #961 and #956. Resolution:
- Module registrations, routes and the `target.rs` import: both sides are kept.
- `overview.rs`: this PR's new tiles replace the figures block whose links #964 had changed, so this PR's version is kept.
- The links `Route::FindingsPage { target }` and `Route::TargetPage { id }` here (overview and `cve_trend.rs`) now use the helpers `Route::findings(...)` and `Route::target(...)` that #964 and #962 added.
Checked locally: fmt, clippy `-D warnings` (core, agent, dashboard server and web), dashboard lib tests (173), core `cve_history` (9) and agent `cve_history` + role_gate tests (11).
- GET /api/v1/cve-history: open CVEs with a fixed version per day (UTC)
by severity, for the tenant, one target or one project's targets, with
the open critical/high findings of the same scope; per-target series
on request. Computed from created_at, resolved_at and the VEX
statement's time, no snapshots.
- GET /api/v1/targets/{id}/top-updates: the package updates that close
the most of a target's open CVEs with a fix.
- Overview: KPI tiles with the 30-day change, a stacked bar chart of the
last 30 days, and the targets as cards grouped by portal project with
sparklines (instead of the CRA-by-target list).
- Target page: the same tiles and chart for the target, and a
"Wo handeln" table.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Describe the new overview figures, the 30-day chart, the targets by
project and the target page's "Wo handeln" table in the guide. Key the
overview's project groups by the project's id, so two projects with the
same name stay apart.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What changed
Agent
GET /api/v1/cve-history?days=30[&target=<id>][&project=<id>][&per_target=true]: per day (UTC, oldest first, today last) the open CVEs with a fixed version, by severity, for the tenant, one target or one project's targets (targets.project_ids), plus the open critical/high findings of the same scope.per_target=trueadds every target's own series (used by the overview's cards and project headers, one request for the whole page).GET /api/v1/targets/{id}/top-updates: the package updates that close the most of a target's open CVEs with a fix.compliance-core/src/cve_history.rs(CveHistory::of,top_updates,open_before,window), shared types with the dashboard. Handlers incompliance-agent/src/api/handlers/cve_history.rs.open_findings_by_severity(health.rs) now takes a scope filter; the overview stats call it with{}as before.tenant_db) and go through the org-role middleware like the other target/CVE reads (GET: IT_ADMIN, USER, CXO, LEGAL; FINANCE / no role refused); not reachable with an API key (not inKEY_SCOPES, same as/targets/{id}/cves). Both added to the role-gate router test.Dashboard
components/cve_trend.rs(used by the overview, project headers, repo cards and the target page):CveDashboard(4 KPI tiles + chart card),CveBars(stacked HTML/CSS bars, critical bottom #7E2318, high top #B3452F, 2px gaps, y-axis 0/mid/top, legend, per-bartitletooltip, hover dims the other days),Sparkline(SVG polyline),TargetCveDashboard(target page section with the "Wo handeln" table). No JS, no chart lib.target.rs): the same tiles and chart scoped to the target, and Wo handeln (package, current version, highest fixed version from the alerts, CVEs closed, critical among them).targetquery param: CVE tiles to/sbom?target=, findings tiles to/findings?target=(empty = all).texts::cve_trendmodule; unused overview texts and CSS of the replaced list removed. Styles in oneCVE trendblock inmain.css, existing tokens plus--cve-critical/--cve-high(the given hex in light; lightened in dark to stay readable on the dark panels).docs/features/overview.md,docs/guide/repositories.md(target page), getting-started (DE/EN), scanning.md, README API table.The "open on day d" rule
A CVE counts on UTC day d when, at the end of d (i.e. before midnight of d+1):
created_at < midnight(d+1)(found by then),resolved_atis unset or>= midnight(d+1)(an alert resolved on d does not count on d),not_affected/fixedwithvex.at < midnight(d+1)(affected/under_investigationdo not settle),fixed_versionsis not empty (no fix version: never counted).Unit = one CVE (
CveAlert::cve(), i.e. the CVE alias of a GHSA) in one target: a GHSA and its CVE alias, or the CVE in two packages of one target, count once at the highest severity (parse_severity, CVSS first, then the advisory's label). The same CVE in two targets counts twice: tenant and project series are the sum over their targets ("fixes to do per repo", not distinct CVE ids tenant-wide). Today's bar is the live KPI value; the 30-day change is the last day minus the first day of the window.On the issue's question (do withdrawn / VEX-settled alerts need their own timestamp?): VEX-settled alerts already carry
vex.at(always set) and it is used. What the stored state cannot show, and would need a status-change log (not in this PR):vex_lifecycle::upsert_reported$unsetsresolved_atwhen an alert is reported again (the gap shows as open),fixed_versionsis the current list (a fix published mid-window counts from the start of the window).API shapes
daysclamped to 1..=90 (default 30);targetwins overproject;targetsis omitted withoutper_target=true, and a target without alerts in the window is not listed (the UI draws it flat at zero).Grouped by (package, version), distinct CVEs counted, highest fixed version via
version::cmp_dotted; sorted by CVEs closed, then critical, then name; at most 10 (totalcounts all). 400 for a malformed id, 404 for a target the tenant does not have.Where the repo grouping lives, and why
On the overview, replacing "CRA-Stand je Prüfobjekt": the overview already loads every target (all pages) and the CRA summary, the acceptance criterion starts "from the overview", and the targets list is server-paged (20/50/100) with a project filter, so a project's repos would straddle pages. The targets table stays the full list, unchanged. One header per portal project (registry order; projects without targets left out; a target in several projects under each; targets in none or only in deleted projects under "Ohne Projekt", last; without any project the single group is titled "Prüfobjekte"), with target count, open critical+high CVEs with a fix and a sparkline (sum of its targets' series). One card per target: open CVEs with a fix (critical · high) + sparkline (opens its SBOM), CRA Annex I bar (opens its CRA status), last scan, links to its findings and SBOM; the name opens the target page. Six cards per project, then "N weitere Prüfobjekte" to the targets list. Within a project: most open CVEs first, then most violated requirements, then name.
How tested
cargo fmt --all --check: okRUSTFLAGS="-D warnings" cargo clippy -p compliance-core --all-targets -- -D warnings: okRUSTFLAGS="-D warnings" cargo clippy -p compliance-agent --all-targets -- -D warnings: okRUSTFLAGS="-D warnings" cargo clippy -p compliance-dashboard --features server --no-default-features --all-targets -- -D warnings: okRUSTFLAGS="-D warnings" cargo clippy -p compliance-dashboard --features web --no-default-features --all-targets -- -D warnings: okcargo test -p compliance-core --lib cve_history: 9 passed (window, never resolved, resolved same day, no fix version excluded, one CVE once per target at highest severity and twice across targets, VEX settles fromvex.atandaffecteddoes not, medium/low apart, top-updates ranking with highest fix and GHSA alias not double-counted, tie-break by critical)cargo test -p compliance-agent --lib -- cve_history role_gate: 11 passed (days clamped/defaulted, blank scope, role gate incl. the two new GET routes)cargo test -p compliance-dashboard --features server --no-default-features --lib -- cve_trend overview i18n: axis top, sparkline points, 30-day change, project grouping (target in two projects, deleted project, empty project), project trend sums, texts DE/ENWhat's left
ScanRunList'son_finishedwould need a non-additive edit oftarget.rs.fixed_versionsas of now).components/mod.rs(aftercra_bar),infrastructure/mod.rs,handlers/mod.rs, a block inroutes.rsbefore/targets/{id}/vex, a module beforetexts::scans, a CSS block before "Targets list".Closes #952
🤖 Generated with Claude Code
Rebased onto #964 (findings link helper), #962 (target route with CVE-cell query), #961 and #956. Resolution:
target.rsimport: both sides are kept.overview.rs: this PR's new tiles replace the figures block whose links #964 had changed, so this PR's version is kept.Route::FindingsPage { target }andRoute::TargetPage { id }here (overview andcve_trend.rs) now use the helpersRoute::findings(...)andRoute::target(...)that #964 and #962 added.Checked locally: fmt, clippy
-D warnings(core, agent, dashboard server and web), dashboard lib tests (173), corecve_history(9) and agentcve_history+ role_gate tests (11).- GET /api/v1/cve-history: open CVEs with a fixed version per day (UTC) by severity, for the tenant, one target or one project's targets, with the open critical/high findings of the same scope; per-target series on request. Computed from created_at, resolved_at and the VEX statement's time, no snapshots. - GET /api/v1/targets/{id}/top-updates: the package updates that close the most of a target's open CVEs with a fix. - Overview: KPI tiles with the 30-day change, a stacked bar chart of the last 30 days, and the targets as cards grouped by portal project with sparklines (instead of the CRA-by-target list). - Target page: the same tiles and chart for the target, and a "Wo handeln" table. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>6d2aba5f5ato1653beb295