Skip to main content

generate

Function generate 

Source
pub fn generate(report: &DiffReport) -> Vec<Recommendation>
Expand description

Generate recommendations from a complete DiffReport.

Rules:

  1. For every divergence in report.divergences (top-K ranked), apply the rule that matches its (kind, primary_axis, explanation) shape.
  2. If the overall worst-severity axis is Severe and no divergence produced an Error-level recommendation, add a single trace-wide recommendation pointing the reviewer at the strongest axis.
  3. Sort by (severity desc, confidence desc, turn asc). Cap at 8 to avoid overwhelming PR comments (callers that want all can still read the raw list — but the canonical ordering is stable here).

Output is stable and deterministic given the same input DiffReport.