NEXORA / tests /test_failures.py
devildasdf's picture
Release validated NEXORA research prototype, tiny weights and evidence
12496fc verified
Raw History Blame Contribute Delete
850 Bytes
import json
import pytest
from nexora.failures import FailureStore
def test_failure_admission_requires_evidence(tmp_path):
s = FailureStore(tmp_path)
with pytest.raises(PermissionError):
s.capture("code", "Incorrect output", "local test")
rid = s.capture("code", "Incorrect output", "original synthetic test", consent=True)
with pytest.raises(ValueError):
s.advance(rid, "candidate", "skip validation", training_approved=True)
for stage in ["classified", "reproduced", "minimized", "test_added"]:
s.advance(rid, stage, "Independent test record")
with pytest.raises(PermissionError):
s.advance(rid, "candidate", "Test evidence")
s.advance(rid, "candidate", "Provenance reviewed", training_approved=True)
assert json.loads((tmp_path / (rid + ".json")).read_text())["training_approved"]