Package com.tnsai.coordination.judge
Record Class JudgeVerdict
java.lang.Object
java.lang.Record
com.tnsai.coordination.judge.JudgeVerdict
- Record Components:
decision- the high-level decision (APPROVE, REJECT, RETRY)reason- human-readable explanation of the decisionscore- quality score in [0.0, 1.0], where 1.0 is perfectsuggestions- actionable feedback for the next retry (empty if approved)
public record JudgeVerdict(JudgeVerdict.Decision decision, String reason, double score, List<String> suggestions)
extends Record
Decision produced by a
JudgePolicy after evaluating cycle output.
The verdict carries enough information for the JudgeCoordinator
to decide whether to stop, retry with feedback, or approve the result.
- Since:
- 0.2.3
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionJudgeVerdict(JudgeVerdict.Decision decision, String reason, double score, List<String> suggestions) Creates an instance of aJudgeVerdictrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic JudgeVerdictConvenience factory for an approval verdict.decision()Returns the value of thedecisionrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanWhether this verdict allows the result to pass.reason()Returns the value of thereasonrecord component.static JudgeVerdictConvenience factory for a rejection verdict.static JudgeVerdictConvenience factory for a retry verdict.doublescore()Returns the value of thescorerecord component.Returns the value of thesuggestionsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
JudgeVerdict
public JudgeVerdict(JudgeVerdict.Decision decision, String reason, double score, List<String> suggestions) Creates an instance of aJudgeVerdictrecord class.- Parameters:
decision- the value for thedecisionrecord componentreason- the value for thereasonrecord componentscore- the value for thescorerecord componentsuggestions- the value for thesuggestionsrecord component
-
-
Method Details
-
approve
Convenience factory for an approval verdict. -
reject
Convenience factory for a rejection verdict. -
retry
Convenience factory for a retry verdict. -
isApproved
public boolean isApproved()Whether this verdict allows the result to pass. -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
decision
Returns the value of thedecisionrecord component.- Returns:
- the value of the
decisionrecord component
-
reason
Returns the value of thereasonrecord component.- Returns:
- the value of the
reasonrecord component
-
score
public double score()Returns the value of thescorerecord component.- Returns:
- the value of the
scorerecord component
-
suggestions
Returns the value of thesuggestionsrecord component.- Returns:
- the value of the
suggestionsrecord component
-