Skip to content

Evaluation

Modules:

Name Description
evaluator
evaluators
experiment
metric_implementation

Pinned metric scripts and the Python environment used to evaluate them.

Classes:

Name Description
EvaluationRecord

A record identifying evaluations for a specific task.

Evaluator

A class for LLM output evaluators.

ExperimentBatchConfig

Configuration for a batch of experiments to be executed by a pipeline.

ExperimentConfig

Configuration for an experiment to be executed by a pipeline.

GenerationRecord

A record identifying generations for a specific task.

GenerationSource

The generation artifact used by an evaluation.

MetaTierGroupedRecord

A record grouping evaluation records by generator name

MetricImplementation

Immutable provenance for one built-in metric implementation.

ResultRecord

A record indicating the result of generation or evaluation.

ScoreCalculator

A protocol for computing evaluation scores.

ScorerFactory

A protocol for constructing a Scorer given a Model.

TaskConfig

Configuration for a task to be executed by a pipeline.

EvaluationRecord

Bases: GenerationRecord

A record identifying evaluations for a specific task.

Attributes:

Name Type Description
dataset_record DatasetRecord

The record of the dataset.

generator_name str

The name of the generator.

task_name str

The name of the task.

model_record ModelRecord

The record of the model.

experiment_name str | None

The name of the experiment, if applicable.

generator_fingerprint str

Identity of the solver configuration and explicit version. Empty for legacy records without this identity.

task_fingerprint str

Identity of preprocessing and sample field mapping. Empty for legacy records without this identity.

evaluator_name str

The name of the evaluator.

evaluator_provenance_json str

Canonical script/runtime provenance.

evaluator_fingerprint str

Identity of the evaluator configuration, including its judge settings and explicit version. Empty for legacy records without this identity.

Methods:

Name Description
__eq__

Checks equality with another record.

__hash__

Generates a hash for the evaluation record.

__lt__

Checks if this record is less than another record.

get_evaluation_record

Generates an evaluation record from the generation record.

get_meta_grouped_record

Generates a perturbation grouped record from the evaluation record.

Source code in evalsense/evaluation/experiment.py
@total_ordering
class EvaluationRecord(GenerationRecord, frozen=True):
    """A record identifying evaluations for a specific task.

    Attributes:
        dataset_record (DatasetRecord): The record of the dataset.
        generator_name (str): The name of the generator.
        task_name (str): The name of the task.
        model_record (ModelRecord): The record of the model.
        experiment_name (str | None): The name of the experiment, if applicable.
        generator_fingerprint (str): Identity of the solver configuration and
            explicit version. Empty for legacy records without this identity.
        task_fingerprint (str): Identity of preprocessing and sample field mapping.
            Empty for legacy records without this identity.
        evaluator_name (str): The name of the evaluator.
        evaluator_provenance_json (str): Canonical script/runtime provenance.
        evaluator_fingerprint (str): Identity of the evaluator configuration,
            including its judge settings and explicit version. Empty for legacy
            records without this identity.
    """

    evaluator_name: str
    evaluator_fingerprint: str = ""
    evaluator_provenance_json: str = ""

    @property
    def generation_record(self) -> GenerationRecord:
        """Generates a generation record from the evaluation record.

        Returns:
            GenerationRecord: The generation record.
        """
        return GenerationRecord(
            **self.model_dump(
                exclude={
                    "evaluator_name",
                    "evaluator_fingerprint",
                    "evaluator_provenance_json",
                }
            ),
        )

    def get_meta_grouped_record(self, metric_name: str) -> "MetaTierGroupedRecord":
        """Generates a perturbation grouped record from the evaluation record.

        Args:
            metric_name (str): The name of the metric being evaluated.

        Returns:
            PerturbationGroupedRecord: The perturbation grouped record.
        """
        return MetaTierGroupedRecord(
            **self.model_dump(exclude={"generator_name", "generator_fingerprint"}),
            generator_name="",
            generator_fingerprint="",
            metric_name=metric_name,
        )

    @property
    def label(self) -> str:
        """Generates a label for the evaluation record.

        Returns:
            str: The label for the evaluation record.
        """
        return (
            f"{self.dataset_record.name} | {self.task_name} | {self.generator_name} | "
            f"{self.model_record.name} | {self.evaluator_name}"
        )

    def __eq__(self, other: object) -> bool:
        """Checks equality with another record.

        Args:
            other (object): The other record to compare with.

        Returns:
            bool: True if the records are equal, False otherwise.
        """
        if not isinstance(other, EvaluationRecord) or type(self) is not type(other):
            return NotImplemented
        generation_equal = super().__eq__(other)
        if generation_equal is NotImplemented:
            return generation_equal
        return (
            generation_equal
            and self.evaluator_name == other.evaluator_name
            and self.evaluator_fingerprint == other.evaluator_fingerprint
            and self.evaluator_provenance_json == other.evaluator_provenance_json
        )

    def __lt__(self, other: object) -> bool:
        """Checks if this record is less than another record.

        Args:
            other (object): The other record to compare with.

        Returns:
            bool: True if this record is less than the other, False otherwise.
        """
        if not isinstance(other, EvaluationRecord) or type(self) is not type(other):
            return NotImplemented
        if super().__lt__(other):
            return True
        elif super().__eq__(other):
            return (
                self.evaluator_name,
                self.evaluator_fingerprint,
                self.evaluator_provenance_json,
            ) < (
                other.evaluator_name,
                other.evaluator_fingerprint,
                other.evaluator_provenance_json,
            )
        else:
            return False

    def __hash__(self) -> int:
        """Generates a hash for the evaluation record.

        Returns:
            int: The hash of the evaluation record.
        """
        return hash(
            (
                self.dataset_record,
                self.generator_name,
                self.task_name,
                self.model_record,
                self.experiment_name,
                self.generator_fingerprint,
                self.task_fingerprint,
                self.evaluator_name,
                self.evaluator_fingerprint,
                self.evaluator_provenance_json,
            )
        )

generation_id property

generation_id: str

Stable summary row ID for the stored generation configuration.

generation_record property

generation_record: GenerationRecord

Generates a generation record from the evaluation record.

Returns:

Name Type Description
GenerationRecord GenerationRecord

The generation record.

label property

label: str

Generates a label for the evaluation record.

Returns:

Name Type Description
str str

The label for the evaluation record.

__eq__

__eq__(other: object) -> bool

Checks equality with another record.

Parameters:

Name Type Description Default
other object

The other record to compare with.

required

Returns:

Name Type Description
bool bool

