Compare commits

..
Author SHA1 Message Date
Sharang ParnerkarandClaude Opus 4.8 6af84c5216 fix(orchestrator): refresh control_refs on existing findings during re-scan
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
CI / Check (push) Skipped
The dedup loop only inserted first-seen findings; re-scans skipped existing
fingerprints entirely, so control_refs (re)computed by the mapping passes were
discarded. A finding first seen before control mapping was enabled/tuned would
therefore never gain its control mappings without being deleted + re-added.

Now: existing findings whose re-scan produced non-empty control_refs get updated
in place ($set control_refs). Guarded on non-empty so a run where mapping didn't
run (breakpilot unreachable) can't wipe existing refs. New findings unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-22 14:18:04 +02:00
+1 -15
View File
@@ -586,21 +586,7 @@ impl PipelineOrchestrator {
let Some(path) = ingest_set.get(&a.id).and_then(|ia| ia.working_path.clone()) else { let Some(path) = ingest_set.get(&a.id).and_then(|ia| ia.working_path.clone()) else {
continue; continue;
}; };
let mut source_findings = crate::pipeline::plc::analyze_tree(&path, target_id); all_findings.extend(crate::pipeline::plc::analyze_tree(&path, target_id));
// Control mapping for the PLC path (run_plc_scan is separate from
// run_pipeline, which does its own mapping). PLC findings carry
// file_path/line/cwe, so the semantic pass reads each region under this
// source's `path` and stamps master-control refs. The LUT + grounded
// surface passes are code-pattern / CRA-specific and don't apply to
// IEC 61131-3 control logic, so only the semantic pass runs here.
crate::controls::semantic_stamp_findings(
&self.config,
self.llm.clone(),
&path,
&mut source_findings,
)
.await;
all_findings.extend(source_findings);
// Control-application SBOM: CODESYS libraries + runtime from a // Control-application SBOM: CODESYS libraries + runtime from a
// `.projectarchive` (uploaded, or committed in the working tree). // `.projectarchive` (uploaded, or committed in the working tree).
let archive = a let archive = a