Appearance
0022: Score product tests in the risk scan
Status: accepted
Date: 2026-12-06
PR: #54
Context
The coverage run of prisk ran only the tests in tools/. So the lcov file had no line for a file in products/urn-forge/, and prisk gave each product file a coverage of 0%. By default, Node 24 also keeps test files out of coverage, so prisk could not score a product test by its own coverage.
Options considered
- Only the product glob: Node 24 still drops test files from lcov, so prisk scores product tests as uncovered.
- A lower score for product code: A lower risk score for product code would hide real gaps in its tests.
Decision
The coverage commands in prisk.yml and pr-summary.yml run 'tools/**/*.test.ts' and 'products/urn-forge/**/*.test.ts'. They pass --test-coverage-exclude='**/node_modules/**', which replaces the default exclude of Node 24, so test files stay in lcov.
Consequences
Test files of tools now appear in lcov, so prisk scores them by their own coverage. Each new product test counts toward the risk score of its pull request. The coverage commands of prisk.yml and pr-summary.yml must change together.