caelum0x b5274e1bb7 fix: calibrate retrieval similarity threshold for voyage-3 (0.72 -> 0.6, env-tunable)
Dogfooding the live app surfaced that verify returned 'no confident match' even when
a claim quoted its own cached primary source: the hardcoded 0.72 cosine floor was too
high for voyage-3, whose claim-vs-source-abstract similarities land ~0.6-0.72. The 95%
benchmark never caught this because it runs the mock/fixture path, bypassing live
retrieval entirely.

- Lower default floor to 0.6; make it configurable via RETRIEVAL_SIMILARITY_THRESHOLD
  (clamped [0,1], malformed values fall back to default) so it can be tuned per model
  without a redeploy.
- Log the top pre-filter similarity on a miss (scores/ids only, no claim/source text)
  so the floor can be calibrated against real data.

tsc + build green.
2026-07-11 23:04:21 +03:00
..