Skip to content

fix: correct column index for corrupt embedding BLOB errors in search - #188

Merged
randomm merged 3 commits into
mainfrom
feature/issue-186-fix-wrong-column-index-in-fromsqlconversionfailure
Aug 21, 2026
Merged

fix: correct column index for corrupt embedding BLOB errors in search#188
randomm merged 3 commits into
mainfrom
feature/issue-186-fix-wrong-column-index-in-fromsqlconversionfailure

Conversation

@randomm

@randomm randomm commented Aug 21, 2026

Copy link
Copy Markdown
Owner

Automated by pi-ensemble /work driver (mechanized commit-pr).
Fixes #186

Assumptions made while resolving this issue

The issue did not fully specify the following. Each was resolved with a defensible default rather than blocking — check them:

  • D3 (constant) should be done — it's 4 one-token edits and directly addresses the "cannot drift again" goal; the issue marks it optional, but it is trivial and low-risk. If the developer judges it complicates things, skip it and note in the PR.

Addresses six-pass review findings from round 1.
Addresses six-pass review findings from round 2.
@randomm

randomm commented Aug 21, 2026

Copy link
Copy Markdown
Owner Author

Six-pass review — findings still open at the round cap

The lens review ran its 3-round fix loop and stopped with these
outstanding. None is CRITICAL and the adversarial gate passed the diff, so the
cycle carried on to CI instead of parking — but nothing listed here has been
fixed. Decide them before merging.

Review findings — 5 MEDIUM, 8 LOW (verdict: ISSUES_FOUND)

  • MEDIUM TYPE_SAFETYsrc/sqlite/list.rs:245 — get_many inline row mapper drops MismatchedDimensions check (type-shape asymmetry)
  • MEDIUM TYPE_SAFETYsrc/sqlite/mod.rs:130 — Fromrusqlite::Error downcasts any domain Error variant, broader than documented
  • MEDIUM SECURITYsrc/sqlite/mod.rs:131 — Error message embeds unsanitized memory id
  • MEDIUM ARCHITECTUREsrc/sqlite/mod.rs:135 — From<rusqlite::Error> downcasts any domain error, broader than documented
  • MEDIUM ARCHITECTUREsrc/sqlite/query_mod.rs:20 — Type erasure of MismatchedDimensions into opaque reason string
  • LOW SIMPLICITYsrc/sqlite/fts.rs:227 — id read from column 0 three times in FTS row closure
  • LOW SIMPLICITYsrc/sqlite/list.rs:255 — tuple element and struct field both re-read row.get(0) in get_many
  • LOW TYPE_SAFETYsrc/sqlite/list.rs:257 — id read from column 0 three times; local not reused
  • LOW ERROR_HANDLINGsrc/sqlite/mod.rs:131 — Overbroad downcast: any sqlite::Error source is surfaced, not just CorruptEmbedding
  • LOW SIMPLICITYsrc/sqlite/mod.rs:393 — Unnecessary id.clone() when id is not consumed after map_err
  • LOW ARCHITECTUREsrc/sqlite/mod.rs:394 — EMBEDDING_COLUMN constant hardcodes wrong diagnostic column in 3-col projection
  • LOW SECURITYsrc/sqlite/query_mod.rs:38 — Untrusted BLOB length feeds heap allocation on decode path

…and 1 more. The full set is on the last lens-issues-found event in the state file.

@randomm randomm changed the title fix: wrong column index in FromSqlConversionFailure for corrupt embeddin fix: correct column index for corrupt embedding BLOB errors in search Aug 21, 2026
@randomm

randomm commented Aug 21, 2026

Copy link
Copy Markdown
Owner Author

Retitled: the automated PR-creation step truncated the title at 72 chars (cut 'embedding' to 'embeddin'). Corrected to a complete, <72-char subject.
This matters because we squash-merge — the PR title becomes the commit subject, changelog entry, and release-note line. See #155 for the related changelog fragility (v0.9.1's '...per-row cosine loop in Dat').

@randomm
randomm merged commit 62f8a8d into main Aug 21, 2026
9 checks passed
@randomm randomm mentioned this pull request Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: wrong column index in FromSqlConversionFailure for corrupt embedding BLOBs in Database::search

1 participant