Skip to content

Commit 55ff194

Browse files
committed
[Rules Score]: Add Description to requirement attributes
1 parent 0f22f53 commit 55ff194

8 files changed

Lines changed: 60 additions & 125 deletions

File tree

bazel/rules/rules_score/docs/user_guide/architectural_design.md

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,6 @@
1111
SPDX-License-Identifier: Apache-2.0
1212
----------------------------------------------------------------------------- -->
1313

14-
<!--
15-
Copyright (c) 2026 Contributors to the Eclipse Foundation
16-
17-
See the NOTICE file(s) distributed with this work for additional
18-
information regarding copyright ownership.
19-
20-
This program and the accompanying materials are made available under the
21-
terms of the Apache License Version 2.0 which is available at
22-
https://www.apache.org/licenses/LICENSE-2.0
23-
24-
SPDX-License-Identifier: Apache-2.0
25-
-->
26-
2714
# Architectural Design
2815

2916
## Overview and Hierarchy

bazel/rules/rules_score/docs/user_guide/dependability_analysis.md

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,6 @@
1111
SPDX-License-Identifier: Apache-2.0
1212
----------------------------------------------------------------------------- -->
1313

14-
<!--
15-
Copyright (c) 2026 Contributors to the Eclipse Foundation
16-
17-
See the NOTICE file(s) distributed with this work for additional
18-
information regarding copyright ownership.
19-
20-
This program and the accompanying materials are made available under the
21-
terms of the Apache License Version 2.0 which is available at
22-
https://www.apache.org/licenses/LICENSE-2.0
23-
24-
SPDX-License-Identifier: Apache-2.0
25-
-->
26-
2714
# Dependability Analysis
2815

2916
The `dependability_analysis` rule is the top-level safety artifact in `rules_score`. It summarizes the dependability analyses (Safety / Security) which were performed for the dependable element.

bazel/rules/rules_score/docs/user_guide/general.md

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,6 @@
1111
SPDX-License-Identifier: Apache-2.0
1212
----------------------------------------------------------------------------- -->
1313

14-
<!--
15-
Copyright (c) 2026 Contributors to the Eclipse Foundation
16-
17-
See the NOTICE file(s) distributed with this work for additional
18-
information regarding copyright ownership.
19-
20-
This program and the accompanying materials are made available under the
21-
terms of the Apache License Version 2.0 which is available at
22-
https://www.apache.org/licenses/LICENSE-2.0
23-
24-
SPDX-License-Identifier: Apache-2.0
25-
-->
26-
2714
# General Information
2815

2916
`rules_score` provides a set of Bazel rules that help you build and document a **Safety Element out of Context (SEooC)** — a safety-critical software component developed independently and delivered with all the evidence needed for integration into a safety-relevant system.

bazel/rules/rules_score/docs/user_guide/requirements.md

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,6 @@
1111
SPDX-License-Identifier: Apache-2.0
1212
----------------------------------------------------------------------------- -->
1313

14-
<!--
15-
Copyright (c) 2026 Contributors to the Eclipse Foundation
16-
17-
See the NOTICE file(s) distributed with this work for additional
18-
information regarding copyright ownership.
19-
20-
This program and the accompanying materials are made available under the
21-
terms of the Apache License Version 2.0 which is available at
22-
https://www.apache.org/licenses/LICENSE-2.0
23-
24-
SPDX-License-Identifier: Apache-2.0
25-
-->
26-
2714
# Requirements
2815

2916
`rules_score` provides three rules for capturing different levels of requirements.

bazel/rules/rules_score/docs/user_guide/unit_design.md

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,6 @@
1111
SPDX-License-Identifier: Apache-2.0
1212
----------------------------------------------------------------------------- -->
1313

14-
<!--
15-
Copyright (c) 2026 Contributors to the Eclipse Foundation
16-
17-
See the NOTICE file(s) distributed with this work for additional
18-
information regarding copyright ownership.
19-
20-
This program and the accompanying materials are made available under the
21-
terms of the Apache License Version 2.0 which is available at
22-
https://www.apache.org/licenses/LICENSE-2.0
23-
24-
SPDX-License-Identifier: Apache-2.0
25-
-->
26-
2714
# Software Unit Design
2815

2916
The `unit_design` rule documents the **internal implementation** of a single software unit — how its source code is structured, what data flows through it, and how it behaves at the code level. This is distinct from the higher-level architectural design diagrams (see {doc}`architectural_design`), which describe the intended component structure of the SEooC as a whole.

bazel/rules/rules_score/examples/seooc/safety_analysis/assets/safety_analysis.puml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,6 @@
1111
' SPDX-License-Identifier: Apache-2.0
1212
' *******************************************************************************
1313

14-
' *******************************************************************************
15-
' Copyright (c) {year} Contributors to the Eclipse Foundation
16-
'
17-
' See the NOTICE file(s) distributed with this work for additional
18-
' information regarding copyright ownership.
19-
'
20-
' This program and the accompanying materials are made available under the
21-
' terms of the Apache License Version 2.0 which is available at
22-
' https://www.apache.org/licenses/LICENSE-2.0
23-
'
24-
' SPDX-License-Identifier: Apache-2.0
25-
' *******************************************************************************
26-
2714
@startuml
2815

2916
object "SEooC" as SEooC

bazel/rules/rules_score/trlc/config/README.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ Type Hierarchy
4040
4141
└── CompReq
4242
├── derived_from (optional): FeatReqId[1..*]
43-
├── fulfilledBy (optional): String
4443
└── mitigates (optional): String
4544

4645
Usage

bazel/rules/rules_score/trlc/config/score_requirements_model.rsl

