Skip to content

bug: --explain says scored below lowest reported score when scores are equal (top-N tie) #116

Description

@aryamthecodebreaker

What happened?

--explain can report a file as below-cutoff with a self-contradictory summary when the file’s score equals the lowest reported score (it lost a top-N / tie-break slot, not a score threshold):

# Why packages/core/src/rank.ts
Scored 6, below the lowest reported score of 6. Name a symbol...

“Below the lowest reported score of 6” while scoring 6 is false. The file was a candidate at the floor score but omitted from the capped report list.

Source: packages/core/src/explain.ts always uses status below-cutoff and the “below the lowest reported score” copy whenever the path is absent from rankContextFiles’s default limited result, without distinguishing score-floor vs top-N truncation vs tie-break loss.

How can we reproduce it?

npx -y @aryam/fixmap@0.7.3 plan --repo /path/to/FixMap \
  --issue "password reset emails never arrive" \
  --explain packages/core/src/rank.ts

(Adjust the explain path if needed until you hit a file whose unrestricted score equals the 8th reported score.)

What did you expect instead?

Copy that matches reality, e.g. “Scored 6, tied with the lowest reported file but outside the top 8 after tie-break” (or whatever the real rule is). Reserve “below the lowest reported score of X” for score < X only.

FixMap version or commit

v0.7.3 / main

Where did this happen?

CLI

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueApproachable contribution with a clear scope

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions