Class DiffService

java.lang.Object
dev.dokimos.server.service.DiffService

@Service public class DiffService extends Object
Builds the per-case run-diff view for the UI. It runs the same core comparison the CI gate uses (through ComparisonSupport) but presents every case (regressed, improved, unchanged, added, removed) as a full, sortable, paginated table with per-evaluator old-to-new deltas.

Unlike the gate, the diff always compares two specific runs the user picked, so the baseline run id is required (there is no automatic baseline resolution here).

The comparison is whole-run by nature: significance requires all paired items, so it cannot be computed over a DB-level page. Pagination is therefore an in-memory slice over the already computed comparison result, not a database join.

  • Constructor Details

  • Method Details

    • listDiff

      @Transactional(readOnly=true) public DiffView listDiff(UUID experimentId, UUID candidateRunId, UUID baselineRunId, String statusFilter, org.springframework.data.domain.Pageable pageable)
      Builds the per-case diff between a candidate run and an explicit baseline run, returning the whole-run summary together with the requested, filtered, sorted page of cases.
      Parameters:
      experimentId - the experiment both runs belong to
      candidateRunId - the candidate run (the "new" side)
      baselineRunId - the baseline run (the "old" side); required
      statusFilter - optional case filter: ALL (default), REGRESSED, IMPROVED, or CHANGED (regressed + improved). Case-insensitive; null or blank means ALL
      pageable - pagination over the filtered, sorted case list
      Returns:
      the summary plus the requested page of cases
      Throws:
      IllegalArgumentException - if the experiment or a run is missing, a run does not belong to the experiment, or statusFilter is not a recognized value (surfaces as 404 for missing entities; an unknown filter surfaces as a 400 via the controller)
      IllegalStateException - if either run is not terminal (surfaces as 409)