Skip to content
Merged
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
9 changes: 1 addition & 8 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,7 @@ bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "flatbuffers", version = "25.9.23")
bazel_dep(name = "download_utils", version = "1.2.2")
bazel_dep(name = "trlc", version = "3.0.0")
bazel_dep(name = "lobster", version = "1.0.3")
git_override(
module_name = "lobster",
# Bumped for req_coverage's use of lobster.common.{io,items,errors,location}.
commit = "247927a438647f68c70a61f9fdde155f5aee145d",
remote = "https://github.com/bmw-software-engineering/lobster.git",
)

bazel_dep(name = "lobster", version = "1.0.4")
bazel_dep(name = "rules_distroless", version = "0.8.0")
bazel_dep(name = "googletest", version = "1.17.0.bcr.2")

Expand Down
5 changes: 4 additions & 1 deletion bazel/rules/rules_score/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,13 @@ Internally:
artifacts, runs validation/core architecture checks as a subrule, and
produces a DE-level LOBSTER report (`lobster_de.conf` template covering
Feature Req → Component Req → Architecture → Public API → Failure Modes).

2. `sphinx_module` compiles all RST sources + diagrams into an HTML zip.

**`bazel test`** — runs the LOBSTER CI report embedded in the index rule
and all component / unit tests transitively.
and all component / unit tests transitively. With `maturity = "development"`
a failing traceability check only prints a warning instead of failing the
test.

