Skip to content

fix: resolve simprint type mismatch in iscc_id queries, cap simprints per type - #5

Open
titusz wants to merge 1 commit into
developfrom
fix/iscc-id-simprints-and-cap
Open

fix: resolve simprint type mismatch in iscc_id queries, cap simprints per type#5
titusz wants to merge 1 commit into
developfrom
fix/iscc-id-simprints-and-cap

Conversation

@titusz

@titusz titusz commented May 7, 2026

Copy link
Copy Markdown
Member

Summary

  • Fix search_assets() drops simprints when resolving iscc_id queries #1: search_assets() silently dropped simprints when resolving iscc_id queries due to type mismatch between IsccEntry.simprints (IsccSimprint objects) and IsccQuery.simprints (bare base64 strings). Extracted query_from_asset() in common.py to handle the conversion for all three backends (usearch, lmdb, memory).
  • Cap simprints: Added cap_simprints() that randomly samples up to 20 simprints per type to keep search load bounded. Applied in normalize_query() so it covers all query paths. Logs when capping occurs.

Test plan

  • All 918 tests pass
  • 100% coverage maintained
  • Verify simprint search works via iscc_id query on an index with simprint data
  • Verify queries with >20 simprints per type are sampled down with log output

… per type

search_assets() silently dropped simprints when resolving iscc_id queries
because IsccEntry.simprints (IsccSimprint objects) couldn't coerce to
IsccQuery.simprints (bare base64 strings). Extract query_from_asset() in
common.py to handle the conversion for all three backends.

Also add cap_simprints() that randomly samples up to 20 simprints per type
to keep search load bounded. Applied in normalize_query() so it covers all
query paths.

Closes #1
@titusz titusz mentioned this pull request Jun 18, 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.

1 participant