Skip to main content

render_diff

Function render_diff 

Source
pub fn render_diff(diff: &DiffReport, baseline_hint: Option<&str>) -> String
Expand description

Render a standalone diff report as Markdown.

Schema:

  • # AgentSec diff vs <baseline-path-or-"latest snapshot"> — header.
  • If the diff is empty, a single _no changes._ line and nothing else.
  • Otherwise the three ### Added / ### Modified / ### Removed subsections, each omitted when its vector is empty.

Pass baseline_hint as Some("/path/to/snapshot") to put the snapshot path in the header, or None for the generic phrasing.