Skip to content
Open
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
16 changes: 14 additions & 2 deletions bazel/rules/rules_score/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,10 @@ sphinx_module(
"docs/**/*.md",
],
allow_empty = True,
),
) + [
"//bazel/rules/rules_score/docs/requirements:requirements_rst",
"//bazel/rules/rules_score/docs/requirements:traceability_rst",
],
index = "docs/index.rst",
visibility = ["//visibility:public"],
)
Expand Down Expand Up @@ -176,13 +179,22 @@ filegroup(
srcs = glob(["*.bzl"]),
)

filegroup(
name = "py_srcs",
srcs = glob(["src/*.py"]),
)

lobster_linker(
name = "rules_score_impl",
srcs = [
":bzl_srcs",
":py_srcs",
"//bazel/rules/rules_score/private:bzl_srcs",
],
visibility = ["//docs/processes:__pkg__"],
visibility = [
"//bazel/rules/rules_score/docs/requirements:__pkg__",
"//docs/processes:__pkg__",
],
)

# ---------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions bazel/rules/rules_score/docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ safety analysis to the top-level SEooC assembly.
integration_guide
user_guide/index
rule_reference
tool_qualification
125 changes: 125 additions & 0 deletions bazel/rules/rules_score/docs/requirements/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
# *******************************************************************************
# 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("@lobster//:lobster.bzl", "lobster_test", "lobster_trlc")
load("@trlc//:trlc.bzl", "trlc_requirements", "trlc_requirements_test", "trlc_rst")
load("//tools/lobster_rst_report:lobster_rst_report.bzl", "lobster_report_rst")

# ---------------------------------------------------------------------------
# TRLC Requirements
# ---------------------------------------------------------------------------

trlc_requirements(
name = "use_cases",
srcs = ["use_cases.trlc"],
spec = ["//bazel/rules/rules_score/trlc/config:qualification_model"],
)

trlc_requirements(
name = "potential_errors",
srcs = ["potential_errors.trlc"],
spec = ["//bazel/rules/rules_score/trlc/config:qualification_model"],
deps = [":use_cases"],
)

trlc_requirements(
name = "tool_requirements",
srcs = ["tool_requirements.trlc"],
spec = ["//bazel/rules/rules_score/trlc/config:qualification_model"],
deps = [
":potential_errors",
":use_cases",
],
)

trlc_requirements_test(
name = "requirements_test",
reqs = [
":tool_requirements",
],
)

# ---------------------------------------------------------------------------
# TRLC → RST rendering (for inclusion in Sphinx documentation)
# ---------------------------------------------------------------------------

trlc_rst(
name = "requirements_rst",
reqs = [
":use_cases",
":potential_errors",
":tool_requirements",
],
visibility = ["//bazel/rules/rules_score:__pkg__"],
)

# ---------------------------------------------------------------------------
# Lobster traceability extraction
# ---------------------------------------------------------------------------

lobster_trlc(
name = "use_cases_lobster",
config = "lobster-use-cases.yaml",
requirements = [":use_cases"],
)

lobster_trlc(
name = "potential_errors_lobster",
config = "lobster-potential-errors.yaml",
requirements = [
":potential_errors",
":use_cases",
],
)

lobster_trlc(
name = "tool_requirements_lobster",
config = "lobster-tool-requirements.yaml",
requirements = [
":tool_requirements",
":potential_errors",
":use_cases",
],
)

# ---------------------------------------------------------------------------
# Lobster traceability report
# ---------------------------------------------------------------------------

lobster_test(
name = "traceability_test",
config = "lobster.conf",
inputs = [
":use_cases_lobster",
":potential_errors_lobster",
":tool_requirements_lobster",
"//bazel/rules/rules_score:rules_score_impl",
],
tags = ["manual"],
)

# ---------------------------------------------------------------------------
# Lobster RST report (for inclusion in Sphinx documentation)
# ---------------------------------------------------------------------------

