Skip to content

Independent Auditing of AI Agents. Run by human or the agent itself, to answer the most crucial question in the AI Agent Economy. Is the agent doing what is supposed to do? With iFixAi you can have this answer in less than 120 seconds.

fix(manifest): canonicalize numeric temperatures before hashing (#323)

Alicia63b6e2505c4e
diff --git a/ifixai/evaluation/manifest.py b/ifixai/evaluation/manifest.py
index 81fa88a..828803f 100644
--- a/ifixai/evaluation/manifest.py
+++ b/ifixai/evaluation/manifest.py
@@ -207,7 +207,9 @@ def build_manifest(
"mode": mode.value,
"model_under_test": model_under_test.model_dump(),
"judge_models": [j.model_dump() for j in judge_models],
- "judge_temperature": judge_temperature,
+ # Match RunManifest's float coercion before hashing, so integer inputs
+ # keep the same identity after validation and JSON round-tripping.
+ "judge_temperature": float(judge_temperature),
"judge_identity": judge_identity.model_dump() if judge_identity else None,
"normalizer_version": normalizer_version,
"test_versions": test_versions,
@@ -226,9 +228,9 @@ def build_manifest(
"b14_seed_pinned": b14_seed_pinned,
"b28_seed_pinned": b28_seed_pinned,
"b30_seed_pinned": b30_seed_pinned,
- "sut_temperature": sut_temperature,
+ "sut_temperature": float(sut_temperature),
"sut_seed": sut_seed,
- "effective_sut_temperature": effective_sut_temperature,
+ "effective_sut_temperature": float(effective_sut_temperature),
"effective_sut_seed": effective_sut_seed,
"seed_supported_by_provider": seed_supported_by_provider,
"holdout_seed": holdout_seed,
diff --git a/ifixai/tests/test_manifest_temperature_canonicalization.py b/ifixai/tests/test_manifest_temperature_canonicalization.py
new file mode 100644
index 0000000..d27bddb
--- /dev/null
+++ b/ifixai/tests/test_manifest_temperature_canonicalization.py
@@ -0,0 +1,68 @@
+"""Manifest identities use the same temperature representation as their models."""
+
+import pytest
+
+from ifixai.core.types import RunMode
+from ifixai.evaluation.manifest import (
+ build_manifest,
+ load_manifest,
+ verify_run_id,
+ write_manifest,
+)
+from ifixai.evaluation.types import ModelDescriptor
+
+TEMPERATURE_FIELDS = (
+ "judge_temperature",
+ "sut_temperature",
+ "effective_sut_temperature",
+)
+
+
+def manifest(**changes):
+ return build_manifest(
+ mode=RunMode.STANDARD,
+ model_under_test=ModelDescriptor(provider="mock", model_id="mock", version="1"),
+ judge_models=[],
+ normalizer_version="1",
+ test_versions={},
+ rubric_hashes={},
+ fixture_digest="a" * 64,
+ run_nonce="0123456789abcdef",
+ timestamp="2026-10-15T00:00:00Z",
+ **changes,
+ )
+
+
[email protected]("field", TEMPERATURE_FIELDS)
[email protected]("value", [0, 1, 2])
+def test_integer_temperature_verifies_and_matches_float_after_roundtrip(tmp_path, field, value):
+ integer = manifest(**{field: value})
+ floating = manifest(**{field: float(value)})
+
+ assert type(getattr(integer, field)) is float
+ assert verify_run_id(integer)
+ assert integer.run_id == floating.run_id
+ assert verify_run_id(floating)
+
+ path = write_manifest(integer, tmp_path)
+ loaded = load_manifest(path)
+ assert loaded.run_id == integer.run_id
+ assert verify_run_id(loaded)
+
+
[email protected]("field", TEMPERATURE_FIELDS)
+def test_fractional_temperature_still_verifies(field):
+ assert verify_run_id(manifest(**{field: 0.5}))
+
+
[email protected]("field", TEMPERATURE_FIELDS)
+def test_actual_temperature_change_still_changes_identity_and_rejects_tampering(field):
+ original = manifest(**{field: 0.0})
+ changed = manifest(**{field: 1.0})
+ assert original.run_id != changed.run_id
+ assert not verify_run_id(original.model_copy(update={field: 1.0}))
+
+
+def test_existing_float_manifest_identity_is_unchanged():
+ # Frozen from the original schema-v4 builder with all default temperatures.
+ assert manifest().run_id == "3df8142e12aac9d7"