diff --git a/.bazelrc b/.bazelrc index b8c89491d..2207f35de 100644 --- a/.bazelrc +++ b/.bazelrc @@ -82,3 +82,10 @@ import %workspace%/quality/static_analysis/static_analysis.bazelrc # Use native sphinx_build_binary instead of the wrapper build --//docs/sphinx/utils:use_native_sphinx_build + +# Configure system JDK for plantuml +build --java_language_version=21 +build --tool_java_language_version=21 +build --java_runtime_version=remotejdk_21 +build --tool_java_runtime_version=remotejdk_21 + diff --git a/.gitignore b/.gitignore index eb1e3d714..018bc457f 100644 --- a/.gitignore +++ b/.gitignore @@ -2,11 +2,14 @@ bazel-* examples/bazel-* MODULE.bazel.lock user.bazelrc -.clwb_aspects -.clwb +_build + # ignore folders created by IDEs .vscode .idea +.clwb_aspects +.clwb + # Ignore clangd's config .clangd @@ -14,3 +17,6 @@ user.bazelrc .cache/* compile_commands.json rust-project.json + +# docs-as-code +docs/ubproject.toml diff --git a/MODULE.bazel b/MODULE.bazel index cb39659ca..b713b0d76 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -40,7 +40,7 @@ download_archive( bazel_dep(name = "score_tooling") git_override( module_name = "score_tooling", - commit = "0160d13fff81ee20643769339036505b853e2bb0", + commit = "bc5233fc59242fa1bbc17e9d37edf043931f87bb", remote = "https://github.com/eclipse-score/tooling.git", ) diff --git a/bazel/toolchains/BUILD b/bazel/toolchains/BUILD index a8e6d4018..6868fd4d4 100644 --- a/bazel/toolchains/BUILD +++ b/bazel/toolchains/BUILD @@ -9,7 +9,9 @@ load( py_binary( name = "sphinx_build", srcs = ["@score_tooling//bazel/rules/rules_score:src/sphinx_wrapper.py"], - data = [], + data = [ + "@score_tooling//tools/sphinx:plantuml", + ], main = "@score_tooling//bazel/rules/rules_score:src/sphinx_wrapper.py", visibility = ["//:__subpackages__"], deps = [ @@ -21,6 +23,7 @@ py_binary( "//third_party/sphinx:sphinx-needs", "//third_party/sphinx:sphinxcontrib-plantuml", "//third_party/sphinx_rtd_theme", + "@rules_python//python/runfiles", "@score_tooling//bazel/rules/rules_score:bazel_sphinx_needs", "@score_tooling//bazel/rules/rules_score:sphinx_module_ext", "@score_tooling//plantuml/sphinx/clickable_plantuml", diff --git a/bazel/toolchains/template/conf.template.py b/bazel/toolchains/template/conf.template.py index 185821619..ae8c80deb 100644 --- a/bazel/toolchains/template/conf.template.py +++ b/bazel/toolchains/template/conf.template.py @@ -20,6 +20,14 @@ import bazel_sphinx_needs +from pathlib import Path +import os + +from python.runfiles import Runfiles +from sphinx.util import logging + +logger = logging.getLogger(__name__) + # Project configuration - {PROJECT_NAME} will be replaced by the module name during build project = "{PROJECT_NAME}" author = "S-CORE" @@ -113,7 +121,32 @@ needs_external_needs = bazel_sphinx_needs.load_external_needs() bazel_sphinx_needs.log_config_info(project) +# Resolve the PlantUML binary via Bazel runfiles. +# The plantuml java_binary target is in data of the local sphinx_build binary +# (//bazel/toolchains:sphinx_build), so it is accessible under the _main repo. +r = Runfiles.Create() +if r is None: + raise ValueError("Could not initialize Bazel runfiles.") + +_plantuml_path = None +# Use source_repo="" (the root module's canonical source repo key in repo_mapping) +# so Bazel resolves the apparent name "score_tooling" to the correct canonical +# name regardless of how the dep is declared (local_path_override → "score_tooling+", +# BCR/git_repository → "score_tooling"). +_candidate = r.Rlocation("score_tooling/tools/sphinx/plantuml", source_repo="") +if _candidate and Path(_candidate).exists(): + _plantuml_path = Path(_candidate) + logger.info(f"PlantUML resolved from runfiles: {_plantuml_path}") + +if _plantuml_path is None: + logger.warning( + "PlantUML binary not found in runfiles — diagrams will not be rendered. " + "Ensure @score_tooling//tools/sphinx:plantuml is in sphinx_build data." + ) +else: + plantuml = str(_plantuml_path) + plantuml_output_format = "svg_obj" + def setup(app): return bazel_sphinx_needs.setup_sphinx_extension(app, needs_external_needs) - diff --git a/docs/sphinx/BUILD b/docs/sphinx/BUILD index 69676bd35..b0b2a9ca8 100644 --- a/docs/sphinx/BUILD +++ b/docs/sphinx/BUILD @@ -49,6 +49,7 @@ filter_execpath( # Build Sphinx documentation sphinx_module( name = "sphinx_doc", + testonly = True, srcs = [ "how_to_document.rst", @@ -73,5 +74,6 @@ sphinx_module( index = "index.rst", visibility = ["//visibility:public"], deps = [ + "//score/message_passing/dependability:dependable_element_message_passing_doc", ], ) diff --git a/docs/sphinx/safety_reports.rst b/docs/sphinx/safety_reports.rst index 320e20395..124274baa 100644 --- a/docs/sphinx/safety_reports.rst +++ b/docs/sphinx/safety_reports.rst @@ -9,5 +9,6 @@ Safety documentation reports * - Report - Description - ... Add references to safety reports in the style of + * - `Message Passing Dependable Element `_ + - Message Passing diff --git a/score/message_passing/BUILD b/score/message_passing/BUILD index 84530a675..5bee2b136 100644 --- a/score/message_passing/BUILD +++ b/score/message_passing/BUILD @@ -14,6 +14,7 @@ load("@rules_cc//cc:defs.bzl", "cc_library") load("@score_baselibs//:bazel/unit_tests.bzl", "cc_gtest_unit_test") load("@score_baselibs//third_party/itf:py_unittest_qnx_test.bzl", "py_unittest_qnx_test") +load("@score_tooling//bazel/rules/rules_score:rules_score.bzl", "unit") py_unittest_qnx_test( name = "unit_tests_qnx", @@ -41,7 +42,10 @@ test_suite( "@score_communication//score/message_passing/log:unit_test_suite_host", "@score_communication//score/message_passing/non_allocating_future:unit_test_suite_host", ], - visibility = ["//score/message_passing:__pkg__"], + visibility = [ + "//score/message_passing:__pkg__", + "//score/message_passing/dependability:__pkg__", + ], ) cc_library( @@ -124,6 +128,21 @@ cc_library( ], ) +unit( + name = "client_connection", + scope = [ + ":message_passing_common", + ], + tests = [ + "//score/message_passing:client_connection_test", + ], + unit_design = ["//score/message_passing/dependability/software_unit_design:client_connection_unit_design"], + visibility = ["//score/message_passing/dependability:__pkg__"], + implementation = [ + "//score/message_passing:message_passing_common", + ], +) + cc_library( name = "message_passing_unix_domain", srcs = [ @@ -157,6 +176,21 @@ cc_library( ], ) +unit( + name = "unix_domain", + scope = [ + ":message_passing_unix_domain", + ], + tests = [ + ":unix_domain_test", + ], + unit_design = ["//score/message_passing/dependability/software_unit_design:unix_domain_unit_design"], + visibility = ["//score/message_passing/dependability:__pkg__"], + implementation = [ + ":message_passing_unix_domain", + ], +) + cc_library( name = "qnx_resource_path", srcs = [ @@ -214,6 +248,21 @@ cc_library( ], ) +unit( + name = "qnx_dispatch", + scope = [ + "//score/message_passing:message_passing_qnx_dispatch", + ], + tests = [ + ":qnx_dispatch_test", + ], + unit_design = ["//score/message_passing/dependability/software_unit_design:qnx_dispatch_unit_design"], + visibility = ["//score/message_passing/dependability:__pkg__"], + implementation = [ + ":message_passing_qnx_dispatch", + ], +) + cc_library( name = "mock", testonly = True, @@ -283,6 +332,7 @@ cc_gtest_unit_test( "resource_manager_fixture_base.h", ], target_compatible_with = ["@platforms//os:qnx"], + visibility = ["//score/message_passing/dependability:__pkg__"], deps = [ ":message_passing_qnx_dispatch", "@score_baselibs//score/concurrency", diff --git a/score/message_passing/client_connection_test.cpp b/score/message_passing/client_connection_test.cpp index 6d66f5437..a5780ea36 100644 --- a/score/message_passing/client_connection_test.cpp +++ b/score/message_passing/client_connection_test.cpp @@ -332,6 +332,7 @@ class ClientConnectionTest : public ::testing::Test TEST_F(ClientConnectionTest, Constructed) { + ::testing::Test::RecordProperty("lobster-tracing", "MessagePassingComponent.REQ_MP_COMP_001"); detail::ClientConnection connection(engine_, protocol_config_, client_config_); EXPECT_EQ(connection.GetState(), State::kStopped); EXPECT_EQ(connection.GetStopReason(), StopReason::kInit); diff --git a/score/message_passing/dependability/BUILD b/score/message_passing/dependability/BUILD new file mode 100644 index 000000000..150d9078d --- /dev/null +++ b/score/message_passing/dependability/BUILD @@ -0,0 +1,82 @@ +# ******************************************************************************* +# Copyright (c) 2026 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 +# ******************************************************************************* + +load( + "@score_tooling//bazel/rules/rules_score:rules_score.bzl", + "component", + "dependable_element", +) + +component( + name = "component_message_passing", + components = [ + ":client", + ":server", + ], + requirements = [ + "//score/message_passing/dependability/requirements:component_requirements", + ], + tags = ["manual"], + tests = [], +) + +# Component: client +# Covers the client-side connection management and common messaging infrastructure +component( + name = "client", + components = [ + "//score/message_passing:client_connection", + ], + requirements = [ + "//score/message_passing/dependability/requirements:component_requirements", + ], + tags = ["manual"], + tests = [], +) + +# Component: server +# Covers the platform-specific server implementations (QNX dispatch and Unix domain) +component( + name = "server", + components = select({ + "@platforms//os:qnx": [ + "//score/message_passing:qnx_dispatch", + "//score/message_passing:unix_domain", + ], + "//conditions:default": ["//score/message_passing:unix_domain"], + }), + requirements = [ + "//score/message_passing/dependability/requirements:component_requirements", + ], + tags = ["manual"], + tests = [], +) + +dependable_element( + name = "dependable_element_message_passing", + architectural_design = ["//score/message_passing/dependability/software_architectural_design:message_passing_architectural_design"], + assumptions_of_use = ["//score/message_passing/dependability/assumed_system:aous"], + components = [":component_message_passing"], + dependability_analysis = ["//score/message_passing/dependability/safety_analysis:message_passing_dependability_analysis"], + integrity_level = "B", + maturity = "development", + requirements = [ + "//score/message_passing/dependability/requirements:feature_requirements", + "//score/message_passing/dependability/assumed_system:assumed_system_requirements", + ], + tags = ["manual"], + tests = [ + "//score/message_passing:unit_tests", + ], + visibility = ["//visibility:public"], +) diff --git a/score/message_passing/dependability/assumed_system/BUILD b/score/message_passing/dependability/assumed_system/BUILD new file mode 100644 index 000000000..c737a1eec --- /dev/null +++ b/score/message_passing/dependability/assumed_system/BUILD @@ -0,0 +1,42 @@ +# ******************************************************************************* +# Copyright (c) 2026 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 +# ******************************************************************************* + +load( + "@score_tooling//bazel/rules/rules_score:rules_score.bzl", + "assumed_system_requirements", + "assumptions_of_use", +) +load("@trlc//:trlc.bzl", "trlc_requirements") + +trlc_requirements( + name = "aous_trlc", + srcs = [ + "aous.trlc", + ], + spec = [ + "@score_tooling//bazel/rules/rules_score/trlc/config:score_requirements_model", + ], + visibility = ["//score/message_passing/dependability:__subpackages__"], +) + +assumptions_of_use( + name = "aous", + srcs = [":aous_trlc"], + visibility = ["//score/message_passing/dependability:__subpackages__"], +) + +assumed_system_requirements( + name = "assumed_system_requirements", + srcs = ["assumed_system_requirements.trlc"], + visibility = ["//score/message_passing/dependability:__subpackages__"], +) diff --git a/score/message_passing/dependability/assumed_system/aous.trlc b/score/message_passing/dependability/assumed_system/aous.trlc new file mode 100644 index 000000000..33ad0d7b8 --- /dev/null +++ b/score/message_passing/dependability/assumed_system/aous.trlc @@ -0,0 +1,27 @@ +/******************************************************************************** + * Copyright (c) 2026 Contributors to the Eclipse Foundation + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0 + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ +package MessagePassing + +import ScoreReq + +// TODO: Add Assumptions of Use (AoU) for message passing +// Example: + +ScoreReq.AoU ExampleAoU { + description = "Example assumption description" + safety = ScoreReq.Asil.B + note = "Example note" + version = 1 + mitigates = "FailureModeName" +} + diff --git a/score/message_passing/dependability/assumed_system/assumed_system_requirements.trlc b/score/message_passing/dependability/assumed_system/assumed_system_requirements.trlc new file mode 100644 index 000000000..88089a8e8 --- /dev/null +++ b/score/message_passing/dependability/assumed_system/assumed_system_requirements.trlc @@ -0,0 +1,27 @@ +/******************************************************************************** + * Copyright (c) 2026 Contributors to the Eclipse Foundation + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0 + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ +package MessagePassingSEooC + +import ScoreReq + +/////////////////////////////// +// Assumed System Requirements +// System level requirements for MessagePassing SEooC +/////////////////////////////// + +ScoreReq.AssumedSystemReq ASR_MP_001 { + description = "The system shall provide a mechanism for inter-process communication via a client-server messaging protocol." + safety = ScoreReq.Asil.B + rationale = "Application processes need to exchange requests and responses reliably across process boundaries." + version = 1 +} diff --git a/score/message_passing/dependability/requirements/BUILD b/score/message_passing/dependability/requirements/BUILD new file mode 100644 index 000000000..20fdeab46 --- /dev/null +++ b/score/message_passing/dependability/requirements/BUILD @@ -0,0 +1,35 @@ +# ******************************************************************************* +# Copyright (c) 2026 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 +# ******************************************************************************* + +load( + "@score_tooling//bazel/rules/rules_score:rules_score.bzl", + "component_requirements", + "feature_requirements", +) + +feature_requirements( + name = "feature_requirements", + srcs = ["feature_requirements.trlc"], + deps = ["//score/message_passing/dependability/assumed_system:assumed_system_requirements"], + visibility = ["//score/message_passing/dependability:__subpackages__"], +) + +component_requirements( + name = "component_requirements", + srcs = ["component_requirements.trlc"], + deps = [ + ":feature_requirements", + "//score/message_passing/dependability/assumed_system:assumed_system_requirements", + ], + visibility = ["//score/message_passing/dependability:__subpackages__"], +) diff --git a/score/message_passing/dependability/requirements/component_requirements.trlc b/score/message_passing/dependability/requirements/component_requirements.trlc new file mode 100644 index 000000000..8abe32901 --- /dev/null +++ b/score/message_passing/dependability/requirements/component_requirements.trlc @@ -0,0 +1,28 @@ +/******************************************************************************** + * Copyright (c) 2026 Contributors to the Eclipse Foundation + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0 + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ +package MessagePassingComponent + +import ScoreReq +import MessagePassingSEooC + +/////////////////////////////// +// Component Requirements +// Server Unit and Client Unit requirements +/////////////////////////////// + +ScoreReq.CompReq REQ_MP_COMP_001 { + description = "The message passing server shall accept connections from clients on a configurable resource path." + safety = ScoreReq.Asil.B + derived_from = [MessagePassingSEooC.FEAT_MP_001@1] + version = 1 +} diff --git a/score/message_passing/dependability/requirements/feature_requirements.trlc b/score/message_passing/dependability/requirements/feature_requirements.trlc new file mode 100644 index 000000000..5d9b7364e --- /dev/null +++ b/score/message_passing/dependability/requirements/feature_requirements.trlc @@ -0,0 +1,27 @@ +/******************************************************************************** + * Copyright (c) 2026 Contributors to the Eclipse Foundation + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0 + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ +package MessagePassingSEooC + +import ScoreReq + +/////////////////////////////// +// Feature Requirements +// Integration level requirements derived from Assumed System Requirements +/////////////////////////////// + +ScoreReq.FeatReq FEAT_MP_001 { + description = "The message passing component shall provide a server interface that registers connection handlers and processes incoming requests." + safety = ScoreReq.Asil.B + derived_from = [MessagePassingSEooC.ASR_MP_001@1] + version = 1 +} diff --git a/score/message_passing/dependability/safety_analysis/BUILD b/score/message_passing/dependability/safety_analysis/BUILD new file mode 100644 index 000000000..12c08a8b6 --- /dev/null +++ b/score/message_passing/dependability/safety_analysis/BUILD @@ -0,0 +1,78 @@ +# ******************************************************************************* +# Copyright (c) 2026 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 +# ******************************************************************************* + +load( + "@score_tooling//bazel/rules/rules_score:rules_score.bzl", + "dependability_analysis", + "fmea", +) +load("@trlc//:trlc.bzl", "trlc_requirements", "trlc_requirements_test") + +trlc_requirements( + name = "failure_modes", + srcs = [ + "failure_modes.trlc", + ], + spec = [ + "@score_tooling//bazel/rules/rules_score/trlc/config:score_requirements_model", + ], + visibility = ["//score/message_passing/dependability:__pkg__"], +) + +trlc_requirements( + name = "control_measures", + srcs = [ + "control_measures.trlc", + ], + spec = [ + "@score_tooling//bazel/rules/rules_score/trlc/config:score_requirements_model", + ], + visibility = ["//score/message_passing/dependability:__pkg__"], + deps = [ + ":failure_modes", + ], +) + +trlc_requirements_test( + name = "fmea_test", + reqs = [ + ":control_measures", + ], + visibility = ["//score/message_passing/dependability:__pkg__"], +) + +filegroup( + name = "fta_files", + srcs = [ + "fta_client_connection_failed.puml", + "fta_server_not_listening.puml", + ], + visibility = ["//score/message_passing/dependability:__pkg__"], +) + +fmea( + name = "message_passing_fmea", + arch_design = "//score/message_passing/dependability/software_architectural_design:message_passing_architectural_design", + controlmeasures = [":control_measures"], + failuremodes = [":failure_modes"], + root_causes = [":fta_files"], + visibility = ["//score/message_passing/dependability:__pkg__"], +) + +dependability_analysis( + name = "message_passing_dependability_analysis", + arch_design = "//score/message_passing/dependability/software_architectural_design:message_passing_architectural_design", + fmea = ["//score/message_passing/dependability/safety_analysis:message_passing_fmea"], + tags = ["manual"], + visibility = ["//score/message_passing/dependability:__pkg__"], +) diff --git a/score/message_passing/dependability/safety_analysis/control_measures.trlc b/score/message_passing/dependability/safety_analysis/control_measures.trlc new file mode 100644 index 000000000..bedcc07a3 --- /dev/null +++ b/score/message_passing/dependability/safety_analysis/control_measures.trlc @@ -0,0 +1,28 @@ +/******************************************************************************** + * Copyright (c) 2026 Contributors to the Eclipse Foundation + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0 + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ +package MessagePassingFMEA + +import ScoreReq + +ScoreReq.ControlMeasure ServerHealthCheck { + safety = ScoreReq.Asil.B + description = "Monitor server availability and trigger safe state on persistent connection failures" + version = 1 +} + +ScoreReq.ControlMeasure ClientRetryPolicy { + safety = ScoreReq.Asil.B + description = "Client shall implement a bounded retry mechanism and report error to caller on exhaustion" + version = 1 +} + diff --git a/score/message_passing/dependability/safety_analysis/failure_modes.trlc b/score/message_passing/dependability/safety_analysis/failure_modes.trlc new file mode 100644 index 000000000..502c9b559 --- /dev/null +++ b/score/message_passing/dependability/safety_analysis/failure_modes.trlc @@ -0,0 +1,34 @@ +/******************************************************************************** + * Copyright (c) 2026 Contributors to the Eclipse Foundation + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0 + * + * SPDX-License-Identifier: Apache-2.0 + ********************************************************************************/ +package MessagePassingFMEA + +import ScoreReq + +ScoreReq.FailureMode ServerNotListening { + guideword = ScoreReq.GuideWord.LossOfFunction + description = "Message passing server fails to accept incoming client connections" + failureeffect = "Clients cannot communicate with the server; IPC requests are lost" + version = 1 + safety = ScoreReq.Asil.B + interface = "IServer.RegisterMessageHandler" +} + +ScoreReq.FailureMode ClientConnectionFailed { + guideword = ScoreReq.GuideWord.LossOfFunction + description = "Message passing client fails to establish a connection to the server" + failureeffect = "Client cannot send requests; dependent functionality is unavailable" + version = 1 + safety = ScoreReq.Asil.B + interface = "IClientFactory.Connect" +} + diff --git a/score/message_passing/dependability/safety_analysis/fta_client_connection_failed.puml b/score/message_passing/dependability/safety_analysis/fta_client_connection_failed.puml new file mode 100644 index 000000000..70e67e8e8 --- /dev/null +++ b/score/message_passing/dependability/safety_analysis/fta_client_connection_failed.puml @@ -0,0 +1,24 @@ +' ******************************************************************************* +' Copyright (c) 2026 Contributors to the Eclipse Foundation +' +' See the NOTICE file(s) distributed with this work for additional +' information regarding copyright ownership. +' +' This program and the accompanying materials are made available under the +' terms of the Apache License Version 2.0 which is available at +' https://www.apache.org/licenses/LICENSE-2.0 +' +' SPDX-License-Identifier: Apache-2.0 +' ******************************************************************************* + +@startuml + +!include fta_metamodel.puml + +$TopEvent("Client fails to establish connection to server", "MessagePassingFMEA.ClientConnectionFailed") + +$OrGate("OG1", "MessagePassingFMEA.ClientConnectionFailed") + +$BasicEvent("Client retry policy missing", "MessagePassingFMEA.ClientRetryPolicy", "OG1") + +@enduml diff --git a/score/message_passing/dependability/safety_analysis/fta_server_not_listening.puml b/score/message_passing/dependability/safety_analysis/fta_server_not_listening.puml new file mode 100644 index 000000000..fdff879c9 --- /dev/null +++ b/score/message_passing/dependability/safety_analysis/fta_server_not_listening.puml @@ -0,0 +1,24 @@ +' ******************************************************************************* +' Copyright (c) 2026 Contributors to the Eclipse Foundation +' +' See the NOTICE file(s) distributed with this work for additional +' information regarding copyright ownership. +' +' This program and the accompanying materials are made available under the +' terms of the Apache License Version 2.0 which is available at +' https://www.apache.org/licenses/LICENSE-2.0 +' +' SPDX-License-Identifier: Apache-2.0 +' ******************************************************************************* + +@startuml + +!include fta_metamodel.puml + +$TopEvent("Server fails to accept incoming client connections", "MessagePassingFMEA.ServerNotListening") + +$OrGate("OG1", "MessagePassingFMEA.ServerNotListening") + +$BasicEvent("Server health check missing", "MessagePassingFMEA.ServerHealthCheck", "OG1") + +@enduml diff --git a/score/message_passing/dependability/software_architectural_design/BUILD b/score/message_passing/dependability/software_architectural_design/BUILD new file mode 100644 index 000000000..9351cb851 --- /dev/null +++ b/score/message_passing/dependability/software_architectural_design/BUILD @@ -0,0 +1,26 @@ +# ******************************************************************************* +# Copyright (c) 2026 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 +# ******************************************************************************* + +load( + "@score_tooling//bazel/rules/rules_score:rules_score.bzl", + "architectural_design", +) + +architectural_design( + name = "message_passing_architectural_design", + static = [ + "static_design.puml", + "client-server.md", + ], + visibility = ["//score/message_passing/dependability:__subpackages__"], +) diff --git a/score/message_passing/design/client-server.md b/score/message_passing/dependability/software_architectural_design/client-server.md similarity index 100% rename from score/message_passing/design/client-server.md rename to score/message_passing/dependability/software_architectural_design/client-server.md diff --git a/score/message_passing/dependability/software_architectural_design/static_design.puml b/score/message_passing/dependability/software_architectural_design/static_design.puml new file mode 100644 index 000000000..df1ed58e5 --- /dev/null +++ b/score/message_passing/dependability/software_architectural_design/static_design.puml @@ -0,0 +1,51 @@ +' ******************************************************************************* +' Copyright (c) 2026 Contributors to the Eclipse Foundation +' +' See the NOTICE file(s) distributed with this work for additional +' information regarding copyright ownership. +' +' This program and the accompanying materials are made available under the +' terms of the Apache License Version 2.0 which is available at +' https://www.apache.org/licenses/LICENSE-2.0 +' +' SPDX-License-Identifier: Apache-2.0 +' ******************************************************************************* + +@startuml + +interface "score::message_passing" as message_passing_public_api +interface "OS" as os + +component "Message Passing" as dependable_element_message_passing <> { + + component "Message Passing" as component_message_passing <> { + + component "Client" as client <> { + component "ClientConnection" as client_connection <> { + } + } + + component "Server" as server <> { + component "QNX Dispatch" as qnx_dispatch <> { + } + component "Unix Domain" as unix_domain <> { + } + } + } + portout " " as message_passing_public_api_port + portin " " as port_os +} + +message_passing_public_api -l-() message_passing_public_api_port +port_os -u-( os : uses + +' ------------------------ Formatting ------------------- + +client -[hidden]down- server +client_connection -[hidden]right- qnx_dispatch +qnx_dispatch -[hidden]right- unix_domain + +@enduml + +x +x diff --git a/score/message_passing/dependability/software_unit_design/BUILD b/score/message_passing/dependability/software_unit_design/BUILD new file mode 100644 index 000000000..a22834333 --- /dev/null +++ b/score/message_passing/dependability/software_unit_design/BUILD @@ -0,0 +1,29 @@ +# ******************************************************************************* +# Copyright (c) 2026 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 +# ******************************************************************************* + +load("@score_tooling//bazel/rules/rules_score:rules_score.bzl", "unit_design") + +unit_design( + name = "client_connection_unit_design", + visibility = ["//score/message_passing:__pkg__"], +) + +unit_design( + name = "unix_domain_unit_design", + visibility = ["//score/message_passing:__pkg__"], +) + +unit_design( + name = "qnx_dispatch_unit_design", + visibility = ["//score/message_passing:__pkg__"], +) diff --git a/score/mw/com/dependability/requirements/assumed_system_requirements/BUILD b/score/mw/com/dependability/requirements/assumed_system_requirements/BUILD index ed110fd56..112b5c9e6 100644 --- a/score/mw/com/dependability/requirements/assumed_system_requirements/BUILD +++ b/score/mw/com/dependability/requirements/assumed_system_requirements/BUILD @@ -11,15 +11,13 @@ # SPDX-License-Identifier: Apache-2.0 # ******************************************************************************* -load("@trlc//:trlc.bzl", "trlc_requirements") +load( + "@score_tooling//bazel/rules/rules_score:rules_score.bzl", + "assumed_system_requirements", +) -trlc_requirements( +assumed_system_requirements( name = "assumed_system_requirements", - srcs = [ - "assumed_system_requirements.trlc", - ], - spec = [ - "@score_tooling//bazel/rules/rules_score/trlc/config:score_requirements_model", - ], + srcs = ["assumed_system_requirements.trlc"], visibility = ["//visibility:public"], ) diff --git a/score/mw/com/dependability/requirements/component_requirements/BUILD b/score/mw/com/dependability/requirements/component_requirements/BUILD index 59345298b..03fb390e5 100644 --- a/score/mw/com/dependability/requirements/component_requirements/BUILD +++ b/score/mw/com/dependability/requirements/component_requirements/BUILD @@ -11,26 +11,20 @@ # SPDX-License-Identifier: Apache-2.0 # ******************************************************************************* -load("@trlc//:trlc.bzl", "trlc_requirements", "trlc_requirements_test") +load( + "@score_tooling//bazel/rules/rules_score:rules_score.bzl", + "component_requirements", +) -trlc_requirements( +component_requirements( name = "component_requirements_ipc", srcs = [ "component_requirements_ipc.trlc", "component_requirements_ipc_methods.trlc", - "//score/mw/com/dependability/requirements/assumed_system_requirements", - "//score/mw/com/dependability/requirements/feature_requirements:feature_requirements_ipc", ], - spec = [ - "@score_tooling//bazel/rules/rules_score/trlc/config:score_requirements_model", - ], - visibility = ["//visibility:public"], -) - -trlc_requirements_test( - name = "component_requirements_ipc_test", - reqs = [ - ":component_requirements_ipc", + deps = [ + "//score/mw/com/dependability/requirements/assumed_system_requirements:assumed_system_requirements", + "//score/mw/com/dependability/requirements/feature_requirements:feature_requirements_ipc", ], visibility = ["//visibility:public"], ) diff --git a/score/mw/com/dependability/requirements/feature_requirements/BUILD b/score/mw/com/dependability/requirements/feature_requirements/BUILD index 9200ce722..1eb645da8 100644 --- a/score/mw/com/dependability/requirements/feature_requirements/BUILD +++ b/score/mw/com/dependability/requirements/feature_requirements/BUILD @@ -11,24 +11,14 @@ # SPDX-License-Identifier: Apache-2.0 # ******************************************************************************* -load("@trlc//:trlc.bzl", "trlc_requirements", "trlc_requirements_test") - -trlc_requirements( - name = "feature_requirements_ipc", - srcs = [ - "feature_requirements_ipc.trlc", - "//score/mw/com/dependability/requirements/assumed_system_requirements", - ], - spec = [ - "@score_tooling//bazel/rules/rules_score/trlc/config:score_requirements_model", - ], - visibility = ["//visibility:public"], +load( + "@score_tooling//bazel/rules/rules_score:rules_score.bzl", + "feature_requirements", ) -trlc_requirements_test( - name = "feature_requirements_ipc_test", - reqs = [ - ":feature_requirements_ipc", - ], +feature_requirements( + name = "feature_requirements_ipc", + srcs = ["feature_requirements_ipc.trlc"], + deps = ["//score/mw/com/dependability/requirements/assumed_system_requirements:assumed_system_requirements"], visibility = ["//visibility:public"], )