Upgrade to Sphinx-Needs 8.x and classify new schema/link features#7
Merged
Conversation
Toolchain:
- Bump sphinx-needs to >=8.0.0,<9 (was >=6.1.0); pin sphinx <10.
- Migrate ubproject.toml from deprecated list/array forms to SN 7+ dict form:
* extra_options = [...] → [needs.fields.<name>] with schema.type
* [[needs.extra_links]] → [needs.links.<name>]
* [needs.global_options.style] → [needs.fields.style]
- Declare safety-relevant enums (ti/si/td/tcl) on needs.fields.
- Bump TOOL_SN version to 8.0.0.
Classification (tools/sphinx-needs):
- New features with faults:
FE_SN_SCHEMA_VALIDATION, FE_SN_TYPED_FIELDS, FE_SN_TYPED_LINK_SCHEMA,
FE_SN_LINK_CONDITIONS, FE_SN_JSON_LINK_CONDITIONS
- Mark FE_SPHINX_NEEDS_DYNAMIC_CONSTRAINTS (needs_constraints) as legacy
and update the code examples of FE_SPHINX_NEEDS_CUSTOMIZABLE_OPTIONS /
_LINKS to the current TOML form.
- New restrictions avoiding the new faults:
RE_SN_USE_SCHEMA, RE_SN_SCHEMA_VIOLATION, RE_SN_TYPE_FIELDS,
RE_SN_LINK_CARDINALITY, RE_SN_JSON_LINK_COND
Classification (tools/ubc):
- FE_UBC_SCHEMA_VALIDATE, FE_UBC_DIFF_GIT, FE_UBC_AGENT_SKILL with faults.
Verified via sphinx-build -W -a -E (clean build, 284 needs total).
Align remaining UI labels (pie charts, tables, dropdowns, prose) with the renamed `fault` directive so the rendered docs no longer mix "Errors" and `fault` terms. ISO 26262 "Tool Error Detection" and Sphinx build-warning/error references are preserved.
danwos
approved these changes
May 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
sphinx-needsto 8.x (>=8.0.0,<9) and migrateubproject.tomloff the deprecated SN 6.x config forms (extra_optionslist →[needs.fields.*],[[needs.extra_links]]→[needs.links.*],[needs.global_options.style]→[needs.fields.style]).NeedLink/parse_conditions), and link-condition export vianeeds_json_include_link_conditions.ubc schema validate,ubc diff git,ubc agent-skill.Toolchain changes
pyproject.tomlsphinx-needs[plotting]>=8.0.0,<9,sphinx[test]>=8.2.3,<10uv.lockjsonschema-rs,minijinjaubproject.toml[needs.fields.*], 13[needs.links.*]; safety-enums onti/si/td/tcltools/sphinx-needs/main.rstTOOL_SNversion →8.0.0New classification items (13)
Features (tools/sphinx-needs + tools/ubc)
FE_SN_SCHEMA_VALIDATION— declarativeneeds_schema_definitions(local + network rules,violationseverity).FE_SN_TYPED_FIELDS— typed[needs.fields.*]with JSON-Schema constraints.FE_SN_TYPED_LINK_SCHEMA— cardinality (minItems/maxItems) on[needs.links.*].FE_SN_LINK_CONDITIONS— SN 8.0NeedLink/parse_conditions.FE_SN_JSON_LINK_CONDITIONS— SN 8.0needs_json_include_link_conditions.FE_UBC_SCHEMA_VALIDATE—ubc schema validateCI gate.FE_UBC_DIFF_GIT—ubc diff gitchange-impact analysis.FE_UBC_AGENT_SKILL—ubc agent-skillontology export for LLM tooling.Each new feature carries 3–6 nested
faults covering the safety-relevant failure modes (silent skip, wrong severity, missing coverage, drift, etc.).Restrictions avoiding the new faults
RE_SN_USE_SCHEMA(legacyneeds_constraintsis disallowed)RE_SN_SCHEMA_VIOLATION(severity = \"violation\"for safety invariants)RE_SN_TYPE_FIELDS(explicitschema.typeon every field)RE_SN_LINK_CARDINALITY(schema.minItemsonraises/avoids/checks/errors/responsible)RE_SN_JSON_LINK_COND(keepneeds_json_include_link_conditionsat defaultTrue)Updated examples of
FE_SPHINX_NEEDS_CUSTOMIZABLE_OPTIONS/_LINKSto the TOML form and markedFE_SPHINX_NEEDS_DYNAMIC_CONSTRAINTSas legacy with a cross-reference.Verification
uv syncinstallssphinx-needs==8.0.0.sphinx-build -W -a -E -b htmlsucceeds clean (0 warnings).needs.jsoncontains 284 needs (was 271); spot-check confirmed all 13 new IDs are present.Test plan
uv sync && sphinx-build -W -a -E -b html . _build/htmllocally and confirms a clean build._build/html/tools/sphinx-needs/features.html,.../restrictions.html,_build/html/tools/ubc/features.html.analysis/indexandtools/sphinx-needs/mainstill render.ubproject.tomlstill drive the visible meta-data in existing needs (e.g. style predicates still color-code types).Follow-ups (not in this PR)
schemas.jsonwith ISO 26262 safety rules and wire it viaschema_definitions_from_json.[scripts]entries forubc schema validate/ubc build needs/ubc agent-skill.TOOL_UBCODE, which is currently a stub.