Skip to content

Feat/missing relation requirements#2926

Open
claudiiolima wants to merge 12 commits into
strictdoc-project:mainfrom
claudiiolima:feat/missing-relation-requirements
Open

Feat/missing relation requirements#2926
claudiiolima wants to merge 12 commits into
strictdoc-project:mainfrom
claudiiolima:feat/missing-relation-requirements

Conversation

@claudiiolima

Copy link
Copy Markdown
Contributor

Description

This PR adds support for running StrictDoc on subprojects that intentionally do not contain all cross-project relations.

Our project is split into hardware, mechanical, and firmware repositories. At system-repo level, all requirement relations resolve correctly. At subproject level, some parent/child links point to requirements that exist only in another repository. Today, this blocks useful workflows such as:

  1. Building firmware-only docs with full local traceability.
  2. Building docs in CI even when external repos are not cloned.
  3. Including source traceability in a subproject without pulling the full system context.

Problem

StrictDoc currently raises an exception when a referenced relation is missing, which stops export/server flows and breaks subproject-level documentation builds.

Solution

Introduce a new relaxed mode that allows builds to continue when requirement relations are missing.

In this mode, StrictDoc:

  1. Continues building instead of failing.
  2. Emits warnings about unresolved relations.
  3. Highlights missing relations in rendered outputs.
  4. Tracks and exposes missing-relations statistics.
  5. Supports searching/filtering for requirements with missing relations.

CLI / Config

Added relation-scoped option:

  1. --allow-missing-relation-requirements

Compatibility:

  1. Legacy parent-only naming is still accepted for backward compatibility.

User-visible behavior

When relaxed mode is enabled:

  1. Missing parent and missing child relations are tolerated.
  2. Warnings are shown in document-level outputs.
  3. A project-level warning is shown on the index page.
  4. Missing relations are visually highlighted in requirement relation sections.
  5. Project statistics include a metric for requirements with missing relations.

Notes

This change is designed for multi-repo/subproject workflows where some upstream/downstream requirement links are expected to be unavailable in the current checkout.

@claudiiolima

claudiiolima commented Jun 18, 2026

Copy link
Copy Markdown
Contributor Author

Some images

Index page

image

Metrics Page

image

Requirement Page

image

@claudiiolima

Copy link
Copy Markdown
Contributor Author

I still have to implement missing file conditions.

@stanislaw

Copy link
Copy Markdown
Collaborator

Hey @claudiiolima thanks a lot for starting this! @mettta and I discussed and created this ticket recently, and it is very close to what you are doing in your PR: #2937.

One thing that we were planning to do was to re-use the engine of Validations: https://strictdoc.readthedocs.io/en/stable/stable/docs/strictdoc_01_user_guide.html#18.1-Custom-validations.

                    # Attach a validation issue to the entire node.
                    traceability.validation_index.add_issue(
                        node,
                        issue="The whole node is really bad.",
                        field=None,
                        subject=f"Node: {node.reserved_title}",
                    )

Give us some time to get through the epic #2964 and some other open issues raised by several users. I hope I can get to reviewing your PR in detail within the next few days.

@claudiiolima

Copy link
Copy Markdown
Contributor Author

@stanislaw Thanks for the initial review!

I've made some changes since then, including leveraging issues from validation_index. I also implemented missing-file warnings and rendering support, and added the same rendering functionality to the table view.

@claudiiolima

Copy link
Copy Markdown
Contributor Author

There is still an uncovered case: the relationship between a source file and a requirement has not been implemented yet.

@bartekpaczek

Copy link
Copy Markdown

Does the change cover only PARENT/CHILD relation or also just [LINK:] to UID or ANCHOR? It would be great if that could also cover it.

@claudiiolima

Copy link
Copy Markdown
Contributor Author

Does the change cover only PARENT/CHILD relation or also just [LINK:] to UID or ANCHOR? It would be great if that could also cover it.

For now I only have worked at PARENT/CHILD/FILE relations. But LINK and ANCHOR could be added too.

@stanislaw

Copy link
Copy Markdown
Collaborator

FYI: Reviewing and integrating this is on my list for the next few days.

…laxed mode

- Add unit tests to validate query methods correctly report unresolved inline links
- Add unit tests to ensure resolved inline links are not flagged as unresolved
@claudiiolima
claudiiolima force-pushed the feat/missing-relation-requirements branch from a2caa00 to de7bf15 Compare July 7, 2026 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants