Skip to content

fix(meta-analyzer): keep LLM-confirmed findings when model returns end_line#70

Open
JiayingHuang wants to merge 1 commit into
NVIDIA:mainfrom
JiayingHuang:fix/meta-analyzer-end-line-mismatch
Open

fix(meta-analyzer): keep LLM-confirmed findings when model returns end_line#70
JiayingHuang wants to merge 1 commit into
NVIDIA:mainfrom
JiayingHuang:fix/meta-analyzer-end-line-mismatch

Conversation

@JiayingHuang

Copy link
Copy Markdown

Problem

LLMMetaAnalyzer.apply_filter silently drops LLM-confirmed findings whose static end_line is None when the model populates end_line (e.g. end_line == start_line, as DeepSeek does). The exact_key, start_only_key and coarse_key lookups all miss, so the finding is filtered out via continue.

Because the meta-analyzer is a drop-by-default whitelist filter, the effect is a security false negative: a skill with live OSV CVEs scored 100 / CRITICAL in static-only mode but 0 / SAFE once LLM analysis was enabled — even though the model confirmed the findings with is_vulnerability=True, confidence≈1.0. Root cause and a no-API-key reproduction are in #67.

Fix

Add an end_line-agnostic fallback index keyed by (file, rule_id, start_line), gated on the static finding having end_line is None. Findings deliberately distinguished by end_line (same file+rule_id+start_line, different end_line) keep using exact matching, so existing behaviour (test_end_line_used_when_provided) is preserved. The is_vulnerability / confidence >= 0.6 gating is unchanged, so the fallback cannot resurrect findings the LLM rejected.

Tests

  • New tests/nodes/test_meta_analyzer.py: regression test fails on main, passes with the fix; plus rejected-finding and exact-match guards.
  • Full tests/nodes + tests/unit stay green (572 passed, 11 skipped).

…d_line

apply_filter dropped LLM-confirmed findings whose static end_line is None
when the model populated end_line (e.g. end_line == start_line, as DeepSeek
does): the granular, start_only and coarse lookups all missed and the
finding was silently filtered out. This turned a CRITICAL skill (live OSV
CVEs) into SAFE once LLM analysis was enabled.

Add an end_line-agnostic fallback keyed by (file, rule_id, start_line),
gated on the static finding having end_line is None so findings deliberately
distinguished by end_line keep exact matching. Add regression tests.

Fixes NVIDIA#67

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Jiaying Huang <hjyxka@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant