Skip to content
Closed
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
6 changes: 3 additions & 3 deletions .github/skills/rules-score/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Use this skill to coordinate; open the specialized skill for the actual work:
| `.trlc` requirement records, `ScoreReq` model, traceability, `assumed_system_requirements` / `feature_requirements` / `component_requirements` / `assumptions_of_use` | **score-requirements** |
| PlantUML diagrams, `architectural_design` / `unit` / `unit_design` / `component` / `dependable_element` structure, architecture/API/sequence validations | **score-architecture** |
| GoogleTest `lobster-tracing` + Given-When-Then, `test_case_coverage.lock.yaml`, attaching tests | **score-testing** |
| FMEA, `FailureMode` / `ControlMeasure` / FTA, `fmea` / `dependability_analysis` | **score-safety-analysis** |
| FMEA, `FailureMode` / `ControlMeasure` / FTA, `safety_analysis` / `dependability_analysis` | **score-safety-analysis** |

---

Expand All @@ -59,7 +59,7 @@ with a traceability report.
| Architectural Design | `architectural_design` | score-architecture |
| Units & Components | `unit`, `unit_design`, `component` | score-architecture |
| Tests & Coverage | `tests` attr, `test_case_coverage_lock` | score-testing |
| Dependability Analysis | `fmea`, `dependability_analysis` | score-safety-analysis |
| Dependability Analysis | `safety_analysis`, `dependability_analysis` | score-safety-analysis |
| SEooC assembly | `dependable_element` | this skill |

### Hierarchy
Expand Down Expand Up @@ -182,7 +182,7 @@ FMEA, cross-module `deps`, and test-case coverage — see
3. **Implementation & tests** → back each `unit` with a `cc_library` + `cc_test`; annotate tests
with `lobster-tracing` + Given-When-Then; add `test_case_coverage_lock` on components.
*(score-testing)*
4. **Safety analysis** → add `fmea` (FailureMode + ControlMeasure + FTA) and wrap it in a
4. **Safety analysis** → add `safety_analysis` (FailureMode + ControlMeasure + FTA) and wrap it in a
`dependability_analysis`. *(score-safety-analysis)*
5. **Assemble** → allocate `CompReq` to `component(requirements=…)` and `FeatReq` to
`dependable_element(requirements=…)`; wire `architectural_design`, `components`,
Expand Down
2 changes: 1 addition & 1 deletion .github/skills/score-safety-analysis/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ score/<component>/dependability/
│ ├── failure_modes.trlc # FailureMode records (one per unique root-cause cluster)
│ ├── control_measures.trlc # ControlMeasure / PreventiveMeasure / AoU records
│ ├── fta_<failure_mode>.puml # One FTA diagram per FailureMode
│ └── BUILD # fmea() rule — must list all .puml in fta_files filegroup
│ └── BUILD # safety_analysis() rule — must list all .puml in fta_files filegroup
├── assumed_system/
│ └── aous.trlc # AoU records (caller obligations)
└── requirements/
Expand Down
12 changes: 6 additions & 6 deletions bazel/rules/rules_score/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ exports_files([
"templates/section_page.template.rst",
"templates/unit.template.rst",
"templates/component.template.rst",
"templates/fmea.template.rst",
"templates/safety_analysis.template.rst",
"templates/puml_diagram.template.rst",
])

Expand Down Expand Up @@ -88,13 +88,13 @@ py_binary(
visibility = ["//visibility:public"],
)

# FMEA page assembler: builds the failure-mode-centric fmea.rst body in-process
# via the extended TRLCRST library and the FTA chains JSON from puml_cli.
# Safety-analysis page assembler: builds the failure-mode-centric safety_analysis.rst body
# in-process via the extended TRLCRST library and the FTA chains JSON from puml_cli.
py_binary(
name = "fmea_assembler",
srcs = ["src/fmea_assembler.py"],
name = "safety_analysis_assembler",
srcs = ["src/safety_analysis_assembler.py"],
imports = ["src"],
main = "src/fmea_assembler.py",
main = "src/safety_analysis_assembler.py",
visibility = ["//visibility:public"],
deps = [
"@trlc//tools/trlc_rst:trlc_rst_lib",
Expand Down
12 changes: 6 additions & 6 deletions bazel/rules/rules_score/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ for safety related automotive software.
| `architectural_design` | `ArchitecturalDesignInfo` |
| `unit` | `UnitInfo`, `CertifiedScope` |
| `component` | `ComponentInfo` |
| `fmea` | `AnalysisInfo` |
| `safety_analysis` | `AnalysisInfo` |
| `glossary` | `SphinxSourcesInfo` |
| `dependability_analysis` | `DependabilityAnalysisInfo` |
| `dependable_element` | HTML documentation zip (Sphinx) |
Expand Down Expand Up @@ -137,19 +137,19 @@ and collects requirement + architecture + test lobster sources.

---

## `fmea`
## `safety_analysis`

```starlark
fmea(
name = "my_fmea",
safety_analysis(
name = "my_safety_analysis",
failuremodes = [":failure_modes"],
controlmeasures = [":control_measures"],
root_causes = ["fta.puml"],
arch_design = ":my_design",
)
```

**`bazel build`** — generates `fmea.rst` (merged FM / CM / FTA sections),
**`bazel build`** — generates `safety_analysis.rst` (merged FM / CM / FTA sections),
runs `lobster-trlc` on TRLC inputs, and extracts FTA events from `.puml`
diagrams into `fta.lobster`. Build-only; traceability validation is done
by the wrapping `dependability_analysis` test.
Expand Down Expand Up @@ -212,7 +212,7 @@ dependable_element(
```starlark
dependability_analysis(
name = "my_da",
fmea = [":my_fmea"],
safety_analysis = [":my_safety_analysis"],
arch_design = ":my_design",
)
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ component "assumptions_of_use" <<requirements>> as aou
component "unit" <<implementation>> as unit
component "component" <<implementation>> as comp

' ── Safety Analysis rules ─────────────────────────────────────────────────────
component "fmea" <<analysis>> as fmea
' ── Safety Analysis rules ──────────────────────────────────────────────────────────
component "safety_analysis" <<analysis>> as safety_analysis
component "dependability_analysis" <<analysis>> as da

' ── Documentation rules ───────────────────────────────────────────────────────
Expand All @@ -56,7 +56,7 @@ component "dependable_element" as de

unit_design --> unit : <<UnitDesignInfo>>

arch --> fmea : <<ArchitecturalDesignInfo>>
arch --> safety_analysis : <<ArchitecturalDesignInfo>>
arch --> de : <<ArchitecturalDesignInfo>>

feat_req --> aou : <<FeatureRequirementsInfo>>
Expand All @@ -65,7 +65,7 @@ feat_req --> de : <<FeatureRequirementsInfo>>
comp_req --> comp : <<ComponentRequirementsInfo>>
comp_req --> aou : <<ComponentRequirementsInfo>>

fmea --> da : <<AnalysisInfo>>
safety_analysis --> da : <<AnalysisInfo>>
da --> de : <<DependabilityAnalysisInfo>>

aou --> de : <<AssumptionsOfUseInfo>>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

@startuml safety_analysis_doc_pipeline

' Component view of the FMEA build: input artifacts (authored + tooling
' defaults) flow through three in-process tool actions of the ``fmea`` rule into
' Component view of the safety-analysis build: input artifacts (authored + tooling
' defaults) flow through three in-process tool actions of the ``safety_analysis`` rule into
' the generated files, the providers, and finally the Sphinx staging tree.

skinparam linetype ortho
Expand Down Expand Up @@ -49,14 +49,14 @@ package "Authored by the component team" {
package "Tooling defaults (rules_score / ScoreReq)" {
rectangle "ScoreReq *.rsl\n(spec attr)" <<def>> as rsl
rectangle "fta_metamodel.puml\n(on PlantUML include path)" <<def>> as meta
rectangle "fmea.template.rst\n({body})" <<def>> as tmpl
rectangle "safety_analysis.template.rst\n({body})" <<def>> as tmpl
rectangle "fm/cm lobster\nconfigs" <<def>> as lcfg
}

' ── fmea rule: three tool actions ────────────────────────────────────────────
package "fmea rule actions" {
' ── safety_analysis rule: three tool actions ───────────────────────────────────────────
package "safety_analysis rule actions" {
component "puml_cli (FTA mode)\n--fta-output-dir\n[crate: puml_fta]" <<tool>> as puml
component "fmea_assembler\n[lib: TRLCRST]" <<tool>> as asm
component "safety_analysis_assembler\n[lib: TRLCRST]" <<tool>> as asm
component "lobster-trlc x2" <<tool>> as ltrlc
}

Expand All @@ -65,18 +65,18 @@ package "Generated files" {
rectangle "fta_*.puml\n(authored, symlinked)" <<gen>> as puml_inl
rectangle "fta_chains.json" <<gen>> as chains
rectangle "root_causes.lobster" <<gen>> as rc_lob
rectangle "fmea.rst" <<gen>> as fmea_rst
rectangle "safety_analysis.rst" <<gen>> as sa_rst
rectangle "failuremodes.lobster\ncontrolmeasures.lobster" <<gen>> as fmcm_lob
}

' ── Providers ────────────────────────────────────────────────────────────────
rectangle "SphinxSourcesInfo\n────────────────\nsrcs: fmea.rst\ndeps: fmea.rst\naux_srcs: fta_*.puml" <<prov>> as ssi
rectangle "SphinxSourcesInfo\n────────────────\nsrcs: safety_analysis.rst\ndeps: safety_analysis.rst\naux_srcs: fta_*.puml" <<prov>> as ssi
rectangle "AnalysisInfo.lobster_files\n────────────────\nfailuremodes.lobster\ncontrolmeasures.lobster\nroot_causes.lobster" <<prov>> as ai

' ── Downstream rules + staging ───────────────────────────────────────────────
component "dependability_analysis" <<tool>> as da
component "dependable_element" <<tool>> as de
rectangle "dependability_analysis/\n dfa.rst <- toctree\n fmea.rst <- toctree\n fta_*.puml (.. uml::)" <<stage>> as stage
rectangle "dependability_analysis/\n dfa.rst <- toctree\n safety_analysis.rst <- toctree\n fta_*.puml (.. uml::)" <<stage>> as stage

' ── Edges: inputs -> tools ───────────────────────────────────────────────────
fta_puml --> puml : parse macro calls
Expand All @@ -93,15 +93,15 @@ rsl --> ltrlc
lcfg --> ltrlc

' ── Edges: tools -> generated ────────────────────────────────────────────────
fta_puml --> puml_inl : symlinked beside fmea.rst
fta_puml --> puml_inl : symlinked beside safety_analysis.rst
meta --> stage : on PlantUML include path
puml --> chains
puml --> rc_lob
asm --> fmea_rst
asm --> sa_rst
ltrlc --> fmcm_lob

' ── Edges: generated -> providers ────────────────────────────────────────────
fmea_rst --> ssi
' ── Edges: generated -> providers ─────────────────────────────────────────────────────
sa_rst --> ssi
puml_inl --> ssi
rc_lob --> ai
fmcm_lob --> ai
Expand Down
10 changes: 5 additions & 5 deletions bazel/rules/rules_score/docs/_assets/seooc_flow.puml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ rectangle "architectural_design" <<rule>> as arch_r
rectangle "unit_design" <<rule>> as ud_r
rectangle "unit" <<rule>> as unit_r
rectangle "component" <<rule>> as comp_r2
rectangle "fmea" <<rule>> as fmea_r
rectangle "safety_analysis" <<rule>> as safety_analysis_r
rectangle "dependability_analysis" <<rule>> as da_r
rectangle "dependable_element" <<rule>> as de_r

Expand All @@ -65,9 +65,9 @@ arch_in --> arch_r
ud_in --> ud_r
impl_in --> unit_r
tests_in --> unit_r
fm_in --> fmea_r
cm_in --> fmea_r
fta_in --> fmea_r
fm_in --> safety_analysis_r
cm_in --> safety_analysis_r
fta_in --> safety_analysis_r

asr_r --> feat_r : deps
asr_r --> aou_r
Expand All @@ -77,7 +77,7 @@ comp_r --> comp_r2 : requirements

ud_r --> unit_r : unit_design
unit_r --> comp_r2 : components
fmea_r --> da_r : fmea
safety_analysis_r --> da_r : safety_analysis

arch_r --> de_r : architectural_design
aou_r --> de_r : assumptions_of_use
Expand Down
10 changes: 5 additions & 5 deletions bazel/rules/rules_score/docs/_assets/tooling_chain.puml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ skinparam rectangle {
' ── Rules (Starlark macros) ───────────────────────────────────────────────────
rectangle "feature_requirements\ncomponent_requirements\nassumed_system_requirements" <<rule>> as req
rectangle "architectural_design\nunit_design" <<rule>> as arch
rectangle "fmea" <<rule>> as fmea
rectangle "safety_analysis" <<rule>> as safety_analysis
rectangle "unit" <<rule>> as unit
rectangle "dependability_analysis" <<rule>> as da
rectangle "dependable_element" <<rule>> as de
Expand All @@ -44,7 +44,7 @@ rectangle "**TRLC**\ntrlc parser + trlc_rst\n(.trlc/.rsl -> .rst; TRLCRST lib)"
rectangle "**rst_to_trlc**\n(.rst -> .trlc)" <<own>> as r2t
rectangle "**PlantUML Parser**\npuml_cli (Rust)\n(.puml -> .fbs.bin + .lobster + .idmap.json)" <<tool>> as puml
rectangle "**puml_cli** (FTA mode)\ninline metamodel + extract\n(.puml -> inlined .puml +\nfta_chains.json + root_causes.lobster)" <<own>> as fta
rectangle "**fmea_assembler**\nTRLCRST page build\n(.trlc + chains -> fmea.rst)" <<own>> as asm
rectangle "**safety_analysis_assembler**\nTRLCRST page build\n(.trlc + chains -> safety_analysis.rst)" <<own>> as asm
rectangle "**Lobster**\nlobster-trlc / -report /\n-ci-report / gtest_report" <<tool>> as lob
rectangle "**Architecture Verifier**\nvalidation_cli\n(arch.json + .fbs.bin)" <<tool>> as verifier
rectangle "**Sphinx**\ntoolchain-resolved build binary + private\nhtml_merge tool\n(.rst -> needs.json + HTML)" <<tool>> as docs
Expand All @@ -58,10 +58,10 @@ req --> trlc : render + typecheck
req --> lob : lobster-trlc

arch --> puml : parse diagrams
fmea --> fta : FTA root causes
fmea --> asm : assemble fmea.rst
safety_analysis --> fta : FTA root causes
safety_analysis --> asm : assemble safety_analysis.rst
asm ..> trlc : TRLCRST lib
fmea --> lob : lobster-trlc
safety_analysis --> lob : lobster-trlc
unit --> lob : gtest_report

da --> lob : lobster-report (FM+CM+FTA)
Expand Down
6 changes: 3 additions & 3 deletions bazel/rules/rules_score/docs/integration_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ Complete Example
"architectural_design", "assumed_system_requirements",
"assumptions_of_use", "component", "component_requirements",
"dependability_analysis", "dependable_element",
"feature_requirements", "fmea", "unit")
"feature_requirements", "safety_analysis", "unit")

# Requirements
assumed_system_requirements(name = "sys_req", srcs = ["docs/sys_req.trlc"])
Expand All @@ -208,11 +208,11 @@ Complete Example
public_api = ["docs/public_api.puml"])

# Safety analysis
fmea(name = "my_fmea", arch_design = ":arch",
safety_analysis(name = "my_safety_analysis", arch_design = ":arch",
controlmeasures = ["docs/controls.trlc"],
failuremodes = ["docs/failures.trlc"],
root_causes = ["docs/fta.puml"])
dependability_analysis(name = "analysis", fmea = [":my_fmea"])
dependability_analysis(name = "analysis", safety_analysis = [":my_safety_analysis"])

# Implementation
cc_library(name = "kvs_lib", srcs = ["kvs.cpp"], hdrs = ["kvs.h"])
Expand Down
4 changes: 2 additions & 2 deletions bazel/rules/rules_score/docs/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ target two layers of checks apply:
derivation chain ``AssumedSystemReq → FeatReq → CompReq``, requires an ``Asil`` safety
classification and defines the safety-analysis
vocabulary (``FailureMode`` with HAZOP ``Guideword``\ s, ``ControlMeasure``,
``AoU``) used by ``fmea``/``assumptions_of_use``.
``AoU``) used by ``safety_analysis``/``assumptions_of_use``.

Architecture consistency (build)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -311,7 +311,7 @@ Quick Reference
* - :ref:`unit_design <rule-unit-design>`
- Artifact
- :doc:`user_guide/unit_design`
* - :ref:`fmea <rule-fmea>`
* - :ref:`safety_analysis <rule-safety-analysis>`
- Artifact
- :doc:`user_guide/dependability_analysis`
* - :ref:`dependability_analysis <rule-dependability-analysis>`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ section "Tool Requirements" {

ToolQualification.ToolRequirement Render_All_Failure_Modes {
description = '''
The FMEA rule shall render every FailureMode record from the
The safety_analysis rule shall render every FailureMode record from the
input TRLC sources into the documentation output.
'''
mitigates = [Missing_Failure_Mode_In_Render]
Expand Down
32 changes: 16 additions & 16 deletions bazel/rules/rules_score/docs/rule_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ architectural_design

Bundles static, dynamic, public-API, and internal-API architecture views into a
single target. Provides ``ArchitecturalDesignInfo`` consumed by ``dependable_element``
and ``fmea``.
and ``safety_analysis``.

.. code-block:: python

Expand Down Expand Up @@ -487,18 +487,18 @@ implementation.

**Generated targets:** ``<name>`` (no standalone test; diagrams are consumed by the parent ``unit``)

.. _rule-fmea:
.. _rule-safety-analysis:

fmea
~~~~
safety_analysis
~~~~~~~~~~~~~~~

Bundles failure modes, control measures, and FTA diagrams into a single FMEA
documentation target.
Bundles failure modes, control measures, and FTA diagrams into a single
safety-analysis documentation target.

.. code-block:: python

fmea(
name = "my_fmea",
safety_analysis(
name = "my_safety_analysis",
failuremodes = ["docs/failuremodes.trlc"],
controlmeasures = ["docs/controlmeasures.trlc"],
root_causes = ["docs/fta.puml"],
Expand Down Expand Up @@ -545,15 +545,15 @@ documentation target.
dependability_analysis
~~~~~~~~~~~~~~~~~~~~~~

Wraps one or more ``fmea`` targets into a complete safety-analysis package.
Running ``bazel test`` validates the full FMEA traceability chain.
Wraps one or more ``safety_analysis`` targets into a complete safety-analysis package.
Running ``bazel test`` validates the full traceability chain.

.. code-block:: python

dependability_analysis(
name = "analysis",
arch_design = ":my_arch",
fmea = [":my_fmea"],
name = "analysis",
arch_design = ":my_arch",
safety_analysis = [":my_safety_analysis"],
)

.. list-table::
Expand All @@ -568,10 +568,10 @@ Running ``bazel test`` validates the full FMEA traceability chain.
- string
- yes
- Target name
* - ``fmea``
* - ``safety_analysis``
- label list
- no
- ``fmea`` targets to include in this analysis (default ``[]``)
- ``safety_analysis`` targets to include in this analysis (default ``[]``)
* - ``arch_design``
- label
- no
Expand All @@ -581,7 +581,7 @@ Running ``bazel test`` validates the full FMEA traceability chain.
- no
- Bazel visibility

**Generated targets:** ``<name>`` (build → documentation; ``bazel test //pkg:analysis`` → full FMEA traceability validation)
**Generated targets:** ``<name>`` (build → documentation; ``bazel test //pkg:analysis`` → full traceability validation)


Structural Rules
Expand Down
Loading
Loading