Commit 7416a81
fix: score_and_compress degrades gracefully when BERT unavailable
Previously embed_batch() errors propagated via `?`, causing the function
to return Err when the daemon is not running (e.g. CI). Five unit tests
that called score_and_compress().unwrap() then panicked in CI even though
they passed locally (daemon was running).
Fix: unwrap_or_else to zero embeddings when embed_batch fails. Zero
embeddings make all cosine scores 0.0, threshold 0.0, so every section
is preserved by rule (imports, typedefs, edit ranges, 50% minimum).
This is the correct degraded behavior — no BERT, no scoring, keep all.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 867327c commit 7416a81
1 file changed
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
399 | 399 | | |
400 | 400 | | |
401 | 401 | | |
402 | | - | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
403 | 409 | | |
404 | 410 | | |
405 | 411 | | |
| |||
0 commit comments