Rule Reference
Documentation Rules
sphinx_module
Builds Sphinx-based HTML documentation from RST/MD source files. Supports cross-module dependencies and automatic HTML merging.
sphinx_module(
name = "my_docs",
srcs = glob(["docs/**/*.rst", "docs/**/*.md"]),
index = "docs/index.rst",
deps = ["@external_module//:docs"],
)
Attribute |
Type |
Required |
Description |
|---|---|---|---|
|
string |
yes |
Target name; also the output directory prefix |
|
label list |
yes |
RST, MD, image, and PlantUML source files |
|
label |
yes |
Path to the root |
|
label list |
no |
Other |
|
label |
no |
Override the Sphinx binary (default: toolchain-provided binary) |
|
bool |
no |
If |
|
— |
no |
Bazel visibility |
Generated targets:
<name>— HTML output underbazel-bin/<name>/html/; use indepsof othersphinx_moduletargets.<name>_needs—needs.jsonproduced by the needs builder; consumed transitively by downstream modules for cross-module{requirement:downstream-ref}resolution. See Two-phase Sphinx build for the full data-flow description.
Artifact Rules
All artifact rules produce a SphinxSourcesInfo provider (documentation page)
and carry typed traceability information for downstream structural rules.
assumed_system_requirements
System-level requirements that the SEooC receives from its operational context. These are too broad to be assigned to a single component.
assumed_system_requirements(
name = "sys_req",
srcs = ["docs/assumed_system_requirements.trlc"],
)
Attribute |
Type |
Required |
Description |
|---|---|---|---|
|
string |
yes |
Target name |
|
label list |
yes |
|
|
label list |
no |
Reserved for consistency; unused at root level (default |
|
— |
no |
Bazel visibility (default |
Generated targets: <name> (documentation), <name>_test (TRLC syntax/type validation)
feature_requirements
High-level requirements derived from AssumedSystemReq. Operate at the
integration level; can only be satisfied by multiple components working together.
feature_requirements(
name = "features",
srcs = ["docs/features.trlc"],
deps = [":sys_req"],
)
Attribute |
Type |
Required |
Description |
|---|---|---|---|
|
string |
yes |
Target name |
|
label list |
yes |
|
|
label list |
no |
|
|
— |
no |
Bazel visibility (default |
Generated targets: <name> (documentation), <name>_test (TRLC validation including cross-reference checks)
component_requirements
Requirements assigned to exactly one component; directly implementable and testable within that component.
component_requirements(
name = "comp_req",
srcs = ["docs/requirements.trlc"],
deps = [":features"],
)
Attribute |
Type |
Required |
Description |
|---|---|---|---|
|
string |
yes |
Target name |
|
label list |
yes |
|
|
label list |
no |
|
|
— |
no |
Bazel visibility (default |
Generated targets: <name> (documentation), <name>_test (TRLC validation)
assumptions_of_use
Conditions that the integrating project must fulfil when using this SEooC.
assumptions_of_use(
name = "aous",
srcs = ["docs/assumptions.trlc"],
requirements = [":features"],
)
Attribute |
Type |
Required |
Description |
|---|---|---|---|
|
string |
yes |
Target name |
|
label list |
yes |
|
|
label list |
no |
|
|
— |
no |
Bazel visibility |
Generated targets: <name> (documentation), <name>_test (TRLC validation)
glossary
Collects glossary pages for Sphinx and forwards them to downstream
documentation assembly (for example through dependable_element).
glossary(
name = "project_glossary",
srcs = ["docs/glossary.rst"],
)
Example glossary source (.rst):
Glossary
========
.. glossary::
integrity level
ASIL rating (QM, A, B, C, D) indicating required safety rigor.
component
Software unit with defined interfaces, implementation, and tests.
Attribute |
Type |
Required |
Description |
|---|---|---|---|
|
string |
yes |
Target name |
|
label list |
yes |
|
|
— |
no |
Bazel visibility |
Generated targets: <name> (documentation; no standalone test)
architectural_design
Bundles static, dynamic, and public-API architecture views into a single target.
Provides ArchitecturalDesignInfo consumed by dependable_element and fmea.
architectural_design(
name = "arch",
static = ["docs/static_design.puml"],
dynamic = ["docs/sequence.puml"],
public_api = ["docs/public_api.puml"],
)
Attribute |
Type |
Required |
Description |
|---|---|---|---|
|
string |
yes |
Target name |
|
label list |
no |
Static-view files ( |
|
label list |
no |
Dynamic-view files (default |
|
label list |
no |
Public-API diagram files ( |
|
— |
no |
Bazel visibility |
Generated targets: <name> (provides ArchitecturalDesignInfo; no standalone test — consistency is validated as part of bazel test //pkg:my_element)
unit_design
Attaches code-level design diagrams to a unit target. Accepts the same
file types as architectural_design but scoped to a single unit’s internal
implementation.
unit_design(
name = "my_unit_design",
static = ["class_diagram.rst", "class_diagram.puml"],
dynamic = ["sequence_diagram.puml"],
)
Attribute |
Type |
Required |
Description |
|---|---|---|---|
|
string |
yes |
Target name |
|
label list |
no |
Static-view files (class diagrams, data-structure diagrams). When an |
|
label list |
no |
Dynamic-view files (sequence, state diagrams) (default |
|
— |
no |
Bazel visibility |
Generated targets: <name> (no standalone test; diagrams are consumed by the parent unit)
fmea
Bundles failure modes, control measures, and FTA diagrams into a single FMEA documentation target.
fmea(
name = "my_fmea",
failuremodes = ["docs/failuremodes.trlc"],
controlmeasures = ["docs/controlmeasures.trlc"],
root_causes = ["docs/fta.puml"],
arch_design = ":arch",
)
Attribute |
Type |
Required |
Description |
|---|---|---|---|
|
string |
yes |
Target name |
|
label list |
no |
|
|
label list |
no |
|
|
label list |
no |
FTA PlantUML diagram files ( |
|
label |
no |
|
|
— |
no |
Bazel visibility |
Generated targets: <name> (documentation; no standalone test — traceability validated via the parent dependability_analysis)
dependability_analysis
Wraps one or more fmea targets into a complete safety-analysis package.
Running bazel test validates the full FMEA traceability chain.
dependability_analysis(
name = "analysis",
fmea = [":my_fmea"],
)
Attribute |
Type |
Required |
Description |
|---|---|---|---|
|
string |
yes |
Target name |
|
label list |
yes |
|
|
— |
no |
Bazel visibility |
Generated targets: <name> (build → documentation; bazel test //pkg:analysis → full FMEA traceability validation)
Structural Rules
unit
The smallest independently testable software element. Ties together
implementation targets, test targets, and an optional unit_design target.
The name must match the unit name used in the static architecture PlantUML
diagram.
unit(
name = "KeyValueStore",
unit_design = [":kvs_unit_design"],
implementation = [":kvs_lib"],
tests = [":kvs_unit_test"],
)
Attribute |
Type |
Required |
Description |
|---|---|---|---|
|
string |
yes |
Target name; must match the |
|
label list |
yes |
|
|
label list |
yes |
Library or binary targets that implement this unit (e.g. |
|
label list |
yes |
Test targets that verify this unit (may be |
|
label list |
no |
Additional targets needed by the implementation but not listed in |
|
bool |
no |
If |
|
— |
no |
Bazel visibility |
Generated targets: <name> (provides UnitInfo; no standalone test — the listed tests run via bazel test //pkg:... directly)
component
Groups unit (and optionally nested component) targets into a logical
subsystem. Associates component-level requirements and integration tests.
The name must match the component name in the static architecture PlantUML
diagram.
component(
name = "KvsComponent",
requirements = [":comp_req"],
components = [":KeyValueStore", ":StorageBackend"],
tests = [],
)
Attribute |
Type |
Required |
Description |
|---|---|---|---|
|
string |
yes |
Target name; must match the |
|
label list |
yes |
|
|
label list |
no |
Nested |
|
label list |
yes |
Integration test targets for the component as a whole (may be |
|
bool |
no |
If |
|
— |
no |
Bazel visibility |
Generated targets: <name> (provides ComponentInfo; no standalone test — the listed tests run via bazel test //pkg:... directly)
dependable_element
Assembles all process artefacts into a complete SEooC. Runs Sphinx to generate unified HTML documentation and enforces architecture consistency, traceability, and scope checks at build/test time.
dependable_element(
name = "my_seooc",
integrity_level = "B",
assumptions_of_use = [":aous"],
requirements = [":features"],
architectural_design = [":arch"],
dependability_analysis = [":analysis"],
components = [":kvs_component"],
tests = [],
)
Attribute |
Type |
Required |
Description |
|---|---|---|---|
|
string |
yes |
Target name; also becomes the SEooC documentation title |
|
string |
yes |
|
|
label list |
yes |
|
|
label list |
yes |
|
|
label list |
yes |
|
|
label list |
yes |
|
|
label list |
yes |
|
|
label list |
yes |
System-level test targets (may be |
|
label list |
no |
Additional |
|
label list |
no |
Other |
|
label |
no |
A YAML file selecting which received AoUs to chain-forward to elements that depend on this one. Each entry requires an |
|
string |
no |
|
|
bool |
no |
If |
|
— |
no |
Bazel visibility |
Generated targets:
Target |
Purpose |
|---|---|
|
Main target: build runs Sphinx; |
|
Internal |
|
Internal artefact-collection and architecture-validation target |