Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ common --registry=https://bcr.bazel.build
# fails on machines without Android SDK APIs (incl. GitHub runners). This
# project does not use Android; unset ANDROID_HOME so the lookup is skipped.
common --repo_env=ANDROID_HOME=
# POC: libclang toolchain for rules_score's unit()/component() C++ parser.
common --extra_toolchains=//bazel/toolchains:score_logging_libclang_toolchain

# Retry HTTP downloads to handle transient failures (e.g. QNX toolchain)
common --http_connector_attempts=10
Expand Down
6 changes: 5 additions & 1 deletion BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ copyright_checker(
)

# Add target for formatting checks
use_format_targets()
# use_format_targets() # POC: disabled, see load-time note above.

exports_files([
"MODULE.bazel",
Expand All @@ -48,6 +48,10 @@ exports_files([

# Creates all documentation targets:
# - `:docs` for building documentation at build-time
# POC: score_process (now score_process_description) content used needextend
# without c.this_doc() scoping, which needs_json's hardcoded -W turned into a
# fatal build failure. Re-added via local_path_override (see MODULE.bazel) to
# a checkout with that fix applied.
docs(
data = [
"@score_platform//:needs_json",
Expand Down
49 changes: 41 additions & 8 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,36 @@ bazel_dep(name = "score_docs_as_code", version = "8.1.1")
bazel_dep(name = "score_tooling", version = "2.2.0")
bazel_dep(name = "score_rust_policies", version = "0.0.5")
bazel_dep(name = "score_process_description", version = "2.1.2")
bazel_dep(name = "score_platform", version = "0.7.2")
#bazel_dep(name = "score_platform", version = "0.7.2")

# POC: local checkout has rst_to_trlc support needed to source feature
# requirements directly from score/docs (not yet in any released version).
local_path_override(
module_name = "score_tooling",
path = "../tooling",
)

# score_tooling's own git_override for rules_distroless (needed for
# apt.sources_list()/apt.sysroot(), used by its hermetic libclang sysroot) is
# only honored when score_tooling is the root module. Since it's a transitive
# dependency here (via local_path_override), this override must be repeated,
# or the registry rules_distroless 0.8.0 (lacking those tag classes) is used
# instead and score_tooling's own MODULE.bazel fails to load.
bazel_dep(name = "rules_distroless", version = "0.8.0")
git_override(
module_name = "rules_distroless",
commit = "e1df344fde5adaef7397c34076b56f27771d08b8",
remote = "https://github.com/LittleHuba/rules_distroless.git",
)

bazel_dep(name = "score_platform", version = "0.6.4", dev_dependency = True)

# POC: reference the local score checkout so mw::log feature requirements can
# be sourced directly from score/docs/features/log_and_trace/logging/requirements.
local_path_override(
module_name = "score_platform",
path = "../score",
)

bazel_dep(name = "score_itf", version = "0.5.0", dev_dependency = True)

Expand Down Expand Up @@ -93,12 +122,7 @@ bazel_dep(name = "score_toolchains_rust", version = "0.10.0", dev_dependency = T
bazel_dep(name = "score_crates", version = "0.0.11")

# TRLC dependency for requirements traceability
bazel_dep(name = "trlc", version = "0.0.0", dev_dependency = True)
git_override(
module_name = "trlc",
commit = "8f369f1208598c2e75f44a77a98d244634ed482a", # trlc-3.0.1 (score_tooling >= 2.x needs trlc 3.x)
remote = "https://github.com/bmw-software-engineering/trlc.git",
)
bazel_dep(name = "trlc", version = "3.0.0", dev_dependency = True)

gcc = use_extension("@score_bazel_cpp_toolchains//extensions:gcc.bzl", "gcc", dev_dependency = True)
gcc.toolchain(
Expand Down Expand Up @@ -158,7 +182,7 @@ llvm.toolchain(
llvm_version = "22.1.7",
stdlib = {"": "stdc++"},
)
use_repo(llvm, "llvm_toolchain", "llvm_toolchain_coverage", "llvm_toolchain_coverage_llvm")
use_repo(llvm, "llvm_toolchain", "llvm_toolchain_coverage", "llvm_toolchain_coverage_llvm", "llvm_toolchain_llvm")

PYTHON_VERSION = "3.12"

Expand All @@ -173,6 +197,15 @@ python.toolchain(
bazel_dep(name = "googletest", version = "1.17.0.bcr.2")
bazel_dep(name = "rapidjson", version = "1.1.0.bcr.20241007")
bazel_dep(name = "score_baselibs", version = "0.2.12")

# POC: reference the local score_baselibs checkout so mw::log's backend can
# consume+forward the frontend's AoU RST (score/mw/log/docs/safety_analysis)
# live via rst_to_trlc.
local_path_override(
module_name = "score_baselibs",
path = "../score_baselibs",
)

bazel_dep(name = "score_communication", version = "0.4.0")

# Rust dependencies
Expand Down
5,257 changes: 4,221 additions & 1,036 deletions MODULE.bazel.lock

Large diffs are not rendered by default.

31 changes: 31 additions & 0 deletions bazel/toolchains/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# *******************************************************************************
# 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
# *******************************************************************************

# POC: libclang toolchain needed by rules_score's unit()/component() C++ parser.
load(
"@score_tooling//cpp/libclang:libclang_toolchain.bzl",
"libclang_toolchain",
)

libclang_toolchain(
name = "score_logging_libclang",
cc_toolchain = "@llvm_toolchain//:cc-clang-x86_64-linux",
libclang = "@llvm_toolchain_llvm//:lib/libclang.so",
)

toolchain(
name = "score_logging_libclang_toolchain",
toolchain = ":score_logging_libclang",
toolchain_type = "@score_tooling//cpp/libclang:libclang_toolchain_type",
visibility = ["//:__subpackages__"],
)
8 changes: 4 additions & 4 deletions docs/components/mw_log/requirements/requirements.rst
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ Non-Functional Requirements
:reqtype: Non-Functional
:security: YES
:safety: ASIL_B
:derived_from: feat_req__logging__resource_runtime, feat_req__logging__asil_support
:derived_from: feat_req__logging__asil_support
:status: valid
:satisfied_by: comp__mw_log_backend

Expand All @@ -178,7 +178,7 @@ Non-Functional Requirements
:reqtype: Non-Functional
:security: YES
:safety: ASIL_B
:derived_from: feat_req__logging__asil_support, feat_req__logging__resource_performance
:derived_from: feat_req__logging__asil_support
:status: valid
:satisfied_by: comp__mw_log_backend

Expand All @@ -190,7 +190,7 @@ Non-Functional Requirements
:reqtype: Non-Functional
:security: YES
:safety: ASIL_B
:derived_from: feat_req__logging__asil_support, feat_req__logging__resource_performance
:derived_from: feat_req__logging__asil_support
:status: valid
:satisfied_by: comp__mw_log_backend

Expand All @@ -204,7 +204,7 @@ Non-Functional Requirements
:reqtype: Non-Functional
:security: YES
:safety: ASIL_B
:derived_from: feat_req__logging__asil_support, feat_req__logging__error_handling_isolation
:derived_from: feat_req__logging__asil_support
:status: valid
:satisfied_by: comp__mw_log_backend

Expand Down
19 changes: 19 additions & 0 deletions docs/verification_report/stats.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,25 @@ In Detail
:tags: TEST
:columns: name as "testcase";result;fully_verifies;partially_verifies;test_type;derivation_technique;id as "link"

TRLC/Lobster Traceability Reports
----------------------------------

*POC (see trlc_migration_plan.md option 2): mw::log backend requirements/tests*
*wired via TRLC + rules_score's dependable_element(), independent of the*
*sphinx-needs-based stats above. Coverage is enforced by*
*`bazel test //score/mw/log/dependability:*`, gated against the committed*
*test_case_coverage.lock.yaml.*

.. list-table::
:widths: 30 70
:header-rows: 1

* - Report
- Description
* - `mw::log Backend <dependable_element_mw_log_backend_doc/index.html>`_
- Dependable Element (requirements, architecture, safety analysis, test coverage)





Expand Down
57 changes: 57 additions & 0 deletions score/mw/log/dependability/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# *******************************************************************************
# 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
# *******************************************************************************

# POC (option 2, see trlc_migration_plan.md): mw::log backend as a full
# rules_score SEooC. maturity="development" and the placeholder FMEA mean this
# is not yet certification evidence -- see safety_analysis/*.trlc notes.
load(
"@score_tooling//bazel/rules/rules_score:rules_score.bzl",
"component",
"dependable_element",
)

component(
name = "component_mw_log_backend",
components = [
"//score/mw/log/detail/data_router:data_router_backend_unit",
"//score/mw/log/detail/data_router/shared_memory:shared_memory_unit",
"//score/mw/log/detail/file_recorder:file_recorder_unit",
"//score/mw/log/detail/wait_free_producer_queue:wait_free_producer_queue_unit",
],
requirements = [
"//score/mw/log/requirements/component_requirements",
"//score/mw/log/requirements/feature_requirements",
],
target_compatible_with = ["@platforms//os:linux"],
test_case_coverage_lock = "test_case_coverage.lock.yaml",
visibility = ["//visibility:public"],
)

dependable_element(
name = "dependable_element_mw_log_backend",
architectural_design = ["//score/mw/log/design/backend:mw_log_backend_architectural_design"],
assumptions_of_use = ["//score/mw/log/requirements/safety_analysis:assumptions_of_use"],
components = [":component_mw_log_backend"],
dependability_analysis = ["//score/mw/log/dependability/safety_analysis:mw_log_backend_dependability_analysis"],
integrity_level = "B",
maturity = "development",
requirements = [
"//score/mw/log/requirements/feature_requirements",
"//score/mw/log/requirements/assumed_system_requirements",
],
target_compatible_with = ["@platforms//os:linux"],
tests = [
"//score/test/component/mw_log:test_mw_log",
],
visibility = ["//visibility:public"],
)
35 changes: 35 additions & 0 deletions score/mw/log/dependability/safety_analysis/BUILD
Original file line number Diff line number Diff line change
@@ -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",
"dependability_analysis",
"fmea",
)

# PLACEHOLDER (POC only) -- see failure_modes.trlc/control_measures.trlc notes.
fmea(
name = "mw_log_backend_fmea",
arch_design = "//score/mw/log/design/backend:mw_log_backend_architectural_design",
controlmeasures = ["control_measures.trlc"],
failuremodes = ["failure_modes.trlc"],
visibility = ["//score/mw/log/dependability:__pkg__"],
)

dependability_analysis(
name = "mw_log_backend_dependability_analysis",
arch_design = "//score/mw/log/design/backend:mw_log_backend_architectural_design",
fmea = [":mw_log_backend_fmea"],
tags = ["manual"],
visibility = ["//score/mw/log/dependability:__pkg__"],
)
Original file line number Diff line number Diff line change
@@ -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
********************************************************************************/
package MwLogBackend

import ScoreReq

// PLACEHOLDER control measure (POC only) -- mirrors the existing
// IndexAndSizeChecking / MemoryBoundChecking component requirements. Needs
// safety engineer confirmation as part of a real FMEA before use as evidence.
ScoreReq.ControlMeasure BoundedSharedMemoryAccess {
description = "Shared-memory writer/reader implementations shall explicitly check indices and buffer bounds before every read from or write to shared memory."
safety = ScoreReq.Asil.B
mitigates = "MwLogBackend.LogMessageLossOrCorruption"
version = 1
note = "PLACEHOLDER entry -- not a completed FMEA."
}
31 changes: 31 additions & 0 deletions score/mw/log/dependability/safety_analysis/failure_modes.trlc
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/********************************************************************************
* 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 MwLogBackend

import ScoreReq

// PLACEHOLDER FMEA (POC only): exercises the TRLC/dependable_element pipeline
// end-to-end. A real safety engineer must author the actual FMEA for mw::log's
// backend (data router, shared memory, file recorder, wait-free queue) before
// this can serve as certification evidence -- see score_baselibs' own
// score/mw/log/docs/safety_analysis/fmea.rst, which is itself only an unfilled
// draft template.
ScoreReq.FailureMode LogMessageLossOrCorruption {
guidewords = [ScoreReq.Guideword.LossOfFunction, ScoreReq.Guideword.Corrupted]
description = "A log message is lost, dropped, or its content is corrupted between being recorded by the frontend and reaching a configured backend sink."
failureeffect = "Diagnostic/verification data is missing or misleading. mw::log is not itself a safety-actuating function (QM), but missing or corrupted logs can hide evidence needed for post-incident or verification analysis."
interface = "DataRouterBackend, SharedMemoryWriter, SharedMemoryReader"
version = 1
safety = ScoreReq.Asil.B
note = "PLACEHOLDER entry -- not a completed FMEA."
}
38 changes: 38 additions & 0 deletions score/mw/log/dependability/software_unit_design/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# *******************************************************************************
# 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
# *******************************************************************************

# Minimal unit_design() stubs: the static/dynamic diagrams already exist at
# //score/mw/log/design/backend and are referenced at the dependable_element's
# architectural_design level; these units don't (yet) have unit-specific
# design docs beyond that.
load("@score_tooling//bazel/rules/rules_score:rules_score.bzl", "unit_design")

unit_design(
name = "file_recorder_unit_design",
visibility = ["//score/mw/log/detail/file_recorder:__pkg__"],
)

unit_design(
name = "data_router_backend_unit_design",
visibility = ["//score/mw/log/detail/data_router:__pkg__"],
)

unit_design(
name = "wait_free_producer_queue_unit_design",
visibility = ["//score/mw/log/detail/wait_free_producer_queue:__pkg__"],
)

unit_design(
name = "shared_memory_unit_design",
visibility = ["//score/mw/log/detail/data_router/shared_memory:__pkg__"],
)
Loading
Loading