Skip to content

Commit c172da2

Browse files
fix(verisim-document): tantivy 0.26 collector API — add .order_by_score() (#76)
## Summary - Single-line fix in `rust-core/verisim-document/src/lib.rs:279`: `TopDocs::with_limit(N)` no longer implements `Collector` in tantivy 0.26 — must select an ordering. `.order_by_score()` preserves existing semantics and return shape. - Drops the stale tantivy-0.25-era CVE-mitigation comment block from workspace `Cargo.toml`. Both referenced advisories are now resolved by the natural transitive upgrade (lz4_flex 0.11.5 → 0.13.1, lru 0.12.5 → 0.16.4 — verified in `Cargo.lock`). ## Impact on CI Unblocks **13 of 16 failing checks** on `origin/main` HEAD. Every Rust-side red (cargo test, clippy, cargo doc, cargo audit, cargo deny, llvm-cov, benchmarks compile, both fuzz targets, Rust build validation, Elixir build validation, compile+test, ExCoveralls) cascaded from this one compile error in verisim-document. Remaining red on main after this lands: - governance / Workflow security linter + governance / Language / package anti-pattern policy — surface from the standards reusable @861b5e9 - scorecard — token-permissions + code-review signals (systemic, not workflow-config) - dispatch — dogfood-gate A2ML manifest cosmetic Those are in scope for separate follow-ups; this PR is the keystone. ## Test plan - [x] Local cargo check -p verisim-document clean - [x] Local cargo check --workspace --all-targets clean (26.08s) - [ ] CI rust-ci / build-validation / fuzz / cargo deny / cargo audit / benchmarks compile / llvm-cov green on PR 🤖 Generated with [Claude Code](https://claude.com/claude-code)
1 parent bc570ad commit c172da2

2 files changed

Lines changed: 4 additions & 18 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -126,23 +126,7 @@ lto = true
126126
codegen-units = 1
127127
panic = "abort"
128128

129-
# Patch Bridge mitigations — forced upgrades for transitive CVEs in tantivy 0.25.0
130-
# These override the versions pinned by tantivy without forking.
131-
#
132-
# RUSTSEC-2026-0041: lz4_flex 0.11.5 — memory leak on decompression (CVSS 8.2 HIGH)
133-
# Chain: tantivy 0.25.0 → lz4_flex 0.11.5
134-
# Fix: 0.11.6 adds proper offset validation. Semver-compatible, safe to patch.
135-
#
136-
# RUSTSEC-2026-0002: lru 0.12.5 — IterMut Stacked Borrows violation (unsound)
137-
# Chain: tantivy 0.25.0 → lru 0.12.5
138-
# Fix: 0.12.6+ not available in 0.12.x line. Patching to 0.12.5 is NOT possible.
139-
# The fix is in 0.16.3 which is semver-incompatible with tantivy's lru ^0.12 pin.
140-
# Status: UNMITIGABLE without tantivy upgrade. tantivy 0.25.0 is latest.
141-
# Risk: Low in practice — VeriSimDB uses #![forbid(unsafe_code)] in verisim-document,
142-
# and the IterMut violation requires specific Miri-detectable UB, not exploitable
143-
# in normal execution. Accepted risk until tantivy 0.26.
144-
#
145-
# NOTE: quinn-proto 0.11.14 (Dependabot alert — build-time only, NOT runtime)
129+
# NOTE: quinn-proto (Dependabot alert — build-time only, NOT runtime)
146130
# Chain: burn 0.20 → cubecl-cpu → tracel-llvm-bundler (build dep) → reqwest 0.12 → quinn → quinn-proto
147131
# This is a build-time dependency for LLVM artifact download, not in any production code path.
148132
# Waiting for burn 0.21 stable release. reqwest bumped to 0.13 for direct deps.

rust-core/verisim-document/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// SPDX-License-Identifier: MPL-2.0
2+
// Copyright (c) Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
23
//! VeriSim Document Modality
34
//!
45
//! Full-text search via Tantivy.
@@ -275,7 +276,8 @@ impl DocumentStore for TantivyDocumentStore {
275276
QueryParser::for_index(&self.index, vec![self.schema.title, self.schema.body]);
276277

277278
let parsed_query = query_parser.parse_query(query)?;
278-
let top_docs = searcher.search(&parsed_query, &TopDocs::with_limit(limit))?;
279+
let top_docs =
280+
searcher.search(&parsed_query, &TopDocs::with_limit(limit).order_by_score())?;
279281

280282
// Create snippet generator for body field
281283
let snippet_generator =

0 commit comments

Comments
 (0)