Skip to content

registration-readiness.ts advertises a stale '95% global coverage' gate; the real gate is 99% patch coverage #6605

Description

@JSONbored

Context

src/signals/registration-readiness.ts:89 defines:

const COVERAGE_GATE = ["npm run test:ci", "global coverage >= 95% (lines, statements, functions, branches)"];

This constant is surfaced as testCoverageHealth.requiredGate in buildRegistrationReadiness's output (src/signals/registration-readiness.ts:109), which flows into:

  • src/services/self-dogfood-registration-pack.ts:134, where each entry is rendered verbatim as `Preserve CI gate: ${gate}.` guidance text shown to a repo owner deciding whether their repo is ready for trusted-label/maintainer-cut promotion.
  • apps/loopover-ui/src/lib/registration-workspace.ts:300, which renders the same list in the registration-workspace UI.

This repository's actual, current test gate — documented at length in codecov.yml and vitest.config.ts — is:

  • codecov.yml: coverage.status.patch.default.target: 99%, described in the file's own header comment as "The real coverage gate is patch: changed lines and branches in a PR must be >=99% covered." project (whole-repo) coverage is explicitly informational: true and never blocks a merge.
  • vitest.config.ts:41-63: a local vitest thresholds backstop of only 90% for lines/functions/branches/statements, with an explicit comment: "Do NOT raise these toward the real coverage number or the cross-PR churn returns."

So COVERAGE_GATE's wording is wrong on two counts: the real gate is a patch (changed-lines) gate, not a global (whole-repo) one, and the real number is 99%, not 95%. This project's own registration-readiness guidance tells other maintainer repos to "preserve" this as "an equivalent test gate" (see the note field alongside it at line 110), so the incorrect number actively misleads a repo owner trying to match this project's real bar.

Requirements

  • Update the COVERAGE_GATE constant in src/signals/registration-readiness.ts:89 so its second entry accurately describes a patch/changed-lines coverage gate at 99%, e.g. "patch (changed-lines) coverage >= 99%", instead of "global coverage >= 95% (lines, statements, functions, branches)".
  • The corrected wording must not claim a "global" whole-repo coverage threshold, since this repo does not enforce one as a hard gate (only the 90% vitest local backstop, which vitest.config.ts explicitly says must never be conflated with "the real coverage number").
  • Add or update an assertion in test/unit/registration-readiness.test.ts that pins the exact, corrected COVERAGE_GATE wording. The existing assertion at line 108 only checks .toContain("npm run test:ci") and does not pin the coverage-percentage string, so without an added assertion this class of drift (correct value going stale again later) would not be caught by CI.

Deliverables

  • COVERAGE_GATE in src/signals/registration-readiness.ts reflects the real 99% patch-coverage gate, not a stale 95%/global figure
  • test/unit/registration-readiness.test.ts asserts the corrected requiredGate wording so this can't silently drift again

Test Coverage Requirements

Touches src/signals/registration-readiness.ts, which is under src/** — this repo's Codecov patch gate (99%+ on changed lines) applies to every changed line, including the new/updated assertion in test/unit/registration-readiness.test.ts.

Expected Outcome

A repo owner reading their registration-readiness report — via the API, self-dogfood-registration-pack.ts, or the loopover-ui registration workspace — sees this project's actual coverage bar (99% patch/changed-lines coverage), not a stale, lower, differently-scoped number.

Links & Resources

  • src/signals/registration-readiness.ts:88-113
  • src/services/self-dogfood-registration-pack.ts:134
  • apps/loopover-ui/src/lib/registration-workspace.ts:300
  • codecov.yml, vitest.config.ts:27-64
  • test/unit/registration-readiness.test.ts:108

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:bugGittensor-scored bug fix — scores a 0.05x multiplier.help wantedExtra attention is needed

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions