Repository navigation
fix(recall): fold Russian yo spelling in Cyrillic fallback - #1340
mengqing88 wants to merge 2 commits into
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
Reviewed 59a28c5. Candidate selection and trigram scoring consistently lowercase and fold ё to е, including uppercase and reverse-spelling inflections. I verified public linear recall in both working and episodic memory, plus unrelated and other-language controls. The focused offline suite passed 157 tests; the packaging lifecycle test remains locally unverified because pip's isolated build dependency setup could not complete offline. The implementation keeps the agreed scope: stored content and FTS indexes are preserved, and query-word averaging, lexical thresholds and existing nonzero-score behavior are unchanged. The remaining multi-word dilution work in #1295 stays separate. Before integration, please refresh against current Main and resolve the cache generation using the actual predecessor plus one. This head uses 17, while Main currently uses 18; retain the graph/embedding changes and update the changelog to the final generation. No additional correctness issue found in the normalization change itself. |
The Russian fallback can lose a memory before scoring it: a query such as
свеклыdoes not match the four-character LIKE prefix in storedСвёкла, and the scorer also treatsеandёas distinct trigrams.Apply the same lowercase/
ё→еnormalization to query prefixes, the SQL candidate predicate and trigram scoring. Stored content and FTS indexes are preserved. Advance enhanced-recall cache generation from 16 to 17 so pre-normalization results are recomputed. The cache regression checks that a generation-16 result is not reused, and that the recomputed result is cached normally.This addresses the normalization portion of #1295, following the reporter's proposed spelling fold. It intentionally leaves the issue open: query-word mean aggregation, nonzero lexical scores suppressing fallback, lexical gate thresholds and cross-language dense admission retain their existing behavior. The synthetic keyboard query in the discussion still scores
(7/9)/6.Regression coverage includes both spelling directions, uppercase, inflections, working and episodic fallback paths, real linear
BeamMemory.recall, preserved stored text, unrelated Cyrillic controls and the existing nonzero-prior behavior. Model downloads and external services are disabled.Core version, its bundled plugin manifest, README, changelog and generated API documentation are updated as required by CONTRIBUTING. The catalog compatibility floor remains
>=4.0.0; the release-contract test now asserts that independent floor instead of incorrectly tying it to every Core iteration.Validation on Ubuntu/Python 3.12 with
TZ=UTCand embeddings disabled:twine checkandgit diff --checkpass.Prepared with assistance from OpenAI Codex.
Summary
Mnemosyne’s Russian lexical fallback now lowercases query and candidate text and folds
ёtoеfor candidate selection and trigram scoring. This helps spelling variants and inflected forms match without changing stored memory text or FTS indexes. The fallback still averages each query word’s best match and uses the existing lexical admission gate.Enhanced-recall cache generation advances from 16 to 17, so cached results from the previous behavior are not reused. Regression tests cover working and episodic fallback, linear recall, cache invalidation, and preservation of the existing nonzero lexical-score behavior. These tests specify expected behavior; completed test results are not available.
Architecture and compatibility
>=4.0.0. The diff does not change MCP or CLI behavior.