Skip to content

fix(retrieval): fill a section-tree answer's open slots from navigation's leaf ranking - #98

Open
hallelx2 wants to merge 2 commits into
halleluyaholudele/hal-3246-engine-return-a-short-document-whole-and-an-evidence-pagesfrom
halleluyaholudele/hal-3388-vectorless-trails-vector-search-on-qasper-retrieval-hit5-064
Open

hallelx2 wants to merge 2 commits into
halleluyaholudele/hal-3246-engine-return-a-short-document-whole-and-an-evidence-pagesfrom
halleluyaholudele/hal-3388-vectorless-trails-vector-search-on-qasper-retrieval-hit5-064

Conversation

@hallelx2

@hallelx2 hallelx2 commented Oct 17, 2026 •

Copy link
Copy Markdown
Owner

On documents navigated by section rather than by page, empty top-5 slots now fill from navigation's ranking of every section.

Stacked on #96. Merge that first.

Measured (2.5 Flash-Lite pilot, QASPER, 50 questions)

Vectorless found the gold paragraph less often than vector search (hit@5 0.64 against BGE's 0.82). By the number of units Vectorless returned:

units returned questions hit@5
5 33 0.88
4 2 1.00
1–3 15 0.07

With all five slots filled, Vectorless is ahead of vector search. The gap is under-filling. On a section tree, open slots filled only from the sections behind pages read just below the evidence. Those pages all belong to the one or two sections navigation chose, so nothing new came in.

Change

  • Fill order. After the sections behind the runner-up pages, sectionRunnerUps takes every section in navigation's own ranking (NavResult.Leaves, best first), up to 16. The response still takes only as many as max_sections leaves room for.
  • Fix: runnerUps returned a panic on a nil navigation result; it now returns nothing.

Verification

  • On vlb-w2, with Go 1.25.11 and golangci-lint v2.14.0 (the Lorx CI steps; Lorx runners are down, HAL-3404): gofmt clean, go vet, go build, golangci-lint 0 issues, go test ./... pass.
  • New: TestSectionRunnerUpsFallBackToTheLeafRanking.

The QASPER hit@5 re-measure needs vlb-engine running and happens in the HAL-3214 re-run.

Closes HAL-3388

Summary by Sourcery

Fill open section-tree answer slots from navigation's ranked leaves while safely handling missing navigation results.

Bug Fixes:

  • Prevent nil navigation results from causing runner-up selection to panic.

Enhancements:

  • Improve section-tree answer completion by filling open slots from navigation's ranked leaves after considering sections associated with runner-up pages, capped at 16 candidates.
  • Preserve navigation ranking and avoid selecting duplicate or already-seen sections.

Tests:

  • Add coverage for fallback to navigation's leaf ranking and nil-navigation behavior.

…on's leaf ranking

On QASPER, ingested as plain text and so navigated as a section tree,
Vectorless returned only 1-3 units for 15 of the pilot's 50 questions.
Those found the gold paragraph 7% of the time; the 33 with all 5 units
found it 88% of the time, ahead of BGE's 82%. The open slots were filled
only from the leaves of pages read below the evidence. Those pages all
belong to the one or two leaves navigation chose, so nothing new came in.

Navigation has already scored every leaf. After the leaves of the
runner-up pages, open slots now fill from that ranking, best first.
@sourcery-ai

sourcery-ai Bot commented Oct 17, 2026

Copy link
Copy Markdown

Sorry @hallelx2, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 2 days and 11 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@coderabbitai

coderabbitai Bot commented Oct 17, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e2a8e964-bd36-4b36-b1bd-44652ae7bde5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@sourcery-ai

sourcery-ai Bot commented Oct 17, 2026

Copy link
Copy Markdown

Reviewer's Guide

Section-tree answers now fill open slots using unseen leaves from navigation’s full ranking, after page-derived runner-ups, with a 16-leaf candidate cap and nil-navigation safety. The new test verifies ordering, deduplication state, and nil handling.

Sequence diagram for section-tree fallback leaf selection

sequenceDiagram
    participant Strategy as JudgeWalkStrategy
    participant Select as sectionRunnerUps
    participant Pages as runnerUps
    participant Nav as NavResult

    Strategy->>Select: sectionRunnerUps(nav, seen)
    Select->>Pages: runnerUps(nav)
    alt nav is nil
        Pages-->>Select: nil
        Select-->>Strategy: no runner-up leaves
    else nav is available
        Pages-->>Select: page-derived runner-ups
        Select->>Select: Add unseen page leaf IDs
        Select->>Nav: Read Leaves best first
        Nav-->>Select: ranked navigation leaves
        Select->>Select: Add unseen leaves up to 16
        Select-->>Strategy: ordered section IDs
    end
Loading

Flow diagram for section-tree runner-up filling

flowchart TD
    A[Section-tree answer has open slots] --> B[sectionRunnerUps]
    B --> C["runnerUps(nav): pages below evidence"]
    C --> D[Add unseen page leaf IDs]
    D --> E[nav.Leaves: full leaf ranking]
    E --> F[Add unseen leaves best first]
    F --> G{16 candidates reached?}
    G -->|Yes| H[Return candidates]
    G -->|No| H
    H --> I[Fill only slots allowed by max_sections]
Loading

File-Level Changes

Change Details Files
Extend section-tree fallback selection with navigation’s ranked leaves after page-derived candidates are exhausted.
  • Preserve runner-up page leaf selection as the first fallback source.
  • Append unseen leaves from NavResult.Leaves in ranking order.
  • Cap fallback candidates at 16 while retaining max_sections response limits.
  • Track selected leaves through the shared seen map to prevent duplicates.
pkg/retrieval/judgewalk.go
Make runner-up extraction safe when navigation results are absent.
  • Return no runner-ups for a nil NavResult instead of dereferencing it.
  • Cover nil navigation and leaf-ranking fallback behavior with a focused test.
pkg/retrieval/judgewalk.go
pkg/retrieval/units_test.go

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

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