Skip to content

perf: replace unscoped verification pages with a TVR summary - #1093

Open
AlexanderLanin wants to merge 8 commits into
eclipse-score:mainfrom
etas-contrib:fix/1076-verification-report-scope
Open

AlexanderLanin wants to merge 8 commits into
eclipse-score:mainfrom
etas-contrib:fix/1076-verification-report-scope

Conversation

@AlexanderLanin

@AlexanderLanin AlexanderLanin commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Why

When Reference Integration mounts docs-as-code, the Tooling Verification and Requirement Test Coverage pages list every passing test in the build. In the build measured for #1076, that was 33,360 rows per table. The pages are slow to render, and the relevant tests are hard to find.

Refs #1076.

What

  • Remove both pages.
  • The Tool Verification Report opens with a short Conclusion: whether the tool must be qualified, the qualification scope, how its tool requirements are verified (fully / partially / not linked, test results), malfunction coverage, and what the report does not reach in its own Bazel module.
  • A new section, How the conclusion is derived, explains the definitions behind those numbers. Everything after it is evidence.
  • All numbers use one scope and add up: qualification-relevant requirements, requirements that need no qualification, and requirements no malfunction violates.
  • A safety-relevant malfunction without a detection assessment no longer yields HIGH: the tool "cannot be classified yet", and the requirements only it violates stay open.
  • New evidence sections break the verifying testcases down by test type and derivation technique, and list the uncovered tool requirements.

Conclusion: before → after
Removed pages (before): Tooling Verification, Requirement Test Coverage

Notes for reviewers

  • Best reviewed commit by commit. The first commit only indents the template; the report renders the same before and after it.
  • The end-to-end scenario src/tests/end_to_end/scenarios/tool_qualification_report shows a complete example: a report next to the mounted docs of a second Bazel module, whose requirements and testcases must not be counted.
  • Individual testcases are no longer listed anywhere; they are only counted.
  • A module with several tool reports is not handled yet: each report would list the other tools' requirements as gaps.
  • The "Qualification scope" pie chart still counts every tool_req in the build, not just the module's. Left for a follow-up.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The cross-cutting change involves Sphinx-Needs callbacks, Bazel provenance, external JUnit imports, and incremental environment state that automated inspection cannot validate end to end.

No open issues 🎉

What changed in this PR

This PR scopes docs-as-code verification reports to relevant tests and requirements, adds Bazel module provenance to JUnit testcase Needs, and improves duplicate-ID handling and incremental testcase replacement.

Changes:

  • Added module-aware testcase provenance, serialization, metamodel support, and generated expectations.
  • Added scoped tooling verification and requirement coverage filters, including cross-module links.
  • Propagated module configuration through the CLI and Bazel documentation builds.
  • Added tests for duplicate test identities, incremental cleanup, serialization, and scoped metrics.
File Description
src/​tests/​docs_bzl/​scenarios/​reference_integration/​score_platform/​_expected/​needs_json/​needs.json Updates expected Needs metadata to include Bazel module provenance.
src/​tests/​docs_bzl/​scenarios/​reference_integration/​modern_module/​docs/​components/​unlinked_component/​_expected/​needs_local.json Updates expected local Needs metadata for module provenance.
src/​tests/​docs_bzl/​scenarios/​reference_integration/​modern_module/​_expected/​needs_json/​needs.json Updates expected exported Needs metadata for the modern module.
src/​tests/​docs_bzl/​scenarios/​reference_integration/​_expected/​root_needs_local.json Updates root Needs metadata expectations.
src/​tests/​docs_bzl/​scenarios/​reference_integration/​_expected/​docs/​modules/​modern_module/​components/​unlinked_component/​generated_metamodel/​index.html Updated as part of this pull request.
src/​extensions/​score_source_code_linker/​xml_parser.py Records the source Bazel module for parsed JUnit testcases.
src/​extensions/​score_source_code_linker/​tests/​test_testlink.py Tests testcase serialization with module provenance.
src/​extensions/​score_source_code_linker/​tests/​test_testcase_needs.py Tests module-aware testcase Need construction and identifiers.
src/​extensions/​score_source_code_linker/​tests/​test_source_code_link_integration.py Tests cross-module duplicate test identities and incremental testcase removal.
src/​extensions/​score_source_code_linker/​testlink.py Adds source-module data to testcase models and serialization.
src/​extensions/​score_source_code_linker/​testcase_needs.py Adds module-aware IDs and provenance while replacing stale imported testcase Needs.
src/​extensions/​score_source_code_linker/​__init__.py Integrates testcase replacement and local module configuration.
src/​extensions/​score_metrics/​tests/​test_sphinx_filters.py Tests scoped tooling and requirement coverage metrics.
src/​extensions/​score_metrics/​sphinx_filters.py Implements module- and requirement-scoped report filters.
src/​extensions/​score_metamodel/​metamodel.yaml Allows optional Bazel module metadata on testcase Needs.
src/​docs_cli/​main_test.py Tests forwarding of the local testcase module setting.
src/​docs_cli/​cli.py Passes the local testcase module setting into Sphinx configuration.
docs/​internals/​requirements/​tooling_verification.rst Scopes tooling verification charts and tables to docs-as-code tests.
docs/​internals/​requirements/​requirements.rst Tags docs-as-code tool requirements for scoped reporting.
docs/​internals/​requirements/​requirement_coverage.rst Scopes requirement coverage charts and traceability tables.
docs.bzl Supplies the owning Bazel module to documentation builds.

