Skip to content

feat: support negative qualifiers in queries - #29

Closed
Djain912 wants to merge 1 commit into
mainfrom
feat/issue-24-negative-matching
Closed

feat: support negative qualifiers in queries#29
Djain912 wants to merge 1 commit into
mainfrom
feat/issue-24-negative-matching

Conversation

@Djain912

Copy link
Copy Markdown
Collaborator

Summary

Implements issue #24 by adding support for negative qualifiers in matching queries.

What changed

  • Added shared negative-query parsing for not, excluding, and except.
  • Added exclusion-context matching against element metadata (section, parent, name, role, value, labelled_by).
  • Wired exclusion filtering into lexical and embedding matchers (combined inherits this behavior automatically).
  • Added focused and edge-case tests, including duplicate-label disambiguation scenarios.
  • Added docs/examples in README and CLI reference.

Example queries now supported

  • submit button not in header
  • login link, not the footer one
  • search box excluding sidebar

Validation

  • go test ./internal/engine -run "TestParseNegativeConstraints_BasicPatterns|TestShouldExcludeElement_ContextSignals|TestLexicalMatcher_NegativeQualifierFiltersExcludedSection|TestEmbeddingMatcher_NegativeQualifierFiltersSidebarVariant|TestCombinedMatcher_NegativeQualifier_RealWorldDuplicateLinks" -count=1
  • go test ./internal/engine -run "TestComprehensiveEvaluation|TestMultiSiteEvaluation" -count=1 -v
  • go test -count=1 ./...
  • go vet ./...
  • go build ./...
  • go build -o semantic.exe ./cmd/semantic
  • go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.9.0 run
  • Manual CLI checks with duplicate section variants (header/footer/sidebar)

Environment note

  • Local Windows race run (go test -race ./...) is blocked by local 64-bit cgo toolchain availability (cc1.exe ... 64-bit mode not compiled in).
  • CI runs on Ubuntu and will execute race tests there.

Closes #24

@luigi-agosti

Copy link
Copy Markdown
Contributor

this pr was partially already implemented I extracted and added to a separated pr the context/region exclusion support only

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 negative matching in queries

2 participants