Risk-weighted coverage policy + diff-coverage gate (ADR 0004) #294
Reference in New Issue
Block a user
Delete Branch "cover-global-90"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Stacked on #290 (base =
cover-egress-addon-adapter).Implements ADR 0004 — risk-weighted coverage: instead of chasing one global percentage (which pushes the most test effort onto the least safety-relevant code and invites performative line-chasing), measure what matters.
What this does
cli/init.py(aread_tty_line()prompt loop) joinscli/tui.pyin.coveragerc, with a rationale comment. Subprocess/backend orchestration is deliberately NOT omitted — that code tears down sandboxes and wires networks, so it stays visible and is scored via the integration suite instead.scripts/coverage.shruns unit + integration under one measurement (the policy's yardstick) and can print the critical security/logic core (--critical).scripts/diff_coverage.pyis stdlib-only (nodiff-coverdependency, per the repo's low-dep rule): new/changed executable lines must be ≥90% covered. This is the enforced regression guard; the global number is informational.coveragejob: combined report + the diff gate (degrades gracefully when the runner lacks Docker — integration skips, the diff gate is Docker-independent).cli/__init__dispatch — it's exit-code logic, not I/O, so it earns tests rather than an omit (9 tests).Numbers
Per-module ratcheting of the critical core toward 90% (egress_addon 76→, git_gate 80→, yaml_subset 83→, …) is the ongoing work this policy frames — see ADR 0004.
Full unit suite (1329 tests) passes; pyright clean; pylint 10.00 on new files.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.