v3.10.0-rc.20 (audit M7) — derive the HNSW persistence base for an embed-db
file. <dir>/<x>.embed.db → <dir>/<x>.hnsw; the index writes immutable
<base>.<nonce>.bin generations and a stable <base>.meta.json pointer.
SINGLE SOURCE OF TRUTH for the base so the WRITER (server.ts persistFile,
passed to saveTo/loadHnswFromDisk) and the ERASER (EmbedDb.clearOnDisk)
can NEVER drift. If they computed the base independently and one changed (the
strip regex or the .hnsw suffix), clear-embeddings would leave the HNSW
sidecars on disk — historical format-2 metadata carried raw text_preview
and current native generations still contain reversible vector material,
so that remains a right-to-erasure gap (the rc.34 P-2 class). The
erasure-completeness invariant asserts both call sites route through this helper.
Parameters
embedDbFile: string
Configured embedding-database path.
Returns string
Same-directory HNSW persistence base for that exact path.
Throws
If the configured path does not end exactly in .embed.db.
v3.10.0-rc.20 (audit M7) — derive the HNSW persistence base for an embed-db file.
<dir>/<x>.embed.db→<dir>/<x>.hnsw; the index writes immutable<base>.<nonce>.bingenerations and a stable<base>.meta.jsonpointer.SINGLE SOURCE OF TRUTH for the base so the WRITER (server.ts
persistFile, passed tosaveTo/loadHnswFromDisk) and the ERASER (EmbedDb.clearOnDisk) can NEVER drift. If they computed the base independently and one changed (the strip regex or the.hnswsuffix),clear-embeddingswould leave the HNSW sidecars on disk — historical format-2 metadata carried rawtext_previewand current native generations still contain reversible vector material, so that remains a right-to-erasure gap (the rc.34 P-2 class). The erasure-completeness invariant asserts both call sites route through this helper.