Repository navigation
Show LLM verification reasoning alongside findings - #454
Conversation
Signed-off-by: Narendran Raghavan <[email protected]>
Signed-off-by: Narendran Raghavan <[email protected]>
Signed-off-by: Narendran Raghavan <[email protected]>
chrisknvidia
left a comment
There was a problem hiding this comment.
Nice work. The sanitizing and the escaping hold up, and I'd like one thing changed before this merges.
What I did: ran the new tests against this head (all 42 pass), rendered verified findings through the HTML, Markdown and terminal reporters, and read the path from _verify_findings_with_llm to each renderer. HTML goes through autoescape, the Markdown cell escapes |, [ and @, control and bidi characters are stripped before any of that, and the metadata survives the JSON round trip. That last part matters because CI re-renders the HTML and Markdown from the redacted JSON, so the hosted reports get the same box. JSON output and the gate are untouched.
The thing to fix is the grouping in the HTML report. _deduplicate_findings now puts the whole verification object in its key, and that includes the reasoning text. The verifier writes a different rationale for every finding, so verified findings almost never merge any more. I tried 30 findings of the same check in one file. Unverified (and on main) that is one card with "30 occurrences" and the line list. On this branch with a per-line rationale it is 30 cards, and the report goes from about 236 KB to 338 KB. That is the pattern the grouping exists for (the macOS user path finding firing on many lines), and --llm-verify is exactly when it shows up. There is a suggested key in the inline comment.
Two small things inline: one test assertion that can't fail, and the downgrade rule being copied from security.py.
Optional: docs/tier1-validation.mdx (around line 100) says downgraded findings carry verification metadata. One sentence there saying the HTML, Markdown and terminal reports now show the verdict, confidence and reasoning would help people find it.
Housekeeping: the branch is one commit behind main, and Tests (Python 3.12) was still running when I looked.
Signed-off-by: Narendran Raghavan <[email protected]>
…rifier-reasoning Signed-off-by: Narendran Raghavan <[email protected]>
Keeps both Unreleased/Added CHANGELOG entries (NeMo Gym backend and LLM verification reasoning from #454). No other files conflicted. Signed-off-by: Narendran Raghavan <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Summary
Show a finding's recorded LLM verification verdict, confidence, bounded reasoning, and final severity in HTML, Markdown, and terminal reports. JSON and gate behavior remain unchanged; a recorded downgrade stays visible when a later policy restores HIGH.
Verified occurrences group by decision (verdict, confidence, severity effect), with the first rationale on the grouped card and every rationale retained in validator details and JSON. The producer and reports share one downgrade-policy definition. Plain/forced-color regressions normalize renderer styling while rejecting input-origin SGR, CSI, and OSC controls.
Review and verification
Release impact
Unreleased changelog and Tier 1 documentation updated. Default downgrade threshold, target severity, exemptions, and JSON contract unchanged.