Upstream contribution · ruvnet/ruflo
ruflo · Keep distinct inputs separate in Ruflo's embedding cache
Problem
Two equal-length strings with a reproducible FNV-1a collision used the same persistent cache slot. An embedding stored for one input could overwrite the vector for the other.
Engineering response
Use versioned SHA-256 keys over the original UTF-16 code units so the cache also distinguishes JavaScript strings containing isolated surrogates. Legacy entries become cold misses and are rebuilt on demand.
Evidence and scope
The pull request documents a failing-then-passing regression that reopens the SQLite store. Its local full-suite attempts had dependency, fixture and disk-space failures.