research follow-up: pre-register CoherenceRatio (kNN similarity peakedness) as an insertion-time poisoning gate
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 4.5k
- Forks
- 603
- Avg merge
- 23h 32m
- Merged PRs (30d)
- 59
Description
Side-finding from closed PR #947 (head 10adce1cb8), surfaced by the 2026-09-05 mission review (agent pr-review-ruview-ruvector). The PR's pre-registered candidate (MinCut) was rejected on its own evidence; this unplanned side result is the part worth keeping.
Where: crates/ruvector-graft-gate/src/gate.rs:84-90 at 10adce1cb8 — peakedness = max_kNN_sim / mean_kNN_sim, reject when > cfg.peakedness_threshold (1.35, config.rs::PEAKEDNESS_THRESHOLD). Results: docs/research/nightly/2026-08-30-mincut-gated-insertion/README.md:31 and :327-361 on that commit.
Observed (synthetic corpus: 5,000 vectors, 20 Gaussian clusters, 200 poison inserts shaped normalize(0.7*target + 0.3*random)): CoherenceRatio caught 122/200 poison (61%) with 0/1,000 legitimate false-rejects at 55 ns per gate; recall@10 rose from 0.598 to 0.844. MinCut caught 0/200 at 13.6 µs. No pre-registered acceptance criteria existed for this signal, so it is an observation, not a result.
Why it matters: the only insertion-time signal in that run with measurable defensive value, at the cost of one ratio over an already-computed kNN list. The 39% miss rate and the single synthetic attack model mean it is not a production recommendation yet.
Ask — a separately pre-registered nightly run that:
- fixes catch-rate / false-reject / recall thresholds before running;
- tests at least one real embedding model and a second attack shape;
- sweeps the 1.35 threshold;
- reports whether the recall@10 gain survives with no poison present.
Reuse the #947 crate at that SHA as the harness rather than rewriting it.
🤖 Generated with RuFlo
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with crates/ruvector-graft-gate/src/gate.rs:84-90 and config.rs::PEAKEDNESS_THRESHOLD at commit 10adce1cb8, then read the cited nightly README sections. Reuse the #947 crate as the harness, pre-register thresholds, test a real embedding model and second attack shape, sweep 1.35, and report catch rate, false rejects, recall@10, and poison-free recall results.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- databases, machine-learning, security
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100