```bash
bazel build //examples/seooc:safety_software_seooc_example # HTML zip
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
' *******************************************************************************
' 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 lobster_report_assembly

' How the dependable_element _index rule assembles the lobster traceability
' report and splices it into the Sphinx documentation tree (stages A-G).

skinparam linetype ortho
skinparam ArrowFontSize 10
skinparam defaultTextAlignment center

skinparam rectangle {
BackgroundColor<<src>> #EFF6FB
BorderColor<<src>> #0066B1
BackgroundColor<<tool>> #E3F2FD
BorderColor<<tool>> #1565C0
BackgroundColor<<own>> #E8F5E9
BorderColor<<own>> #2E7D32
BackgroundColor<<rep>> #FFF3E0
BorderColor<<rep>> #EF6C00
BackgroundColor<<out>> #F3E5F5
BorderColor<<out>> #6A1B9A
}

rectangle "A: Per-level .lobster files\n(Feature/Component Req, Unit Test,\nCoverage, Architecture, Public API,\nFailure Modes, Control Measures,\nRoot Causes)" <<src>> as A

rectangle "B: expand_template\nformat_lobster_block() per level\n(emit_empty=strict in release)" <<own>> as B
rectangle "de_traceability_config" <<rep>> as conf

rectangle "C: subrule_lobster_report\nlobster-report (lobster-config flag)" <<tool>> as C
rectangle "report.json" <<rep>> as report

rectangle "D: subrule_lobster_html_report\n(optional, generate_html_report)" <<tool>> as D
rectangle "report.html" <<rep>> as html

rectangle "E: lobster-rst-report\n(out-dir, source-root flags)" <<tool>> as E
rectangle "traceability_report/\n(index.rst + one page/level)" <<rep>> as rst

rectangle "F: _section_page +\nexpand_template(index.rst)\n(toctree entry added iff E ran)" <<own>> as F
rectangle "<name>_index/index.rst" <<rep>> as index

rectangle "G: DefaultInfo +\nDependableElementLobsterInfo +\nOutputGroupInfo(lobster_ci_report)" <<own>> as G

rectangle "<name> test\nlobster-ci-report (pass/fail gate)" <<out>> as gate
rectangle "<name>_doc sphinx_module\n(HTML documentation)" <<out>> as docs

A --> B
B --> conf
conf --> C
C --> report
report --> D
D --> html
report --> E
E --> rst
rst --> F
F --> index
report --> G
html --> G
rst --> G
index --> G
G --> gate
G --> docs

@enduml
6 changes: 5 additions & 1 deletion bazel/rules/rules_score/docs/rule_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,11 @@ and scope checks at build/test time.
* - ``maturity``
- string
- no
- ``"release"`` (default) treats certified-scope violations and architecture consistency errors as hard build failures. ``"development"`` downgrades them to warnings so the build still succeeds — useful when iterating before all scope and architecture declarations are finalised. **Always revert to ``"release"`` before a certification delivery.**
- ``"release"`` (default) treats certified-scope violations, architecture consistency errors, and missing traceability links as hard build/test failures. ``"development"`` downgrades them to warnings so the build/test still succeeds — useful when iterating before all scope, architecture, and traceability declarations are finalised. **Always revert to ``"release"`` before a certification delivery.**
* - ``generate_html_report``
- bool
- no
- If ``True``, additionally generate a standalone LOBSTER HTML traceability report. Off by default: nothing consumes it (Sphinx renders the multi-page RST report under ``traceability_report/`` instead), so it only adds a build action (default ``False``)
* - ``testonly``
- bool
- no
Expand Down
29 changes: 29 additions & 0 deletions bazel/rules/rules_score/docs/tooling_architecture.rst
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,35 @@ feed that pipeline:
**FTA** (``fta.puml``) → ``puml_cli`` (FTA mode) → ``root_causes.lobster``.
* **Unit tests** (gtest) → ``gtest_report`` → ``<unit>.lobster``.

Lobster report assembly (``dependable_element``)
-------------------------------------------------

The ``config → report.json → gate`` box in the diagram above is itself a
multi-step pipeline, all inside the ``dependable_element`` ``_index`` rule.
Stages A–D turn the collected ``.lobster`` inputs into the aggregated report;
stages E–G render it as Sphinx documentation and expose it to the pass/fail
test and to other rules.

.. uml:: _assets/lobster_report_assembly.puml
:align: center
:alt: How dependable_element assembles and publishes the lobster report
:width: 100%

#. **Config** — ``format_lobster_block()`` fills a template with one block per
level, guarded by whether that level has sources (release mode force-emits
empty verification levels so a missing one still fails the gate).
#. **Report** — ``lobster-report`` aggregates all levels/inputs against that
config into ``report.json``, the single artefact everything below reads.
#. **HTML** — optional standalone convenience artefact.
#. **Multi-page RST** — ``lobster-rst-report --out-dir`` renders one page per
level plus an ``index.rst`` into a directory artefact.
#. **Splice** — the parent ``index.rst`` gets a ``Traceability`` toctree entry
pointing at that directory, but only if it was actually produced.
#. **Publish** — ``report.json`` (plus HTML/RST) are exposed via
``DependableElementLobsterInfo`` and an output group, so the sibling
``<name>`` test can gate on it (``lobster-ci-report``) and the sibling
``<name>_doc`` ``sphinx_module`` can render it into the final HTML.

.. _two-phase-sphinx-build:

Two-phase Sphinx build
Expand Down
2 changes: 2 additions & 0 deletions bazel/rules/rules_score/examples/integrator/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,15 @@ component(
# receives all forwarded AoUs:
# - SampleType.SampleAoU (auto-forwarded, own AoU of seooc)
# - OtherLibrary.TimingConstraint (chain-forwarded from other_seooc through seooc)

dependable_element(
name = "integrator_seooc",
architectural_design = [":integrator_design"],
assumptions_of_use = [],
components = [":integrator_component"],
dependability_analysis = [],
integrity_level = "B",
maturity = "development",
requirements = [
"//docs/requirements:feature_requirements",
],
Expand Down
7 changes: 1 addition & 6 deletions bazel/rules/rules_score/examples/integrator/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,7 @@ local_path_override(

bazel_dep(name = "trlc", version = "3.0.0")
bazel_dep(name = "googletest", version = "1.17.0.bcr.2")
bazel_dep(name = "lobster", version = "1.0.3")
git_override(
module_name = "lobster",
commit = "07382c33f95e22992e0f8788c0537ec06877e51f",
remote = "https://github.com/bmw-software-engineering/lobster.git",
)
bazel_dep(name = "lobster", version = "1.0.4")

# seooc's own llvm toolchain extension is a dev_dependency, so it is only
# honored while seooc itself is the root module — it is stripped when seooc is
Expand Down
7 changes: 1 addition & 6 deletions bazel/rules/rules_score/examples/minimal/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,4 @@ use_repo(llvm, "llvm_toolchain", "llvm_toolchain_llvm")

bazel_dep(name = "trlc", version = "3.0.0")
bazel_dep(name = "googletest", version = "1.17.0.bcr.2")
bazel_dep(name = "lobster", version = "1.0.3")
git_override(
module_name = "lobster",
commit = "07382c33f95e22992e0f8788c0537ec06877e51f",
remote = "https://github.com/bmw-software-engineering/lobster.git",
)
bazel_dep(name = "lobster", version = "1.0.4")
7 changes: 1 addition & 6 deletions bazel/rules/rules_score/examples/seooc/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,4 @@ use_repo(llvm, "llvm_toolchain", "llvm_toolchain_llvm")

bazel_dep(name = "trlc", version = "3.0.0")
bazel_dep(name = "googletest", version = "1.17.0.bcr.2")
bazel_dep(name = "lobster", version = "1.0.3")
git_override(
module_name = "lobster",
commit = "07382c33f95e22992e0f8788c0537ec06877e51f",
remote = "https://github.com/bmw-software-engineering/lobster.git",
)
bazel_dep(name = "lobster", version = "1.0.4")
48 changes: 14 additions & 34 deletions bazel/rules/rules_score/lobster/config/lobster_de.conf.tpl
Original file line number Diff line number Diff line change
@@ -1,39 +1,19 @@
requirements "Feature Requirements" {
{FEAT_REQ_SOURCES}
}
{FEAT_REQ_BLOCK}

requirements "Forwarded AoUs" {
{FORWARDED_AOU_SOURCES}
}
{FORWARDED_AOU_BLOCK}

requirements "Component Requirements" {
{COMP_REQ_SOURCES}{COMP_REQ_TRACE}}
{COMP_REQ_BLOCK}

activity "Unit Test" {
{UNIT_TEST_SOURCES}
}
{UNIT_TEST_BLOCK}

{COVERAGE_BLOCK}
implementation "Architecture" {
{ARCH_SOURCES}
trace to: "Component Requirements";
}

implementation "Public API" {
{PUBLIC_API_SOURCES}
}

requirements "Failure Modes" {
{FM_SOURCES}
trace to: "Public API";
}

requirements "Control Measures" {
{CM_SOURCES}
}

activity "Root Causes" {
{RC_SOURCES}
trace to: "Failure Modes";
trace to: "Control Measures";
}

{ARCH_BLOCK}

{PUBLIC_API_BLOCK}

{FM_BLOCK}

{CM_BLOCK}

{RC_BLOCK}
Loading
Loading