Fixes#1041. I found it testing supplier SBOMs on stage, but it affects every target.
Cause
vex_lifecycle::upsert_reported writes the whole alert a scan builds with $set, including created_at. Every scan builds its alerts anew, with created_at set to now. So each rescan moved the "found" time of every CVE it still reports to the rescan itself:
Verlauf: the rescan listed those CVEs as neu again. On stage, lodash's four CVEs were already found by the first scan and showed as "neu" on the rescan.
CVE trend ("Offene CVE mit Fix", cve_history): it counts a CVE as open from created_at, so the days before the last scan lost it.
created_at is written only when the alert is first stored ($setOnInsert); every other field is still set as before. #1015 changes other parts of vex_lifecycle.rs, not upsert_reported, so they don't overlap.
Alerts stored before this change keep the created_at of their last scan; earlier times can't be recovered. From the next scan on, the time no longer moves.
Tests
tests/vex_lifecycle.rs: an alert reported again with a later created_at keeps the first one.
Local runs: the agent test suite is green, and clippy --all-targets -D warnings is clean.
Fixes #1041. I found it testing supplier SBOMs on stage, but it affects every target.
## Cause
`vex_lifecycle::upsert_reported` writes the whole alert a scan builds with `$set`, including `created_at`. Every scan builds its alerts anew, with `created_at` set to now. So each rescan moved the "found" time of every CVE it still reports to the rescan itself:
- **Verlauf:** the rescan listed those CVEs as **neu** again. On stage, lodash's four CVEs were already found by the first scan and showed as "neu" on the rescan.
- **CVE trend** ("Offene CVE mit Fix", `cve_history`): it counts a CVE as open from `created_at`, so the days before the last scan lost it.
This has been the behaviour since #502.
## What
`created_at` is written only when the alert is first stored (`$setOnInsert`); every other field is still set as before. #1015 changes other parts of `vex_lifecycle.rs`, not `upsert_reported`, so they don't overlap.
Alerts stored before this change keep the `created_at` of their last scan; earlier times can't be recovered. From the next scan on, the time no longer moves.
## Tests
- `tests/vex_lifecycle.rs`: an alert reported again with a later `created_at` keeps the first one.
- **Local runs:** the agent test suite is green, and clippy `--all-targets -D warnings` is clean.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9
upsert_reported $set the whole alert a scan built, created_at included,
so every rescan moved each still-reported CVE's 'found' time to its own:
the target's history listed them as new again, and the CVE trend lost
them for the days before. created_at is now written on insert only.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9
sharang
merged commit 832f9b13e1 into main2026-11-17 12:59:51 +00:00
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.
Fixes #1041. I found it testing supplier SBOMs on stage, but it affects every target.
Cause
vex_lifecycle::upsert_reportedwrites the whole alert a scan builds with$set, includingcreated_at. Every scan builds its alerts anew, withcreated_atset to now. So each rescan moved the "found" time of every CVE it still reports to the rescan itself:cve_history): it counts a CVE as open fromcreated_at, so the days before the last scan lost it.This has been the behaviour since #502.
What
created_atis written only when the alert is first stored ($setOnInsert); every other field is still set as before. #1015 changes other parts ofvex_lifecycle.rs, notupsert_reported, so they don't overlap.Alerts stored before this change keep the
created_atof their last scan; earlier times can't be recovered. From the next scan on, the time no longer moves.Tests
tests/vex_lifecycle.rs: an alert reported again with a latercreated_atkeeps the first one.--all-targets -D warningsis clean.🤖 Generated with Claude Code
https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9