Restrictions

Restriction: Do not use dynamic functions CHECK_SN_NO_DYN
style: orange_bar

Dynamic functions can execute not qualified code, which has full access to all Sphinx-Needs data. So its execution can corrupt the data.

Restriction: Warning to Error RE_SN_WARNINGS
style: orange_bar

Always use the sphinx-build option -W to transform all warnings into errors, because only errors stop the build and set an exit code > 0.

Restriction: Clean full build RE_SN_CLEAN
style: orange_bar

Always use a clean and full sphinx-build. An incremental build is not allowed, as not all files get updated by Sphinx.

So before the sphinx-build command gets executed, the related build folder shall be deleted. Then sphinx-build shall be built with the options -a and -E to force Sphinx to read and write really all files.

Restriction: Use declarative schema validation instead of needs_constraints RE_SN_USE_SCHEMA

The legacy needs_constraints mechanism evaluates arbitrary Python expressions against need data. Safety-relevant projects shall use Declarative schema validati... (FE_SN_SCHEMA_VALIDATION) (JSON-Schema based) via needs_schema_definitions or schema_definitions_from_json instead. The schema form is declarative, auditable, reproducible (no embedded Python), and its diagnostics are structured (sn_schema_*), which lets CI and ubCode process them.

Restriction: Use severity "violation" for safety-relevant schema rules RE_SN_SCHEMA_VIOLATION

Any schema rule that encodes a safety invariant (e.g. “every safe feature raises at least one fault”, “every fault is mitigated”) shall declare severity = "violation". Combined with Warning to Error (RE_SN_WARNINGS), a violation breaks the build and therefore cannot reach a release pipeline unnoticed.

Restriction: Type every extra field via needs.fields schema RE_SN_TYPE_FIELDS

Every field declared under [needs.fields.<name>] shall carry at least an explicit schema.type. Safety-relevant enumerations (asil, tcl, ti, td, si) shall additionally declare schema.enum. This removes the fall-back to an untyped nullable-string schema and makes invalid values surface during the build.