chore(coverage): relax thresholds to cut low-value churn
test / unit (push) Successful in 48s
prd-number-check / require-numbered-prds (pull_request) Successful in 9s
tracker-policy-pr / check-pr (pull_request) Successful in 10s
test / unit (pull_request) Successful in 49s
test / image-input-builds (pull_request) Successful in 50s
test / integration-docker (pull_request) Successful in 56s
test / coverage (pull_request) Successful in 15s
test / image-input-builds (push) Successful in 46s
Update Quality Badges / update-badges (push) Successful in 56s
test / coverage (push) Successful in 22s
test / integration-docker (push) Successful in 1m3s
lint / lint (push) Successful in 2m59s
test / unit (push) Successful in 48s
prd-number-check / require-numbered-prds (pull_request) Successful in 9s
tracker-policy-pr / check-pr (pull_request) Successful in 10s
test / unit (pull_request) Successful in 49s
test / image-input-builds (pull_request) Successful in 50s
test / integration-docker (pull_request) Successful in 56s
test / coverage (pull_request) Successful in 15s
test / image-input-builds (push) Successful in 46s
Update Quality Badges / update-badges (push) Successful in 56s
test / coverage (push) Successful in 22s
test / integration-docker (push) Successful in 1m3s
lint / lint (push) Successful in 2m59s
Lower the diff-coverage gate from 90% to 80% and the critical-module target from 90% to 85%. The 90% diff gate forced back-fill tests on nearly every changed line; 80% keeps new code honest without the churn. Global coverage stays informational per ADR 0004 (no new gate added). Updates scripts/diff_coverage.py, scripts/coverage.sh, scripts/critical-modules.txt, .gitea/workflows/test.yml, and records the change as a dated revision in ADR 0004. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit was merged in pull request #521.
This commit is contained in:
@@ -298,7 +298,7 @@ jobs:
|
||||
- name: Combined coverage (unit + docker integration)
|
||||
run: PYTHON=python3 bash scripts/coverage.sh aggregate critical
|
||||
|
||||
- name: Diff-coverage gate (changed lines >= 90%)
|
||||
- name: Diff-coverage gate (changed lines >= 80%)
|
||||
run: |
|
||||
git fetch --no-tags origin main:refs/remotes/origin/main
|
||||
python3 scripts/diff_coverage.py --base origin/main --min 90
|
||||
python3 scripts/diff_coverage.py --base origin/main --min 80
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
- **Status:** Accepted
|
||||
- **Date:** 2026-06-25
|
||||
- **Deciders:** didericis
|
||||
- **Revised:** 2026-07-27 — thresholds relaxed (critical minimum 90→85%,
|
||||
diff-coverage gate 90→80%) to cut low-value test churn on changed lines.
|
||||
The risk-weighting structure and the "global is informational" rule are
|
||||
unchanged.
|
||||
|
||||
## Context
|
||||
|
||||
@@ -34,7 +38,7 @@ a regression (Goodhart's law).
|
||||
Coverage is **risk-weighted**, measured over the **combined unit +
|
||||
integration** suites, with three rules:
|
||||
|
||||
1. **Critical modules must remain ≥ 90%.** The curated security/logic core
|
||||
1. **Critical modules must remain ≥ 85%.** The curated security/logic core
|
||||
covers the host and gateway egress policy, manifest trust boundary,
|
||||
git-gate enforcement, supervise protocol/server, YAML parser, and bottle
|
||||
state. The concrete module list lives in `scripts/critical-modules.txt`;
|
||||
@@ -55,7 +59,7 @@ integration** suites, with three rules:
|
||||
|
||||
The forward-looking guard is a **diff-coverage gate**
|
||||
(`scripts/diff_coverage.py`): new/changed executable lines on a branch
|
||||
must be ≥ 90% covered. This catches regressions where they are
|
||||
must be ≥ 80% covered. This catches regressions where they are
|
||||
introduced without forcing a back-fill crusade through legacy glue. The
|
||||
gate skips lines in omitted files (there is no coverage data for them),
|
||||
so the omit list cannot launder *new* logic into the dark: anything that
|
||||
|
||||
+5
-5
@@ -13,7 +13,7 @@
|
||||
# are re-executed; no KVM or Docker dependency.
|
||||
#
|
||||
# Pass "critical" as the last argument in either mode to also report just the
|
||||
# critical modules (ADR 0004 target: 90%).
|
||||
# critical modules (ADR 0004 target: 85%).
|
||||
set -euo pipefail
|
||||
|
||||
cd "$(dirname "$0")/.."
|
||||
@@ -34,8 +34,8 @@ if [ "${1:-}" = "aggregate" ]; then
|
||||
"$PY" -m coverage report -m
|
||||
|
||||
if [ "${2:-}" = "critical" ]; then
|
||||
echo "== critical modules (ADR 0004 minimum: 90%) ==" >&2
|
||||
"$PY" -m coverage report --include="$CRITICAL" --fail-under=90
|
||||
echo "== critical modules (ADR 0004 minimum: 85%) ==" >&2
|
||||
"$PY" -m coverage report --include="$CRITICAL" --fail-under=85
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
@@ -55,6 +55,6 @@ echo "== combined report ==" >&2
|
||||
"$PY" -m coverage report -m
|
||||
|
||||
if [ "${1:-}" = "critical" ]; then
|
||||
echo "== critical modules (ADR 0004 minimum: 90%) ==" >&2
|
||||
"$PY" -m coverage report --include="$CRITICAL" --fail-under=90
|
||||
echo "== critical modules (ADR 0004 minimum: 85%) ==" >&2
|
||||
"$PY" -m coverage report --include="$CRITICAL" --fail-under=85
|
||||
fi
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Critical security/logic core held to the >=90% coverage bar by
|
||||
# Critical security/logic core held to the >=85% coverage bar by
|
||||
# docs/decisions/0004-coverage-policy.md.
|
||||
#
|
||||
# SINGLE SOURCE OF TRUTH: scripts/coverage.sh (the `critical` report) and
|
||||
|
||||
@@ -13,8 +13,8 @@ policy.
|
||||
|
||||
Usage:
|
||||
scripts/coverage.sh # produce .coverage first
|
||||
python3 scripts/diff_coverage.py # gate against origin/main, min 90%
|
||||
python3 scripts/diff_coverage.py --base main --min 85
|
||||
python3 scripts/diff_coverage.py # gate against origin/main, min 80%
|
||||
python3 scripts/diff_coverage.py --base main --min 75
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
@@ -74,7 +74,7 @@ def main() -> int:
|
||||
ap = argparse.ArgumentParser()
|
||||
ap.add_argument("--base", default="origin/main",
|
||||
help="git ref to diff against (default: origin/main)")
|
||||
ap.add_argument("--min", type=float, default=90.0,
|
||||
ap.add_argument("--min", type=float, default=80.0,
|
||||
help="minimum %% of changed executable lines covered")
|
||||
args = ap.parse_args()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user