Skip to content

0012: Give Detection credit only for real checks ​

Status: accepted

Date: 2026-12-04

PR: #10

Context ​

The risk scan scores Detection mostly from the test coverage of code. Some files have no coverage number: modules of only types, data files, workflows and the risk map. docs-map.yml arrived later, and the scan scored it as product code with no tests.

Options considered ​

  • Score docs-map.yml as code: the scan scored a YAML settings file as code with no tests.

Decision ​

A module of only types counts as 100% covered, because the compiler checks it. A data file that covered code imports scores a Detection of 3 when the tests pass and 5 when they fail. A workflow that runs on pull_request scores a Detection of 2, because a broken edit fails on the same pull request.

The scan reads the risk map from the merge base. An edit to the risk map scores a Detection of 2 only when the new map is valid and the tests pass. Any other file that no check covers scores as risky. The scan scores docs-map.yml as a build file.

Consequences ​

A file gets a better Detection only when a real check can catch a mistake in it. The compiler, the tests and the CI of the pull request are real checks. Files that cannot break at runtime do not make a pull request look more risky than it is. A file that no check covers scores as risky, never as safe. A pull request cannot loosen its own rules. docs-map.yml carries the risk of build config, because a tool in CI reads it.

Code ​