Lines changed: 60 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -27,91 +27,105 @@ enum Status {
2727
// Abstract Types
2828
///////////////////////////////
2929

30-
abstract type Requirement {
31-
description String
32-
version Integer
33-
note optional String
34-
status Status
35-
freeze status = Status.valid
30+
abstract type Requirement "Base type for all S-CORE requirements." {
31+
description "The normative requirement text. Must express an obligation (shall/should)."
32+
String
33+
version "Monotonically increasing version counter. Increment on every content change."
34+
Integer
35+
note "Non-normative explanatory text providing additional context."
36+
optional String
37+
status "Current lifecycle status of this requirement."
38+
Status
39+
freeze status = Status.valid
3640
}
3741

38-
abstract type RequirementSafety extends Requirement {
39-
safety Asil
42+
abstract type RequirementSafety "Extension of Requirement that carries an ASIL classification." extends Requirement {
43+
safety "The Automotive Safety Integrity Level assigned to this requirement."
44+
Asil
4045
}
4146

4247
///////////////////////////////
4348
// S-Core Requirements Model
4449
///////////////////////////////
4550

46-
type AssumedSystemReq extends RequirementSafety {
47-
rationale String
51+
type AssumedSystemReq "System-level requirement received from the wider operational context (e.g. platform)." extends RequirementSafety {
52+
rationale "Explanation of why this system-level requirement exists and how it was derived."
53+
String
4854
}
4955

5056
tuple AssumedSystemReqId {
51-
item AssumedSystemReq
52-
separator @
53-
version Integer
57+
item AssumedSystemReq
58+
separator @
59+
version Integer
5460
}
5561

56-
type FeatReq extends RequirementSafety {
57-
derived_from AssumedSystemReqId[1 .. *]
62+
type FeatReq "High-level feature requirement derived from one or more AssumedSystemReq items." extends RequirementSafety {
63+
derived_from "One or more versioned references to the AssumedSystemReq items this feature requirement is derived from."
64+
AssumedSystemReqId[1 .. *]
5865
}
5966

6067
tuple FeatReqId {
61-
item FeatReq
62-
separator @
63-
version Integer
68+
item FeatReq
69+
separator @
70+
version Integer
6471
}
6572

66-
type CompReq extends RequirementSafety {
67-
derived_from optional FeatReqId[1 .. *]
68-
fulfilledBy optional String
69-
mitigates optional String
73+
type CompReq "Component-level requirement allocated to a specific software component." extends RequirementSafety {
74+
derived_from "Versioned references to the FeatReq items this component requirement is derived from. Omit only for component-internal requirements with no feature-level parent."
75+
optional FeatReqId[1 .. *]
76+
mitigates "Reference to the FailureMode or safety concern that this requirement mitigates."
77+
optional String
7078
}
7179

7280
tuple CompReqId {
73-
item CompReq
74-
separator @
75-
version Integer
81+
item CompReq
82+
separator @
83+
version Integer
7684
}
7785

7886
///////////////////////////////
7987
// Safety Analyses
8088
///////////////////////////////
8189

82-
enum GuideWord {
83-
TooEarly
84-
TooLate
85-
Wrong
86-
LossOfFunction
87-
PartialFunction
88-
UnintendedFunction
89-
ExceedingFunction
90-
DelayedFunction
90+
enum GuideWord "HAZOP-style guide words used to categorise the nature of a failure mode." {
91+
TooEarly "The function or signal occurs earlier than expected."
92+
TooLate "The function or signal occurs later than expected."
93+
Wrong "The function produces an incorrect value or signal."
94+
LossOfFunction "The function is completely absent when it should be active."
95+
PartialFunction "The function is active but only partially fulfils its purpose."
96+
UnintendedFunction "The function is active when it should not be."
97+
ExceedingFunction "The function operates beyond its specified bounds."
98+
DelayedFunction "The function is active but with an unacceptable delay."
9199
}
92100

93-
type FailureMode extends ScoreReq.RequirementSafety {
94-
guideword GuideWord
95-
failureeffect String
96-
rationale optional String
97-
potentialcause optional String
98-
interface optional String
101+
type FailureMode "A potential failure of a system function, described using a HAZOP guide word." extends ScoreReq.RequirementSafety {
102+
guideword "HAZOP guide word classifying the nature of this failure."
103+
GuideWord
104+
failureeffect "Description of the consequence of this failure mode on the system or its users."
105+
String
106+
rationale "Explanation of why this failure mode is considered relevant."
107+
optional String
108+
potentialcause "Description of the root cause or triggering condition for this failure mode."
109+
optional String
110+
interface "The system interface or signal that is affected by this failure mode."
111+
optional String
99112
}
100113

101-
abstract type Measure extends ScoreReq.RequirementSafety {
114+
abstract type Measure "Abstract base type for all safety measures. Cannot be instantiated directly." extends ScoreReq.RequirementSafety {
102115
}
103116

104-
type ControlMeasure extends Measure {
117+
type ControlMeasure "A design or operational measure that detects, prevents, or limits a failure mode." extends Measure {
105118
}
106119

107-
type PreventiveMeasure extends Measure {
120+
type PreventiveMeasure "A measure that prevents a failure mode from occurring in the first place." extends Measure {
108121
}
109122

110-
type Mitigation extends Measure {
123+
type Mitigation "A measure that reduces the severity or probability of a failure mode's effect." extends Measure {
111124
}
112125

113-
type AoU extends ControlMeasure {
114-
mitigates optional String
126+
type AoU "Assumption of Use — a safety-relevant condition that a caller must fulfil when using this component." extends ControlMeasure {
127+
mitigates "Reference to the FailureMode or hazard that is mitigated when this assumption is satisfied."
128+
optional String
115129
}
116130

117131
///////////////////////////////

0 commit comments

Comments
 (0)