- An eval-worktree cherry-pick swept 16 packages/*/node_modules symlinks into the index; 'node_modules/' with a trailing slash only matches directories, so symlinked installs bypassed the ignore. Dropped the slash and removed the tracked links.
Aligns the shim's runtime safeParse/__validator with the wire/tool-call
path, so legacy draft-07 documents (tuple items) accept the same values
validateToolArguments does. Adds a regression test.
Swap the batch-shaped scoring loops to the pi-natives kernels behind the
existing TS function signatures, so every caller keeps its guards and
observable behavior: mmrRerank (default Jaccard path), searchExactVectorIndex,
clusterBySimilarity, BinaryVectorStore.search, and FastBinarySearch.search.
cosine_similarity_pairs now takes Float64Array so f64 vectors round-trip
without f32 narrowing. Scalar one-off call sites stay in TS (query-cache
cosine probe, shmr centroid/confidence loops, recall per-row cosine map,
custom-similarity mmrRerank). Adds a seeded parity suite: 1e-9 relative
tolerance for floats, exact equality for Hamming distances and pair lists,
identical MMR index sequences across lambda/topK grids.
Review follow-ups:
- The corruption retry now goes THROUGH the sidecar heal, so a cache
broken in both ways (truncated model blob AND stale/missing
config/tokenizer sidecars) recovers in one pass instead of the retry
escaping with a sidecar error.
- defaultLocalModelInitializer is exported from core as the shared
initializer and the coding-agent embed worker now uses it instead of
calling FlagEmbedding.init directly, so omp's subprocess embeddings
inherit both heals; fastembed/onnxruntime still load only in the
child address space.
defaultLocalModelInitializer (exported @internal for tests; production
seam stays setLocalModelInitializer) now provably retries
FlagEmbedding.init EXACTLY once after a Protobuf-corruption failure,
quarantining the cached file in between, and surfaces the error without
looping when the retry fails too. The heal callsite now passes
options.cacheDir so containment checks the caller's cache root, not
only the global default.
A truncated model_optimized.onnx (observed live: 5.7MB file from June,
'Protobuf parsing failed' on every load) blocks local embeddings
forever: the downloader treats the existing file as complete, so every
init re-parses the same broken bytes and local recall/retain loses its
embedder. defaultLocalModelInitializer now quarantines the exact file
named by the loader (atomic rename to *.corrupt-<ts>) and retries init
ONCE so the model re-downloads.
The extracted path is error-message content: it is honored only when
it resolves inside the fastembed cache directory, so a dependency
emitting an unexpected message can never rename an arbitrary file.
Contract tests: protobuf failure quarantines exactly the named cache
file and reports retry-safe; unrelated errors touch nothing; a missing
file (concurrent heal) stays retry-safe; a path outside the cache root
is refused untouched.
Working-memory TTL trim treated every consolidated_at IS NULL row as
scratch, so restored or imported durable rows disappeared on the next
write, and the trim delete left annotations, embeddings, facts, and
memoria projections orphaned.
- Exclude IMPORTED-tier rows from the trim eligibility query so restored
banks survive a later remember()/rememberBatch().
- Stamp imported working-memory rows as consolidated in importFromDict so
restored backups are durable regardless of trust tier.
- Add purgeWorkingMemoryArtifacts() and route trim, forgetWorking, and
force-import overwrite through it to cascade annotations, embeddings,
facts (source_msg_id), memoria_* (source_memory_id), gists, and the
graph edges tied to those memory/gist/fact node ids.
Fixes#4819
- Resolved ONNX Runtime from fastembed's own dependency graph.
- Prepended the cached DLL directory before loading the native binding.
- Added regression coverage for inherited stale runtime paths.
Fixes#4849