Repository navigation
#95: coverage matrix aspects - #98
Conversation
…link warnings - A counted criterion with aspects gets one aspect entry per declared value; a bare @ac:<id> link covers every aspect, and the row's status follows its aspects. - A keyword criterion's row carries its keyword, the one placeholder_values key. - STALE_AC_REF, PLANNED_AC_HAS_TESTS and IN_REVIEW_AC_HAS_TESTS follow the forwarded warnings; a tag with an aspect still covers a criterion without aspects. - Lineage maps aspect[] and placeholder_values; the link's aspect is dropped with a reason. - The fixture pair's root coverage moves from 66.7 to 55.6: golden, tests, CI and docs follow.
…the Living Documentation Toolkit
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Per-aspect coverage rows packages/services/coverage_matrix/src/living_doc_service_coverage_matrix/builder.py, .../lineage.py, packages/services/coverage_matrix/tests/test_builder.py, .../test_lineage.py, .../expected/*, packages/services/coverage_matrix/README.md |
Criteria with declared aspects now have ordered aspect coverage entries, and row status reflects the aspect statuses. Bare links cover each declared aspect; aspect-specific links cover matching aspects. Keyword values and lineage mappings are retained. |
Warnings for uncounted links packages/services/coverage_matrix/src/living_doc_service_coverage_matrix/builder.py, packages/services/coverage_matrix/tests/test_builder.py, .../test_service.py, apps/cli/tests/test_coverage_matrix.py, packages/services/coverage_matrix/README.md, apps/cli/README.md |
The builder reports warnings for links to unknown criteria, undeclared aspects, and planned or in-review criteria. The tests check warning contents, ordering, and criteria omitted from rows. |
Fixtures, command checks, and documentation .github/workflows/integration.yml, apps/cli/tests/test_coverage_matrix.py, tests/test_main.py, packages/services/coverage_matrix/tests/test_service.py, packages/services/coverage_matrix/tests/expected/*, CONTEXT.md, packages/services/CONTEXT.md, DEVELOPER.md, apps/cli/README.md, packages/services/coverage_matrix/README.md |
Fixtures and command tests use totals of 6 counted criteria, 3 covered, 1 partially covered, and 2 not covered, with 55.6% coverage. Threshold checks and documentation reflect the updated output and checks. |
Priority:
Estimated code review effort: 3 (Moderate) | ~25 minutes
Change: Feature · Severity of issue fixed: Medium
Sequence Diagram(s)
sequenceDiagram
participant DocSourceResult
participant UITestsResult
participant build_coverage_matrix
participant CLI
participant CoverageMatrixArtifact
DocSourceResult->>build_coverage_matrix: Criteria and declared aspects
UITestsResult->>build_coverage_matrix: Scenario links
build_coverage_matrix->>CLI: Matrix rows and warnings
CLI->>CoverageMatrixArtifact: Write coverage matrix
Possibly related PRs
- AbsaOSS/living-doc-toolkit#90: Adds the UI-test acceptance-criterion links and aspects that this change uses to assign scenarios to coverage aspects and generate link warnings.
- AbsaOSS/living-doc-toolkit#94: Adds the initial coverage-matrix service that this change extends with per-aspect coverage and link warnings.
Suggested labels: enhancement
Suggested reviewers: tmikula-dev
Merge Risk: 
Minimal · up to adda5
-
The updated coverage behavior and checks present no identified merge-blocking risk. Merge after normal checks.
Pre-merge checks: 
3 · 
2
-
Failed checks: 2 warnings Passed checks: 3 passed-
Full details: Linked Issues check
-
Explanation
Issue
#95is open and directly linked. The builder now creates ordered per-aspect coverage, applies bare and aspect-specific links, preserves plain-criterion behavior, sets keyword metadata, and emits the three required warning codes. The lineage table maps aspects and keyword values and routes link aspects. The reported tests, fixture updates, full-sample checks, integration assertions, andmake qaresults cover the remaining coding requirements.
-
Full details: Out of Scope Changes check
-
Explanation
The new root
CONTEXT.mddocuments the whole monorepo, including all commands, general conventions, CI structure, and project invariants. This content does not implement or test issue#95. The reportedpackages/services/CONTEXT.mdchange also documents the services generally rather than the requested coverage-matrix behavior. These additions are not needed for the per-aspect coverage, warning, lineage, fixture, or integration objectives.Resolution
Remove the unrelated
CONTEXT.mdadditions from this pull request, or move them to a separate documentation pull request.
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 30 functions across 7 files. (8 skipped: 8 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches: 💡 1
-
📝 Generate docstrings: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
A rabbit checks each aspect row,
And watches coverage statuses grow.
A bare link visits aspects all,
A named link finds its matching call.
Keywords stay; warnings mark the trail.
The matrix writes the measured tale.
Comment @coderabbitai help to get the list of available commands.
Overview
coverage-matrixnow computes what the canon's coverage rules compute: coverage per declared aspect, the keyword, and a warning for each scenario link it does not count as written. Nothing else in the command changes: the inputs, the entities and their order,planned_summary,--view,--fail-under, the envelope and the documentation entry'sselected_stats.Rows with aspects. A counted criterion that declares aspects, with
Aspect:or a keyword, gets oneaspects[]entry per declared value, in declared order. A scenario goes under the aspect its link names. A bare@AC:<id>link puts it under every aspect. Each scenario is listed once per aspect, in input order. An aspect iscoveredwith a scenario andnot_coveredwithout one. The row iscoveredwhen every aspect is,not_coveredwhen none is, andpartially_coveredotherwise. Its ownscenario_idsstays empty, as in the contract's sample. A criterion with aspects and no scenario isnot_covered. The summaries need no new code:CoverageSummary.from_rowsalready weighs apartially_coveredrow as its covered aspects over its declared ones.The keyword. A keyword criterion is counted per value exactly as an
Aspect:one. Its row carrieskeyword, the criterion's oneplaceholder_valueskey as stored (rule), which labels the breakdown. AnAspect:row and a row without aspects carry none.ui-tests.jsondoes not store a keyword tag's name, only its value, so the name is not checked.Rows without aspects are unchanged. Every link to the criterion covers it, including a link that names an aspect.
The warnings. The builder adds them after every forwarded warning, in scenario order, then link order:
STALE_AC_REF: the link names a criterion that no User Story or Functionality in the documentation input has, or an aspect the criterion does not declare.PLANNED_AC_HAS_TESTS/IN_REVIEW_AC_HAS_TESTS: the criterion isplanned/in_review, whatever the link's aspect. The criterion has no row, and the scenario keeps its link inui-test-catalog.ac_idis the link's id, whichAcLinkguarantees is valid, andentity_idis that id without its last-<n>.line_no,pathandsource_urlstay unset, because a collector fills them. Themessagenames the scenario, the criterion and any undeclared aspect. Thecontextholds them asscenario_id='<id>', plusaspect='<value>'for an undeclared aspect.Why an undeclared aspect still covers a criterion without aspects, and never one with aspects. A criterion documented without aspects can meet scenarios tagged with aspects, for example when its documentation is mined from an issue and its tests come from
.featurefiles that declare them.living-doc's examples README expects exactly thisSTALE_AC_REFon itsgh-issueschain. The scenario names the criterion, and that criterion has only one thing to cover, so the link covers it, with the warning. On a criterion with aspects, a value it does not declare counts nowhere. Treating it as a bare link would let a typo cover every aspect.The coverage percentage moves. It changes wherever criteria declare aspects, because a
partially_coveredrow now weighs less than 1. The fixture pair goes from 66.7 to 55.6 (6 counted, 3 covered, 1 partially covered, 2 not covered). A--fail-underthreshold set against the old figure may need a look.DEVELOPER.md's local example ran the fixture pair with--fail-under 60, so it is now 50.Lineage. Under both
user_stories[]andfunctionalities[],acceptance_criteria[].aspect[]now maps toentities[].acceptance_criteria[].aspects[].aspect, andacceptance_criteria[].placeholder_valuestoentities[].acceptance_criteria[].keyword. Both are added toMAPPED_ENTITY_PATHS. The link'saspectisDropped, like itsid, with its own reason: it only decides which aspect of the criterion's row lists the scenario. The entry that dropped these paths until per-aspect coverage existed is gone. Every other entry stays, and so does the run-time check: once, before the write, against the documentation entry'sselected_statsover the counted criteria. A criterion's aspects lost from one list while the other list fills the path is still a partial drop, which R11 does not detect, and the package README says so.Version impact. No bump; every package stays
0.1.0. No input, option, exit code or error line changes, and no artifact contract changes. The output now fillsaspects[]andkeywordand adds three transform warnings, all of whichcoverage-matrix-v1.0.0already defines.Release Notes
coverage-matrixcounts coverage per aspect: a criterion that declares aspects or a keyword iscovered,partially_coveredornot_coveredfrom its aspects, with a breakdown per aspect; a bare@AC:<id>tag covers every aspect.coverage-matrixwarns about a scenario link it does not count as written:STALE_AC_REFfor an unknown criterion or an undeclared aspect,PLANNED_AC_HAS_TESTSandIN_REVIEW_AC_HAS_TESTSfor aplannedorin_reviewcriterion. The run still succeeds, and a tag with an aspect still covers a criterion that declares none.partially_coveredcriterion weighs its covered aspects over its declared ones.Framework
aspect,placeholder_values,AcLink.aspect), and the change mirrors no contract model and commits no schema (F7).Related
Closes #95
Contract Rules
scenario_idsstays empty: rendering, § Coverage.CoverageSummary.from_rows.STALE_AC_REFis "reported".aspect, andplaceholder_valueskeeps its one name: AC grammar, § Variants.make no-vendored-schemasis clean;read_artifactand the matrix is written withwrite_artifact;No disagreement with the canon was found. One reading the pages leave open: an aspect value is matched exactly as written, so
Minimum-Lengthis notminimum-length. The canon folds keyword names, but it states no folding for values.Verification
make qapassed: core 67 tests, normalize-docs 70, normalize-tests 20, coverage-matrix 60 (100 % coverage), CLI 47, root 59. Pylint 10.00 in every package; Black, ruff, mypy and deptry clean;no-vendored-schemasclean.FUNC-001's rows and the root):FUNC-001-01:coveredoverminimum-length,character-classesandno-username, one scenario each.FUNC-001-02:not_covered.FUNC-001-03: keywordrule,partially_covered1/3, withminimum-lengthcovered by one scenario.FUNC-001: 3 counted, 1 covered, 1 partially covered, 1 not covered, 44.4.US-001is unchanged at 66.7, andFUNC-002still has no row.planned_summary: total 2, backlog 1,{"1.1.0": 1}.generated_atmasked; the release view differs only indocument.view.FIELD_LOSS; every entity, row, aspect, keyword and summary, andplanned_summary, equalfull_sample("coverage-matrix-v1.0.0")'s by entity id; root 7 counted, 2 covered, 1 partially covered, 4 not covered, 33.3; no warning.integration.ymlassertions ran locally on the repository's venv over a release-view matrix:action-run's(6, 3, 1, 2),55.6andFUNC-001-03'spartially_coveredandrule, and the isolation job's(6, 55.6).Acceptance criteria
A bare
builder.py,lineage.py,service.pyortests/test_*.pypath is underpackages/services/coverage_matrix/(src/living_doc_service_coverage_matrix/for the modules).scenario_idsempty; no scenario →not_covered; a row without aspects unchanged:builder.py:58-102;tests/test_builder.py:123,:185,:199,:216,:225,:235,:279,:311.Aspect:one, withkeyword; none on anAspect:row or a plain row:builder.py:99-100;tests/test_builder.py:145,:252.FUNC-001-01covered over three aspects,FUNC-001-03rule1/3,FUNC-00144.4, root 6 / 3 / 1 / 2 at 55.6:tests/expected/coverage-matrix.json,tests/expected/README.md;tests/test_builder.py:171,tests/test_service.py:61,:79.planned/in_review, and the count rule:builder.py:125-191,:306;tests/test_builder.py:328,:358,:394,:417,:441,:462; the run succeeds:tests/test_service.py:245,apps/cli/tests/test_coverage_matrix.py:145.full_sample("coverage-matrix-v1.0.0")by entity id:tests/test_service.py:92.assert_completepasses for both contracts, and a builder that drops the aspects or the keyword fails withFIELD_LOSSand writes no file:lineage.py:83-84,:110-113;tests/test_lineage.py:10,:14,:20,:48;tests/test_service.py:316(fixture pair, Functionalities),:338(full samples, User Stories).selected_statsunchanged:builder.py:220-258.action-runand the isolation job assert the new numbers:.github/workflows/integration.yml:155-162,:253. No page, test or comment says the matrix is per criterion or that aspects come later.make qagreen;integration.ymlruns on this PR.## Frameworkabove.