From 418af1da9788224b358b47156a981885f762a8d5 Mon Sep 17 00:00:00 2001 From: Brad Edwards Date: Thu, 30 Jul 2026 19:44:06 +0200 Subject: [PATCH] fix: resolve SonarCloud quality gate findings --- .../python/packages/raes_backend_protocols/manifest.py | 1 - .../python/packages/raes_contracts/contracts/bundle.py | 2 +- .../tests/test_asr_535_participant_flow_assurance.py | 9 ++++++--- .../test_issue_811_participant_bisimulation_design.py | 9 ++++++--- .../python/tests/test_sem_218_realization_designation.py | 3 ++- 5 files changed, 15 insertions(+), 9 deletions(-) diff --git a/implementations/python/packages/raes_backend_protocols/manifest.py b/implementations/python/packages/raes_backend_protocols/manifest.py index 96606521c..552a8064c 100644 --- a/implementations/python/packages/raes_backend_protocols/manifest.py +++ b/implementations/python/packages/raes_backend_protocols/manifest.py @@ -72,7 +72,6 @@ def _evaluator_capability_payload(manifest: BackendManifest) -> dict[str, Any] | def backend_manifest_v2_model(manifest: BackendManifest) -> BackendManifestV2Model: """Render a backend manifest as the authoritative v2 contract model.""" - return BackendManifestV2Model( identity=ApparatusIdentityModel( name=manifest.identity.name, diff --git a/implementations/python/packages/raes_contracts/contracts/bundle.py b/implementations/python/packages/raes_contracts/contracts/bundle.py index 24d871178..d00cffa6e 100644 --- a/implementations/python/packages/raes_contracts/contracts/bundle.py +++ b/implementations/python/packages/raes_contracts/contracts/bundle.py @@ -258,7 +258,7 @@ def _raw_schema_bundle() -> dict[str, dict[str, Any]]: @cache -def _schema_bundle_template() -> dict[str, dict[str, Any]]: +def _schema_bundle_template() -> dict[str, dict[str, Any]]: # NOSONAR """Build the immutable-in-practice template used by :func:`schema_bundle`.""" bundle = _raw_schema_bundle() diff --git a/implementations/python/tests/test_asr_535_participant_flow_assurance.py b/implementations/python/tests/test_asr_535_participant_flow_assurance.py index 4c6830b8b..a218f8999 100644 --- a/implementations/python/tests/test_asr_535_participant_flow_assurance.py +++ b/implementations/python/tests/test_asr_535_participant_flow_assurance.py @@ -178,10 +178,13 @@ def test_policy_cases_bind_exact_coordinates_rather_than_prose_in_a_case_name() assert binding.claim.evidence_scope == "finite" assert binding.claim.assurance_status == "tested" assert binding.claim.observation_projection_revision == "rev1" - assert binding.policy_revision and binding.decision_cut_ref - assert binding.assumptions.order_model and binding.assumptions.scheduler_class + assert binding.policy_revision + assert binding.decision_cut_ref + assert binding.assumptions.order_model + assert binding.assumptions.scheduler_class assert binding.assumptions.probability.startswith("outside scope") - assert case.finite_scope and case.probe_set_digest + assert case.finite_scope + assert case.probe_set_digest assert any("noninterference" in claim for claim in case.explicit_non_claims) diff --git a/implementations/python/tests/test_issue_811_participant_bisimulation_design.py b/implementations/python/tests/test_issue_811_participant_bisimulation_design.py index 244527897..f94747654 100644 --- a/implementations/python/tests/test_issue_811_participant_bisimulation_design.py +++ b/implementations/python/tests/test_issue_811_participant_bisimulation_design.py @@ -113,8 +113,10 @@ def test_selected_profile_is_closed_independently_derived_and_divergence_preserv assert left["transition_source"] != right["transition_source"] assert left["independent_construction"] is True assert right["independent_construction"] is True - assert left["state_coordinates"] and right["state_coordinates"] - assert left["initial_state"] and right["initial_state"] + assert left["state_coordinates"] + assert right["state_coordinates"] + assert left["initial_state"] + assert right["initial_state"] mapping = profile["state_runtime_mapping"] assert mapping["claim_axis"] == "runtime-realization" @@ -213,7 +215,8 @@ def test_governance_program_is_requirement_backed_acyclic_and_reproduction_gated assert set(issues) == REQUIRED_CHILDREN issue_numbers: set[int] = set() for key, entry in issues.items(): - assert isinstance(entry["issue_number"], int) and entry["issue_number"] > 0, key + assert isinstance(entry["issue_number"], int), key + assert entry["issue_number"] > 0, key assert entry["issue_number"] not in issue_numbers issue_numbers.add(entry["issue_number"]) assert entry["milestone"] == MILESTONE diff --git a/implementations/python/tests/test_sem_218_realization_designation.py b/implementations/python/tests/test_sem_218_realization_designation.py index 4e9bd4233..2e2c88cda 100644 --- a/implementations/python/tests/test_sem_218_realization_designation.py +++ b/implementations/python/tests/test_sem_218_realization_designation.py @@ -228,7 +228,8 @@ def test_rfc6901_scope_resolution_preserves_escaped_key_identity(): "/nodes/slash~1key/os", ) - assert found and value == "linux" + assert found + assert value == "linux" assert not resolve_json_pointer_surface( {"nodes": {"slash/key": {"os": "linux"}}}, "/nodes/slash/key/os",