Skip to content

fix(search): preserve keyless inverse exclusions - #857

Open
FanWu-ai wants to merge 1 commit into
krisk:mainfrom
FanWu-ai:fix-keyless-inverse-exclusions-20261011
Open

FanWu-ai wants to merge 1 commit into
krisk:mainfrom
FanWu-ai:fix-keyless-inverse-exclusions-20261011

Conversation

@FanWu-ai

Copy link
Copy Markdown

Summary

With extended search across title and author, {title: 'Syrup', author: 'Honey'} is excluded by search('!Syrup'), but incorrectly included by search({$and: ['!Syrup']}).

Apply the existing global-search inverse aggregation to keyless logical leaves: a successful inverse match cannot override another key's failed match. Add regressions for inverse/prefix/suffix operators, AND/OR nesting, key order, missing fields, collection changes, scores and match metadata. Positive and explicitly keyed searches retain their behavior. Regenerate the tracked distributions using the native build.

This follows the global-search behavior requested in #736. It is separate from #854, which changes inverse matching across array elements inside _findMatches; this patch changes the keyless logical scalar-key aggregation branch.

Validation

  • Pristine build and full 449-test suite passed before edits.
  • New tests against pristine distributions: 12 failed and 4 controls passed; final full suite: all 465 tests passed across 23 files, including worker-thread tests.
  • Full build, ESLint, TypeScript, VitePress docs, changed-file Prettier, commitlint and whitespace checks pass.
  • Four-build differential: 4,800 comparisons, with 1,632 repaired and 3,168 unchanged; another 100 independent logical/global comparisons pass.
  • Actual package consumer checks pass; all six modified packaged runtimes match the tested generated files.
  • Tested locally on Node 24.19.0/Linux. Other runtime/platform and hosted checks have not been run locally.

The supplemental whole-repository format check has unchanged pristine/final failures in KeyStore formatting and three legacy import-assertion fixtures. It is not a contribution/CI/hook gate; no unrelated formatting or checker configuration was changed.

AI assistance: OpenAI Codex was used for investigation, implementation, tests and automated validation. No human review or hosted CI pass is claimed.

@FanWu-ai
FanWu-ai marked this pull request as ready for review October 11, 2026 19:20

This branch has not been deployed

No deployments
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.

1 participant