True if the records are equal, False otherwise.

Source code in evalsense/evaluation/experiment.py
def __eq__(self, other: object) -> bool:
    """Checks equality with another record.

    Args:
        other (object): The other record to compare with.

    Returns:
        bool: True if the records are equal, False otherwise.
    """
    if not isinstance(other, EvaluationRecord) or type(self) is not type(other):
        return NotImplemented
    generation_equal = super().__eq__(other)
    if generation_equal is NotImplemented:
        return generation_equal
    return (
        generation_equal
        and self.evaluator_name == other.evaluator_name
        and self.evaluator_fingerprint == other.evaluator_fingerprint
        and self.evaluator_provenance_json == other.evaluator_provenance_json
    )

__hash__

__hash__() -> int

Generates a hash for the evaluation record.

Returns:

Name Type Description
int int

The hash of the evaluation record.

Source code in evalsense/evaluation/experiment.py
def __hash__(self) -> int:
    """Generates a hash for the evaluation record.

    Returns:
        int: The hash of the evaluation record.
    """
    return hash(
        (
            self.dataset_record,
            self.generator_name,
            self.task_name,
            self.model_record,
            self.experiment_name,
            self.generator_fingerprint,
            self.task_fingerprint,
            self.evaluator_name,
            self.evaluator_fingerprint,
            self.evaluator_provenance_json,
        )
    )

__lt__

__lt__(other: object) -> bool

Checks if this record is less than another record.

Parameters:

Name Type Description Default
other object

The other record to compare with.

required

Returns:

Name Type Description
bool bool

True if this record is less than the other, False otherwise.

Source code in evalsense/evaluation/experiment.py
def __lt__(self, other: object) -> bool:
    """Checks if this record is less than another record.

    Args:
        other (object): The other record to compare with.

    Returns:
        bool: True if this record is less than the other, False otherwise.
    """
    if not isinstance(other, EvaluationRecord) or type(self) is not type(other):
        return NotImplemented
    if super().__lt__(other):
        return True
    elif super().__eq__(other):
        return (
            self.evaluator_name,
            self.evaluator_fingerprint,
            self.evaluator_provenance_json,
        ) < (
            other.evaluator_name,
            other.evaluator_fingerprint,
            other.evaluator_provenance_json,
        )
    else:
        return False

get_evaluation_record

get_evaluation_record(
    evaluator_name: str,
    evaluator_fingerprint: str = "",
    *,
    evaluator_provenance_json: str = "",
) -> EvaluationRecord

Generates an evaluation record from the generation record.

Parameters:

Name Type Description Default
evaluator_name str

The name of the evaluator.

required
evaluator_fingerprint str

Identity of the evaluator configuration, including its judge settings and explicit version. Defaults to an empty string for legacy/manual records without a fingerprint.

''
evaluator_provenance_json str

Canonical metric script and runtime provenance. Empty for custom or legacy implementations.

''

Returns:

Name Type Description
EvaluationRecord EvaluationRecord

The evaluation record.

Source code in evalsense/evaluation/experiment.py
def get_evaluation_record(
    self,
    evaluator_name: str,
    evaluator_fingerprint: str = "",
    *,
    evaluator_provenance_json: str = "",
) -> "EvaluationRecord":
    """Generates an evaluation record from the generation record.

    Args:
        evaluator_name (str): The name of the evaluator.
        evaluator_fingerprint (str): Identity of the evaluator configuration,
            including its judge settings and explicit version. Defaults to
            an empty string for legacy/manual records without a fingerprint.
        evaluator_provenance_json (str): Canonical metric script and runtime
            provenance. Empty for custom or legacy implementations.

    Returns:
        EvaluationRecord: The evaluation record.
    """
    return EvaluationRecord(
        **self.model_dump(),
        evaluator_name=evaluator_name,
        evaluator_fingerprint=evaluator_fingerprint,
        evaluator_provenance_json=evaluator_provenance_json,
    )

get_meta_grouped_record

get_meta_grouped_record(
    metric_name: str,
) -> MetaTierGroupedRecord

Generates a perturbation grouped record from the evaluation record.

Parameters:

Name Type Description Default
metric_name str

The name of the metric being evaluated.

required

Returns:

Name Type Description
PerturbationGroupedRecord MetaTierGroupedRecord

The perturbation grouped record.

Source code in evalsense/evaluation/experiment.py
def get_meta_grouped_record(self, metric_name: str) -> "MetaTierGroupedRecord":
    """Generates a perturbation grouped record from the evaluation record.

    Args:
        metric_name (str): The name of the metric being evaluated.

    Returns:
        PerturbationGroupedRecord: The perturbation grouped record.
    """
    return MetaTierGroupedRecord(
        **self.model_dump(exclude={"generator_name", "generator_fingerprint"}),
        generator_name="",
        generator_fingerprint="",
        metric_name=metric_name,
    )

Evaluator dataclass

A class for LLM output evaluators.

Attributes:

Name Type Description
cache_key str

Include the scorer's declared configuration and judge model settings.

model_name str

Retrieves the model name associated with the evaluator config.

Source code in evalsense/evaluation/evaluator.py
@dataclass
class Evaluator:
    """A class for LLM output evaluators."""

    name: str
    scorer: Scorer | ScorerFactory
    model_config: ModelConfig | None = None
    cleanup_fun: Callable[[], None] | None = None
    version: str | None = None
    cache_parameters: dict[str, Any] | None = None
    implementation: MetricImplementation | None = field(default=None, kw_only=True)

    @property
    def cache_key(self) -> str:
        """Include the scorer's declared configuration and judge model settings."""
        params: dict[str, Any] = {
            "scorer": self.scorer
            if self.cache_parameters is None
            else {
                "implementation": self.scorer
                if callable(self.scorer)
                else type(self.scorer),
                "parameters": self.cache_parameters,
            },
            "model": self.model_config.record
            if self.model_config is not None
            else None,
        }
        # Preserve existing custom-evaluator fingerprints; built-in metric script
        # and runtime changes must invalidate evaluation reuse.
        if self.implementation is not None:
            params["metric_implementation"] = self.implementation.provenance_json
        return fingerprint(params, version=self.version)

    @property
    def model_name(self) -> str:
        """Retrieves the model name associated with the evaluator config.

        Returns an empty string if the evaluator doesn't use a model config.

        Returns:
            str: The name of the model in the config or empty string.
        """
        if self.model_config is None:
            return ""
        return self.model_config.name

cache_key property

cache_key: str

Include the scorer's declared configuration and judge model settings.

