Computes the delta between the previous scan state and the current report:
new— findings present now that were absent last runresolved— findings present last run that are absent nowstill_present— findings in both, with theirfirst_seen_atpreserved from the prior state for patch-lag display
The dedup key is Finding.dedupe_key/1 (id, package, version).
Two findings reported by different sources for the same advisory
on the same package@version are considered the same finding —
resolution is based on the underlying vulnerability, not the
scanner that surfaced it.
Summary
Functions
Compute the diff between a previous state map (typically loaded from the state file) and the current report.
String form of Finding.dedupe_key/1 — matches StateFile entry keys.
Types
@type t() :: %MobDev.SecurityScan.Diff{ first_seen: %{required(MobDev.SecurityScan.StateFile.key()) => DateTime.t()}, new: [MobDev.SecurityScan.Finding.t()], resolved: [MobDev.SecurityScan.StateFile.entry()], still_present: [MobDev.SecurityScan.Finding.t()] }
Functions
@spec compute( MobDev.SecurityScan.StateFile.state(), MobDev.SecurityScan.Report.t(), DateTime.t() ) :: t()
Compute the diff between a previous state map (typically loaded from the state file) and the current report.
Both sides are keyed by the string form of Finding.dedupe_key/1
("id|package|version") so we can compare across the JSON state
file boundary.
now is injectable so tests can pin timestamps.
@spec string_key(MobDev.SecurityScan.Finding.t()) :: String.t()
String form of Finding.dedupe_key/1 — matches StateFile entry keys.