Skip to content

fix: sanitize FTS5 search queries to handle special characters#19

Merged
danielkov merged 1 commit intomainfrom
danielkov/search-fails-for-prior-art-based-on-special-chars
Feb 19, 2026
Merged

fix: sanitize FTS5 search queries to handle special characters#19
danielkov merged 1 commit intomainfrom
danielkov/search-fails-for-prior-art-based-on-special-chars

Conversation

@danielkov
Copy link
Copy Markdown
Collaborator

FTS5 search no longer fails on special characters

Queries containing FTS5 operator characters like -, +, *, or keywords like NOT/OR/AND are now properly escaped before being passed to SQLite's FTS5 MATCH clause.

Previously, running something like granary plan "Fix TypeScript v2 build failures - 11 root causes from SDK battery tests" would fail because the - was interpreted as FTS5's NOT operator. Now, each token is individually quoted and purely-punctuation tokens (like a bare -) are dropped, so the search works regardless of what characters appear in the plan name.

Search queries also now use OR semantics instead of implicit AND, which makes prior-art matching more lenient — a project only needs to match some of the query terms to appear in results, rather than requiring all of them.

✻ Clauded...

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@danielkov danielkov force-pushed the danielkov/search-fails-for-prior-art-based-on-special-chars branch from a33c3f6 to 844450e Compare February 19, 2026 13:47
@danielkov danielkov merged commit 49f6e15 into main Feb 19, 2026
3 checks passed
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