fix(memory/holographic): sanitize hyphenated tokens in FTS5 queries - #14262
fix(memory/holographic): sanitize hyphenated tokens in FTS5 queries#14262ms-alan wants to merge 3 commits into
Conversation
Fixes 'no such column' errors when fact_store search receives hyphenated identifiers like 'pve-01' by wrapping bare hyphenated tokens in double quotes before passing to FTS5 MATCH. Closes NousResearch#14024
|
Competing fix with #14033. |
teknium1
left a comment
There was a problem hiding this comment.
Thanks for isolating the hyphenated FTS5 failure. The identifier-retrieval problem still needs a fix on current main, but this branch predates the current shared query-normalization path.
Problems
plugins/memory/holographic/retrieval.py:503now uses_sanitize_fts_query(). That helper removes-at lines 603-615, sopve-01becomespve01before MATCH rather than remaining a quoted phrase.plugins/memory/holographic/store.py:212-215shares that helper forsearch_facts(). Updating only the retriever would leave the sibling direct-store path without a verified identifier-preserving contract.- The current tests only assert crash safety for hyphenated input (
tests/plugins/memory/test_holographic_retrieval.py:58-72); they do not prove a storedpve-01fact is retrieved. - The gateway and error-classifier commits are unrelated to this memory fix and overlap later main fixes (
40dbfa0e3ce85dc0d63f1ebe1319d212c53d3511,38e7bd8a08a9df450b7d8661778ecc47f25323c2).
Suggested changes
- Integrate phrase preservation into the existing shared sanitizer while retaining its prose-query OR behavior.
- Add retrieval and direct-store regressions for a fact containing
pve-01.
This is an automated hermes-sweeper review.
| @@ -496,7 +510,7 @@ def _fts_candidates( | |||
| # We need to join facts_fts with facts to get all columns | |||
There was a problem hiding this comment.
Current main now normalizes this argument through _sanitize_fts_query() before MATCH, and that helper strips - from pve-01. Please integrate identifier phrase preservation into that existing shared sanitizer rather than applying this legacy raw-query wrapper alone.
| @@ -773,6 +773,14 @@ def _classify_by_message( | |||
| should_fallback=True, | |||
There was a problem hiding this comment.
This change is unrelated to holographic FTS5 handling and is superseded by current main's broader overload classification fix (38e7bd8a08a9df450b7d8661778ecc47f25323c2). It should not be included in a focused salvage of this memory fix.
Fixes 'no such column' errors when fact_store search receives hyphenated identifiers like 'pve-01' by wrapping bare hyphenated tokens in double quotes before passing to FTS5 MATCH.
Closes #14024