diff --git a/src/openultrasast/mapping/fact_authority.py b/src/openultrasast/mapping/fact_authority.py index 9528a00..8d7c48a 100644 --- a/src/openultrasast/mapping/fact_authority.py +++ b/src/openultrasast/mapping/fact_authority.py @@ -323,9 +323,7 @@ def _validate_disclosure(content: bytes) -> None: "conflicts": tuple(conflicts), "resolved": True, } - expected = canonical.canonical_record_bytes( - canonical_value, known_schema_versions=(AUTHORITY_CONFLICT_DISCLOSURE_SCHEMA,) - ) + expected = canonical.canonical_record_bytes(canonical_value, known_schema_versions=(AUTHORITY_CONFLICT_DISCLOSURE_SCHEMA,)) if content != expected: raise EntryFactAuthorityError("authority conflict disclosure bytes are not canonical") diff --git a/src/openultrasast/semantic/obligations/core_contract.py b/src/openultrasast/semantic/obligations/core_contract.py index be389b7..da7ec0c 100644 --- a/src/openultrasast/semantic/obligations/core_contract.py +++ b/src/openultrasast/semantic/obligations/core_contract.py @@ -48,9 +48,7 @@ def _build_contract() -> family.FamilyContract: (semantics.RelationStatus.INCOMPLETE, semantics.RelationStatus.UNRESOLVED), ), ), - residual_questions=( - family.ResidualQuestion("is_path_authorized", required, ("unguarded", "discharged", "indeterminate")), - ), + residual_questions=(family.ResidualQuestion("is_path_authorized", required, ("unguarded", "discharged", "indeterminate")),), indeterminate_reasons=("missing_constraint_relation", "ambiguous_constraint_relation"), ) diff --git a/tests/test_prover_scenarios.py b/tests/test_prover_scenarios.py index 6c24953..cf0fe35 100644 --- a/tests/test_prover_scenarios.py +++ b/tests/test_prover_scenarios.py @@ -150,16 +150,18 @@ def _function(name: str, calls: tuple[str, ...] = ()) -> FunctionIR: start_line=1, end_line=9, binds=(), - calls=tuple( - CallSite(call_name, 3 + offset, (), (), (), False, offset) - for offset, call_name in enumerate(calls) - ), + calls=tuple(CallSite(call_name, 3 + offset, (), (), (), False, offset) for offset, call_name in enumerate(calls)), ) def _operation() -> Operation: return Operation( - "src/C.java", 8, "handle", "protected_read", "f:op", "book", + "src/C.java", + 8, + "handle", + "protected_read", + "f:op", + "book", ("path_guard",), ) @@ -169,8 +171,15 @@ def _witness( authority: AuthorityRef | None = None, ) -> Discharge: return Discharge( - "src/C.java", 3, "handle", "path_guard", "f:guard", "call", - "statement", resource=resource, authority=authority, + "src/C.java", + 3, + "handle", + "path_guard", + "f:guard", + "call", + "statement", + resource=resource, + authority=authority, ) @@ -270,10 +279,7 @@ def test_ambiguous_receiver_stays_a_candidate_set() -> None: target = resolve_call(call, module="src/A.java", index=index) assert not target.completeness.is_complete assert len(target.targets) == 2 - assert any( - reason.endswith("receiver_type_unknown") - for reason in target.completeness.reasons - ) + assert any(reason.endswith("receiver_type_unknown") for reason in target.completeness.reasons) def test_recursion_resolves_completely() -> None: @@ -299,12 +305,8 @@ def test_budget_cutoff_records_its_reason() -> None: from openultrasast.semantic.obligations.resolution import SymbolId index = SymbolIndex.build((("src/M.java", MUTUAL_JAVA, "java"),)) - functions = { - "src/M.java": (_function("a", ("b",)), _function("b", ("a",))) - } - callee = SymbolId( - module="src/M.java", enclosing_type="C", name="b", signature=None - ) + functions = {"src/M.java": (_function("a", ("b",)), _function("b", ("a",)))} + callee = SymbolId(module="src/M.java", enclosing_type="C", name="b", signature=None) summaries = monotone_summaries( functions, index, @@ -312,7 +314,4 @@ def test_budget_cutoff_records_its_reason() -> None: budget=ExplorationBudget(depth=1), ) by_name = {summary.symbol.name: summary for summary in summaries} - assert any( - reason.endswith("depth_cutoff") - for reason in by_name["a"].completeness.reasons - ) + assert any(reason.endswith("depth_cutoff") for reason in by_name["a"].completeness.reasons) diff --git a/tests/test_registration_sites.py b/tests/test_registration_sites.py index 8c2590a..431e5f6 100644 --- a/tests/test_registration_sites.py +++ b/tests/test_registration_sites.py @@ -95,9 +95,7 @@ def test_multiple_entries_are_deterministic() -> None: first = strategy.recognize(_target(), JAVA_EXACT) second = strategy.recognize(_target(), JAVA_EXACT) assert first == second - assert [entry.function_name for entry in first] == sorted( - entry.function_name or "" for entry in first - ) + assert [entry.function_name for entry in first] == sorted(entry.function_name or "" for entry in first) def test_registry_dispatch_stamps_strategy_provenance() -> None: