Skip to content

feat(platform-report): list requirements without in-scope references - #921

Merged
antonkri merged 2 commits into
feat/requirement-reference-coveragefrom
feat/requirement-reference-gap-tables
Oct 7, 2026
Merged

antonkri merged 2 commits into
feat/requirement-reference-coveragefrom
feat/requirement-reference-gap-tables

Conversation

@antonkri

@antonkri antonkri commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Builds on #896 — the base branch is feat/requirement-reference-coverage, so this PR's diff only contains the change described below. Please merge #896 first; GitHub will then retarget this PR to main automatically.

Why

#896 adds the reference coverage pies, which show how many requirements are not referenced by any lower-level requirement — but not which ones. That makes the gap visible, yet not actionable.

What

A collapsed table next to each pie, listing exactly the requirements behind the red "not referenced" slice:

  • Stakeholder section — stakeholder requirements not referenced by any in-scope feature requirement.
  • Per feature — feature requirements not referenced by any in-scope component requirement.

The tables are omitted entirely when there is no gap, so an empty table never shows up. The count is part of the dropdown title, so the gap size is visible without expanding it.

Report version scoping

Both tables are filtered by the same pre-scoped ID lists that feed the pies (ns_stkh_ref.missing / ns_feat_ref.missing), so chart and table cannot disagree by construction.

This matters because the scoping is not expressible as a needtable filter: the filter string knows neither req_in_report_version nor how to follow derived_from (a comp_req inherits its version from its parent). The scope is therefore resolved in Jinja — where that helper is available — and the result is expanded into the filter as a plain ID list, the same mechanism the existing requirement tables already use.

The practical consequence: a requirement referenced only from outside the report's report_version still counts as a gap. That case is covered by the added end-to-end test, which renders the actual report.

Note on the "Referenced by" column

This deliberately does not reintroduce the per-row "Referenced by" column that was removed in #896. A column would need the scoped backlinks as a field on the need, which requires a new link type in the metamodel. A table only needs a row selection, which works with the existing machinery. See the discussion in #896.

The reference coverage pies show *how many* requirements are not referenced by
any lower-level requirement, but not *which* ones. Add a collapsed table next
to each pie that lists exactly those requirements:

- Stakeholder section: stakeholder requirements not referenced by any in-scope
  feature requirement.
- Per feature: feature requirements not referenced by any in-scope component
  requirement.

Both tables are filtered by the same pre-scoped ID lists that feed the pies
(`ns_stkh_ref.missing` / `ns_feat_ref.missing`), so chart and table cannot
disagree. The report version scoping therefore applies to the tables as well: a
requirement referenced only from outside the report's `report_version` still
counts as a gap.

The tables are omitted entirely when there is no gap, so an empty table never
shows up.

Adds an end-to-end test rendering the report, covering the case where the only
reference comes from an out-of-scope requirement.
@antonkri
antonkri merged commit ea145c3 into feat/requirement-reference-coverage Oct 7, 2026
31 of 32 checks passed
@antonkri
antonkri deleted the feat/requirement-reference-gap-tables branch October 7, 2026 11:53
@antonkri

antonkri commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

Folded into #896 rather than kept as a stacked PR: the gap tables only make sense together with the pie charts whose red slice they explain, so reviewing them separately meant looking at half a feature.

Since this branch was stacked directly on feat/requirement-reference-coverage, fast-forwarding that branch to this one brought both changes over unchanged - GitHub marked this PR as merged automatically. No code was lost or rewritten.

Everything now lives in #896.

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

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

1 participant