Follow-up to #491/#497, requested by the platform session. Stage only.
Problem
PLC findings were still keyed by POU + line and inserted one by one. Every line shift in an export created a duplicate finding, and the old one stayed, because PLC findings aren't auto-closed.
Change
plc::analyze_tree gives each hit its content:
the POU;
the rule's title and description, which name variables and functions but contain no line numbers;
an occurrence index among identical hits in the POU, ordered by line.
A PLCopen XML line refers to the embedded body, not the file, so the file isn't read.
The PLC scan saves through RunFindings:
content keys;
a row stored under the line-based fingerprint is taken over (id, status, triage kept);
moved lines are followed;
control refs are refreshed on earlier rows, which is what the replaced loop did.
Still no auto-close for PLC.
content_fingerprints now works without a tree when the scanner supplies the content, because a PLC scan reads several trees.
Tests
plc_findings_are_keyed_by_what_they_flag_not_their_line: a comment added at the top keeps every content key (the lines move by 2), and no two hits share one.
PLC and finding_store unit tests green. Agent lib: 711 tests.
Follow-up to #491/#497, requested by the platform session. Stage only.
## Problem
PLC findings were still keyed by POU + **line** and inserted one by one. Every line shift in an export created a duplicate finding, and the old one stayed, because PLC findings aren't auto-closed.
## Change
- **`plc::analyze_tree`** gives each hit its content:
- the POU;
- the rule's title and description, which name variables and functions but contain no line numbers;
- an occurrence index among identical hits in the POU, ordered by line.
A PLCopen XML line refers to the embedded body, not the file, so the file isn't read.
- **The PLC scan saves through `RunFindings`:**
- content keys;
- a row stored under the line-based fingerprint is **taken over** (id, status, triage kept);
- moved lines are followed;
- control refs are refreshed on earlier rows, which is what the replaced loop did.
- Still no auto-close for PLC.
- **`content_fingerprints`** now works without a tree when the scanner supplies the content, because a PLC scan reads several trees.
## Tests
- `plc_findings_are_keyed_by_what_they_flag_not_their_line`: a comment added at the top keeps every content key (the lines move by 2), and no two hits share one.
- PLC and finding_store unit tests green. Agent lib: 711 tests.
- Mongo: `content_fingerprints`, `group_findings`, `group_decisions`, `resolve_findings` green.
- fmt and clippy `-D warnings`.
## To check on stage
Check 19: rescan a PLC target unchanged, then with a comment added at the top.
- No new findings, statuses kept.
- Logs: `… now keyed by their content` on the first rescan, then `findings whose code moved …`.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
PLC findings were still keyed by POU and line and inserted one by one, so
every line shift in an export made a duplicate finding (they are not
auto-closed, so the old one stayed).
- plc::analyze_tree gives each hit its content: the POU, the rule's title
and description (variable and function names, no line numbers) and its
occurrence among identical hits in the POU. A PLCopen XML line is a line
of the embedded body, not of the file, so the file is not read.
- The PLC scan saves through RunFindings: content keys, the row stored
under the line-based fingerprint taken over (id, status, triage kept),
moved lines followed, control refs refreshed on earlier rows (what the
removed loop did). Still no auto-close for PLC.
- content_fingerprints works without a tree when the scanner gives the
content (a PLC scan reads several trees).
- Test: a comment added on top keeps every PLC content key, and no two
hits share one. Staging test plan: check 19.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
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.
Follow-up to #491/#497, requested by the platform session. Stage only.
Problem
PLC findings were still keyed by POU + line and inserted one by one. Every line shift in an export created a duplicate finding, and the old one stayed, because PLC findings aren't auto-closed.
Change
plc::analyze_treegives each hit its content:A PLCopen XML line refers to the embedded body, not the file, so the file isn't read.
The PLC scan saves through
RunFindings:content_fingerprintsnow works without a tree when the scanner supplies the content, because a PLC scan reads several trees.Tests
plc_findings_are_keyed_by_what_they_flag_not_their_line: a comment added at the top keeps every content key (the lines move by 2), and no two hits share one.content_fingerprints,group_findings,group_decisions,resolve_findingsgreen.-D warnings.To check on stage
Check 19: rescan a PLC target unchanged, then with a comment added at the top.
… now keyed by their contenton the first rescan, thenfindings whose code moved ….🤖 Generated with Claude Code
https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
83c892bdfato922635daa2