77
88from ix .assurance import AssuranceProfileRegistry , assess_ix
99from ix .cli import main
10- from ix .cognition import cognition_obligation_ids , require_cognition_obligation
10+ from ix .cognition import (
11+ cognition_obligation_ids ,
12+ get_cognition_obligation ,
13+ require_cognition_obligation ,
14+ )
1115from ix .parser import parse_ix
1216
1317
@@ -34,15 +38,22 @@ def build_cognition_contract(
3438 ]
3539
3640 for obligation_id in selected_obligations :
37- definition = require_cognition_obligation (obligation_id )
38- falsification_condition = overrides .get (
39- obligation_id ,
40- definition .falsification_conditions [0 ],
41+ definition = get_cognition_obligation (obligation_id )
42+ evidence_artifact = (
43+ definition .evidence_artifacts [0 ]
44+ if definition is not None
45+ else f"{ obligation_id } _record"
4146 )
47+ default_falsification = (
48+ definition .falsification_conditions [0 ]
49+ if definition is not None
50+ else f"{ obligation_id } _missing"
51+ )
52+ falsification_condition = overrides .get (obligation_id , default_falsification )
4253 lines .extend (
4354 [
4455 f" obligation { obligation_id } {{" ,
45- f" evidence_required { definition . evidence_artifacts [ 0 ] } " ,
56+ f" evidence_required { evidence_artifact } " ,
4657 f" falsify_if { falsification_condition } " ,
4758 " }" ,
4859 "" ,
@@ -89,7 +100,10 @@ def test_cognition_profile_requires_non_empty_program(self):
89100 self .assertNotIn ("program.no_executable_path" , check_ids )
90101
91102 def test_cognition_profile_requires_attempt_contract_not_loose_statements (self ):
92- report = assess_ix (parse_ix ('trace "static contract marker"' ), profile = "cognitionkernel-wave6" )
103+ report = assess_ix (
104+ parse_ix ('trace "static contract marker"' ),
105+ profile = "cognitionkernel-wave6" ,
106+ )
93107 check_ids = {check .check_id for check in report .checks }
94108
95109 self .assertEqual (report .status , "fail" )
0 commit comments