Review effort: Lite

@AlexanderLanin
AlexanderLanin force-pushed the fix/1076-verification-report-scope branch from 59b7788 to 00824fd Compare November 23, 2026 10:55
Copilot AI lite review requested due to automatic review settings November 23, 2026 10:55

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

A moderate active issue remains because the provenance check ignores fields declared through needs_extra_options, causing module-scoped reports to exclude all tests for affected consumers.

1 open issue

Review effort: Lite

@AlexanderLanin
AlexanderLanin force-pushed the fix/1076-verification-report-scope branch from 00824fd to a325998 Compare November 23, 2026 11:07
Copilot AI lite review requested due to automatic review settings November 23, 2026 11:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The change has unresolved correctness and test-execution defects: Bazel Needs actions do not receive the module name, and a unit-test stub lacks the configuration attributes now required by the implementation.

3 open issues

Review effort: Lite

Comment thread docs.bzl Resolved
@github-actions

Copy link
Copy Markdown
Contributor

Documentation preview for this pull request is available at:
pr-1093: https://eclipse-score.github.io/docs-as-code/pr-1093/

@AlexanderLanin AlexanderLanin self-assigned this Nov 23, 2026
@AlexanderLanin
AlexanderLanin force-pushed the fix/1076-verification-report-scope branch from a325998 to 7a6bb47 Compare November 23, 2026 12:57
Copilot AI lite review requested due to automatic review settings November 23, 2026 12:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Two active moderate issues can omit module metadata for local and cached testcases, causing them to disappear from the new module-scoped reports.

4 open issues

Review effort: Lite

@AlexanderLanin AlexanderLanin moved this from In Progress to in review in INF - Infrastructure Community Nov 23, 2026
@AlexanderLanin
AlexanderLanin force-pushed the fix/1076-verification-report-scope branch from 7a6bb47 to 5feb6f6 Compare November 24, 2026 15:44
Copilot AI lite review requested due to automatic review settings November 24, 2026 15:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

A moderate correctness issue misclassifies whitespace-only source links, and the added test lacks required traceability metadata.

5 open issues
1 resolved since last review

Review effort: Lite

@AlexanderLanin AlexanderLanin moved this from in review to In Progress in INF - Infrastructure Community Nov 24, 2026
@AlexanderLanin
AlexanderLanin force-pushed the fix/1076-verification-report-scope branch from 5feb6f6 to 2513d96 Compare November 24, 2026 16:53
Copilot AI lite review requested due to automatic review settings November 24, 2026 16:53

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

A critical linkage bug causes all verification links to be skipped and the traceability table to remain empty, while a new test also lacks required metadata for the documentation build.

5 open issues
1 resolved since last review

Review effort: Lite

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Three critical issues remain in the report template: summary counts can duplicate malfunctions, unassessed detection yields a contradictory HIGH classification, and requirements from unassessed malfunctions can be incorrectly excluded from qualification accounting.

5 open issues
2 resolved since last review

Review effort: Lite

@MaximilianSoerenPollak MaximilianSoerenPollak left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot feedback has to be read through, and addressed if still valid.
I would also change the test to a end_to_end test to increase readability and make having an easy to build example simple.

The template is really hard to read wihtout indentation but I guess we can't do much there.

derivation
)
# This project has no bundle ownership, so the report has no module to
# list requirements and testcases for.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for what?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sentence just seems to cut off.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reworded in e258069: this project is not built through Bazel, so the report has no Bazel module whose other tool requirements and testcases it could count.