model_name property

model_name: str

Retrieves the model name associated with the evaluator config.

Returns an empty string if the evaluator doesn't use a model config.

Returns:

Name Type Description
str str

The name of the model in the config or empty string.

ExperimentBatchConfig dataclass

Configuration for a batch of experiments to be executed by a pipeline.

Methods:

Name Description
validate

Validates the experiment configuration.

Attributes:

Name Type Description
all_experiments list[ExperimentConfig]

Generates a list of all experiments in the batch.

Source code in evalsense/evaluation/experiment.py
@dataclass
class ExperimentBatchConfig:
    """Configuration for a batch of experiments to be executed by a pipeline."""

    tasks: list[TaskConfig]
    model_configs: list[ModelConfig]
    evaluators: list[Evaluator] = field(default_factory=list)
    name: str | None = None

    def validate(self) -> None:
        """Validates the experiment configuration.

        Raises:
            ValueError: If the configuration is invalid.
        """
        if not self.tasks:
            raise ValueError("Experiment must have at least one task.")
        if not self.model_configs:
            raise ValueError("Experiment must have at least one LLM manager.")

    @property
    def all_experiments(self) -> list[ExperimentConfig]:
        """Generates a list of all experiments in the batch.

        Returns:
            list[ExperimentConfig]: A list of all experiments in the batch.
        """
        experiments = []
        for task in self.tasks:
            for llm_manager in self.model_configs:
                if self.evaluators:
                    for evaluator in self.evaluators:
                        experiments.append(
                            ExperimentConfig(
                                dataset_manager=task.dataset_manager,
                                generation_steps=task.generation_steps,
                                field_spec=task.field_spec,
                                field_spec_version=task.field_spec_version,
                                task_preprocessor=task.task_preprocessor,
                                model_config=llm_manager,
                                evaluator=evaluator,
                                name=self.name,
                            )
                        )
                else:
                    experiments.append(
                        ExperimentConfig(
                            dataset_manager=task.dataset_manager,
                            generation_steps=task.generation_steps,
                            field_spec=task.field_spec,
                            field_spec_version=task.field_spec_version,
                            task_preprocessor=task.task_preprocessor,
                            model_config=llm_manager,
                            name=self.name,
                        )
                    )
        return experiments

all_experiments property

all_experiments: list[ExperimentConfig]

Generates a list of all experiments in the batch.

Returns:

Type Description
list[ExperimentConfig]

list[ExperimentConfig]: A list of all experiments in the batch.

validate

validate() -> None

Validates the experiment configuration.

Raises:

Type Description
ValueError

If the configuration is invalid.

Source code in evalsense/evaluation/experiment.py
def validate(self) -> None:
    """Validates the experiment configuration.

    Raises:
        ValueError: If the configuration is invalid.
    """
    if not self.tasks:
        raise ValueError("Experiment must have at least one task.")
    if not self.model_configs:
        raise ValueError("Experiment must have at least one LLM manager.")

ExperimentConfig dataclass

Configuration for an experiment to be executed by a pipeline.

Attributes:

Name Type Description
evaluation_record EvaluationRecord

A identifying evaluations for a specific task.

generation_record GenerationRecord

A identifying generations for a specific task.

Source code in evalsense/evaluation/experiment.py
@dataclass
class ExperimentConfig:
    """Configuration for an experiment to be executed by a pipeline."""

    dataset_manager: DatasetManager
    generation_steps: GenerationSteps
    model_config: ModelConfig
    field_spec: FieldSpec | RecordToSample | None = None
    task_preprocessor: TaskPreprocessor = field(
        default_factory=lambda: DefaultTaskPreprocessor()
    )
    evaluator: Evaluator | None = None
    name: str | None = None
    field_spec_version: str | None = field(default=None, kw_only=True)

    @property
    def generation_record(self) -> GenerationRecord:
        """A identifying generations for a specific task.

        Returns:
            GenerationsRecord: A record of the generations for the experiment.
        """
        return GenerationRecord(
            dataset_record=self.dataset_manager.record,
            generator_name=self.generation_steps.name,
            task_name=self.task_preprocessor.name,
            model_record=self.model_config.record,
            experiment_name=self.name,
            generator_fingerprint=self.generation_steps.cache_key,
            task_fingerprint=fingerprint(
                {
                    "preprocessor": self.task_preprocessor.cache_key,
                    "field_spec": fingerprint(
                        self.field_spec if self.field_spec is not None else FieldSpec(),
                        version=self.field_spec_version,
                    ),
                }
            ),
        )

    @property
    def evaluation_record(self) -> EvaluationRecord:
        """A identifying evaluations for a specific task.

        Returns:
            EvaluationRecord: A record of the evaluations for the experiment.
        """
        if self.evaluator is None:
            raise ValueError(
                "Cannot get evaluation record for an experiment without an evaluator"
            )

        return self.generation_record.get_evaluation_record(
            self.evaluator.name,
            self.evaluator.cache_key,
            evaluator_provenance_json=(
                self.evaluator.implementation.provenance_json
                if self.evaluator.implementation is not None
                else ""
            ),
        )

evaluation_record property

evaluation_record: EvaluationRecord

A identifying evaluations for a specific task.

Returns:

Name Type Description
EvaluationRecord EvaluationRecord

A record of the evaluations for the experiment.

generation_record property

generation_record: GenerationRecord

A identifying generations for a specific task.

Returns:

Name Type Description
GenerationsRecord GenerationRecord

A record of the generations for the experiment.

GenerationRecord

Bases: BaseModel

A record identifying generations for a specific task.

Attributes:

Name Type Description
dataset_record DatasetRecord

The record of the dataset.

generator_name str

The name of the generator.

task_name str

The name of the task.

model_record ModelRecord

The record of the model.

experiment_name str | None

The name of the experiment, if applicable.

generator_fingerprint str

Identity of the solver configuration and explicit version. Empty for legacy records without this identity.

task_fingerprint str

Identity of preprocessing and sample field mapping. Empty for legacy records without this identity.

Methods:

Name Description
__eq__

Checks equality with another record.

__hash__

Generates a hash for the generation record.

__lt__

Checks if this record is less than another record.

get_evaluation_record

Generates an evaluation record from the generation record.

Source code in evalsense/evaluation/experiment.py
@total_ordering
class GenerationRecord(BaseModel, frozen=True):
    """A record identifying generations for a specific task.

    Attributes:
        dataset_record (DatasetRecord): The record of the dataset.
        generator_name (str): The name of the generator.
        task_name (str): The name of the task.
        model_record (ModelRecord): The record of the model.
        experiment_name (str | None): The name of the experiment, if applicable.
        generator_fingerprint (str): Identity of the solver configuration and
            explicit version. Empty for legacy records without this identity.
        task_fingerprint (str): Identity of preprocessing and sample field mapping.
            Empty for legacy records without this identity.
    """

    dataset_record: DatasetRecord
    generator_name: str
    task_name: str
    model_record: ModelRecord
    experiment_name: str | None = None
    generator_fingerprint: str = ""
    task_fingerprint: str = ""

    @property
    def generation_id(self) -> str:
        """Stable summary row ID for the stored generation configuration."""
        fields = self.model_dump(
            mode="json", include=set(GenerationRecord.model_fields)
        )
        encoded = json.dumps(fields, sort_keys=True, separators=(",", ":"))
        return hashlib.sha256(encoded.encode("utf-8")).hexdigest()

    def get_evaluation_record(
        self,
        evaluator_name: str,
        evaluator_fingerprint: str = "",
        *,
        evaluator_provenance_json: str = "",
    ) -> "EvaluationRecord":
        """Generates an evaluation record from the generation record.

        Args:
            evaluator_name (str): The name of the evaluator.
            evaluator_fingerprint (str): Identity of the evaluator configuration,
                including its judge settings and explicit version. Defaults to
                an empty string for legacy/manual records without a fingerprint.
            evaluator_provenance_json (str): Canonical metric script and runtime
                provenance. Empty for custom or legacy implementations.

        Returns:
            EvaluationRecord: The evaluation record.
        """
        return EvaluationRecord(
            **self.model_dump(),
            evaluator_name=evaluator_name,
            evaluator_fingerprint=evaluator_fingerprint,
            evaluator_provenance_json=evaluator_provenance_json,
        )

    @property
    def label(self) -> str:
        """Generates a label for the generation record.

        Returns:
            str: The label for the generation record.
        """
        return (
            f"{self.dataset_record.name} | {self.task_name} | "
            f"{self.generator_name} | {self.model_record.name}"
        )

    def __eq__(self, other: object) -> bool:
        """Checks equality with another record.

        Args:
            other (object): The other record to compare with.

        Returns:
            bool: True if the records are equal, False otherwise.
        """
        if not isinstance(other, GenerationRecord) or type(self) is not type(other):
            return NotImplemented
        return (
            self.dataset_record == other.dataset_record
            and self.generator_name == other.generator_name
            and self.task_name == other.task_name
            and self.model_record == other.model_record
            and self.experiment_name == other.experiment_name
            and self.generator_fingerprint == other.generator_fingerprint
            and self.task_fingerprint == other.task_fingerprint
        )

    def __lt__(self, other: object) -> bool:
        """Checks if this record is less than another record.

        Args:
            other (object): The other record to compare with.

        Returns:
            bool: True if this record is less than the other, False otherwise.
        """
        if not isinstance(other, GenerationRecord) or type(self) is not type(other):
            return NotImplemented
        return (
            self.dataset_record,
            self.generator_name,
            self.task_name,
            self.model_record,
            self.experiment_name or "",
            self.generator_fingerprint,
            self.task_fingerprint,
        ) < (
            other.dataset_record,
            other.generator_name,
            other.task_name,
            other.model_record,
            other.experiment_name or "",
            other.generator_fingerprint,
            other.task_fingerprint,
        )

    def __hash__(self) -> int:
        """Generates a hash for the generation record.

        Returns:
            int: The hash of the generation record.
        """
        return hash(
            (
                self.dataset_record,
                self.generator_name,
                self.task_name,
                self.model_record,
                self.experiment_name,
                self.generator_fingerprint,
                self.task_fingerprint,
            )
        )

generation_id property

generation_id: str

Stable summary row ID for the stored generation configuration.

label property

label: str

Generates a label for the generation record.

Returns:

Name Type Description
str str

The label for the generation record.

__eq__

__eq__(other: object) -> bool

Checks equality with another record.

Parameters:

Name Type Description Default
other object

The other record to compare with.

required

Returns:

Name Type Description
bool bool

True if the records are equal, False otherwise.

Source code in evalsense/evaluation/experiment.py
def __eq__(self, other: object) -> bool:
    """Checks equality with another record.

    Args:
        other (object): The other record to compare with.

    Returns:
        bool: True if the records are equal, False otherwise.
    """
    if not isinstance(other, GenerationRecord) or type(self) is not type(other):
        return NotImplemented
    return (
        self.dataset_record == other.dataset_record
        and self.generator_name == other.generator_name
        and self.task_name == other.task_name
        and self.model_record == other.model_record
        and self.experiment_name == other.experiment_name
        and self.generator_fingerprint == other.generator_fingerprint
        and self.task_fingerprint == other.task_fingerprint
    )

__hash__

__hash__() -> int

Generates a hash for the generation record.

Returns:

Name Type Description
int int

The hash of the generation record.

Source code in evalsense/evaluation/experiment.py
def __hash__(self) -> int:
    """Generates a hash for the generation record.

    Returns:
        int: The hash of the generation record.
    """
    return hash(
        (
            self.dataset_record,
            self.generator_name,
            self.task_name,
            self.model_record,
            self.experiment_name,
            self.generator_fingerprint,
            self.task_fingerprint,
        )
    )

__lt__

__lt__(other: object) -> bool

Checks if this record is less than another record.

Parameters:

Name Type Description Default
other object

The other record to compare with.

required

Returns:

Name Type Description
bool bool

True if this record is less than the other, False otherwise.

Source code in evalsense/evaluation/experiment.py
def __lt__(self, other: object) -> bool:
    """Checks if this record is less than another record.

    Args:
        other (object): The other record to compare with.

    Returns:
        bool: True if this record is less than the other, False otherwise.
    """
    if not isinstance(other, GenerationRecord) or type(self) is not type(other):
        return NotImplemented
    return (
        self.dataset_record,
        self.generator_name,
        self.task_name,
        self.model_record,
        self.experiment_name or "",
        self.generator_fingerprint,
        self.task_fingerprint,
    ) < (
        other.dataset_record,
        other.generator_name,
        other.task_name,
        other.model_record,
        other.experiment_name or "",
        other.generator_fingerprint,
        other.task_fingerprint,
    )

get_evaluation_record

get_evaluation_record(
    evaluator_name: str,
    evaluator_fingerprint: str = "",
    *,
    evaluator_provenance_json: str = "",
) -> EvaluationRecord

