Skip to content

Conversation

@ramceb
Copy link

@ramceb ramceb commented Dec 17, 2025

This commit introduces the initial implementation of the score_module
Bazel rules for handling SEOOC (Safety Element Out Of Context) modules.

Key additions:

  • Core rules in score_module.bzl and private/seooc.bzl
  • Test infrastructure with fixtures covering architecture design,
    assumptions of use, component requirements, and safety analysis

Copy link

@masc2023 masc2023 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not follow process description, that will cover also other standards, Safety is based on Quality, and defined folder structures?

@ramceb ramceb force-pushed the mb_module_api branch 2 times, most recently from 0f3a3f4 to 74365d5 Compare December 17, 2025 13:24
@ramceb ramceb marked this pull request as draft December 17, 2025 13:24
@ramceb ramceb force-pushed the mb_module_api branch 3 times, most recently from 8421a28 to ae85726 Compare December 17, 2025 13:54
@ramceb
Copy link
Author

ramceb commented Dec 18, 2025

Why not follow process description, that will cover also other standards, Safety is based on Quality, and defined folder structures?

The concept behind the module API is to enforce that modules follow the score processes.

This commit introduces the initial implementation of the score_module
Bazel rules for handling SEOOC (Safety Element Out Of Context) modules.

Key additions:
- Core rules in score_module.bzl and private/seooc.bzl
- Test infrastructure with fixtures covering architecture design,
    assumptions of use, component requirements, and safety analysis
Copy link
Member

@AlexanderLanin AlexanderLanin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good start! I feel using baselibs as an example is not ideal. We should try to apply this to a component that has existing documentation.

safety_element_out_of_context(
name = "my_module",
assumptions_of_use = ":assumptions",
component_requirements = ":requirements",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be seooc_requirements... but since seeoc is redundant we can also just say requirements? But that again is confusing. Is it maybe assumed requirements? Or what is it? Probably a question for the process experts :)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO, we have feature requirements and component requirements. Conceptually, its important that these requirements are verified with the targets from tests. So that we can compute a meaningful requirements coverage.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be seooc_requirements... but since seeoc is redundant we can also just say requirements? But that again is confusing. Is it maybe assumed requirements? Or what is it? Probably a question for the process experts :)

Process defines assumptions of use and requirementes, e.g.Platform
https://eclipse-score.github.io/score/main/requirements/index.html


- ``name``: The name of the safety element module. Used as the base name
for all generated targets.
- ``assumptions_of_use``: Label to a ``.rst`` or ``.md`` file containing the
Copy link
Member

@AlexanderLanin AlexanderLanin Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I imagine that this may not be a single file. And what exactly is a file here? filegroup?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Valid point. Technically it can be anything which returns a SphinxDocsLibraryProvider, which of course can contain rst, md, svg files etc.

safety analysis, including FMEA, FMEDA, FTA, or other safety analysis
results as required by ISO 26262-9 clause 8. Documents hazard analysis and
safety measures.
- ``implementations``: List of labels to Bazel targets representing the actual
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bazel targets would be treated as transitive?! So why do we even need multiple labels here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. We could hide this behind a single target. But this is what the rule already does. The idea was a different one: Behind each of these targets is an api, provided to the user. E.g. the hdrs attribute of a cc_library provide the header files published by that library. We should also use this information to enhance the documentation with API docs generated from the code.

software implementation (cc_library, cc_binary, etc.) that realizes the
component requirements. This is the source code that implements the safety
functions as required by ISO 26262-6 clause 8.
- ``tests``: List of labels to Bazel test targets (cc_test, py_test, etc.)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remark for the future: we'll need to split this to slow tests and fast tests, or the old unit test and integration test split.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. But then we should differentiate between "integration tests" and "unit tests" according to the test lavels.


**Generated Targets:**

This macro creates multiple targets automatically:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are all docu related. Where are implementation and tests?

- ``assumptions_of_use``: Label to a ``.rst`` or ``.md`` file containing the
Assumptions of Use, which define the safety-relevant operating conditions
and constraints for the SEooC as required by ISO 26262-10 clause 5.4.4.
- ``component_requirements``: Label to a ``.rst`` or ``.md`` file containing
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SEOOC would contain only safety requirements AFAIK. Do we want to include all requirements here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. A limitation to safety requirements does not make sense. The safety_element_out_of_context shall be a self contained unit.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to avoid here misunderstanding, Process covers NOT only Safety, also QM and Security, and we define here Modules, containing everything, Module can be seen as SEooC, but compare Handbook and Safety Plan, we do not deliver SEooC, there will be no safey argumentation, integrator can take it to make a SEooC out it.

https://eclipse-score.github.io/process_description/main/general_concepts/score_building_blocks_concept.html
https://eclipse-score.github.io/process_description/main/general_concepts/score_building_blocks_concept.html
https://eclipse-score.github.io/process_description/main/process_areas/safety_management/safety_management_workproducts.html#wp__platform_safety_package

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the basic naming is wrong here? It should not be "safety_element_out_of_context" but just "score_module"?

"assumptions_of_use": attr.label(
providers = [SphinxDocsLibraryInfo],
mandatory = True,
doc = "Label to a sphinx_docs_library target containing the Assumptions of Use, which define the safety-relevant operating conditions and constraints for the SEooC as required by ISO 26262-10 clause 5.4.4.",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, this doesn't quite match docu where it says this needs to point to an rst/md file.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair. the documentation needs to be updated.

all_files = []
for artifact in seooc_artifacts:
dep = getattr(ctx.attr, artifact)
for t in dep[SphinxDocsLibraryInfo].transitive.to_list():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assembles all the artifacts into a standard file structure. So I have wo wonder, whether it would be easier to collect only a single SphinxDocsLibraryInfo, instead of collecting multiple and internally assembling a single one.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes. This is intenionally like this. The rule shall provide an abstract api, which always provides you a valid SpinxDocsLibrary.

mandatory = True,
doc = "Label to a sphinx_docs_library target containing the safety analysis, including FMEA, FMEDA, FTA, or other safety analysis results as required by ISO 26262-9 clause 8. Documents hazard analysis and safety measures.",
),
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having everything in separate SphinxDocsLibraryInfo targets means the generated index file will differ from the original index file. So module docu will look different than seeoc docu of the same module. Correct?

package(default_visibility = ["//visibility:public"])

# Test fixtures for seooc tests
sphinx_docs_library(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would currently only provide the raw .rst files? Specifically no prebuild json data?

Copy link
Author

@ramceb ramceb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good start! I feel using baselibs as an example is not ideal. We should try to apply this to a component that has existing documentation.

Thx. Baselibs was chosen on purpose as it provides several seoocs. Anyhow, we can also use any other module, which comes with more documentation in the module repository. Any suggestions?

@masc2023
Copy link

Very good start! I feel using baselibs as an example is not ideal. We should try to apply this to a component that has existing documentation.

Thx. Baselibs was chosen on purpose as it provides several seoocs. Anyhow, we can also use any other module, which comes with more documentation in the module repository. Any suggestions?

Persistency?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Draft

Development

Successfully merging this pull request may close these issues.

4 participants