Commit c8664f5
fix(service): base64-encode envector cipher before Vault.DecryptScores
The Vault gRPC `DecryptScoresRequest.encrypted_blob_b64` field is a proto3
`string` (valid-UTF-8 only). envector's `Score` returns raw cipher bytes,
not a base64 string — so casting `string(blobs[0])` and passing it through
trips proto3 string-validation:
grpc: error while marshaling: string field contains invalid UTF-8
The bug surfaced as silent zero-result recall (fail point hidden inside
the recall pipeline; envector cluster row count rises after capture but
recall returns 0 hits) and an "invalid UTF-8" warning during the capture
novelty check.
Two call sites, both fixed identically:
recall.go:163 (RecallService.searchSingle)
capture.go:276 (CaptureService novelty-check decrypt)
In both, encode the cipher with `base64.StdEncoding.EncodeToString` before
passing it as the `EncryptedBlobB64` argument. The field name itself —
`...B64` — was the contract; v0.4's port omitted the encoding step on
both paths.
Test plan
---------
- /rune:capture an entry, /rune:recall a related query → top hit returned
with score > 0.5 (verified end-to-end on local stack).
- Korean-only capture no longer warns "invalid UTF-8" during novelty check.
- envector cluster row count + capture_log.jsonl entry both increment per
capture (already confirmed pre-fix; unchanged here).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent de17146 commit c8664f5
2 files changed
Lines changed: 14 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
273 | 274 | | |
274 | 275 | | |
275 | 276 | | |
276 | | - | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
277 | 282 | | |
278 | 283 | | |
279 | 284 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
162 | | - | |
163 | | - | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
164 | 170 | | |
165 | 171 | | |
166 | 172 | | |
| |||
0 commit comments