Closes#491. Fingerprints hashed repository/rule/file/line, so since the
auto-close (#443) and issue sync (#451) every line added above a finding
closed it and its tracker issue, reported it anew and lost its triage.
- RunFindings keys every finding at one place in a file by content
(finding_store::content_fingerprints, applied with the variant labels
before grouping and on save): repository, scanner, rule, file, the
flagged line without whitespace, and the number of identical lines
above it (two identical lines stay two findings). The idea of CodeQL's
primaryLocationLineHash and CodeChecker's context-free-v2. Version-tagged
("content-v1").
- Per tool: gitleaks gives the matched secret as the content
(Finding::fingerprint_content, never stored), as a hit from the history
may not be on that line of the tree any more.
- One-time alias: the replaced line-based fingerprint is kept
(Finding::legacy_fingerprints); the first scan after deploy finds the
row stored under it and takes it over (fingerprint rewritten, old one
recorded) instead of inserting, so the row keeps its id (tracker issue),
status (a person's decisions included) and triage. Idempotent: later
scans find the new fingerprint directly.
- A stored finding whose code moved is updated to its new line and snippet.
- Groups (#464/#477) keep their line-free key and never take over a
member's former fingerprint.
- Unchanged: findings without file and line (CVE, malware, binaries,
DAST), and the PLC path, which does not save through RunFindings.
- Tests: a line added above and re-indentation keep the fingerprint,
twins stay distinct, a secret is keyed by its match, groups untouched;
Mongo: pre-change rows are adopted with id/status kept, a later line
shift gives no new row and no close/reopen, the line follows.
- Docs (findings guide); staging test plan: check 18.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p