From b5321c5e8e6bd3712904ab6f1d10e9fd68c9506d Mon Sep 17 00:00:00 2001 From: Jacob Hagstedt Date: Thu, 17 Sep 2026 19:24:11 +0200 Subject: [PATCH] Correct the coverage gates the guide advertises The documented gates had drifted well below the real ones: the backend gate reads 80 in the workflow, not 50, and the frontend thresholds are 96 lines and statements, 91 functions, 92 branches, not the 80/85 pair recorded here. Anyone trusting the old numbers would think they had headroom that CI does not grant. The frontend type-check command is also named correctly now, since invoking tsc through npx picks up a newer compiler and fails spuriously. --- CLAUDE.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 3d3e200..7c9e20b 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -125,19 +125,19 @@ uv run ruff format --check . # format check uv run pytest # tests with coverage (config in pyproject.toml) ``` -CI gate: `--cov-fail-under=50` today (current total ~52%), climbing toward **90** as tests land. Don't lower it — only raise when coverage grows. +CI gate: `--cov-fail-under=80` today (current total ~84%), climbing toward **90** as tests land. Don't lower it — only raise when coverage grows. **Frontend** (from `frontend/`): ```bash -npx tsc --noEmit # type check +npm run typecheck # type check (never npx tsc: it resolves a newer TS and emits a bogus TS5101) npm run lint # ESLint, zero warnings npm run coverage # Vitest with coverage ``` CI gates (measured baseline after `src/pages/**` inclusion): -- lines: **80%** | functions: **85%** | branches: **85%** | statements: **80%** -- These act as a regression ratchet, not a target. Current state (82.36% lines, 88.5% functions) shows pages are now visible and poorly covered (Auth, Tips, DevFetch at 0%); the intent is to raise thresholds over time, not to churn tests today. +- lines: 96 | functions: 91 | branches: 92 | statements: 96 +- These act as a regression ratchet, not a target. Current coverage (97.26% lines/statements, 93.05% functions, 93.51% branches) exceeds thresholds; gates must never be lowered to pass. ### WHO RUNS THE VERIFICATION COMMANDS (cost rule) @@ -156,7 +156,7 @@ needed is reading pass/fail and the failure output. Paying a large model to sit than burning a large model on them. This applies to the full-suite verification runs: `uv run pytest`, `uv run ruff check .`, -`uv run ruff format --check .`, `npx tsc --noEmit`, `npm run lint`, `npm run coverage`, +`uv run ruff format --check .`, `npm run typecheck`, `npm run lint`, `npm run coverage`, `npx vitest run`, and `uv run alembic upgrade head`. It does **not** apply to quick diagnostics while you are mid-task — reading a single file, a