Skip to content

feat: support ordinal queries (first/second/last) - #36

Merged
luigi-agosti merged 6 commits into
mainfrom
feat/followup-ordinal-queries
Apr 23, 2026
Merged

feat: support ordinal queries (first/second/last)#36
luigi-agosti merged 6 commits into
mainfrom
feat/followup-ordinal-queries

Conversation

@luigiagent

Copy link
Copy Markdown
Collaborator

Summary

This PR supersedes #30 and delivers the ordinal-query work for #25 in a cleaner follow-up branch.

It adds support for selecting elements by ordinal position among matching candidates, including:

  • first, second, third
  • numeric ordinals like 3rd
  • last
  • composition with context exclusion, for example second submit button not in login

What changed

  • added ordinal query parsing and selection flow
  • preserved document order for ordinal queries, including snapshots without explicit positional hints
  • added guard behavior so literal phrases like first name are not misparsed as ordinal intent
  • composed ordinal selection with context exclusion logic
  • added unit coverage for ordinal parsing and matching behavior
  • added ordinal corpus benchmark data and e2e coverage
  • cleaned up the local dev command from ./dev benchmark to ./dev bench while keeping compatibility

Validation

  • go test ./... -count=1
  • ordinal e2e case passes with the repo-built binary
  • ./dev bench

Notes

@luigi-agosti
luigi-agosti merged commit 12db628 into main Apr 23, 2026
7 checks passed
luigi-agosti added a commit that referenced this pull request Apr 24, 2026
feat: support ordinal queries (first/second/last)
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.

Support ordinal queries (first, second, last)

2 participants