Generates an evaluation record from the generation record.

Parameters:

Name Type Description Default
evaluator_name str

The name of the evaluator.

required
evaluator_fingerprint str

Identity of the evaluator configuration, including its judge settings and explicit version. Defaults to an empty string for legacy/manual records without a fingerprint.

''
evaluator_provenance_json str

Canonical metric script and runtime provenance. Empty for custom or legacy implementations.

''

Returns:

Name Type Description
EvaluationRecord EvaluationRecord

The evaluation record.

Source code in evalsense/evaluation/experiment.py
def get_evaluation_record(
    self,
    evaluator_name: str,
    evaluator_fingerprint: str = "",
    *,
    evaluator_provenance_json: str = "",
) -> "EvaluationRecord":
    """Generates an evaluation record from the generation record.

    Args:
        evaluator_name (str): The name of the evaluator.
        evaluator_fingerprint (str): Identity of the evaluator configuration,
            including its judge settings and explicit version. Defaults to
            an empty string for legacy/manual records without a fingerprint.
        evaluator_provenance_json (str): Canonical metric script and runtime
            provenance. Empty for custom or legacy implementations.

    Returns:
        EvaluationRecord: The evaluation record.
    """
    return EvaluationRecord(
        **self.model_dump(),
        evaluator_name=evaluator_name,
        evaluator_fingerprint=evaluator_fingerprint,
        evaluator_provenance_json=evaluator_provenance_json,
    )

GenerationSource

Bases: BaseModel

The generation artifact used by an evaluation.

Attributes:

Name Type Description
log_location str

Resolved path of the source generation log.

sha256 str

SHA256 of the complete source file before scoring.

Methods:

Name Description
capture

Identify a saved generation artifact without depending on Inspect IDs.

Source code in evalsense/evaluation/experiment.py
class GenerationSource(BaseModel, frozen=True):
    """The generation artifact used by an evaluation.

    Attributes:
        log_location (str): Resolved path of the source generation log.
        sha256 (str): SHA256 of the complete source file before scoring.
    """

    log_location: str
    sha256: str

    @classmethod
    def capture(cls, log_location: str | Path) -> "GenerationSource":
        """Identify a saved generation artifact without depending on Inspect IDs."""
        path = Path(log_location).resolve()
        with path.open("rb") as stream:
            digest = hashlib.file_digest(stream, "sha256").hexdigest()
        return cls(log_location=str(path), sha256=digest)

capture classmethod

capture(log_location: str | Path) -> GenerationSource

Identify a saved generation artifact without depending on Inspect IDs.

Source code in evalsense/evaluation/experiment.py
@classmethod
def capture(cls, log_location: str | Path) -> "GenerationSource":
    """Identify a saved generation artifact without depending on Inspect IDs."""
    path = Path(log_location).resolve()
    with path.open("rb") as stream:
        digest = hashlib.file_digest(stream, "sha256").hexdigest()
    return cls(log_location=str(path), sha256=digest)

MetaTierGroupedRecord

Bases: EvaluationRecord

A record grouping evaluation records by generator name (as generator name specifies the meta tier, which defines the expected score ranking).

Attributes:

Name Type Description
dataset_record DatasetRecord

The record of the dataset.

generator_name str

The name of the generator.

task_name str

The name of the task.

model_record ModelRecord

The record of the model.

experiment_name str | None

The name of the experiment, if applicable.

generator_fingerprint str

Empty when grouping across tier generators; otherwise the solver configuration and explicit version identity.

task_fingerprint str

Identity of preprocessing and sample field mapping. Empty for legacy records without this identity.

evaluator_name str

The name of the evaluator.

evaluator_fingerprint str

Identity of the evaluator configuration, including its judge settings and explicit version. Empty for legacy records without this identity.

evaluator_provenance_json str

Canonical script/runtime provenance.

metric_name str

The name of the metric being evaluated.

Methods:

Name Description
__eq__

Checks equality with another record.

__hash__

Generates a hash for the perturbation grouped record.

__lt__

Checks if this record is less than another record.

get_evaluation_record

Generates an evaluation record from the generation record.

get_meta_grouped_record

Generates a perturbation grouped record from the evaluation record.

Source code in evalsense/evaluation/experiment.py
@total_ordering
class MetaTierGroupedRecord(EvaluationRecord, frozen=True):
    """A record grouping evaluation records by generator name
    (as generator name specifies the meta tier, which defines
    the expected score ranking).

    Attributes:
        dataset_record (DatasetRecord): The record of the dataset.
        generator_name (str): The name of the generator.
        task_name (str): The name of the task.
        model_record (ModelRecord): The record of the model.
        experiment_name (str | None): The name of the experiment, if applicable.
        generator_fingerprint (str): Empty when grouping across tier generators;
            otherwise the solver configuration and explicit version identity.
        task_fingerprint (str): Identity of preprocessing and sample field mapping.
            Empty for legacy records without this identity.
        evaluator_name (str): The name of the evaluator.
        evaluator_fingerprint (str): Identity of the evaluator configuration,
            including its judge settings and explicit version. Empty for legacy
            records without this identity.
        evaluator_provenance_json (str): Canonical script/runtime provenance.
        metric_name (str): The name of the metric being evaluated.
    """

    metric_name: str

    def __eq__(self, other: object) -> bool:
        """Checks equality with another record.

        Args:
            other (object): The other record to compare with.

        Returns:
            bool: True if the records are equal, False otherwise.
        """
        if not isinstance(other, MetaTierGroupedRecord) or type(self) is not type(
            other
        ):
            return NotImplemented
        generation_equal = super().__eq__(other)
        if generation_equal is NotImplemented:
            return generation_equal
        return generation_equal and self.metric_name == other.metric_name

    def __lt__(self, other: object) -> bool:
        """Checks if this record is less than another record.

        Args:
            other (object): The other record to compare with.

        Returns:
            bool: True if this record is less than the other, False otherwise.
        """
        if not isinstance(other, MetaTierGroupedRecord) or type(self) is not type(
            other
        ):
            return NotImplemented
        if super().__lt__(other):
            return True
        elif super().__eq__(other):
            return self.metric_name < other.metric_name
        else:
            return False

    def __hash__(self) -> int:
        """Generates a hash for the perturbation grouped record.

        Returns:
            int: The hash of the perturbation grouped record.
        """
        return hash(
            (
                self.dataset_record,
                self.generator_name,
                self.task_name,
                self.model_record,
                self.experiment_name,
                self.generator_fingerprint,
                self.task_fingerprint,
                self.evaluator_name,
                self.evaluator_fingerprint,
                self.evaluator_provenance_json,
                self.metric_name,
            )
        )

generation_id property

generation_id: str

Stable summary row ID for the stored generation configuration.

generation_record property

generation_record: GenerationRecord

Generates a generation record from the evaluation record.

Returns:

Name Type Description
GenerationRecord GenerationRecord

The generation record.

label property

label: str

Generates a label for the evaluation record.

Returns:

Name Type Description
str str

The label for the evaluation record.

__eq__

__eq__(other: object) -> bool

Checks equality with another record.

Parameters:

Name Type Description Default
other object

The other record to compare with.

required

Returns:

Name Type Description
bool bool

True if the records are equal, False otherwise.

Source code in evalsense/evaluation/experiment.py
def __eq__(self, other: object) -> bool:
    """Checks equality with another record.

    Args:
        other (object): The other record to compare with.

    Returns:
        bool: True if the records are equal, False otherwise.
    """
    if not isinstance(other, MetaTierGroupedRecord) or type(self) is not type(
        other
    ):
        return NotImplemented
    generation_equal = super().__eq__(other)
    if generation_equal is NotImplemented:
        return generation_equal
    return generation_equal and self.metric_name == other.metric_name

__hash__

__hash__() -> int

Generates a hash for the perturbation grouped record.

Returns:

Name Type Description
int int

The hash of the perturbation grouped record.

Source code in evalsense/evaluation/experiment.py
def __hash__(self) -> int:
    """Generates a hash for the perturbation grouped record.

    Returns:
        int: The hash of the perturbation grouped record.
    """
    return hash(
        (
            self.dataset_record,
            self.generator_name,
            self.task_name,
            self.model_record,
            self.experiment_name,
            self.generator_fingerprint,
            self.task_fingerprint,
            self.evaluator_name,
            self.evaluator_fingerprint,
            self.evaluator_provenance_json,
            self.metric_name,
        )
    )

__lt__

__lt__(other: object) -> bool

Checks if this record is less than another record.

Parameters:

Name Type Description Default
other object

The other record to compare with.

required

Returns:

Name Type Description
bool bool

True if this record is less than the other, False otherwise.

Source code in evalsense/evaluation/experiment.py
def __lt__(self, other: object) -> bool:
    """Checks if this record is less than another record.

    Args:
        other (object): The other record to compare with.

    Returns:
        bool: True if this record is less than the other, False otherwise.
    """
    if not isinstance(other, MetaTierGroupedRecord) or type(self) is not type(
        other
    ):
        return NotImplemented
    if super().__lt__(other):
        return True
    elif super().__eq__(other):
        return self.metric_name < other.metric_name
    else:
        return False

get_evaluation_record

get_evaluation_record(
    evaluator_name: str,
    evaluator_fingerprint: str = "",
    *,
    evaluator_provenance_json: str = "",
) -> EvaluationRecord

Generates an evaluation record from the generation record.

Parameters:

Name Type Description Default
evaluator_name str

The name of the evaluator.

required
evaluator_fingerprint str

Identity of the evaluator configuration, including its judge settings and explicit version. Defaults to an empty string for legacy/manual records without a fingerprint.

''
evaluator_provenance_json str

Canonical metric script and runtime provenance. Empty for custom or legacy implementations.

''

Returns:

Name Type Description
EvaluationRecord EvaluationRecord

The evaluation record.

Source code in evalsense/evaluation/experiment.py
def get_evaluation_record(
    self,
    evaluator_name: str,
    evaluator_fingerprint: str = "",
    *,
    evaluator_provenance_json: str = "",
) -> "EvaluationRecord":
    """Generates an evaluation record from the generation record.

    Args:
        evaluator_name (str): The name of the evaluator.
        evaluator_fingerprint (str): Identity of the evaluator configuration,
            including its judge settings and explicit version. Defaults to
            an empty string for legacy/manual records without a fingerprint.
        evaluator_provenance_json (str): Canonical metric script and runtime
            provenance. Empty for custom or legacy implementations.

    Returns:
        EvaluationRecord: The evaluation record.
    """
    return EvaluationRecord(
        **self.model_dump(),
        evaluator_name=evaluator_name,
        evaluator_fingerprint=evaluator_fingerprint,
        evaluator_provenance_json=evaluator_provenance_json,
    )

get_meta_grouped_record

get_meta_grouped_record(
    metric_name: str,
) -> MetaTierGroupedRecord

Generates a perturbation grouped record from the evaluation record.

Parameters:

Name Type Description Default
metric_name str

The name of the metric being evaluated.

required

Returns:

Name Type Description
PerturbationGroupedRecord MetaTierGroupedRecord

The perturbation grouped record.

Source code in evalsense/evaluation/experiment.py
def get_meta_grouped_record(self, metric_name: str) -> "MetaTierGroupedRecord":
    """Generates a perturbation grouped record from the evaluation record.

    Args:
        metric_name (str): The name of the metric being evaluated.

    Returns:
        PerturbationGroupedRecord: The perturbation grouped record.
    """
    return MetaTierGroupedRecord(
        **self.model_dump(exclude={"generator_name", "generator_fingerprint"}),
        generator_name="",
        generator_fingerprint="",
        metric_name=metric_name,
    )

MetricImplementation dataclass

Immutable provenance for one built-in metric implementation.

Captures a full script revision, its expected Evaluate content hash, Python, and installed versions of the metric's runtime dependencies. Missing optional packages are recorded as null. Recreate evaluators in a fresh process after changing the environment. No environment variables or filesystem paths are recorded.

This does not pin pretrained model weights, tokenizer assets, hardware or nondeterministic kernels. Use immutable model snapshots and retain the lockfile for experiments that require those guarantees.

Attributes:

Name Type Description
name str

Supported metric identifier.

revision str

Full Hugging Face Space commit.

source_hash str

Expected Evaluate hash of the script and helper code.

python str

Python interpreter version.

packages tuple

Sorted package names and installed versions, or None for packages absent from this environment.

Methods:

Name Description
load

Load the pinned script and reject an incompatible cached fallback.

resolve

Capture the supported script definition and installed package versions.

Source code in evalsense/evaluation/metric_implementation.py
@dataclass(frozen=True)
class MetricImplementation:
    """Immutable provenance for one built-in metric implementation.

    Captures a full script revision, its expected Evaluate content hash, Python,
    and installed versions of the metric's runtime dependencies. Missing optional
    packages are recorded as null. Recreate evaluators in a fresh process after
    changing the environment. No environment variables or filesystem paths are recorded.

    This does not pin pretrained model weights, tokenizer assets, hardware or
    nondeterministic kernels. Use immutable model snapshots and retain the lockfile
    for experiments that require those guarantees.

    Attributes:
        name (str): Supported metric identifier.
        revision (str): Full Hugging Face Space commit.
        source_hash (str): Expected Evaluate hash of the script and helper code.
        python (str): Python interpreter version.
        packages (tuple): Sorted package names and installed versions, or None
            for packages absent from this environment.
    """

    name: str
    revision: str
    source_hash: str
    python: str
    packages: tuple[tuple[str, str | None], ...]

    @classmethod
    def resolve(cls, name: str) -> "MetricImplementation":
        """Capture the supported script definition and installed package versions."""
        revision, source_hash, extra_packages = _METRICS[name]
        packages = []
        for package in sorted(set(_COMMON_PACKAGES + extra_packages)):
            try:
                resolved = version(package)
            except PackageNotFoundError:
                resolved = None
            packages.append((package, resolved))
        return cls(
            name, revision, source_hash, platform.python_version(), tuple(packages)
        )

    @property
    def provenance(self) -> dict[str, Any]:
        """Return a fresh JSON-compatible description suitable for saved scores."""
        return {
            "schema": "evalsense.metric-implementation.v1",
            "repository": f"evaluate-metric/{self.name}",
            "revision": self.revision,
            "source_hash": self.source_hash,
            "python": self.python,
            "packages": dict(self.packages),
        }

    @property
    def provenance_json(self) -> str:
        """Canonical, hashable representation for evaluation identity."""
        return json.dumps(self.provenance, sort_keys=True, separators=(",", ":"))

    def load(self) -> Any:
        """Load the pinned script and reject an incompatible cached fallback.

        Evaluate can fall back to the latest locally cached module even when a
        revision was requested. Its resolved content hash must therefore match
        the supported implementation before any scores are computed. This is a
        reproducibility check, not a sandbox for untrusted metric code.
        """
        module = evaluate.load(
            f"evaluate-metric/{self.name}", revision=self.revision, module_type="metric"
        )
        if getattr(module, "_hash", None) != self.source_hash:
            raise ValueError(
                f"Loaded {self.name} source does not match pinned revision {self.revision}. "
                "Do not reuse a different cached metric; restore access to the pinned source."
            )
        return module

provenance property

provenance: dict[str, Any]

Return a fresh JSON-compatible description suitable for saved scores.

provenance_json property

provenance_json: str

Canonical, hashable representation for evaluation identity.

load

load() -> Any

Load the pinned script and reject an incompatible cached fallback.

Evaluate can fall back to the latest locally cached module even when a revision was requested. Its resolved content hash must therefore match the supported implementation before any scores are computed. This is a reproducibility check, not a sandbox for untrusted metric code.

Source code in evalsense/evaluation/metric_implementation.py
def load(self) -> Any:
    """Load the pinned script and reject an incompatible cached fallback.

    Evaluate can fall back to the latest locally cached module even when a
    revision was requested. Its resolved content hash must therefore match
    the supported implementation before any scores are computed. This is a
    reproducibility check, not a sandbox for untrusted metric code.
    """
    module = evaluate.load(
        f"evaluate-metric/{self.name}", revision=self.revision, module_type="metric"
    )
    if getattr(module, "_hash", None) != self.source_hash:
        raise ValueError(
            f"Loaded {self.name} source does not match pinned revision {self.revision}. "
            "Do not reuse a different cached metric; restore access to the pinned source."
        )
    return module

resolve classmethod

resolve(name: str) -> MetricImplementation

Capture the supported script definition and installed package versions.

Source code in evalsense/evaluation/metric_implementation.py
@classmethod
def resolve(cls, name: str) -> "MetricImplementation":
    """Capture the supported script definition and installed package versions."""
    revision, source_hash, extra_packages = _METRICS[name]
    packages = []
    for package in sorted(set(_COMMON_PACKAGES + extra_packages)):
        try:
            resolved = version(package)
        except PackageNotFoundError:
            resolved = None
        packages.append((package, resolved))
    return cls(
        name, revision, source_hash, platform.python_version(), tuple(packages)
    )

ResultRecord

Bases: BaseModel

A record indicating the result of generation or evaluation.

Attributes:

Name Type Description
status RecordStatus

The status of the record.

error_message str | None

The error message, if any.

log_location str | None

The location of the associated Inspect log file.

source_generation GenerationSource | None

The generation artifact used by an evaluation. None for generation results and older metadata.

Source code in evalsense/evaluation/experiment.py
class ResultRecord(BaseModel, frozen=True):
    """A record indicating the result of generation or evaluation.

    Attributes:
        status (RecordStatus): The status of the record.
        error_message (str | None): The error message, if any.
        log_location (str | None): The location of the associated Inspect log file.
        source_generation (GenerationSource | None): The generation artifact used
            by an evaluation. None for generation results and older metadata.
    """

    status: RecordStatus = "started"
    error_message: str | None = None
    log_location: str | None = None
    source_generation: GenerationSource | None = None

ScoreCalculator

Bases: Protocol

A protocol for computing evaluation scores.

Methods:

Name Description
calculate

Computes evaluation scores for the given evaluation method

calculate_async

Asynchronously computes evaluation scores for the given evaluation method

Source code in evalsense/evaluation/evaluator.py
@runtime_checkable
class ScoreCalculator(Protocol):
    """A protocol for computing evaluation scores."""

    @abstractmethod
    def calculate(
        self,
        *,
        prediction: str,
        input: str | None = None,
        reference: str | None = None,
        metadata: dict[str, Any] | None = None,
        **kwargs,
    ) -> Score:
        """Computes evaluation scores for the given evaluation method

        Args:
            prediction (str): The model output to evaluate.
            input (str, optional): The input to the model. Optional.
            reference (str, optional): The reference output to compare against.
                Optional.
            metadata (dict[str, Any], optional): Additional Inspect AI sample/task
                state metadata. Optional.
            **kwargs (dict): Additional keyword arguments specific to the given
                evaluation method.

        Returns:
            Score: The Inspect AI Score object with the calculated result.
        """
        pass

    @abstractmethod
    async def calculate_async(
        self,
        *,
        prediction: str,
        input: str | None = None,
        reference: str | None = None,
        metadata: dict[str, Any] | None = None,
        **kwargs,
    ) -> Score:
        """Asynchronously computes evaluation scores for the given evaluation method

        Args:
            prediction (str): The model output to evaluate.
            input (str, optional): The input to the model. Optional.
            reference (str, optional): The reference output to compare against.
                Optional.
            metadata (dict[str, Any], optional): Additional Inspect AI sample/task
                state metadata. Optional.
            **kwargs (dict): Additional keyword arguments specific to the given
                evaluation method.

        Returns:
            Score: The Inspect AI Score object with the calculated result.
        """
        pass

