Record Class GateVerdict

java.lang.Object
java.lang.Record
dev.dokimos.core.gate.GateVerdict
Record Components:
status - one of PASS, FAIL, NO_BASELINE
passed - true when the gate allows the build to proceed (status != FAIL)
pairing - positional, dataset_item_id, or none (NO_BASELINE)
baselinePassRate - baseline overall pass rate, or null when NO_BASELINE
candidatePassRate - candidate overall pass rate (always a number)
passRateDelta - candidate minus baseline pass rate, or null when NO_BASELINE
significant - whether the pass-rate change is statistically significant
improvedCount - items significantly improved
regressedCount - the regressed-case count shown in the comment: the larger of the engine's significance-gated count and the deduped union of guard-1 and guard-2 cases, so a guard-2-only break never renders as "0 regressed cases" above a populated list
totalRegressedCases - the deduped union total of regressed cases before the display cap, used by toMarkdown() as the truncation denominator so it is exact even for a guard-2-only break
unchangedCount - items with no significant change
addedCount - items present only in the candidate
removedCount - items present only in the baseline
regressedEvaluators - evaluators flagged as significant regressions
cases - regressed items shown in the comment (capped at 50)
casesTruncated - true when the deduped case total exceeded the cap
comparedPass - true when a real comparison ran (false only for NO_BASELINE)
warnings - coverage-loss and threshold-drift notices

public record GateVerdict(String status, boolean passed, String pairing, Double baselinePassRate, double candidatePassRate, Double passRateDelta, boolean significant, int improvedCount, int regressedCount, int totalRegressedCases, int unchangedCount, int addedCount, int removedCount, List<GateVerdict.RegressedEvaluator> regressedEvaluators, List<GateVerdict.RegressedCase> cases, boolean casesTruncated, boolean comparedPass, List<String> warnings) extends Record
The result of a regression-gate comparison: the overall status, the pass-rate move, the regressed evaluators and cases, and any coverage-loss or threshold-drift warnings.

toJson() writes the verdict in the shape the CI report action consumes (one verdict file per baseline under target/dokimos); toMarkdown() renders the same content as a CI-agnostic comment. The JSON field names are a stable contract for that renderer: the per-case key serializes under index, and candidatePassRate is always present as a number.

Thresholds are advisory: the verdict uses each side's recorded pass/fail, never a recomputed threshold comparison. A threshold change between baseline and candidate produces a warning, not a gate failure.

  • Constructor Details

    • GateVerdict

      public GateVerdict(String status, boolean passed, String pairing, Double baselinePassRate, double candidatePassRate, Double passRateDelta, boolean significant, int improvedCount, int regressedCount, int totalRegressedCases, int unchangedCount, int addedCount, int removedCount, List<GateVerdict.RegressedEvaluator> regressedEvaluators, List<GateVerdict.RegressedCase> cases, boolean casesTruncated, boolean comparedPass, List<String> warnings)
      Creates an instance of a GateVerdict record class.
      Parameters:
      status - the value for the status record component
      passed - the value for the passed record component
      pairing - the value for the pairing record component
      baselinePassRate - the value for the baselinePassRate record component
      candidatePassRate - the value for the candidatePassRate record component
      passRateDelta - the value for the passRateDelta record component
      significant - the value for the significant record component
      improvedCount - the value for the improvedCount record component
      regressedCount - the value for the regressedCount record component
      totalRegressedCases - the value for the totalRegressedCases record component
      unchangedCount - the value for the unchangedCount record component
      addedCount - the value for the addedCount record component
      removedCount - the value for the removedCount record component
      regressedEvaluators - the value for the regressedEvaluators record component
      cases - the value for the cases record component
      casesTruncated - the value for the casesTruncated record component
      comparedPass - the value for the comparedPass record component
      warnings - the value for the warnings record component
  • Method Details

    • noBaseline

      public static GateVerdict noBaseline(double candidatePassRate)
      The verdict when no baseline exists yet: nothing to regress against, so the gate passes. The candidate pass rate is still reported (the renderer always renders it).
      Parameters:
      candidatePassRate - the candidate overall pass rate (pass ExperimentResult.passRate())
      Returns:
      a NO_BASELINE verdict
    • toJson

      public String toJson()
      Serializes to compact JSON, the shape the CI report action consumes.
      Returns:
      the verdict as a single-line JSON document
    • toMarkdown

      public String toMarkdown()
      Renders the verdict as CI-agnostic Markdown so any runner (GitLab, Jenkins, local) can post the same comment. A FAIL with no per-item case (a broad significance failure) renders an explicit aggregate-regression line rather than an empty section, and any warnings are appended.
      Returns:
      the Markdown summary
    • 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.
    • status

      public String status()
      Returns the value of the status record component.
      Returns:
      the value of the status record component
    • passed

      public boolean passed()
      Returns the value of the passed record component.
      Returns:
      the value of the passed record component
    • pairing

      public String pairing()
      Returns the value of the pairing record component.
      Returns:
      the value of the pairing record component
    • baselinePassRate

      public Double baselinePassRate()
      Returns the value of the baselinePassRate record component.
      Returns:
      the value of the baselinePassRate record component
    • candidatePassRate

      public double candidatePassRate()
      Returns the value of the candidatePassRate record component.
      Returns:
      the value of the candidatePassRate record component
    • passRateDelta

      public Double passRateDelta()
      Returns the value of the passRateDelta record component.
      Returns:
      the value of the passRateDelta record component
    • significant

      public boolean significant()
      Returns the value of the significant record component.
      Returns:
      the value of the significant record component
    • improvedCount

      public int improvedCount()
      Returns the value of the improvedCount record component.
      Returns:
      the value of the improvedCount record component
    • regressedCount

      public int regressedCount()
      Returns the value of the regressedCount record component.
      Returns:
      the value of the regressedCount record component
    • totalRegressedCases

      public int totalRegressedCases()
      Returns the value of the totalRegressedCases record component.
      Returns:
      the value of the totalRegressedCases record component
    • unchangedCount

      public int unchangedCount()
      Returns the value of the unchangedCount record component.
      Returns:
      the value of the unchangedCount record component
    • addedCount

      public int addedCount()
      Returns the value of the addedCount record component.
      Returns:
      the value of the addedCount record component
    • removedCount

      public int removedCount()
      Returns the value of the removedCount record component.
      Returns:
      the value of the removedCount record component
    • regressedEvaluators

      public List<GateVerdict.RegressedEvaluator> regressedEvaluators()
      Returns the value of the regressedEvaluators record component.
      Returns:
      the value of the regressedEvaluators record component
    • cases

      Returns the value of the cases record component.
      Returns:
      the value of the cases record component
    • casesTruncated

      public boolean casesTruncated()
      Returns the value of the casesTruncated record component.
      Returns:
      the value of the casesTruncated record component
    • comparedPass

      public boolean comparedPass()
      Returns the value of the comparedPass record component.
      Returns:
      the value of the comparedPass record component
    • warnings

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