Skip to content

feat(dev): enforce vitest coverage thresholds per TDD domain #188

Description

@melagiri

Context

PR #187 established strategic TDD domains with coverage targets:

Level Domain Coverage Target
MUST TDD Parsers (cli/src/providers/) 90%+
MUST TDD Normalizers (server/src/llm/*-normalize.ts) 85%+
MUST TDD Pricing (server/src/llm/analysis-pricing.ts) 85%+
MUST TDD Response parsers (server/src/llm/response-parsers.ts) 85%+
MUST TDD Migrations (cli/src/db/) 90%+
MUST TDD Shared utilities 85%+
SHOULD TDD API routes (server/src/routes/) 70%+

Currently these targets are documented (in docs/QA.md, docs/DEVELOPMENT.md, and agent prompts) but not enforced — there's no vitest config or CI check that fails when coverage drops below the threshold.

What

Configure vitest coverage thresholds so that pnpm test fails if coverage drops below the target for MUST TDD domains.

Acceptance Criteria

  • vitest.config.ts in cli/ and server/ configured with coverage.thresholds per-glob pattern
  • pnpm test:coverage fails if any MUST TDD domain drops below its target
  • Baseline coverage measured and documented (current actual vs target)
  • If current coverage is below target for any domain, create a plan to close the gap before enforcing
  • Pre-PR hookify gate updated to run pnpm test:coverage (or document why pnpm test alone is sufficient)

Notes

  • Raised during triple-layer review of PR feat(dev): implement strategic TDD workflow #187 (Wild Card suggestion S4)
  • Coverage enforcement should be additive — don't block pnpm test on coverage, use pnpm test:coverage as a separate check
  • Consider whether coverage thresholds should be warnings vs hard failures initially

Size

T-shirt: S (config changes + baseline measurement)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions