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: preserve schema v2 manifest hash fields (#243)

Rudy Mizrahi Celeklief1943d0af58
diff --git a/ifixai/evaluation/manifest.py b/ifixai/evaluation/manifest.py
index 0cb7be4..e95251d 100644
--- a/ifixai/evaluation/manifest.py
+++ b/ifixai/evaluation/manifest.py
@@ -281,8 +281,10 @@ def verify_run_id(manifest: RunManifest) -> bool:
exclude: set[str] = set(_RUN_ID_EXCLUDE_FIELDS)
if manifest.schema_version < 4:
exclude.add("sut_context_digest")
- if manifest.schema_version < 3:
+ if manifest.schema_version < 2:
exclude.update(_LEGACY_V1_EXTRA_EXCLUDE)
+ elif manifest.schema_version < 3:
+ exclude.update({"b29_seed", "b32_seed", "b29_seed_pinned", "b32_seed_pinned"})
payload = manifest.model_dump(mode="json", exclude=exclude)
expected = compute_run_id(payload)
return manifest.run_id == expected
diff --git a/ifixai/tests/test_manifest_v2_verification.py b/ifixai/tests/test_manifest_v2_verification.py
new file mode 100644
index 0000000..7c7151c
--- /dev/null
+++ b/ifixai/tests/test_manifest_v2_verification.py
@@ -0,0 +1,36 @@
+from ifixai.core.types import RunMode
+from ifixai.evaluation.manifest import RunManifest, compute_run_id, verify_run_id
+from ifixai.evaluation.types import ModelDescriptor
+
+
+def test_schema_v2_verifies_its_original_fields():
+ manifest = RunManifest(
+ run_id="",
+ timestamp="now",
+ schema_version=2,
+ run_nonce="a" * 16,
+ mode=RunMode.STANDARD,
+ model_under_test=ModelDescriptor(
+ provider="mock", model_id="model", version="1"
+ ),
+ normalizer_version="1",
+ test_versions={},
+ fixture_digest="a" * 64,
+ holdout_seed=42,
+ holdout_ids={"actor": "held-out"},
+ )
+ fields = manifest.model_dump(
+ mode="json",
+ exclude={
+ "run_id",
+ "timestamp",
+ "sut_context_digest",
+ "b29_seed",
+ "b32_seed",
+ "b29_seed_pinned",
+ "b32_seed_pinned",
+ },
+ )
+ manifest.run_id = compute_run_id(fields)
+ assert verify_run_id(manifest)
+ assert not verify_run_id(manifest.model_copy(update={"holdout_seed": 43}))