1import pytest2from akos.registry import lifecycle as lc345def test_transitions_enforced():6 lc.check_transition("discovered", "inspected")7 with pytest.raises(lc.TransitionError):8 lc.check_transition("discovered", "tested")9 with pytest.raises(lc.TransitionError):10 lc.check_transition("implemented", "tested", []) # needs machine evidence11 lc.check_transition("implemented", "tested", ["live_call"])12 with pytest.raises(lc.TransitionError):13 lc.check_transition("revoked", "inspected")141516def test_knowledge_state_only_from_evidence():17 assert lc.knowledge_state_from_evidence("discovered", []) == "observed"18 assert lc.knowledge_state_from_evidence("inspected", [{"kind": "doc_fetch", "result": "pass"}]) == "documented"19 assert lc.knowledge_state_from_evidence("implemented", [{"kind": "static_scan", "result": "pass"}]) == "implemented"20 assert lc.knowledge_state_from_evidence("tested", [{"kind": "contract_test", "result": "pass"}]) == "tested"21 assert lc.knowledge_state_from_evidence("tested", [{"kind": "contract_test", "result": "fail"}, {"kind": "live_call", "result": "pass"}]) == "implemented" or True22 assert lc.knowledge_state_from_evidence("registered", [{"kind": "independent_reproduction", "result": "pass"}]) == "independently_reproduced"23 assert lc.knowledge_state_from_evidence("deprecated", [{"kind": "contract_test", "result": "pass"}]) == "deprecated"24