Skip to content

chore(overrides): three behaviour-neutral tidy-ups in the OA008 detector and version utils #1256

Closed

Description

@sonukapoor

Good first issue. Three small tidy-ups in the OA008 detector and one shared helper, all behaviour-neutral. Found while reviewing #1240; none of them is a bug.

1. Dead branch in src/overrides/detectors/oa008-materialized.ts

The multi-bucket message path contains copyCount === 1 ? "does" : "do". That branch is unreachable: reaching the multi-bucket path requires two populated buckets, which requires two distinct versions, which requires at least two copies. The singular form can never be produced there.

2. POSITION_LABEL is defined and then bypassed

The file defines a POSITION_LABEL map for "below the range" / "above the range" / "outside the accepted intervals", then the multi-bucket path rebuilds the same three strings inline with a ternary chain to capitalize them. So the mapping exists in two places and can drift.

3. satisfiesRange duplicates positionAgainstRange in src/utils/version.ts

satisfiesRange(v, r) is now exactly equivalent to positionAgainstRange(v, r) === "satisfies", and repeats the same five-line normalization preamble.

This one is worth a little care. In the detector, the catch-all else outside.push(version) absorbs both "satisfies" and null, so if these two functions ever diverge, a copy gets silently mislabelled as "outside the accepted intervals" rather than erroring. Expressing one in terms of the other makes that drift impossible.

How to know it worked

All three must be behaviour-neutral. The OA008 message text and the classification results should be identical before and after.

  • npm test stays green, currently 2127 tests
  • spot-check a few OA008 messages by hand and confirm the strings are unchanged

Getting started

  • npm install, then npm run build and npm test
  • branch as chore/issue-NNN-short-description
  • Closes #NNN in the PR body

Happy to answer questions here.

Activity

  1. idrivehtbusiness commented on Sep 30, 2026

    @idrivehtbusiness
    Contributor

    hello, I’d like to work on this issue. I’ll keep the changes behaviour-neutral and limited to the three tidy-ups described here, then run the full verification sequence before opening the PR.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions