pub fn generate(report: &DiffReport) -> Vec<Recommendation>Expand description
Generate recommendations from a complete DiffReport.
Rules:
- For every divergence in
report.divergences(top-K ranked), apply the rule that matches its(kind, primary_axis, explanation)shape. - If the overall worst-severity axis is
Severeand no divergence produced an Error-level recommendation, add a single trace-wide recommendation pointing the reviewer at the strongest axis. - 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.