Problem
threshold: NaN never passes (even identical texts), threshold: -5 always passes (even junk): the threshold is used raw with no range check.
Where
src/scorers/embedding-similarity.ts (typeof spec.threshold === "number" ? spec.threshold : 0.8, then score >= threshold).
Acceptance
Add a failing test first asserting threshold: NaN (and <0/>1) fails validation or is clamped. Then fix.
Problem
threshold: NaNnever passes (even identical texts),threshold: -5always passes (even junk): the threshold is used raw with no range check.Where
src/scorers/embedding-similarity.ts(typeof spec.threshold === "number" ? spec.threshold : 0.8, thenscore >= threshold).Acceptance
Add a failing test first asserting
threshold: NaN(and<0/>1) fails validation or is clamped. Then fix.