Skip to content

feature/measurement semantics cleanup - #31

Closed
mohanagy wants to merge 6 commits into
mainfrom
feature/measurement-semantics-cleanup
Closed

mohanagy wants to merge 6 commits into
mainfrom
feature/measurement-semantics-cleanup

Conversation

@mohanagy

@mohanagy mohanagy commented May 1, 2026 •

Copy link
Copy Markdown
Owner
  • test: lock retrieval seed ranking behavior
  • feat: make retrieval expansion relation-aware
  • test: assert real second-hop retrieval nodes
  • test: add retrieval quality guardrails
  • feat: improve retrieval ranking quality
  • Fix directed retrieval expansion

Summary by CodeRabbit

Release Notes

  • New Features

    • Improved retrieval ranking with relation-aware expansion to surface more connected evidence and prioritize relevant results
  • Bug Fixes

    • Added guardrails to evaluation reporting for recall and ranking metrics to reduce risk of misleading benchmark results
  • Tests

    • Expanded benchmark test coverage with additional question scenarios
    • Added unit tests validating ranking behavior and budget-aware retrieval

mohanagy and others added 6 commits April 27, 2026 13:13
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented May 1, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ae398e32-a088-45df-9a21-7f8ebdfa28ac

📥 Commits

Reviewing files that changed from the base of the PR and between a176bc4 and 8b7492b.

📒 Files selected for processing (5)
  • CHANGELOG.md
  • src/infrastructure/benchmark/quality.ts
  • src/runtime/retrieve.ts
  • tests/unit/benchmark-quality.test.ts
  • tests/unit/retrieve.test.ts

📝 Walkthrough

Walkthrough

This PR improves retrieval quality through three main components: expanded benchmark test coverage for retrieval and community-label operations, refactored seed scoring using evidence-tier based ranking instead of TF-IDF, and relation-aware multi-hop expansion with guardrails to prevent misleading benchmark results.

Changes

Cohort / File(s) Summary
Documentation & Changelog
CHANGELOG.md
Added unreleased entry documenting improved retrieval ranking with relation-aware expansion and updated evaluation reporting with guardrails.
Benchmark Configuration
src/infrastructure/benchmark/quality.ts
Expanded GOLD_QUESTIONS with 4 new entries covering retrieveContext and scoreNode operations with additional expected label assertions.
Core Retrieval Logic
src/runtime/retrieve.ts
Refactored seed scoring to use evidence-tier model combining label matching, token similarity, source-path similarity, and optional community-label similarity; updated multi-hop expansion to be relation-aware with Hop 1/2 neighbor scoring; reordered snippet inclusion by evidence tier.
Benchmark Quality Tests
tests/unit/benchmark-quality.test.ts
Added 2 new unit tests validating MRR computation when expected node ranks first and recall preservation with symbol-scoped queries.
Retrieval Tests
tests/unit/retrieve.test.ts
Added 344 lines of comprehensive tests validating direct symbol match prioritization, directed-graph predecessor inclusion, relation-type prioritization over broad expansion, and budget-sensitive filtering.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Poem

🐰 Hops through graphs with cleverer sight,
Evidence-tiers now rank just right—
Relations guide each hop with care,
No more misleading results to spare!
Quality hops higher, retrieved with delight! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (2 warnings, 1 inconclusive)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is largely incomplete—it lacks the required template structure, provides only bullet-point commit messages without explanations, and omits critical sections like Testing checklist, documentation updates, and issue references. Reformat the description to follow the template: add a Summary section explaining what changed and why, a Testing section with verification commands, and complete the Checklist section with accurate checkboxes and any related issue references.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'feature/measurement semantics cleanup' is vague and generic, using non-descriptive terms that don't convey the actual changes (retrieval ranking, expansion relation-awareness, and quality guardrails). Revise the title to be more specific about the main changes, such as 'Improve retrieval ranking with relation-aware expansion and quality guardrails' or similar.
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/measurement-semantics-cleanup
⚔️ Resolve merge conflicts
  • Resolve merge conflict in branch feature/measurement-semantics-cleanup

Review rate limit: 9/10 reviews remaining, refill in 6 minutes.

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

@mohanagy
mohanagy marked this pull request as ready for review May 1, 2026 20:37
@mohanagy mohanagy closed this May 1, 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