From 5f47fe63fe0168d745a442c83483fb0d2c1c3d1e Mon Sep 17 00:00:00 2001 From: "jhr2hi@bosch.com" Date: Tue, 28 Jul 2026 10:52:00 +0200 Subject: [PATCH 1/4] change mandatory to optional links --- src/extensions/score_metamodel/metamodel.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/extensions/score_metamodel/metamodel.yaml b/src/extensions/score_metamodel/metamodel.yaml index 9a6deb4ad..1177226c2 100644 --- a/src/extensions/score_metamodel/metamodel.yaml +++ b/src/extensions/score_metamodel/metamodel.yaml @@ -430,10 +430,11 @@ needs_types: mandatory_links: # req-Id: tool_req__docs_arch_links includes: logic_arc_int, logic_arc_int_op - # req-Id: tool_req__docs_arch_link_fulfils, tool_req__docs_arch_link_fulfils_aou - fulfils: feat_req, aou_req # req-Id: tool_req__docs_arch_links belongs_to: feat # make it mandatory for evaluation + optional_links: + # req-Id: tool_req__docs_arch_link_fulfils, tool_req__docs_arch_link_fulfils_aou + fulfils: feat_req, aou_req tags: - architecture_element - architecture_view @@ -589,10 +590,10 @@ needs_types: mandatory_links: # req-Id: tool_req__docs_arch_links belongs_to: comp - # req-Id: tool_req__docs_arch_link_fulfils, tool_req__docs_arch_link_fulfils_aou - fulfils: comp_req, aou_req optional_links: uses: logic_arc_int, real_arc_int_op + # req-Id: tool_req__docs_arch_link_fulfils, tool_req__docs_arch_link_fulfils_aou + fulfils: comp_req, aou_req tags: - architecture_view parts: 3 From ce38c533eb407e6a3404408f6fb6b860ce3cfeac Mon Sep 17 00:00:00 2001 From: "jhr2hi@bosch.com" Date: Wed, 29 Jul 2026 07:36:27 +0200 Subject: [PATCH 2/4] fix review findings --- docs/internals/requirements/requirements.rst | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/docs/internals/requirements/requirements.rst b/docs/internals/requirements/requirements.rst index a49df7bf4..257cca2de 100644 --- a/docs/internals/requirements/requirements.rst +++ b/docs/internals/requirements/requirements.rst @@ -546,11 +546,11 @@ Architecture Attributes 🔗 Linkage ------------------------ -.. tool_req:: Mandatory Architecture Attribute: fulfils +.. tool_req:: Architecture fulfils linkage rules :id: tool_req__docs_arch_link_fulfils :tags: Architecture :implemented: YES - :version: 2 + :version: 3 :satisfies: gd_req__arch_linkage_requirement_type[version==1], gd_req__arch_attr_fulfils[version==1], @@ -558,7 +558,9 @@ Architecture Attributes gd_req__req_linkage_fulfill[version==1], :parent_covered: YES - Docs-as-Code shall enforce that linking via the ``fulfils`` attribute follows defined rules. + Docs-as-Code shall permit the ``fulfils`` attribute to be omitted for feat_arc_sta and + comp_arc_sta. When ``fulfils`` is present, Docs-as-Code shall enforce that linking via + the ``fulfils`` attribute follows defined rules. Allowed source and target combinations are defined in the following table: @@ -579,12 +581,13 @@ Architecture Attributes .. tool_req:: Architecture fulfils linkage to AoU :id: tool_req__docs_arch_link_fulfils_aou :implemented: YES - :version: 1 + :version: 2 :satisfies: gd_req__arch_attr_fulfils_aou[version==1] :parent_covered: YES Architectural static views (feat_arc_sta, comp_arc_sta) - link to Assumptions of Use (aou_req) via the ``fulfils`` attribute. + may link to Assumptions of Use (aou_req) via the ``fulfils`` attribute. + When such a link is present, Docs-as-Code shall restrict its target to aou_req. .. tool_req:: Check Architecture linkage to AoU :id: tool_req__docs_arch_link_aou_check From 8590090e4e7dc510f5c3283936a345b854a7b866 Mon Sep 17 00:00:00 2001 From: "jhr2hi@bosch.com" Date: Wed, 29 Jul 2026 11:06:44 +0200 Subject: [PATCH 3/4] extent table with link type --- docs/internals/requirements/requirements.rst | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/internals/requirements/requirements.rst b/docs/internals/requirements/requirements.rst index 257cca2de..db7bbb620 100644 --- a/docs/internals/requirements/requirements.rst +++ b/docs/internals/requirements/requirements.rst @@ -567,16 +567,16 @@ Architecture Attributes .. table:: :widths: auto - ==================================== ========================================== - Link Source Allowed Link Target - ==================================== ========================================== - feat_arc_sta feat_req, aou_req - feat_arc_dyn feat_req - logic_arc_int feat_req - comp_arc_sta comp_req, aou_req - comp_arc_dyn comp_req - real_arc_int comp_req - ==================================== ========================================== + ==================================== ========================================== ============== + Link Source Allowed Link Target Optional/Mandatory + ==================================== ========================================== ============== + feat_arc_sta feat_req, aou_req Optional + feat_arc_dyn feat_req Mandatory + logic_arc_int feat_req Mandatory + comp_arc_sta comp_req, aou_req Optional + comp_arc_dyn comp_req Mandatory + real_arc_int comp_req Mandatory + ==================================== ========================================== ============== .. tool_req:: Architecture fulfils linkage to AoU :id: tool_req__docs_arch_link_fulfils_aou From c07e9cfe7b201472a01f089dd153cf70a9a3f36e Mon Sep 17 00:00:00 2001 From: "jhr2hi@bosch.com" Date: Wed, 29 Jul 2026 12:52:38 +0200 Subject: [PATCH 4/4] Address review: reword fulfils rule and add optional-link tests - Reword tool_req__docs_arch_link_fulfils per review (allow/enforce wording) - Mark all architecture fulfils links as optional in metamodel - Add tests for unlinked static view (accepted) and invalid fulfils target (rejected) --- docs/internals/requirements/requirements.rst | 21 ++++++++-------- src/extensions/score_metamodel/metamodel.yaml | 10 +++++--- .../rst/options/test_options_options.rst | 25 +++++++++++++++++++ 3 files changed, 42 insertions(+), 14 deletions(-) diff --git a/docs/internals/requirements/requirements.rst b/docs/internals/requirements/requirements.rst index db7bbb620..30098606d 100644 --- a/docs/internals/requirements/requirements.rst +++ b/docs/internals/requirements/requirements.rst @@ -558,9 +558,8 @@ Architecture Attributes gd_req__req_linkage_fulfill[version==1], :parent_covered: YES - Docs-as-Code shall permit the ``fulfils`` attribute to be omitted for feat_arc_sta and - comp_arc_sta. When ``fulfils`` is present, Docs-as-Code shall enforce that linking via - the ``fulfils`` attribute follows defined rules. + Docs-as-Code shall allow or enforce where necessary that linking via the ``fulfils`` + attribute follows the defined rules. Allowed source and target combinations are defined in the following table: @@ -570,22 +569,22 @@ Architecture Attributes ==================================== ========================================== ============== Link Source Allowed Link Target Optional/Mandatory ==================================== ========================================== ============== - feat_arc_sta feat_req, aou_req Optional - feat_arc_dyn feat_req Mandatory - logic_arc_int feat_req Mandatory - comp_arc_sta comp_req, aou_req Optional - comp_arc_dyn comp_req Mandatory - real_arc_int comp_req Mandatory + feat_arc_sta feat_req Optional + feat_arc_dyn feat_req Optional + logic_arc_int feat_req Optional + comp_arc_sta comp_req Optional + comp_arc_dyn comp_req Optional + real_arc_int comp_req Optional ==================================== ========================================== ============== .. tool_req:: Architecture fulfils linkage to AoU :id: tool_req__docs_arch_link_fulfils_aou :implemented: YES - :version: 2 + :version: 3 :satisfies: gd_req__arch_attr_fulfils_aou[version==1] :parent_covered: YES - Architectural static views (feat_arc_sta, comp_arc_sta) + Architectural static views (feat_arc_sta) and the component itself (comp) may link to Assumptions of Use (aou_req) via the ``fulfils`` attribute. When such a link is present, Docs-as-Code shall restrict its target to aou_req. diff --git a/src/extensions/score_metamodel/metamodel.yaml b/src/extensions/score_metamodel/metamodel.yaml index 1177226c2..25257106d 100644 --- a/src/extensions/score_metamodel/metamodel.yaml +++ b/src/extensions/score_metamodel/metamodel.yaml @@ -454,9 +454,11 @@ needs_types: # req-Id: tool_req__docs_common_attr_status status: ^(valid|invalid)$ mandatory_links: - fulfils: feat_req # req-Id: tool_req__docs_arch_links belongs_to: feat + optional_links: + # req-Id: tool_req__docs_arch_link_fulfils + fulfils: feat_req tags: - architecture_view - architecture_element @@ -562,7 +564,6 @@ needs_types: safety: ^(QM|ASIL_B)$ # req-Id: tool_req__docs_common_attr_status status: ^(valid|invalid)$ - mandatory_links: belongs_to: feat # preparation for linking change according to DR-005 optional_links: @@ -570,6 +571,8 @@ needs_types: implements: logic_arc_int, real_arc_int_op uses: logic_arc_int, real_arc_int_op consists_of: comp + # tool_req__docs_arch_link_fulfils_aou + fulfils: aou_req tags: - architecture_element parts: 2 @@ -593,7 +596,7 @@ needs_types: optional_links: uses: logic_arc_int, real_arc_int_op # req-Id: tool_req__docs_arch_link_fulfils, tool_req__docs_arch_link_fulfils_aou - fulfils: comp_req, aou_req + fulfils: comp_req tags: - architecture_view parts: 3 @@ -614,6 +617,7 @@ needs_types: mandatory_links: # req-Id: tool_req__docs_arch_links belongs_to: comp + optional_links: fulfils: comp_req tags: - architecture_view diff --git a/src/extensions/score_metamodel/tests/rst/options/test_options_options.rst b/src/extensions/score_metamodel/tests/rst/options/test_options_options.rst index 576c6e19c..d2b345203 100644 --- a/src/extensions/score_metamodel/tests/rst/options/test_options_options.rst +++ b/src/extensions/score_metamodel/tests/rst/options/test_options_options.rst @@ -223,6 +223,31 @@ --- feat_saf_fmea violates end --- +--- arch fulfils optional begin --- + +.. Positive Test: fulfils is optional for static views, an unlinked feat_arc_sta is accepted. + +.. feat_arc_sta:: Static view without fulfils + :id: feat_arc_sta__fulfils__optional + :status: valid + :safety: ASIL_B + :security: YES + :expect_not: is missing required link: `fulfils` + + +.. Negative Test: when fulfils is present, its target type is still restricted. + +.. feat_arc_sta:: Static view with invalid fulfils target + :id: feat_arc_sta__fulfils__bad_target + :status: valid + :safety: ASIL_B + :security: YES + :fulfils: comp_req__child__ASIL_B + :expect: feat_arc_sta__fulfils__bad_target: references 'comp_req__child__ASIL_B' as 'fulfils', but it must reference Feature Requirement (feat_req) or Assumption of Use Requirement (aou_req). + +--- arch fulfils optional end --- + + .. Tests if the attribute `safety` follows the pattern `^(QM|ASIL_B)$` .. document:: This is a test document