Comment on lines +735 to +737
"sphinx_needs",
"score_sphinx_needs_templates",
"score_metamodel",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not better to use the bundle extension to catch unwanted consequences however unlikely?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in e258069b9: the module case is now an end-to-end scenario that mounts the docs of a real second Bazel module, so the bundle lookup is no longer patched.

Comment on lines +710 to +712
def test_tool_qualification_report_lists_uncovered_requirements_of_its_own_module(
tmp_path: Path,
monkeypatch: pytest.MonkeyPatch,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks to me like this should be a end_to_end test. There is 100 lines of RST jsut berried in here. Wouldn't this be much easier to read and follow as an end_to_end test? That's why we restructured them .
You could still have all the pytest asserts same as before no?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there was nu module in end to end when i started this PR 😆

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in e258069b9: new scenario src/tests/end_to_end/scenarios/tool_qualification_report with the same assertions in test_tool_qualification_report.py. Only the unassessed-detection cases stay unit tests, because the metamodel rejects that input in a real -W build.

Comment on lines +35 to +86
{% set report_scope = namespace(requirement_ids=[], test_ids=[]) %}
{% set verification = namespace(fully=0, partially=0, unverified=0, test_ids=[], tests=[]) %}
{% for malfunction_id in malfunction_scope.ids %}
{% for requirement in linked_needs(malfunction_id, "violates")|selectattr("type", "equalto", "tool_req")|list %}
{% if requirement["id"] not in report_scope.requirement_ids %}
{% set report_scope.requirement_ids = report_scope.requirement_ids + [requirement["id"]] %}
{% set fully_verifying_tests = linked_needs(requirement["id"], "fully_verifies_back")|list %}
{% set partially_verifying_tests = linked_needs(requirement["id"], "partially_verifies_back")|list %}
{% for test in fully_verifying_tests + partially_verifying_tests %}
{% if test["id"] not in report_scope.test_ids %}
{% set report_scope.test_ids = report_scope.test_ids + [test["id"]] %}
{% endif %}
{% endfor %}
{% if requirement["id"] in qualification_requirement_scope.ids %}
{% if fully_verifying_tests %}
{% set verification.fully = verification.fully + 1 %}
{% elif partially_verifying_tests %}
{% set verification.partially = verification.partially + 1 %}
{% else %}
{% set verification.unverified = verification.unverified + 1 %}
{% endif %}
{% for test in fully_verifying_tests + partially_verifying_tests %}
{% if test["id"] not in verification.test_ids %}
{% set verification.test_ids = verification.test_ids + [test["id"]] %}
{% set verification.tests = verification.tests + [test] %}
{% endif %}
{% endfor %}
{% endif %}
{% endif %}
{% endfor %}
{% endfor %}
{% set requirements_without_qualification = report_scope.requirement_ids|length - qualification_requirement_scope.ids|length %}
{% set result_parts = namespace(items=[], known=0) %}
{% for result, singular, plural_wording in [("passed", "passed", "passed"), ("failed", "failed", "failed"), ("skipped", "was skipped", "were skipped"), ("disabled", "is disabled", "are disabled")] %}
{% set result_count = verification.tests|selectattr("result", "equalto", result)|list|length %}
{% set result_parts.known = result_parts.known + result_count %}
{% if result_count %}
{% set result_parts.items = result_parts.items + [result_count ~ " " ~ (singular if result_count == 1 else plural_wording)] %}
{% endif %}
{% endfor %}
{% set results_missing = verification.tests|length - result_parts.known %}
{% if results_missing %}
{% set result_parts.items = result_parts.items + [results_missing ~ (" has" if results_missing == 1 else " have") ~ " no result"] %}
{% endif %}
{% set all_passed = verification.tests and verification.tests|selectattr("result", "equalto", "passed")|list|length == verification.tests|length %}
{% if not verification.tests %}
{% set verification_results = "No testcase verifies them yet." %}
{% elif all_passed %}
{% set verification_results = ("The verifying testcase passed." if verification.tests|length == 1 else "All " ~ verification.tests|length ~ " verifying testcases passed.") %}
{% else %}
{% set verification_results = "Of " ~ plural(verification.tests|length, "verifying testcase") ~ ", " ~ result_parts.items|join(", ") ~ "." %}
{% endif %}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a comment.

Without indentation this is so bad to read. ^^

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its horrible

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Improved in e258069b9: the computing part of the template now uses {%- -%} on every tag, so it is indented and commented without emitting blank lines into the RST. The rendered output is unchanged. The RST part below has to stay as is, since there indentation is output.

Copilot AI lite review requested due to automatic review settings November 27, 2026 16:02

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

A critical active finding remains: the report can expose a HIGH derived Need while its conclusion is indeterminate, creating an unresolved safety-relevant inconsistency.

3 open issues
3 resolved since last review

Review effort: Lite

Copilot AI lite review requested due to automatic review settings November 27, 2026 16:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Human assessment is needed because a safety-relevant malfunction can be misclassified as out of scope in the report’s pie chart, conflicting with the conclusion’s indeterminate state and the derivation’s still-open semantics.

2 open issues
1 resolved since last review

Review effort: Lite

Copilot AI lite review requested due to automatic review settings November 27, 2026 16:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

A moderate active finding remains because indeterminate safety-relevant malfunctions can leave an open qualification requirement unaccounted for in the rendered report.

3 open issues

Review effort: Lite

The computing part of the Tool Verification Report template now uses
`{%- -%}` on every tag, so it can be indented and commented without emitting
blank lines into the RST. Helpers are grouped first, the use case and
malfunction scopes follow. The rendered report is unchanged.
The conclusion of the Tool Verification Report used to list ratios such as
"1/2 safety-relevant malfunctions have insufficient detection" and left the
reader to combine them. It now opens with one sentence: the tool must be
qualified, does not need to be, or cannot be classified yet because the
detection of a safety-relevant malfunction is not assessed. In that last case
the report no longer claims `tcl: HIGH`, and the evaluation overview marks
the malfunction as "open" instead of "HIGH".

A new "How the conclusion is derived" section explains the classification,
the qualification scope and what "fully" and "partially" verified mean.
The qualification scope paragraph now also covers the tool requirements of
the report that are not in the scope:

- a requirement violated only by safety-relevant malfunctions without a
  detection assessment is still open, also when no malfunction needs
  qualification yet;
- a requirement violated only by malfunctions that need no qualification is
  out of scope.

Each malfunction is now collected once, and the classification counts are
taken from that collection.
The conclusion now states how many tool requirements in the qualification
scope are linked to fully verifying, only partially verifying or no
testcases, and what the verifying testcases resulted in. Every testcase is
counted once: an unexpected result is named, and a testcase without a result
is counted as such.

A new "Verifying testcases" section counts these testcases by test type and
derivation technique; testcases without that metadata count as "not set".
Templates can call `document_bazel_module(docname)` to get the Bazel module
of the bundle that supplied a document. A post-template cannot read
`bazel_module` from its own Need, because that field is only assigned after
all documents are collected, but the template is rendered while its Need is
created.

`score_mounts` gains `get_document_bundle()`, which looks up one document
without copying the whole mapping, so it is cheap enough to call per Need.
The conclusion now counts the tool requirements and testcases of the report's
own Bazel module that the report does not reach: requirements no malfunction
violates, and testcases that verify none of the report's requirements. The
derivation explains why they matter, and a "Not covered by this report"
section lists the uncovered tool requirements.

Mounted modules and imported Needs are not counted. A local Need without a
module yet belongs to the module of its document; an imported one never falls
back to the document that imports it.
A new scenario builds a Tool Verification Report in a real Bazel module, next
to the mounted documentation of a second module and an imported inventory.
Its verifying testcases cover every result once. The tests check the verdict
and its evidence, a requirement without qualification need, that only the
report's own module is checked for gaps, and the design summary of the
verifying testcases.

The scenario's lock file also picks up score_tools 0.0.5, which main already
depends on.
When Reference Integration mounts docs-as-code, the "Tooling Verification"
and "Requirement Coverage" pages list every passing test in the build, not
only those of docs-as-code. In the build measured for eclipse-score#1076 that was 33,360
rows per table.

The Tool Verification Report now summarizes the verification of its own
qualification scope and the gaps of its own module instead, so both pages
and the `get_metrics_with_first_value_total` filter only they used are
removed.

Refs eclipse-score#1076.
@AlexanderLanin
AlexanderLanin force-pushed the fix/1076-verification-report-scope branch from 986e3b9 to 62a029f Compare November 27, 2026 18:46
Copilot AI lite review requested due to automatic review settings November 27, 2026 18:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues were identified, so the scoped report changes and their associated end-to-end and template tests are ready for approval.

No open issues 🎉

3 resolved since last review

Review effort: Lite

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

3 participants