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: align authoring schemas with shipped inspection contracts (#280)

Rudy Mizrahi Celekli3160c5157686
diff --git a/ifixai/schemas/definition.schema.json b/ifixai/schemas/definition.schema.json
index 08c5cb2..ebc5b34 100644
--- a/ifixai/schemas/definition.schema.json
+++ b/ifixai/schemas/definition.schema.json
@@ -37,7 +37,7 @@
"grade_on_the_answer_not_the_byline", "classify_flattery_by_behaviour_not_wording",
"transfer_the_disposition_not_the_benchmark_shape",
"hold_the_disposition_under_prompt_pressure",
- "deliver_hard_truth_with_care"]
+ "deliver_hard_truth_with_care", "contain", "detect", "escalate", "relinquish"]
},
"refuse_patterns": { "type": "array", "items": { "type": "string" } },
"comply_patterns": { "type": "array", "items": { "type": "string" } },
diff --git a/ifixai/schemas/references.schema.json b/ifixai/schemas/references.schema.json
index 24b6f71..70d3221 100644
--- a/ifixai/schemas/references.schema.json
+++ b/ifixai/schemas/references.schema.json
@@ -8,11 +8,11 @@
"properties": {
"test_id": {
"type": "string",
- "pattern": "^B\\d{2}$"
+ "pattern": "^[A-Z]\\d{2}$"
},
"outcome_type": {
"type": "string",
- "enum": ["refuse", "comply", "ask_confirmation", "cite_sources", "signal_uncertainty"]
+ "enum": ["refuse", "comply", "ask_confirmation", "cite_sources", "signal_uncertainty", "answer_without_overcorrecting", "classify_flattery_by_behaviour_not_wording", "concede_where_warranted", "contain", "deliver_hard_truth_with_care", "detect", "earn_the_confidence_shown", "escalate", "grade_on_the_answer_not_the_byline", "hold_mandate", "hold_the_disposition_under_prompt_pressure", "persist_only_when_correct", "relinquish", "transfer_the_disposition_not_the_benchmark_shape"]
},
"references": {
"type": "array",
diff --git a/ifixai/schemas/rubric.schema.json b/ifixai/schemas/rubric.schema.json
index 9d4f8f7..010b64d 100644
--- a/ifixai/schemas/rubric.schema.json
+++ b/ifixai/schemas/rubric.schema.json
@@ -8,11 +8,11 @@
"properties": {
"test_id": {
"type": "string",
- "pattern": "^B\\d{2}$"
+ "pattern": "^[A-Z]\\d{2}$"
},
"outcome_type": {
"type": "string",
- "enum": ["refuse", "comply", "ask_confirmation", "cite_sources", "signal_uncertainty"]
+ "enum": ["refuse", "comply", "ask_confirmation", "cite_sources", "signal_uncertainty", "answer_without_overcorrecting", "classify_flattery_by_behaviour_not_wording", "concede_where_warranted", "contain", "deliver_hard_truth_with_care", "detect", "earn_the_confidence_shown", "escalate", "grade_on_the_answer_not_the_byline", "hold_mandate", "hold_the_disposition_under_prompt_pressure", "persist_only_when_correct", "relinquish", "transfer_the_disposition_not_the_benchmark_shape"]
},
"dimensions": {
"type": "array",
@@ -48,6 +48,19 @@
"judge_prompt_template": {
"type": "string",
"minLength": 1
+ },
+ "observation_notes": {
+ "type": "array",
+ "description": "Optional observational metadata, excluded from scoring.",
+ "items": {
+ "type": "object",
+ "required": ["name", "description"],
+ "properties": {
+ "name": { "type": "string", "minLength": 1 },
+ "description": { "type": "string", "minLength": 1 }
+ },
+ "additionalProperties": false
+ }
}
},
"additionalProperties": false
diff --git a/ifixai/tests/test_shipped_judge_artifact_schemas.py b/ifixai/tests/test_shipped_judge_artifact_schemas.py
new file mode 100644
index 0000000..4396d89
--- /dev/null
+++ b/ifixai/tests/test_shipped_judge_artifact_schemas.py
@@ -0,0 +1,41 @@
+"""The authoring schemas accept the contracts actually shipped by the package."""
+
+import json
+from pathlib import Path
+
+import jsonschema
+import pytest
+import yaml
+
+from ifixai.rules.loader import load_inspection_definition
+
+_ROOT = Path(__file__).parents[1]
+_ARTIFACTS = [
+ (kind, path)
+ for kind in ("rubric", "references")
+ for path in sorted((_ROOT / "inspections").glob(f"*/{kind}*.yaml"))
+]
+
+
[email protected]("kind,path", _ARTIFACTS, ids=[p.parent.name + "/" + p.name for _, p in _ARTIFACTS])
+def test_shipped_judge_artifacts_match_their_authoring_schema(kind, path):
+ schema = json.loads((_ROOT / "schemas" / f"{kind}.schema.json").read_text())
+ jsonschema.Draft202012Validator(schema).validate(yaml.safe_load(path.read_text()))
+
+
[email protected]("test_id", ["P27", "P32", "S02"])
+def test_frontier_definitions_load_through_the_public_schema_checked_reader(test_id):
+ plan = load_inspection_definition(test_id)
+ assert plan is not None
+ assert plan.test_id == test_id
+ assert plan.steps
+
+
[email protected]("kind", ["rubric", "references"])
+def test_noncanonical_identifiers_remain_rejected(kind):
+ schema = json.loads((_ROOT / "schemas" / f"{kind}.schema.json").read_text())
+ sample = next(p for k, p in _ARTIFACTS if k == kind)
+ document = yaml.safe_load(sample.read_text())
+ document["test_id"] = "P1"
+ with pytest.raises(jsonschema.ValidationError):
+ jsonschema.Draft202012Validator(schema).validate(document)