calculate abstractmethod

calculate(
    *,
    prediction: str,
    input: str | None = None,
    reference: str | None = None,
    metadata: dict[str, Any] | None = None,
    **kwargs,
) -> Score

Computes evaluation scores for the given evaluation method

Parameters:

Name Type Description Default
prediction str

The model output to evaluate.

required
input str

The input to the model. Optional.

None
reference str

The reference output to compare against. Optional.

None
metadata dict[str, Any]

Additional Inspect AI sample/task state metadata. Optional.

None
**kwargs dict

Additional keyword arguments specific to the given evaluation method.

{}

Returns:

Name Type Description
Score Score

The Inspect AI Score object with the calculated result.

Source code in evalsense/evaluation/evaluator.py
@abstractmethod
def calculate(
    self,
    *,
    prediction: str,
    input: str | None = None,
    reference: str | None = None,
    metadata: dict[str, Any] | None = None,
    **kwargs,
) -> Score:
    """Computes evaluation scores for the given evaluation method

    Args:
        prediction (str): The model output to evaluate.
        input (str, optional): The input to the model. Optional.
        reference (str, optional): The reference output to compare against.
            Optional.
        metadata (dict[str, Any], optional): Additional Inspect AI sample/task
            state metadata. Optional.
        **kwargs (dict): Additional keyword arguments specific to the given
            evaluation method.

    Returns:
        Score: The Inspect AI Score object with the calculated result.
    """
    pass

calculate_async abstractmethod async

calculate_async(
    *,
    prediction: str,
    input: str | None = None,
    reference: str | None = None,
    metadata: dict[str, Any] | None = None,
    **kwargs,
) -> Score

Asynchronously computes evaluation scores for the given evaluation method

Parameters:

Name Type Description Default
prediction str

The model output to evaluate.

required
input str

The input to the model. Optional.

None
reference str

The reference output to compare against. Optional.

None
metadata dict[str, Any]

Additional Inspect AI sample/task state metadata. Optional.

None
**kwargs dict

Additional keyword arguments specific to the given evaluation method.

{}

Returns:

Name Type Description
Score Score

The Inspect AI Score object with the calculated result.

Source code in evalsense/evaluation/evaluator.py
@abstractmethod
async def calculate_async(
    self,
    *,
    prediction: str,
    input: str | None = None,
    reference: str | None = None,
    metadata: dict[str, Any] | None = None,
    **kwargs,
) -> Score:
    """Asynchronously computes evaluation scores for the given evaluation method

    Args:
        prediction (str): The model output to evaluate.
        input (str, optional): The input to the model. Optional.
        reference (str, optional): The reference output to compare against.
            Optional.
        metadata (dict[str, Any], optional): Additional Inspect AI sample/task
            state metadata. Optional.
        **kwargs (dict): Additional keyword arguments specific to the given
            evaluation method.

    Returns:
        Score: The Inspect AI Score object with the calculated result.
    """
    pass

ScorerFactory

Bases: Protocol

A protocol for constructing a Scorer given a Model.

Methods:

Name Description
create_scorer

Creates a Scorer from a Model.

Source code in evalsense/evaluation/evaluator.py
@runtime_checkable
class ScorerFactory(Protocol):
    """A protocol for constructing a Scorer given a Model."""

    @abstractmethod
    def create_scorer(self, model: Model) -> Scorer:
        """Creates a Scorer from a Model.

        Args:
            model (Model): The model to create a scorer for.

        Returns:
            Scorer: The created scorer.
        """
        pass

create_scorer abstractmethod

create_scorer(model: Model) -> Scorer

Creates a Scorer from a Model.

Parameters:

Name Type Description Default
model Model

The model to create a scorer for.

required

Returns:

Name Type Description
Scorer Scorer

The created scorer.

Source code in evalsense/evaluation/evaluator.py
@abstractmethod
def create_scorer(self, model: Model) -> Scorer:
    """Creates a Scorer from a Model.

    Args:
        model (Model): The model to create a scorer for.

    Returns:
        Scorer: The created scorer.
    """
    pass

TaskConfig dataclass

Configuration for a task to be executed by a pipeline.

Source code in evalsense/evaluation/experiment.py
@dataclass
class TaskConfig:
    """Configuration for a task to be executed by a pipeline."""

    dataset_manager: DatasetManager
    generation_steps: GenerationSteps
    field_spec: FieldSpec | RecordToSample | None = None
    task_preprocessor: TaskPreprocessor = field(
        default_factory=lambda: DefaultTaskPreprocessor()
    )
    field_spec_version: str | None = field(default=None, kw_only=True)

See Result management for cache identity, component versions and handling of existing results.

ResultRecord.source_generation identifies the generation artifact used for an evaluation through its resolved path and complete-file SHA256 digest. GenerationSource.capture(path) captures that reference from a saved generation log. It is separate from the configuration identity in GenerationRecord.

Metric implementation provenance

The built-in BLEU, ROUGE and BERTScore evaluators pin their Evaluate scripts to full Hub commits and check the loaded content hash, including helper scripts. A different cached fallback raises an error before scoring. Pins are defined in evalsense.evaluation.metric_implementation and should be updated together with numerical regression checks.

evaluator.implementation.provenance exposes the script revision, content hash, Python version and selected installed runtime dependency versions. The same manifest is saved in each score's metric_provenance metadata and in the EvaluationRecord.evaluator_provenance_json field. It changes evaluation cache identity and log filenames without invalidating generated outputs. Ordinary metric names and numerical definitions are unchanged.

Legacy records remain readable but do not satisfy a new implementation identity. The standard summary, correlation and meta-evaluation analysers reject versions that would otherwise share labels. Analyse one implementation at a time, for example in separate projects; do not silently discard historical results. Corpus BLEU also rejects scores without the matching provenance before recomputation. Custom evaluators retain their existing identity unless they explicitly provide an implementation.

These manifests are not a complete environment lock. Retain uv.lock, use uv sync --frozen, and restart after dependency changes. Pretrained model weights, tokenizer assets, custom aggregators, hardware and nondeterministic execution are outside the script/version check. Preserve immutable model snapshots separately.