Package dev.dokimos.core.gate
Class BaselineStore
java.lang.Object
dev.dokimos.core.gate.BaselineStore
Reads and writes the regression-gate baseline file, and reconstructs comparison-ready
RunResults from it.
The baseline is a committed source file. It is read and written through the module-relative
filesystem path, never the classpath, so the read and the write always target the same file (a
classpath copy under target/test-classes would not).
-
Method Summary
Modifier and TypeMethodDescriptionstatic BaselineFileproject(ExperimentResult result, GateConfig config) Projects an experiment result into the v1 baseline format (no I/O).static BaselineFileReads and validates a baseline file.toRunResults(BaselineFile baseline) Reconstructs comparison-ready runs from a baseline.static voidwrite(Path path, ExperimentResult result, GateConfig config) Writes a baseline atomically to the given source-tree path (creating parent directories).
-
Method Details
-
project
Projects an experiment result into the v1 baseline format (no I/O).- Parameters:
result- the experiment result to project (must have at least one run)config- the gate configuration (controls pairing)- Returns:
- the baseline projection
- Throws:
IllegalArgumentException- if the result has no runsIllegalStateException- if an item has no evaluator results
-
write
Writes a baseline atomically to the given source-tree path (creating parent directories).- Parameters:
path- the baseline file pathresult- the experiment result to projectconfig- the gate configuration- Throws:
IOException- if the file cannot be written
-
read
Reads and validates a baseline file.- Parameters:
path- the baseline file path- Returns:
- the parsed and validated baseline
- Throws:
IOException- if the file cannot be readIllegalStateException- if the format version is unsupported or the content is invalidIllegalArgumentException- if the file is not valid JSON
-
toRunResults
Reconstructs comparison-ready runs from a baseline. The reconstructed run is faithful for what the comparison engine reads (item key + per-evaluator score and verdict); the model outputs, reasons, and metrics the projection dropped are never consulted by the engine.- Parameters:
baseline- the baseline to reconstruct- Returns:
- a single-element list holding the reconstructed run
-