RunFindings keys every finding at one place in a file by:
repository, scanner, rule, file;
the flagged line without whitespace;
the number of identical lines above it, so two identical lines stay two findings.
This is the idea behind CodeQL's primaryLocationLineHash and CodeChecker's context-free-v2. The hash is tagged content-v1.
It runs centrally, before grouping and on save. The scanners' own hashing is untouched except for one hunk in gitleaks.
Per tool: gitleaks supplies the matched secret as the content (Finding::fingerprint_content, never stored), because a hit from the git history may not be on that line of the tree any more.
One-time alias:
The replaced line-based fingerprint stays in Finding::legacy_fingerprints.
The first scan after deploy finds the row stored under it and takes it over instead of inserting: the fingerprint is rewritten and the old one recorded.
The row therefore keeps its id (and with it its tracker issue), its status (a person's decisions included) and its triage.
Idempotent: later scans find the new fingerprint directly.
Moved code: 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 (this was a real bug in the first draft).
Unchanged:
findings without file and line (CVE, malware, binaries, DAST);
the PLC path, which doesn't save through RunFindings; that can follow.
Scope versus the other agents' areas
Hunks touch only finding_store.rs, grouping.rs (one line), gitleaks.rs (one line), orchestrator.rs (with_tree) and Finding. Nothing in rules/vendor/, cve.rs or binaries.rs.
Tests
Unit:
a line added above and re-indentation keep the fingerprint;
identical lines stay distinct;
the old fingerprint is kept;
a missing file leaves the finding as it was;
a secret is keyed by its match (also from the history);
groups are untouched.
Mongo (tests/content_fingerprints.rs):
pre-change rows (one marked false positive, one open) are adopted with id and status kept and the old fingerprint recorded;
after lines are added above them: no new rows, no close/reopen (status_changed empty), and the line follows.
Closes #491. Item 1 of the OSS research's short-term list. Stage only.
## Problem
Fingerprints hashed repository/rule/file/**line**. Since the auto-close (#443) and issue sync (#451), every line added above a finding:
- closed it and its tracker issue;
- reported it anew;
- dropped its triage.
## Change
- **Content-based key** (`finding_store::content_fingerprints`).
- `RunFindings` keys every finding at one place in a file by:
- repository, scanner, rule, file;
- the **flagged line without whitespace**;
- the **number of identical lines above it**, so two identical lines stay two findings.
- This is the idea behind CodeQL's `primaryLocationLineHash` and CodeChecker's `context-free-v2`. The hash is tagged `content-v1`.
- It runs centrally, before grouping and on save. The scanners' own hashing is untouched except for one hunk in gitleaks.
- **Per tool:** gitleaks supplies the matched secret as the content (`Finding::fingerprint_content`, never stored), because a hit from the git history may not be on that line of the tree any more.
- **One-time alias:**
- The replaced line-based fingerprint stays in `Finding::legacy_fingerprints`.
- The first scan after deploy finds the row stored under it and **takes it over** instead of inserting: the fingerprint is rewritten and the old one recorded.
- The row therefore keeps its **id (and with it its tracker issue)**, its **status** (a person's decisions included) and its **triage**.
- Idempotent: later scans find the new fingerprint directly.
- **Moved code:** 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 (this was a real bug in the first draft).
- **Unchanged:**
- findings without file and line (CVE, malware, binaries, DAST);
- the PLC path, which doesn't save through `RunFindings`; that can follow.
## Scope versus the other agents' areas
Hunks touch only `finding_store.rs`, `grouping.rs` (one line), `gitleaks.rs` (one line), `orchestrator.rs` (`with_tree`) and `Finding`. Nothing in `rules/vendor/`, `cve.rs` or `binaries.rs`.
## Tests
- **Unit:**
- a line added above and re-indentation keep the fingerprint;
- identical lines stay distinct;
- the old fingerprint is kept;
- a missing file leaves the finding as it was;
- a secret is keyed by its match (also from the history);
- groups are untouched.
- **Mongo (`tests/content_fingerprints.rs`):**
- pre-change rows (one marked false positive, one open) are adopted with id and status kept and the old fingerprint recorded;
- after lines are added above them: **no new rows, no close/reopen** (`status_changed` empty), and the line follows.
- `group_findings`, `group_decisions`, `finding_variants`, `resolve_findings`, `live_findings`, `finding_migrations`: green.
- fmt and clippy `-D warnings`: agent, core, mcp, dashboard (server and wasm).
- Agent lib: 710 tests. Core: 85.
## To check on stage
Check 18 in `docs/release/staging-test-plan-after-v0.4.5.md`:
1. Rescan a target with history: nothing new, nothing closed; log `… now keyed by their content` with `adopted=…`.
2. Push lines above a finding: same finding and issue, new line; log `findings whose code moved …`.
3. Duplicate a flagged line: two findings.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
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
sharang
merged commit ece992da32 into main2026-10-06 10:35:14 +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.
Closes #491. Item 1 of the OSS research's short-term list. Stage only.
Problem
Fingerprints hashed repository/rule/file/line. Since the auto-close (#443) and issue sync (#451), every line added above a finding:
Change
finding_store::content_fingerprints).RunFindingskeys every finding at one place in a file by:primaryLocationLineHashand CodeChecker'scontext-free-v2. The hash is taggedcontent-v1.Finding::fingerprint_content, never stored), because a hit from the git history may not be on that line of the tree any more.Finding::legacy_fingerprints.RunFindings; that can follow.Scope versus the other agents' areas
Hunks touch only
finding_store.rs,grouping.rs(one line),gitleaks.rs(one line),orchestrator.rs(with_tree) andFinding. Nothing inrules/vendor/,cve.rsorbinaries.rs.Tests
tests/content_fingerprints.rs):status_changedempty), and the line follows.group_findings,group_decisions,finding_variants,resolve_findings,live_findings,finding_migrations: green.-D warnings: agent, core, mcp, dashboard (server and wasm).To check on stage
Check 18 in
docs/release/staging-test-plan-after-v0.4.5.md:… now keyed by their contentwithadopted=….findings whose code moved ….🤖 Generated with Claude Code
https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p