Skip to content

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

Merged
tobi merged 1 commit into
tobi:mainfrom
rymalia:fix/semantic-query-hyphen-validation
May 3, 2026
Merged

fix: allow hyphenated words in vec/hyde queries (#383)#384
tobi merged 1 commit into
tobi:mainfrom
rymalia:fix/semantic-query-hyphen-validation

Conversation

@rymalia

@rymalia rymalia commented Mar 12, 2026

Copy link
Copy Markdown
Contributor

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>
@ferentchak

Copy link
Copy Markdown

Landed here from #383 — hit the same validateSemanticQuery rejection on v2.1.0 with hyphenated domain terms. Was going to submit a docs-only PR to clarify the current behavior, but the regex change here is trivial and actually resolves the bug instead of documenting around it. Would love to see this merged.

@tobi tobi merged commit 06218b1 into tobi:main May 3, 2026
@rymalia rymalia deleted the fix/semantic-query-hyphen-validation branch May 27, 2026 04:07
lucndm pushed a commit to lucndm/qmd that referenced this pull request Jun 7, 2026
…lidation

fix: allow hyphenated words in vec/hyde queries (tobi#383)
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

3 participants