Skip to content

Make match ranking deterministic and strengthen visual-hint regressions - #31

Closed
Djain912 wants to merge 2 commits into
mainfrom
feat/issue-26-visual-position-hints
Closed

Make match ranking deterministic and strengthen visual-hint regressions#31
Djain912 wants to merge 2 commits into
mainfrom
feat/issue-26-visual-position-hints

Conversation

@Djain912

@Djain912 Djain912 commented Apr 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR improves matcher determinism, regression protection, and CLI documentation around positional snapshot fields.

What changed

  • Added a shared deterministic comparator for scored matches.
  • Made combined strategy merging stable by preserving input order before sorting.
  • Applied the same deterministic tie-break behavior to embedding ranking.
  • Added regression tests for tie scenarios in combined and embedding strategies.
  • Added a regression test to ensure "sign in" is not treated as a visual-layout hint.
  • Expanded CLI snapshot docs to clearly show supported geometry/positional fields used by visual hints.

Why

Equal-score candidates could produce unstable ordering, which can cause flaky behavior across repeated runs. This change makes tie outcomes predictable and test-backed.

Validation

  • go test ./... (passes)

Risk

Low. Behavior changes are scoped to tie-breaking and deterministic ordering.

Reviewer Checklist

  • Verify deterministic ordering behavior for equal-score candidates.
  • Confirm both combined and embedding strategies use the shared tie-break policy.
  • Confirm non-tie ranking behavior is unchanged.
  • Review new regression tests for tie cases and visual query parsing.
  • Validate CLI docs for positional/geometry fields match parser support.
  • Confirm no unrelated scratch files are included in the PR.

@Djain912 Djain912 changed the title feat: support visual position hints in queries Make match ranking deterministic and strengthen visual-hint regressions Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants