Skip to content

Commit b122d7c

Browse files
castlerCopilot
andcommitted
[rules score] add integrator example illustrating AoU chain-forwarding
Extend the examples with a three-level forwarding chain: other_seooc (defines TimingConstraint AoU) ↑ deps safety_software_seooc_example (chain-forwards TimingConstraint) ↑ deps integrator_seooc (receives forwarded AoUs, has own feature reqs) - Add AoU TRLC source to other_seooc and wire assumptions_of_use - Add aou_forwarding.yaml to seooc for chain-forwarding - Create integrator_seooc with assumed system requirements and feature requirements demonstrating the dependee's responsibilities Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent ed81b20 commit b122d7c

10 files changed

Lines changed: 306 additions & 2 deletions

File tree

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# *******************************************************************************
2+
# Copyright (c) 2026 Contributors to the Eclipse Foundation
3+
#
4+
# See the NOTICE file(s) distributed with this work for additional
5+
# information regarding copyright ownership.
6+
#
7+
# This program and the accompanying materials are made available under the
8+
# terms of the Apache License Version 2.0 which is available at
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# SPDX-License-Identifier: Apache-2.0
12+
# *******************************************************************************
13+
#
14+
# Example: System integrator SEooC that depends on safety_software_seooc_example.
15+
#
16+
# This illustrates the full AoU forwarding chain:
17+
#
18+
# other_seooc defines AoU: OtherLibrary.TimingConstraint
19+
# ↑ (deps)
20+
# safety_software_seooc_example
21+
# - defines own AoU: SampleType.SampleAoU (auto-forwarded here)
22+
# - chain-forwards OtherLibrary.TimingConstraint via aou_forwarding.yaml
23+
# ↑ (deps)
24+
# integrator_seooc (this target)
25+
# - receives SampleType.SampleAoU (auto-forwarded from seooc)
26+
# - receives OtherLibrary.TimingConstraint (chain-forwarded through seooc)
27+
# - must handle both in its lobster traceability report
28+
#
29+
30+
load(
31+
"//bazel/rules/rules_score:rules_score.bzl",
32+
"architectural_design",
33+
"component",
34+
"dependable_element",
35+
"unit",
36+
)
37+
38+
cc_library(
39+
name = "integrator_lib",
40+
srcs = [],
41+
visibility = ["//visibility:public"],
42+
deps = [
43+
"//bazel/rules/rules_score/examples/seooc:sample_library",
44+
],
45+
)
46+
47+
architectural_design(
48+
name = "integrator_design",
49+
static = ["static_design.puml"],
50+
)
51+
52+
unit(
53+
name = "integrator_unit",
54+
implementation = [":integrator_lib"],
55+
scope = ["//bazel/rules/rules_score/examples/integrator:__pkg__"],
56+
tests = [],
57+
unit_design = [],
58+
)
59+
60+
component(
61+
name = "integrator_component",
62+
components = [":integrator_unit"],
63+
requirements = [
64+
"//bazel/rules/rules_score/examples/seooc/docs/requirements:component_requirements",
65+
],
66+
tags = ["manual"],
67+
tests = [],
68+
)
69+
70+
# The integrator depends on safety_software_seooc_example and therefore
71+
# receives all forwarded AoUs:
72+
# - SampleType.SampleAoU (auto-forwarded, own AoU of seooc)
73+
# - OtherLibrary.TimingConstraint (chain-forwarded from other_seooc through seooc)
74+
dependable_element(
75+
name = "integrator_seooc",
76+
architectural_design = [":integrator_design"],
77+
assumptions_of_use = [],
78+
components = [":integrator_component"],
79+
dependability_analysis = [],
80+
integrity_level = "B",
81+
requirements = [
82+
"//bazel/rules/rules_score/examples/integrator/docs/requirements:feature_requirements",
83+
],
84+
tests = [],
85+
deps = ["//bazel/rules/rules_score/examples/seooc:safety_software_seooc_example"],
86+
)
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# *******************************************************************************
2+
# Copyright (c) 2026 Contributors to the Eclipse Foundation
3+
#
4+
# See the NOTICE file(s) distributed with this work for additional
5+
# information regarding copyright ownership.
6+
#
7+
# This program and the accompanying materials are made available under the
8+
# terms of the Apache License Version 2.0 which is available at
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# SPDX-License-Identifier: Apache-2.0
12+
# *******************************************************************************
13+
14+
load("//bazel/rules/rules_score:rules_score.bzl", "assumed_system_requirements", "feature_requirements")
15+
16+
assumed_system_requirements(
17+
name = "assumed_system_requirements",
18+
srcs = [
19+
"assumed_system_requirements.trlc",
20+
],
21+
visibility = ["//visibility:public"],
22+
)
23+
24+
feature_requirements(
25+
name = "feature_requirements",
26+
srcs = [
27+
"feature_requirements.trlc",
28+
],
29+
visibility = ["//visibility:public"],
30+
deps = [
31+
":assumed_system_requirements",
32+
],
33+
)
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/********************************************************************************
2+
* Copyright (c) 2026 Contributors to the Eclipse Foundation
3+
*
4+
* See the NOTICE file(s) distributed with this work for additional
5+
* information regarding copyright ownership.
6+
*
7+
* This program and the accompanying materials are made available under the
8+
* terms of the Apache License Version 2.0 which is available at
9+
* https://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* SPDX-License-Identifier: Apache-2.0
12+
********************************************************************************/
13+
package Integrator
14+
15+
import ScoreReq
16+
17+
///////////////////////////////
18+
// Assumed System Requirements
19+
// System level requirements for the integrator
20+
///////////////////////////////
21+
22+
ScoreReq.AssumedSystemReq ASR_INT_001 {
23+
description = "The system shall integrate the numeric value management SEooC and invoke its interfaces within real-time constraints"
24+
safety = ScoreReq.Asil.B
25+
version = 1
26+
rationale = "System-level requirement for integrating a safety-qualified SEooC into the target platform"
27+
}
28+
29+
ScoreReq.AssumedSystemReq ASR_INT_002 {
30+
description = "The system shall detect and react to faults reported by integrated SEooC components within a bounded time"
31+
safety = ScoreReq.Asil.B
32+
version = 1
33+
rationale = "System-level requirement for fault handling in a safety-critical integration context"
34+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/********************************************************************************
2+
* Copyright (c) 2026 Contributors to the Eclipse Foundation
3+
*
4+
* See the NOTICE file(s) distributed with this work for additional
5+
* information regarding copyright ownership.
6+
*
7+
* This program and the accompanying materials are made available under the
8+
* terms of the Apache License Version 2.0 which is available at
9+
* https://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* SPDX-License-Identifier: Apache-2.0
12+
********************************************************************************/
13+
package Integrator
14+
15+
import ScoreReq
16+
17+
///////////////////////////////
18+
// Feature Requirements
19+
// Requirements for the system integrator that incorporates safety_software_seooc
20+
///////////////////////////////
21+
22+
ScoreReq.FeatReq FEAT_INT_001 {
23+
description = "The integrator shall initialize the numeric value manager provided by the SEooC within the system startup sequence"
24+
safety = ScoreReq.Asil.B
25+
derived_from = [Integrator.ASR_INT_001@1]
26+
version = 1
27+
}
28+
29+
ScoreReq.FeatReq FEAT_INT_002 {
30+
description = "The integrator shall invoke the validation interface cyclically with a period no greater than 10ms to ensure timely fault detection"
31+
safety = ScoreReq.Asil.B
32+
derived_from = [Integrator.ASR_INT_001@1]
33+
version = 1
34+
}
35+
36+
ScoreReq.FeatReq FEAT_INT_003 {
37+
description = "The integrator shall transition to a safe state within 50ms if the validation interface returns a failure result"
38+
safety = ScoreReq.Asil.B
39+
derived_from = [Integrator.ASR_INT_002@1]
40+
version = 1
41+
}
42+
43+
ScoreReq.FeatReq FEAT_INT_004 {
44+
description = "The integrator shall provide a diagnostic reporting interface that exposes the current health status of all managed SEooC components"
45+
safety = ScoreReq.Asil.B
46+
derived_from = [Integrator.ASR_INT_002@1]
47+
version = 1
48+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
' *******************************************************************************
2+
' Copyright (c) 2026 Contributors to the Eclipse Foundation
3+
'
4+
' See the NOTICE file(s) distributed with this work for additional
5+
' information regarding copyright ownership.
6+
'
7+
' This program and the accompanying materials are made available under the
8+
' terms of the Apache License Version 2.0 which is available at
9+
' https://www.apache.org/licenses/LICENSE-2.0
10+
'
11+
' SPDX-License-Identifier: Apache-2.0
12+
' *******************************************************************************
13+
14+
@startuml
15+
16+
package "Integrator SEooC" as integrator_seooc <<SEooC>> {
17+
component "IntegratorComponent" as integrator_component <<component>> {
18+
component "IntegratorUnit" as integrator_unit <<unit>>
19+
}
20+
}
21+
22+
@enduml

bazel/rules/rules_score/examples/seooc/BUILD

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ dependability_analysis(
5050
dependable_element(
5151
name = "safety_software_seooc_example",
5252
architectural_design = ["//bazel/rules/rules_score/examples/seooc/design:sample_seooc_design"],
53-
assumptions_of_use = [],
53+
assumptions_of_use = ["//bazel/rules/rules_score/examples/seooc/docs:sample_aous"],
5454
components = [":component_example"],
5555
dependability_analysis = [
5656
":sample_dependability_analysis",
@@ -61,4 +61,8 @@ dependable_element(
6161
],
6262
tests = [],
6363
deps = ["//bazel/rules/rules_score/examples/some_other_library:other_seooc"],
64+
# Chain-forward received AoUs that this element cannot handle itself.
65+
# TimingConstraint from other_seooc is forwarded to dependees (integrator).
66+
aou_forwarding = "aou_forwarding.yaml",
67+
visibility = ["//:__subpackages__"],
6468
)
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# *******************************************************************************
2+
# Copyright (c) 2026 Contributors to the Eclipse Foundation
3+
#
4+
# See the NOTICE file(s) distributed with this work for additional
5+
# information regarding copyright ownership.
6+
#
7+
# This program and the accompanying materials are made available under the
8+
# terms of the Apache License Version 2.0 which is available at
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# SPDX-License-Identifier: Apache-2.0
12+
# *******************************************************************************
13+
#
14+
# Chain-forwarding configuration for safety_software_seooc_example.
15+
#
16+
# This SEooC depends on other_seooc (some_other_library) and receives its AoU
17+
# "OtherLibrary.TimingConstraint". Since this element cannot satisfy the timing
18+
# constraint itself (it is a library, not a runtime scheduler), it forwards the
19+
# AoU to its own dependees — the system integrator.
20+
#
21+
forwarded_aous:
22+
- aou_id: "OtherLibrary.TimingConstraint"
23+
justification: >
24+
This SEooC is a library component and has no control over the
25+
invocation cycle time. The system integrator must ensure that calls
26+
to the library do not exceed the 10ms cycle time constraint imposed
27+
by the underlying other_seooc dependency.

bazel/rules/rules_score/examples/seooc/docs/BUILD

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
# SPDX-License-Identifier: Apache-2.0
1212
# *******************************************************************************
1313
load("@trlc//:trlc.bzl", "trlc_requirements", "trlc_requirements_test")
14+
load(
15+
"//bazel/rules/rules_score:rules_score.bzl",
16+
"assumptions_of_use",
17+
)
1418

1519
trlc_requirements(
1620
name = "aous",
@@ -23,6 +27,12 @@ trlc_requirements(
2327
visibility = ["//visibility:public"],
2428
)
2529

30+
assumptions_of_use(
31+
name = "sample_aous",
32+
srcs = [":aous"],
33+
visibility = ["//visibility:public"],
34+
)
35+
2636
trlc_requirements_test(
2737
name = "aous_test",
2838
reqs = [

bazel/rules/rules_score/examples/some_other_library/BUILD

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@
1010
#
1111
# SPDX-License-Identifier: Apache-2.0
1212
# *******************************************************************************
13+
load("@trlc//:trlc.bzl", "trlc_requirements")
1314
load(
1415
"//bazel/rules/rules_score:rules_score.bzl",
1516
"architectural_design",
17+
"assumptions_of_use",
1618
"component",
1719
"dependable_element",
1820
"unit",
@@ -25,6 +27,17 @@ architectural_design(
2527
],
2628
)
2729

30+
trlc_requirements(
31+
name = "aous_trlc",
32+
srcs = ["aous.trlc"],
33+
spec = ["@score_tooling//bazel/rules/rules_score/trlc/config:score_requirements_model"],
34+
)
35+
36+
assumptions_of_use(
37+
name = "other_library_aous",
38+
srcs = [":aous_trlc"],
39+
)
40+
2841
unit(
2942
name = "abc",
3043
scope = ["//bazel/rules/rules_score/examples/some_other_library:__pkg__"],
@@ -48,7 +61,7 @@ component(
4861
dependable_element(
4962
name = "other_seooc",
5063
architectural_design = [":sample_seooc_design"],
51-
assumptions_of_use = [],
64+
assumptions_of_use = [":other_library_aous"],
5265
components = [":component_example"],
5366
dependability_analysis = [],
5467
integrity_level = "D",
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/********************************************************************************
2+
* Copyright (c) 2026 Contributors to the Eclipse Foundation
3+
*
4+
* See the NOTICE file(s) distributed with this work for additional
5+
* information regarding copyright ownership.
6+
*
7+
* This program and the accompanying materials are made available under the
8+
* terms of the Apache License Version 2.0 which is available at
9+
* https://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* SPDX-License-Identifier: Apache-2.0
12+
********************************************************************************/
13+
package OtherLibrary
14+
15+
import ScoreReq
16+
17+
ScoreReq.AoU TimingConstraint {
18+
description = "The caller shall ensure that invocations do not exceed 10ms cycle time"
19+
safety = ScoreReq.Asil.B
20+
version = 1
21+
}
22+
23+
ScoreReq.AoU SpaceConstraint {
24+
description = "The caller shall ensure that invocations do not exceed 10 MB"
25+
safety = ScoreReq.Asil.B
26+
version = 1
27+
}

0 commit comments

Comments
 (0)