Evidence
src/_core/config/index.ts:183-185:
dimensions: env.ENGRAM_EMBEDDING_DIMS
? parseInt(env.ENGRAM_EMBEDDING_DIMS, 10)
: (overrides?.embedding?.dimensions ?? defaults.embedding.dimensions),
parseRetentionDays in the same file guards with Number.isFinite; this one does not. The value reaches createVecIfNeeded(db, table, dims) (src/_core/db/schema.ts:894-897) as CREATE VIRTUAL TABLE … USING vec0(id TEXT PRIMARY KEY, embedding float[NaN]).
Why it's a bug
ENGRAM_EMBEDDING_DIMS=256px (or any value parseInt cannot parse) makes every engram command and the daemon fail at initDatabase with sqlite-vec's could not parse vector column 'embedding float[NaN]' — an error that names neither the variable nor the value. Documented variable (README: "must match the existing DB"), misconfiguration trigger, loud failure → P3.
Suggested direction
Validate in loadConfig (positive integer, else throw naming the variable) — engram doctor's env-file check could flag it too.
Related: #61.
Evidence
src/_core/config/index.ts:183-185:parseRetentionDaysin the same file guards withNumber.isFinite; this one does not. The value reachescreateVecIfNeeded(db, table, dims)(src/_core/db/schema.ts:894-897) asCREATE VIRTUAL TABLE … USING vec0(id TEXT PRIMARY KEY, embedding float[NaN]).Why it's a bug
ENGRAM_EMBEDDING_DIMS=256px(or any valueparseIntcannot parse) makes everyengramcommand and the daemon fail atinitDatabasewith sqlite-vec'scould not parse vector column 'embedding float[NaN]'— an error that names neither the variable nor the value. Documented variable (README: "must match the existing DB"), misconfiguration trigger, loud failure → P3.Suggested direction
Validate in
loadConfig(positive integer, else throw naming the variable) —engram doctor's env-file check could flag it too.Related: #61.