Skip to content

fix: allow hyphenated words in vec/hyde queries (#383)#384

Open
rymalia wants to merge 1 commit intotobi:mainfrom
rymalia:fix/semantic-query-hyphen-validation
Open

fix: allow hyphenated words in vec/hyde queries (#383)#384
rymalia wants to merge 1 commit intotobi:mainfrom
rymalia:fix/semantic-query-hyphen-validation

Conversation

@rymalia
Copy link
Contributor

@rymalia rymalia commented Mar 12, 2026

Summary

  • Tighten validateSemanticQuery regex from /-\w/ to /(^|\s)-[\w"]/ so negation is only detected at token boundaries
  • Hyphenated/kebab-case words (real-time, multi-client, better-sqlite3, state-of-the-art) now pass validation
  • Actual negation syntax (-term, -"phrase") still correctly rejected
  • Added 14 new test cases covering both directions

Test plan

  • All 709 existing tests pass
  • 14 new validateSemanticQuery tests covering hyphenated acceptance + negation rejection
  • End-to-end CLI test: qmd query 'vec: long-lived daemon' passes validation

Fixes #383

🤖 Generated with my pal CC, Claude Code

The validateSemanticQuery regex rejected any hyphen followed by a word
character, blocking common compound words (real-time, multi-client,
kebab-case identifiers like better-sqlite3). Tighten the check to only
match negation syntax at token boundaries (start of string or after
whitespace).

See tobi#383

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

vec/hyde queries reject hyphenated words (kebab-case, compound adjectives) as negation syntax

1 participant