# Coverage Threshold Policy

This repository uses a **pragmatic threshold policy** focused on core-path confidence over vanity percentages.

## Policy

- Do not merge changes that reduce confidence on critical paths without compensating tests.
- For changes touching core pipeline/API/export logic, add or update targeted tests.
- Use contract tests + integration smoke + eval suites as the primary confidence stack.

## Hard Threshold (active)

CI enforces `--cov-fail-under=85` on the full `grantflow/` package.

Baseline measured 2026-05-14: **92%** total (809 tests).
The threshold is set at 85% to give headroom for new untested modules while blocking significant regressions.

To check locally:

```bash
pytest grantflow/tests/ --cov=grantflow --cov-report=term-missing:skip-covered --cov-fail-under=85
```

## Merge Gate Expectations

- CI test jobs must pass (includes coverage gate).
- Contract guards must pass.
- Quality/eval guards must pass.
- For risky changes, include explicit test evidence in PR summary.

## Tightening Path

If total coverage stays consistently above 90% for two releases, raise the threshold to 90%.
Do not raise the threshold during a sprint with active new-feature work.
