Skip to content

Add deterministic tie-break to repair suggestion ranking#68

Merged
VPDPersonal merged 1 commit into
feature/serialize-reference-dropdownfrom
fix/sr-repair-suggestion-deterministic-tiebreak
Jun 23, 2026
Merged

Add deterministic tie-break to repair suggestion ranking#68
VPDPersonal merged 1 commit into
feature/serialize-reference-dropdownfrom
fix/sr-repair-suggestion-deterministic-tiebreak

Conversation

@VPDPersonal

Copy link
Copy Markdown
Owner

Summary

  • Add a deterministic tie-break to the Smart-Fix candidate ranking in SerializeReferenceRepairSuggestions.Rank: after the descending-score sort, ties now break on the candidate's Type.FullName and then its assembly name (both Ordinal).
  • Prevents the one-click repair suggestion from flipping between equally-scored same-named types (e.g. two Pistol classes in different namespaces) across domain reloads, which could otherwise re-point a reference to the wrong type.

Notes for review

  • The previous sort keyed only on the discrete float Score with an unstable List.Sort, so the winner depended on TypeCache ordering. The new comparator is total and stable across reloads. No behavioural change for the common single-best-candidate case.

Linked issues

Refs #49 - addresses review finding #49 (comment)

@VPDPersonal VPDPersonal added type: fix Bug fix status: needs-review Ready for review area: editor Editor-only code labels Jun 21, 2026
@VPDPersonal VPDPersonal merged commit 770a207 into feature/serialize-reference-dropdown Jun 23, 2026
1 check passed
@VPDPersonal VPDPersonal deleted the fix/sr-repair-suggestion-deterministic-tiebreak branch June 23, 2026 14:04
@github-actions github-actions Bot removed the status: needs-review Ready for review label Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: editor Editor-only code type: fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant