Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
11 changes: 11 additions & 0 deletions docs/internals/requirements/requirements.rst
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,17 @@ 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 belongs_to a safety parent
:id: tool_req__docs_arch_link_safety_belongs_to
: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 link only
to ASIL architecture elements via ``belongs_to``.

.. tool_req:: Security: Restrict linkage
:id: tool_req__docs_arch_link_security
:tags: Architecture
Expand Down
12 changes: 12 additions & 0 deletions src/extensions/score_metamodel/metamodel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1026,6 +1026,18 @@ graph_checks:
fulfils: safety != QM
explanation: An QM architecture element cannot implement ASIL requirements.

# req-Id: tool_req__docs_arch_link_safety_belongs_to
tool_req__docs_arch_link_safety_belongs_to:
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:
belongs_to: safety != QM
explanation: Safety architecture views must belong to safety 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,96 @@
..
# *******************************************************************************
# Copyright (c) 2025 Contributors to the Eclipse Foundation
Comment thread
a-zw marked this conversation as resolved.
Outdated
#
# 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:: QM Feature Parent
:id: feat__test__qm_parent
:safety: QM
:security: NO
:status: valid

.. feat:: Safety Feature Parent
:id: feat__test__asil_parent
:safety: ASIL_B
:security: NO
:status: valid

.. comp:: QM Component Parent
:id: comp__test__qm_parent
:safety: QM
:security: NO
:status: valid
:belongs_to: feat__test__qm_parent

.. comp:: Safety Component Parent
:id: comp__test__asil_parent
:safety: ASIL_B
:security: NO
:status: valid
:belongs_to: feat__test__asil_parent


.. Negative Test: Safety feat_arc_sta belongs_to a QM feat β€” should warn.
#EXPECT: feat_arc_sta__test__safety_to_qm: Parent need `feat__test__qm_parent` does not fulfill condition `safety != QM`.
Comment thread
MaximilianSoerenPollak marked this conversation as resolved.
Outdated

.. 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
:belongs_to: feat__test__qm_parent


.. Positive Test: Safety feat_arc_sta belongs_to a safety feat β€” should not warn.
#EXPECT-NOT: Safety architecture views must belong to safety architecture elements

.. feat_arc_sta:: Safety view with safety parent
:id: feat_arc_sta__test__safety_to_asil
:safety: ASIL_B
:security: NO
:status: valid
:belongs_to: feat__test__asil_parent


.. Positive Test: QM feat_arc_sta β€” check does not apply to QM elements.
#EXPECT-NOT: Safety architecture views must belong to safety architecture elements

.. feat_arc_sta:: QM view with QM parent
:id: feat_arc_sta__test__qm_to_qm
:safety: QM
:security: NO
:status: valid
:belongs_to: feat__test__qm_parent


.. Negative Test: Safety comp_arc_sta belongs_to a QM comp β€” should warn.
#EXPECT: comp_arc_sta__test__safety_to_qm: Parent need `comp__test__qm_parent` does not fulfill condition `safety != QM`.

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


.. Positive Test: Safety comp_arc_sta belongs_to a safety comp β€” should not warn.
#EXPECT-NOT: Safety architecture views must belong to safety architecture elements

.. comp_arc_sta:: Safety component view with safety parent
:id: comp_arc_sta__test__safety_to_asil
:safety: ASIL_B
:security: NO
:status: valid
:belongs_to: comp__test__asil_parent
Loading