feat(plc): PLC findings keyed by what they flag, saved through RunFindings (#491 follow-up) #499

Merged
sharang merged 2 commits from feat/plc-content-fingerprints into main 2026-10-06 11:27:35 +00:00
2 Commits
Author SHA1 Message Date
Sharang ParnerkarandClaude Opus 5.5 922635daa2 ci: retrigger after runner disk failure
CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Deploy Agent (pull_request) Skipped
CI / Deploy Dashboard (pull_request) Skipped
CI / Deploy Docs (pull_request) Skipped
CI / Deploy MCP (pull_request) Skipped
CI / Check (pull_request) Successful in 11m16s
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
2026-10-06 13:09:11 +02:00
Sharang ParnerkarandClaude Opus 5.5 47de7ecf0d feat(plc): PLC findings keyed by what they flag, saved through RunFindings (#491 follow-up)
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
2026-10-06 13:09:11 +02:00