Package dev.dokimos.core.gate
Record Class GateVerdict
java.lang.Object
java.lang.Record
dev.dokimos.core.gate.GateVerdict
- Record Components:
status- one ofPASS,FAIL,NO_BASELINEpassed- true when the gate allows the build to proceed (status != FAIL)pairing-positional,dataset_item_id, ornone(NO_BASELINE)baselinePassRate- baseline overall pass rate, or null when NO_BASELINEcandidatePassRate- candidate overall pass rate (always a number)passRateDelta- candidate minus baseline pass rate, or null when NO_BASELINEsignificant- whether the pass-rate change is statistically significantimprovedCount- items significantly improvedregressedCount- 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 listtotalRegressedCases- the deduped union total of regressed cases before the display cap, used bytoMarkdown()as the truncation denominator so it is exact even for a guard-2-only breakunchangedCount- items with no significant changeaddedCount- items present only in the candidateremovedCount- items present only in the baselineregressedEvaluators- evaluators flagged as significant regressionscases- regressed items shown in the comment (capped at 50)casesTruncated- true when the deduped case total exceeded the capcomparedPass- 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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordA per-item evaluator score drop.static final recordA single regressed item, identified by its dataset item id when paired by id or by its positional index otherwise.static final recordA single evaluator's significant regression between baseline and candidate. -
Constructor Summary
ConstructorsConstructorDescriptionGateVerdict(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 aGateVerdictrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of theaddedCountrecord component.Returns the value of thebaselinePassRaterecord component.doubleReturns the value of thecandidatePassRaterecord component.cases()Returns the value of thecasesrecord component.booleanReturns the value of thecasesTruncatedrecord component.booleanReturns the value of thecomparedPassrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of theimprovedCountrecord component.static GateVerdictnoBaseline(double candidatePassRate) The verdict when no baseline exists yet: nothing to regress against, so the gate passes.pairing()Returns the value of thepairingrecord component.booleanpassed()Returns the value of thepassedrecord component.Returns the value of thepassRateDeltarecord component.intReturns the value of theregressedCountrecord component.Returns the value of theregressedEvaluatorsrecord component.intReturns the value of theremovedCountrecord component.booleanReturns the value of thesignificantrecord component.status()Returns the value of thestatusrecord component.toJson()Serializes to compact JSON, the shape the CI report action consumes.Renders the verdict as CI-agnostic Markdown so any runner (GitLab, Jenkins, local) can post the same comment.final StringtoString()Returns a string representation of this record class.intReturns the value of thetotalRegressedCasesrecord component.intReturns the value of theunchangedCountrecord component.warnings()Returns the value of thewarningsrecord component.
-
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 aGateVerdictrecord class.- Parameters:
status- the value for thestatusrecord componentpassed- the value for thepassedrecord componentpairing- the value for thepairingrecord componentbaselinePassRate- the value for thebaselinePassRaterecord componentcandidatePassRate- the value for thecandidatePassRaterecord componentpassRateDelta- the value for thepassRateDeltarecord componentsignificant- the value for thesignificantrecord componentimprovedCount- the value for theimprovedCountrecord componentregressedCount- the value for theregressedCountrecord componenttotalRegressedCases- the value for thetotalRegressedCasesrecord componentunchangedCount- the value for theunchangedCountrecord componentaddedCount- the value for theaddedCountrecord componentremovedCount- the value for theremovedCountrecord componentregressedEvaluators- the value for theregressedEvaluatorsrecord componentcases- the value for thecasesrecord componentcasesTruncated- the value for thecasesTruncatedrecord componentcomparedPass- the value for thecomparedPassrecord componentwarnings- the value for thewarningsrecord component
-
-
Method Details
-
noBaseline
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 (passExperimentResult.passRate())- Returns:
- a NO_BASELINE verdict
-
toJson
Serializes to compact JSON, the shape the CI report action consumes.- Returns:
- the verdict as a single-line JSON document
-
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 anywarningsare appended.- Returns:
- the Markdown summary
-
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 '=='. -
status
Returns the value of thestatusrecord component.- Returns:
- the value of the
statusrecord component
-
passed
public boolean passed()Returns the value of thepassedrecord component.- Returns:
- the value of the
passedrecord component
-
pairing
Returns the value of thepairingrecord component.- Returns:
- the value of the
pairingrecord component
-
baselinePassRate
Returns the value of thebaselinePassRaterecord component.- Returns:
- the value of the
baselinePassRaterecord component
-
candidatePassRate
public double candidatePassRate()Returns the value of thecandidatePassRaterecord component.- Returns:
- the value of the
candidatePassRaterecord component
-
passRateDelta
Returns the value of thepassRateDeltarecord component.- Returns:
- the value of the
passRateDeltarecord component
-
significant
public boolean significant()Returns the value of thesignificantrecord component.- Returns:
- the value of the
significantrecord component
-
improvedCount
public int improvedCount()Returns the value of theimprovedCountrecord component.- Returns:
- the value of the
improvedCountrecord component
-
regressedCount
public int regressedCount()Returns the value of theregressedCountrecord component.- Returns:
- the value of the
regressedCountrecord component
-
totalRegressedCases
public int totalRegressedCases()Returns the value of thetotalRegressedCasesrecord component.- Returns:
- the value of the
totalRegressedCasesrecord component
-
unchangedCount
public int unchangedCount()Returns the value of theunchangedCountrecord component.- Returns:
- the value of the
unchangedCountrecord component
-
addedCount
public int addedCount()Returns the value of theaddedCountrecord component.- Returns:
- the value of the
addedCountrecord component
-
removedCount
public int removedCount()Returns the value of theremovedCountrecord component.- Returns:
- the value of the
removedCountrecord component
-
regressedEvaluators
Returns the value of theregressedEvaluatorsrecord component.- Returns:
- the value of the
regressedEvaluatorsrecord component
-
cases
Returns the value of thecasesrecord component.- Returns:
- the value of the
casesrecord component
-
casesTruncated
public boolean casesTruncated()Returns the value of thecasesTruncatedrecord component.- Returns:
- the value of the
casesTruncatedrecord component
-
comparedPass
public boolean comparedPass()Returns the value of thecomparedPassrecord component.- Returns:
- the value of the
comparedPassrecord component
-
warnings
Returns the value of thewarningsrecord component.- Returns:
- the value of the
warningsrecord component
-