lobster_report_rst(
name = "traceability_rst",
config = "lobster.conf",
inputs = [
":use_cases_lobster",
":potential_errors_lobster",
":tool_requirements_lobster",
"//bazel/rules/rules_score:rules_score_impl",
],
visibility = ["//bazel/rules/rules_score:__pkg__"],
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# *******************************************************************************
# 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
# *******************************************************************************
inputs:
- .
conversion-rules:
- package: ToolQualification
record-type: PotentialError
namespace: req
description-fields:
- description
tags:
- affects
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# *******************************************************************************
# 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
# *******************************************************************************
inputs:
- .
conversion-rules:
- package: ToolQualification
record-type: ToolRequirement
namespace: req
description-fields:
- description
tags:
- mitigates
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# *******************************************************************************
# 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
# *******************************************************************************
inputs:
- .
conversion-rules:
- package: ToolQualification
record-type: UseCase
namespace: req
description-fields:
- description
18 changes: 18 additions & 0 deletions bazel/rules/rules_score/docs/requirements/lobster.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
requirements "Use Cases" {
source: "use_cases_lobster.lobster";
}

requirements "Potential Errors" {
source: "potential_errors_lobster.lobster";
trace to: "Use Cases";
}

requirements "Tool Requirements" {
source: "tool_requirements_lobster.lobster";
trace to: "Potential Errors";
}

implementation "Code" {
source: "rules_score_impl.lobster";
trace to: "Tool Requirements";
}
100 changes: 100 additions & 0 deletions bazel/rules/rules_score/docs/requirements/potential_errors.trlc
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
/********************************************************************************
* 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 UseCases
import ToolQualification

section "Potential Errors" {

section "Documentation Build" {

ToolQualification.PotentialError Missing_Requirement_In_Output {
description = '''
A requirement defined in a TRLC source file is silently omitted
from the rendered RST output, causing the documentation to be
incomplete without any build error.
'''
impacts = ["Incomplete safety documentation delivered to assessor"]
affects = [Build_Traceable_Documentation]
impact_type = ToolQualification.Impact_Type.Safety
}

ToolQualification.PotentialError Broken_Cross_Reference {
description = '''
A cross-reference between requirements (e.g. derived_from) is
not resolved correctly in the rendered documentation, showing
a broken link or missing reference.
'''
impacts = ["Traceability information is incorrect in delivered documentation"]
affects = [Build_Traceable_Documentation, Validate_Requirement_Chains]
impact_type = ToolQualification.Impact_Type.Safety
}

}

section "Requirement Traceability" {

ToolQualification.PotentialError Undetected_Missing_Traceability {
description = '''
A component requirement that lacks a derived_from reference to
a feature requirement is not flagged as an error during the
build, allowing gaps in the traceability chain.
'''
impacts = ["Safety requirements may not be implemented"]
affects = [Validate_Requirement_Chains]
impact_type = ToolQualification.Impact_Type.Safety
}

ToolQualification.PotentialError Incorrect_Provider_Chain {
description = '''
The Bazel provider chain (TrlcProviderInfo, SphinxSourcesInfo)
is assembled incorrectly so that downstream rules receive stale
or incomplete requirement data.
'''
impacts = ["Traceability report based on outdated information"]
affects = [Validate_Requirement_Chains, Assemble_Dependable_Element]
impact_type = ToolQualification.Impact_Type.Safety
}

}

section "Safety Analysis" {

ToolQualification.PotentialError Missing_Failure_Mode_In_Render {
description = '''
A failure mode defined in TRLC is not rendered in the FMEA
documentation output, causing an incomplete safety analysis
artefact.
'''
impacts = ["Incomplete FMEA delivered as part of safety case"]
affects = [Render_Safety_Analyses, Assemble_Dependable_Element]
impact_type = ToolQualification.Impact_Type.Safety
}

}

section "Architecture" {

ToolQualification.PotentialError Silent_Diagram_Parse_Failure {
description = '''
A syntactically invalid PlantUML diagram is not rejected by
the parser, producing an incorrect or empty FlatBuffers output
that is consumed silently by downstream rules.
'''
impacts = ["Architecture verification based on incorrect model"]
affects = [Parse_Architectural_Diagrams, Assemble_Dependable_Element]
impact_type = ToolQualification.Impact_Type.Safety
}

}

}
Loading
Loading