Files
java-ai-agents/pr-reviewer/src/main/java/com/ankurm/prreviewer/Finding.java
T

27 lines
1.1 KiB
Java

package com.ankurm.prreviewer;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
/**
* One claim made by the model. Nothing in it is trusted yet: {@link LineGuard} decides whether
* {@code line} and {@code quote} really point at a line this pull request added.
*/
public record Finding(
@JsonPropertyDescription("Line number in the new file, copied from the left column of the diff")
int line,
@JsonPropertyDescription("The exact code on that line, copied character for character, without the line number and + marker")
String quote,
Severity severity,
Category category,
@JsonPropertyDescription("Short headline, under 80 characters")
String title,
@JsonPropertyDescription("Why this is a problem, one or two sentences")
String comment,
@JsonPropertyDescription("Replacement code or a concrete fix; empty string if none")
String suggestion) {
Finding atLine(int newLine) {
return new Finding(newLine, quote, severity, category, title, comment, suggestion);
}
}