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 decision
score - quality score in [0.0, 1.0], where 1.0 is perfect
suggestions - 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
  • Constructor Details

    • JudgeVerdict

      public JudgeVerdict(JudgeVerdict.Decision decision, String reason, double score, List<String> suggestions)
      Creates an instance of a JudgeVerdict record class.
      Parameters:
      decision - the value for the decision record component
      reason - the value for the reason record component
      score - the value for the score record component
      suggestions - the value for the suggestions record component
  • Method Details

    • approve

      public static JudgeVerdict approve(String reason, double score)
      Convenience factory for an approval verdict.
    • reject

      public static JudgeVerdict reject(String reason, double score, List<String> suggestions)
      Convenience factory for a rejection verdict.
    • retry

      public static JudgeVerdict retry(String reason, double score, List<String> suggestions)
      Convenience factory for a retry verdict.
    • isApproved

      public boolean isApproved()
      Whether this verdict allows the result to pass.
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • decision

      public JudgeVerdict.Decision decision()
      Returns the value of the decision record component.
      Returns:
      the value of the decision record component
    • reason

      public String reason()
      Returns the value of the reason record component.
      Returns:
      the value of the reason record component
    • score

      public double score()
      Returns the value of the score record component.
      Returns:
      the value of the score record component
    • suggestions

      public List<String> suggestions()
      Returns the value of the suggestions record component.
      Returns:
      the value of the suggestions record component