Skip to content

[quality] vitest coverage thresholds sit ~11 points below actual coverage; the gate cannot catch regressions #201

Description

@hivecommons-hive

Finding

vitest.config.mjs enforces coverage thresholds of lines 85 / branches 83 / functions 91 / statements 85. Actual coverage on main @ 187c5e3 (npx vitest run --coverage, 1291 tests) is:

Metric Actual Threshold Slack
Statements 96.35% (2325/2413) 85 11.35 pts (~274 statements)
Branches 94.55% (1441/1524) 83 11.55 pts (~176 branches)
Functions 99.14% (465/469) 91 8.14 pts (~38 functions)
Lines 96.16% (2208/2296) 85 11.16 pts (~256 lines)

A PR could delete roughly a quarter of the suite's coverage and build-test would still pass. The threshold exists as a regression gate but is not currently gating anything. There is no other coverage signal: .github/workflows/test.yml runs npm run test:coverage with text reporters only — no artifact, badge, or PR annotation — and the repository has no end-to-end suite, so unit coverage is the only evidence available.

Recommendation

Ratchet the thresholds to just under the current floor so a regression of more than ~1 point fails CI:

thresholds: {
  lines: 95,
  branches: 93,
  functions: 98,
  statements: 95,
},

Verified locally: the suite passes at these values on 187c5e3. Once the currently held error-path test PRs (#173–#200) land, coverage will be ~99% and the thresholds can be ratcheted again; alternatively set coverage.thresholds.autoUpdate: true so vitest rewrites the config whenever coverage rises, at the cost of a config diff in contributor working trees.

Priority

  • Impact: medium — coverage regressions currently pass CI unnoticed
  • Effort: low — one config change

Filed by quality agent (hold-gated mode)

🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5q9t | SHA: 187c5e3

— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88

Activity

  1. added
    qualityCreated by Hive for agent-filed issue provenance
    testingCreated by Hive for agent-filed issue provenance
    agent/qualityCreated by Hive for agent-filed issue provenance
    on Sep 27, 2026
  2. github-actions commented on Sep 27, 2026

    @github-actions
    Contributor

    Please add a kind label with /kind failing-test or /kind cleanup.

  3. added
    hive/covered-by-prHive verified that an open PR references or claims this issue; still actionable until confirmed
    on Sep 27, 2026
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

    agent/qualityCreated by Hive for agent-filed issue provenancehive/covered-by-prHive verified that an open PR references or claims this issue; still actionable until confirmedhive/hosted-available-lke648397-260827-5q9tCreated by Hive for agent-filed issue provenanceneeds-kindqualityCreated by Hive for agent-filed issue provenancetestingCreated by Hive for agent-filed issue provenance

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions