Skip to content

Coverage threshold contradiction remains: CLAUDE.md/csharp.md say 80%, general-unit-test.md/quality-tiers.md say 85%/75%, and two live gates disagree #563

Description

@drmoisan

Summary

Issue #494 was chartered to reconcile the repository's contradictory coverage thresholds. A
user-authorized scope correction recorded in that feature's spec.md deferred the edits to
CLAUDE.md, .claude/rules/general-unit-test.md, and .claude/rules/quality-tiers.md to an
upstream prompt artifact for a separate repository. The contradiction therefore still exists in
TaskMaster after the epic merged.

Current state

Three always-loaded governance documents disagree:

Document Line coverage Branch coverage
CLAUDE.md (UT2) >= 80% on a "testable denominator" with COM/VSTO exemptions not stated
.claude/rules/csharp.md 80% not stated
.claude/rules/general-unit-test.md >= 85% >= 75%
.claude/rules/quality-tiers.md >= 85% uniform T1-T4 >= 75% uniform T1-T4

CLAUDE.md also permits [ExcludeFromCodeCoverage] and coverage.config assembly excludes, while
.claude/rules/general-unit-test.md states that no production file may be excluded from coverage
measurement and instructs reviewers to treat such an exclusion as a Blocking finding.

Why this is now executable, not just textual

The epic added Assert-CoberturaLineCoverageThreshold
(scripts/vscode/Invoke-MSTestWithCoverage.Helpers.ps1:487), which enforces 80% line coverage
and performs no branch check. The review hook
.claude/hooks/validate-feature-review-coverage.ps1:313,323 fails below 85.0 line and 75.0
branch.

A measured figure in the interval [80, 85) passes the developer-facing gate and fails the
review-facing gate. The two enforcement points disagree on live numbers, not just prose.

Impact on the epic's stated outcome

docs/features/epics/build-ci-coverage-gate-fidelity/epic.md lists as leading indicator 2: "A
deliberately introduced coverage regression fails the documented coverage gate." The gate does
mechanically fail a regression, but at a threshold that disagrees with two of the three documents
#494 was chartered to reconcile. The indicator is partially discharged.

Suggested resolution

Pick one number for line coverage and one for branch coverage, apply it to all four documents and
both enforcement points, and record the decision. Per the epic's own recorded NFR, no threshold may
be lowered to accommodate a corrected denominator without an explicit recorded decision, so this
needs a maintainer decision rather than an agent choosing the convenient value.

Related: #561 (no CI enforcement of any threshold).

Found during the build-ci-coverage-gate-fidelity epic fan-in review; corroborated independently by
two review passes and the epic audit.

Activity

  1. drmoisan commented on Sep 11, 2026

    @drmoisan
    OwnerAuthor

    Maintainer decision recorded 2026-09-11

    Question Decision
    C# line-coverage floor 80%
    C# branch-coverage floor 75%
    Exclusion policy The three exemption classes in CLAUDE.md UT2 stand as written: (a) VSTO lifecycle classes, (b) WinForms form-derived and Designer code, (c) Outlook Interop event-handler classes without an injectable seam. Testable seams inside COM-bound assemblies remain non-exempt.
    PowerShell floor Same number as C#: 80% line. Branch is not measured by Pester and no branch gate applies.
    Where the decision is recorded CLAUDE.md alone. The .claude/rules/*.md files and validate-feature-review-coverage.ps1 are push-down owned from drm-copilot and are not edited in this repository.

    Measured at the time of the decision (PR #829, de-duplicated first-party aggregation): C# line 84.56%, C# branch 79.24%, PowerShell line 78.3% over scripts/vscode. The C# figures clear both floors. The PowerShell figure is 1.7 points below its floor and must be raised, not the floor lowered, before a Pester CI gate at 80 can pass (#562).

    Resolution in this repository: CLAUDE.md UT2 and CUT3 are corrected to state 80 line / 75 branch for C#, 80 line for PowerShell, and the script gate at 80 is confirmed as the single enforced number. The review hook's 85/75 figures are an upstream matter and are recorded, not changed, here. This work is folded into the CLAUDE.md corrections item alongside #828, scheduled into the consolidated bug parallel run being planned on 2026-09-11.

  2. drmoisan commented on Sep 28, 2026

    @drmoisan
    OwnerAuthor

    Verified fixed in this repository by PR #894 (item #870). CLAUDE.md now states C# 80% line and 75% branch and PowerShell 80% line, and the script gates enforce the same figures (Invoke-MSTestWithCoverage.Threshold.ps1:52,58). The push-down-owned residual (.claude/rules/*.md and validate-feature-review-coverage.ps1 still say 85/75) is carried by the upstream tracker #932. Closing as fixed by #894.

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

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions