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
14 changes: 13 additions & 1 deletion docs/internals/requirements/requirements.rst
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,18 @@ Architecture Attributes
Docs-as-Code shall enforce that valid safety architectural elements (Safety != QM) can
only be linked against valid safety architectural elements.

.. tool_req:: Check safety architecture view fulfils only safety requirements
:id: tool_req__docs_arch_link_safety_fulfils
:tags: Architecture
:implemented: YES
:version: 1
:satisfies: gd_req__arch_linkage_safety
Comment thread
a-zw marked this conversation as resolved.
:parent_covered: YES

Enforce that valid ASIL architecture views
(``feat_arc_sta``, ``feat_arc_dyn``, ``comp_arc_sta``, ``comp_arc_dyn``)
"fulfil" only ASIL requirements.
Comment on lines +718 to +728
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we not already have a requirement that does this?
This one here

Also this should be filtered against VALID only no?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Tricky question. We don't have check that in other cases. Any mandatory link may go an invalid item.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We do have this check here:

https://github.com/eclipse-score/docs-as-code/blob/main/src/extensions/score_metamodel/checks/graph_checks.py#L205-L230

i have to ask where the process requirement for this is again.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I believe need._links.values() in graph_checks already covers all attributes including fulfil? That would imply we don't have to check it here again.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe it's better to extend tool_req__docs_req_arch_link_safety_to_arch to cover all architecture elements AND views? Otherwise it feels like we spread the same requirement to multiple requirements.


.. tool_req:: Security: Restrict linkage
:id: tool_req__docs_arch_link_security
:tags: Architecture
Expand All @@ -739,7 +751,7 @@ Architecture Attributes
gd_req__arch_viewpoints,
:parent_covered: YES

Docs-as-Code shall enable the rendering of diagrams for the following architecture views:
Enable the rendering of diagrams for the following architecture views:

* Feature Package Diagram (feat_arc_sta)
* Feature Sequence Diagram (feat_arc_dyn)
Expand Down
14 changes: 13 additions & 1 deletion src/extensions/score_metamodel/metamodel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1023,9 +1023,21 @@ graph_checks:
include: feat_arc_sta, logic_arc_int, logic_arc_int_op, comp_arc_sta, real_arc_int, real_arc_int_op
condition: safety == QM
check:
fulfils: safety != QM
fulfils: safety == QM
explanation: An QM architecture element cannot implement ASIL requirements.

# req-Id: tool_req__docs_arch_link_safety_fulfils
tool_req__docs_arch_link_safety_fulfils:
needs:
include: feat_arc_sta, feat_arc_dyn, comp_arc_sta, comp_arc_dyn
Comment thread
a-zw marked this conversation as resolved.
condition:
and:
- safety != QM
- status == valid
check:
fulfils: safety != QM
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This has to be status == valid too.
Otherwise we would be checking also when we link against invalid requirements ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Same as the other comment: We don't require that for other links.

explanation: Safety-critical architecture views must only "fulfil" safety-critical architecture elements.

# req-Id: tool_req__docs_req_arch_link_safety_to_arch
tool_req__docs_req_arch_link_safety_to_arch:
needs:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
..
# *******************************************************************************
# 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
# *******************************************************************************

#CHECK: check_metamodel_graph

.. feat_req:: QM Feature Requirement Parent
:id: feat_req__test__qm_parent
:safety: QM
:status: valid

.. feat_req:: Safety Feature Requirement Parent
:id: feat_req__test__asil_parent
:safety: ASIL_B
:status: valid

.. comp_req:: QM Component Requirement Parent
:id: comp_req__test__qm_parent
:safety: QM
:status: valid

.. comp_req:: Safety Component Requirement Parent
:id: comp_req__test__asil_parent
:safety: ASIL_B
:status: valid


.. Negative Test: Safety feat_arc_sta fulfils a QM feat_req β€” should warn.
#EXPECT: feat_arc_sta__test__safety_to_qm: Parent need `feat_req__test__qm_parent` does not fulfill condition `safety != QM`.
Comment thread
AlexanderLanin marked this conversation as resolved.

.. feat_arc_sta:: Safety view with QM parent
:id: feat_arc_sta__test__safety_to_qm
Comment thread
a-zw marked this conversation as resolved.
:safety: ASIL_B
:security: NO
:status: valid
:fulfils: feat_req__test__qm_parent


.. Positive Test: Safety feat_arc_sta fulfils a safety feat_req β€” should not warn.
#EXPECT-NOT: fulfil

.. feat_arc_sta:: Safety view with safety parent
:id: feat_arc_sta__test__safety_to_asil
:safety: ASIL_B
:security: NO
:status: valid
:fulfils: feat_req__test__asil_parent


.. Positive Test: QM feat_arc_sta β€” check does not apply to QM elements.
#EXPECT-NOT: fulfil

.. feat_arc_sta:: QM view with QM parent
:id: feat_arc_sta__test__qm_to_qm
:safety: QM
:security: NO
:status: valid
:fulfils: feat_req__test__qm_parent


.. Negative Test: Safety feat_arc_dyn fulfils a QM feat_req β€” should warn.
#EXPECT: feat_arc_dyn__test__safety_to_qm: Parent need `feat_req__test__qm_parent` does not fulfill condition `safety != QM`.
Comment thread
a-zw marked this conversation as resolved.

.. feat_arc_dyn:: Safety dynamic view with QM parent
:id: feat_arc_dyn__test__safety_to_qm
:safety: ASIL_B
:security: NO
:status: valid
:fulfils: feat_req__test__qm_parent


.. Positive Test: Safety feat_arc_dyn fulfils a safety feat_req β€” should not warn.
#EXPECT-NOT: fulfil

.. feat_arc_dyn:: Safety dynamic view with safety parent
:id: feat_arc_dyn__test__safety_to_asil
:safety: ASIL_B
:security: NO
:status: valid
:fulfils: feat_req__test__asil_parent


.. Positive Test: QM feat_arc_dyn β€” check does not apply to QM elements.
#EXPECT-NOT: fulfil

.. feat_arc_dyn:: QM dynamic view with QM parent
:id: feat_arc_dyn__test__qm_to_qm
:safety: QM
:security: NO
:status: valid
:fulfils: feat_req__test__qm_parent


.. Negative Test: Safety comp_arc_sta fulfils a QM comp_req β€” should warn.
#EXPECT: comp_arc_sta__test__safety_to_qm: Parent need `comp_req__test__qm_parent` does not fulfill condition `safety != QM`.
Comment thread
a-zw marked this conversation as resolved.

.. comp_arc_sta:: Safety component view with QM parent
:id: comp_arc_sta__test__safety_to_qm
:safety: ASIL_B
:security: NO
:status: valid
:fulfils: comp_req__test__qm_parent


.. Positive Test: Safety comp_arc_sta fulfils a safety comp_req β€” should not warn.
#EXPECT-NOT: fulfil

.. comp_arc_sta:: Safety component view with safety parent
:id: comp_arc_sta__test__safety_to_asil
:safety: ASIL_B
:security: NO
:status: valid
:fulfils: comp_req__test__asil_parent


.. Negative Test: Safety comp_arc_dyn fulfils a QM comp_req β€” should warn.
#EXPECT: comp_arc_dyn__test__safety_to_qm: Parent need `comp_req__test__qm_parent` does not fulfill condition `safety != QM`.
Comment thread
a-zw marked this conversation as resolved.

.. comp_arc_dyn:: Safety dynamic component view with QM parent
:id: comp_arc_dyn__test__safety_to_qm
:safety: ASIL_B
:security: NO
:status: valid
:fulfils: comp_req__test__qm_parent


.. Positive Test: Safety comp_arc_dyn fulfils a safety comp_req β€” should not warn.
#EXPECT-NOT: fulfil

.. comp_arc_dyn:: Safety dynamic component view with safety parent
:id: comp_arc_dyn__test__safety_to_asil
:safety: ASIL_B
:security: NO
:status: valid
:fulfils: comp_req__test__asil_parent
Loading