Skip to content

feat(search): expose lane evidence on hits - #1562

Merged
Sinity merged 1 commit into
masterfrom
feature/search-hit-lane-evidence-873
May 25, 2026
Merged

Sinity merged 1 commit into
masterfrom
feature/search-hit-lane-evidence-873

Conversation

@Sinity

@Sinity Sinity commented May 25, 2026

Copy link
Copy Markdown
Owner

Summary

Carries explicit lane-rank, lane-contribution, and raw-score evidence through ranked search hits and the shared public ConversationSearchMatchPayload.

Problem

#873's ranked-search contract called for lane_rank, lane_contribution, and raw_score, but the public match payload only exposed collapsed score_components. Consumers could see per-lane hybrid components, but had to infer the primary lane and backend-native score themselves, and the storage evidence bridge dropped fields that already existed on ConversationSearchEvidenceHit.

Solution

  • Add lane_rank, lane_contribution, and raw_score to ConversationSearchHit and ConversationSearchMatchPayload.
  • Preserve those fields across storage evidence hits, repository search mapping, generated CLI schemas, and OpenAPI.
  • Populate lane_rank/raw_score for FTS and attachment identity evidence paths.
  • Derive the strongest contributing RRF lane for hybrid hits while preserving the full per-lane map in score_components.
  • Document the added fields in docs/search.md.

Ref #873

Verification

  • pytest -q tests/unit/surfaces/test_search_explanation_contract.py tests/unit/storage/test_search_explanation_wiring.py tests/unit/storage/test_archive_search_contracts.py tests/unit/archive/test_query_search_runtime.py --tb=short — 32 passed.
  • ruff format --check ... && ruff check ... on touched code/test files — passed.
  • mypy ... on touched code/test files — passed.
  • devtools render-all --check — passed.
  • devtools verify --json — exit 0; 297 pytest-testmon selected tests passed; total 107.83s.
  • pre-push devtools verify --quick — exit 0; total 34.64s. The normal git push path hit repeated GitHub 500s, so the branch was created through GitHub's Git Data API with an identical tree diff.

Problem: #873's ranked-search contract promised lane_rank, lane_contribution, and raw_score evidence, but public hit payloads only exposed collapsed score_components. Consumers had to reverse-engineer the primary lane from component names.

What changed: carry lane/raw-score evidence through archive hits, storage evidence hits, repository mapping, and the shared ConversationSearchMatchPayload. FTS and attachment identity paths now fill lane_rank/raw_score where available, and hybrid hits derive the strongest contributing RRF lane while preserving full score_components.

Verification: pytest -q tests/unit/surfaces/test_search_explanation_contract.py tests/unit/storage/test_search_explanation_wiring.py tests/unit/storage/test_archive_search_contracts.py tests/unit/archive/test_query_search_runtime.py --tb=short; ruff format/check touched files; mypy touched files; devtools render-all --check; devtools verify --json.
@coderabbitai

coderabbitai Bot commented May 25, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@Sinity, we couldn't start this review because you've used your available PR reviews for now.

Your plan includes 1 review of capacity. Refill in 19 minutes and 9 seconds.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more review capacity refills, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: fbff56ac-bbc7-4b2f-a16b-e5d65c9ecee8

📥 Commits

Reviewing files that changed from the base of the PR and between 1c39aaf and d266feb.

📒 Files selected for processing (11)
  • docs/openapi/search.yaml
  • docs/schemas/cli-output/conversation-search-hit.schema.json
  • docs/schemas/cli-output/search-envelope.schema.json
  • docs/search.md
  • polylogue/archive/query/search_hits.py
  • polylogue/storage/repository/archive/search.py
  • polylogue/storage/sqlite/queries/attachment_records.py
  • polylogue/storage/sqlite/queries/conversations_search.py
  • polylogue/surfaces/payloads.py
  • tests/unit/storage/test_archive_search_contracts.py
  • tests/unit/surfaces/test_search_explanation_contract.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/search-hit-lane-evidence-873

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Sinity
Sinity merged commit 0dbc2e6 into master May 25, 2026
7 checks passed
@Sinity
Sinity deleted the feature/search-hit-lane-evidence-873 branch May 25, 2026 09:10
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