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
1 change: 1 addition & 0 deletions bazel/rules/rules_score/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ py_binary(
visibility = ["//visibility:public"],
deps = [
requirement("pyyaml"),
"@lobster//lobster/common",
],
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ section "Tool Requirements" {
The dependable_element rule shall automatically include lobster
traceability entries for all assumptions of use defined by its
direct dependencies in the dependee's traceability report as
a "Forwarded AoUs" tier.
a "Received AoUs" tier.
'''
mitigates = [AoU_Silently_Dropped]
derived_from = [Forward_AoU_To_Dependees]
Expand Down Expand Up @@ -162,12 +162,30 @@ section "Tool Requirements" {
satisfied_by = Tools.Bazel
}

ToolQualification.ToolRequirement Cover_Received_AoU_Via_Component_Requirement {
description = '''
The CompReq requirement type shall support an optional
derived_from_aou field: a free-text list of AoU identifiers
(no cross-module TRLC reference) that this component
requirement implements. The dependable_element rule shall
convert this field to lobster trace references resolved
against the "Received AoUs" tier, so a component requirement
can cover a received AoU it handles locally without requiring
that AoU to be chain-forwarded.
'''
mitigates = [AoU_Silently_Dropped]
derived_from = [Forward_AoU_To_Dependees, Gate_Traceability_At_Test_Time]
satisfied_by = Tools.Lobster
}

ToolQualification.ToolRequirement Include_Forwarded_AoUs_In_Traceability {
description = '''
The lobster traceability report of a dependee shall include
forwarded AoUs as traceable items so that the existing
lobster-ci-report test fails when forwarded AoUs are not
handled (linked to a requirement, test, or justification).
The lobster traceability report of a dependable element shall
require every item in its "Received AoUs" tier to be covered
by at least one of: a component requirement (via
derived_from_aou) or a chain-forwarding entry (via
aou_forwarding), so that the existing lobster-ci-report test
fails when a received AoU is neither handled nor forwarded.
'''
mitigates = [AoU_Silently_Dropped]
derived_from = [Forward_AoU_To_Dependees, Gate_Traceability_At_Test_Time]
Expand Down
8 changes: 8 additions & 0 deletions bazel/rules/rules_score/docs/rule_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,14 @@ testable within that component.

**Generated targets:** ``<name>`` (documentation), ``<name>_test`` (TRLC validation)

A ``CompReq`` record may also set ``derived_from_aou``, a free-text list of
identifiers (``PackageName.RecordName``, no ``@version``) naming AoUs
received by the enclosing ``dependable_element`` that this requirement
implements. Unlike ``derived_from``, this is a plain string field (no TRLC
cross-module reference), matched by name against received AoUs at the
``dependable_element`` lobster-report level — see
:doc:`user_guide/assumptions_of_use`.

.. _rule-assumptions-of-use:

assumptions_of_use
Expand Down
51 changes: 42 additions & 9 deletions bazel/rules/rules_score/docs/user_guide/assumptions_of_use.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ or risk that is mitigated when this assumption is fulfilled.

Traceability to requirements is established at the Bazel level via the ``deps``
attribute on the ``assumptions_of_use`` rule — there is no TRLC ``derived_from``
or ``satisfies`` field on ``AoU``.
or ``satisfies`` field on ``AoU`` itself. A dependent component requirement can,
however, declare that it implements a received AoU via ``derived_from_aou``
(see `AoU Forwarding`_ below).

.. code-block:: text
:caption: examples/seooc/docs/aous.trlc
Expand Down Expand Up @@ -83,15 +85,45 @@ is forwarded rather than handled locally:
calls to the library do not exceed the 10ms cycle time constraint
imposed by the underlying other_seooc dependency.

**Handling forwarded AoUs in the dependee**
Forwarded AoUs appear as a "Forwarded AoUs" tier in the dependee's lobster
traceability report. The dependee must handle each forwarded AoU by one of:
**Handling AoUs received in the dependee**
Every AoU a dependable element receives (own AoUs forwarded automatically from
a dependency, plus anything that dependency itself chain-forwarded) appears as
an item in a "Received AoUs" tier in the dependee's lobster traceability
report. Each received AoU must be covered by exactly one of:

- Linking it to a component requirement that addresses the assumption
- Linking it to a test that verifies the assumption is met
- Chain-forwarding it further (with justification) to its own dependees
- **Handling it locally**: a component requirement's ``derived_from_aou`` field
names the AoU it implements (see below). This shows up as "Component
Requirements" coverage in the report.
- **Chain-forwarding it further** (with justification) via ``aou_forwarding``,
to be handled by this element's own dependees instead. This shows up as
"Forwarded AoUs" coverage in the report.

If a forwarded AoU is not handled, the ``bazel test`` traceability check will fail.
If a received AoU is neither handled nor forwarded, the ``bazel test``
traceability check fails (in ``maturity = "release"``; in
``maturity = "development"`` it is only reported as a warning).

**Handling a received AoU with a component requirement**
Add the AoU's identifier (``PackageName.RecordName``, matching the name used
in the upstream ``AoU`` TRLC record, without ``@version``) to the
``derived_from_aou`` field of the ``CompReq`` that implements it:

.. code-block:: text
:caption: examples/integrator/docs/requirements/component_requirements.trlc

ScoreReq.CompReq COMP_INT_001 {
description = "The startup module shall call the SEooC initialization routine before entering the main loop"
safety = ScoreReq.Asil.B
derived_from = [Integrator.FEAT_INT_001@1]
derived_from_aou = ["SampleType.SampleAoU"]
version = 1
}

``derived_from_aou`` is a plain free-text field (not a TRLC cross-module
reference), so no ``import`` of the upstream AoU's package is needed. It is
converted directly to a lobster trace reference and matched, by name, against
the AoUs this dependable element actually receives -- a typo or an AoU that is
not actually received will fail the build with an "unknown tracing target"
error rather than silently doing nothing.

**Example: three-level forwarding chain** (the real working code for this
example lives in ``examples/some_other_library``, ``examples/seooc``, and
Expand All @@ -105,7 +137,8 @@ example lives in ``examples/some_other_library``, ``examples/seooc``, and
→ chain-forwards received TimingConstraint via aou_forwarding.yaml
↑ (deps)
integrator_seooc → receives SampleType.SampleAoU (auto-forwarded)
and OtherLibrary.TimingConstraint (chain-forwarded), must handle both
and OtherLibrary.TimingConstraint (chain-forwarded)
→ handles both locally via derived_from_aou (no further dependees)

.. code-block:: starlark
:caption: examples/seooc/BUILD
Expand Down
12 changes: 8 additions & 4 deletions bazel/rules/rules_score/examples/integrator/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
#
# Example: System integrator SEooC that depends on safety_software_seooc_example.
#
# This illustrates the full AoU forwarding chain:
# This illustrates the full AoU forwarding chain, and the two ways a
# dependable element can cover an AoU it receives:
#
# other_seooc defines AoU: OtherLibrary.TimingConstraint
# ↑ (deps)
Expand All @@ -22,9 +23,9 @@
# - chain-forwards OtherLibrary.TimingConstraint via aou_forwarding.yaml
# ↑ (deps)
# integrator_seooc (this target)
# - receives SampleType.SampleAoU (auto-forwarded from seooc)
# - receives OtherLibrary.TimingConstraint (chain-forwarded through seooc)
# - must handle both in its lobster traceability report
# - receives SampleType.SampleAoU (auto-forwarded from seooc)
# - receives OtherLibrary.TimingConstraint (chain-forwarded through seooc)
# - HANDLES both locally: COMP_INT_001 and COMP_INT_002
#

load(
Expand Down Expand Up @@ -71,6 +72,9 @@ component(
# receives all forwarded AoUs:
# - SampleType.SampleAoU (auto-forwarded, own AoU of seooc)
# - OtherLibrary.TimingConstraint (chain-forwarded from other_seooc through seooc)
# Both are handled locally via `derived_from_aou` on component requirements
# (see docs/requirements/component_requirements.trlc); no further
# aou_forwarding.yaml is needed here.

dependable_element(
name = "integrator_seooc",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@ ScoreReq.CompReq COMP_INT_001 {
description = "The startup module shall call the SEooC initialization routine before entering the main loop"
safety = ScoreReq.Asil.B
derived_from = [Integrator.FEAT_INT_001@1]
derived_from_aou = ["SampleType.SampleAoU"]
version = 1
}

ScoreReq.CompReq COMP_INT_002 {
description = "The cyclic task shall invoke the validation interface every 10ms using a hardware timer interrupt"
description = "The cyclic task shall invoke the validation interface every 10ms using a hardware timer interrupt, satisfying the underlying library's timing constraint"
safety = ScoreReq.Asil.B
derived_from = [Integrator.FEAT_INT_002@1]
derived_from_aou = ["OtherLibrary.TimingConstraint"]
version = 1
}

Expand Down
6 changes: 0 additions & 6 deletions bazel/rules/rules_score/lobster/config/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,6 @@ filegroup(
# for source file lists. Used by rules_score to generate per-target configs
# via ctx.actions.expand_template() — only the source paths vary.
# ---------------------------------------------------------------------------
filegroup(
name = "lobster_component_template",
srcs = ["lobster_component.conf.tpl"],
visibility = ["//visibility:public"],
)

filegroup(
name = "lobster_de_template",
srcs = ["lobster_de.conf.tpl"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ conversion-rules:
description-fields: description
tags:
- derived_from
- derived_from_aou

This file was deleted.

2 changes: 2 additions & 0 deletions bazel/rules/rules_score/lobster/config/lobster_de.conf.tpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{FEAT_REQ_BLOCK}

{RECEIVED_AOU_BLOCK}

{FORWARDED_AOU_BLOCK}

{COMP_REQ_BLOCK}
Expand Down
Loading
Loading