Skip to content

feat: rank parallels by textual relevance#1

Merged
xr843 merged 3 commits into
masterfrom
agent/query-relevance
Jul 10, 2026
Merged

feat: rank parallels by textual relevance#1
xr843 merged 3 commits into
masterfrom
agent/query-relevance

Conversation

@xr843

@xr843 xr843 commented Jul 10, 2026

Copy link
Copy Markdown
Owner

Summary

  • rank exact normalized sentences ahead of containing passages
  • prefer shorter containing passages before MITRA confidence
  • make final ties deterministic by source, juan, and Chinese text
  • replace quadratic search-result grouping with HashMap lookup

Why

Common passages such as 色即是空 previously ranked long commentarial matches ahead of concise source passages because search ordering primarily used confidence and insertion order. This change makes relevance explicit and deterministic without changing the CLI, JSON schema, SQLite schema, or data artifact.

Verification

  • cargo fmt --all --check
  • cargo clippy --all-targets -- -D warnings
  • cargo test --all (61 tests)
  • python3 -m pytest tests/ -q
  • cargo build --release
  • real MITRA dataset: 色即是空 returns concise matches first in under 0.01 seconds
  • real MITRA dataset: two-character 色即 query completes in 0.15 seconds

@xr843 xr843 merged commit b14e8ba into master Jul 10, 2026
5 checks passed
@xr843 xr843 deleted the agent/query-relevance branch July 10, 2026 05:15
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