fix(orchestrator): refresh control_refs on PLC re-scans #230

Merged
sharang merged 1 commits from fix/plc-refresh-control-refs into main 2026-07-22 17:06:09 +00:00
Owner

run_plc_scan's persist block was insert-only, so a PLC re-scan never updated control_refs on findings first seen before the semantic mapping pass ran — mappings could only be picked up by delete + re-add of the target. This ports the refresh branch run_pipeline already has (#228): when a finding already exists and now carries control_refs, $set them onto the existing row.

Why now: the PLC control-mapping loop was just proven live (pump-station: 11/16 findings tagged to master controls, emitted via oscal_assessment over MCP). This removes the delete/re-add wart so future PLC re-scans refresh mappings in place.

Verified: cargo fmt --all --check, cargo clippy -p compliance-agent -- -D warnings, and the CI --lib test set all green locally (-j8).

🤖 Generated with Claude Code

`run_plc_scan`'s persist block was insert-only, so a PLC re-scan never updated `control_refs` on findings first seen before the semantic mapping pass ran — mappings could only be picked up by delete + re-add of the target. This ports the refresh branch `run_pipeline` already has (#228): when a finding already exists and now carries `control_refs`, `$set` them onto the existing row. **Why now:** the PLC control-mapping loop was just proven live (pump-station: 11/16 findings tagged to master controls, emitted via `oscal_assessment` over MCP). This removes the delete/re-add wart so future PLC re-scans refresh mappings in place. **Verified:** `cargo fmt --all --check`, `cargo clippy -p compliance-agent -- -D warnings`, and the CI `--lib` test set all green locally (-j8). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
sharang added 1 commit 2026-07-22 16:40:23 +00:00
fix(orchestrator): refresh control_refs on PLC re-scans
CI / Check (push) Skipped
CI / Check (pull_request) Successful in 5m40s
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
731f84d2e5
run_plc_scan's persist block was insert-only, so a PLC re-scan never
updated control_refs on findings first seen before the semantic mapping
pass ran (or before it was enabled) — mappings could only be picked up by
deleting and re-adding the target. Port the refresh branch run_pipeline
already has (#228): when a finding already exists and now carries
control_refs, $set them onto the existing row.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
sharang merged commit effc3080e0 into main 2026-07-22 17:06:09 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sharang/compliance-scanner-agent#230