Repository navigation
Conversation
`search::generate_search_trapdoors_keyed` built its word part with `BlindIndexer::stem_tags`, which tags every token, so the keyed cutover (index scheme 1, internal#573) would have lost the query stop-word filter that #877 (MCP) and #875 (Python) added on the unkeyed path. New `BlindIndexer::query_stem_tags(query)`, the keyed twin of `generate_query_blind_indices`: the same stop list (`QUERY_STOP_WORDS`), the token is tested and not its stem, a query made only of stop words keeps every tag, and the result is sorted and deduplicated. Writes are unchanged: `stem_tags`, `prepare_fact_v1_keyed` and every store path keep tagging every token. Bindings: WASM `WasmBlindIndexer.queryStemTags`, PyO3 `BlindIndexer.query_stem_tags`. Clients that call `generateSearchTrapdoorsKeyed` / `generate_search_trapdoors_keyed` get the filter with no code change. Tests: unit tests in `blind.rs`, a search test, and the fixture key `query_stem_vectors` in `keyed-blind-indices-v1.json` (its generator reads the stop list from `query-blind-indices-v1.json`), checked by the Rust, WASM and PyO3 legs. Co-Authored-By: Claude Code <noreply@anthropic.com>
Collaborator
Author
|
Independent review (GLM 5.3) approved: rules match the unkeyed filter, writes unchanged, legs green. Core is in the Halborn scope, so this goes to them as a delta review; merge is yours. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
The keyed search path (index scheme 1) now gets the same English query stop-word filter that the unkeyed path already has.
search::generate_search_trapdoors_keyedbuilt its stem part withBlindIndexer::stem_tags, which tags every token. After the keyed cutover (internal#573) that would have lost the filter that #877 (MCP) and #875 (Python) added on the unkeyed path. The fix is in core: clients that callgenerateSearchTrapdoorsKeyed/generate_search_trapdoors_keyedget it with no code change.Rules (the same as
generate_query_blind_indices)QUERY_STOP_WORDS(153 entries). No second list.stem_tagsgives it.stem_tags,prepare_fact_v1_keyedand every store path keep tagging every token. Only query trapdoors filter. Entity tags and keyed LSH tags are unchanged.New bindings
WasmBlindIndexer.queryStemTags(query)BlindIndexer.query_stem_tags(query)Tests
Every new test was seen failing before its implementation existed.
cd rust/totalreclaw-core && cargo test:918 passed; 0 failed(7 new unit tests inblind.rs, 1 new search test, 2 new tests intests/keyed_blind_indices.rs).python scripts/check-pyfunction-parity.py:OK: all #[pyfunction] declarations are registered.generate-keyed-blind-indices-v1.py(new keyquery_stem_vectors, 6 cases; the 11 existing keys are byte-identical; the generator reads the stop list fromquery-blind-indices-v1.json),generate-query-blind-indices-v1.pyandgenerate-same-fact-judge-v1.py: output identical on re-run.test_keyed_blind_indices_parity.py+test_query_blind_indices_parity.py:14 passed.wasm-pack build --target nodejs --out-dir pkg --features wasm):keyed-blind-indices-parity.test.ts:106 passed, 0 failed;query-blind-indices-parity.test.ts:17 passed, 0 failed.No version bump and no client change. Core is in the Halborn audit scope; this goes to them as a delta review.
🤖 Generated with Claude Code