Repository navigation
fix(server): /v1/query leads with judgewalk's evidence pages; max_sections keeps them - #89
Conversation
…tions keeps them The self-host and production server (cmd/server, internal/handler) read only SelectedIDs from a page-based strategy, so /v1/query returned the overlapping sections in document order and dropped the evidence pages HAL-1390 added to the standalone engine. With max_sections 5 the gold evidence was often cut: on the rig the 3M FY2018 capex question's section came 7th of 35. The evidence pages now lead (page_<n>, '<section> · p.<n>', page text), the same contract as internal/api, and max_sections caps the combined list so a small cap keeps the evidence.
Reviewer's GuideThe server handler now mirrors the standalone engine by prepending Judge-selected evidence pages to Sequence diagram for evidence-first query responsessequenceDiagram
participant Client
participant QueryHandler
participant CostStrategy
participant Document
Client->>QueryHandler: HandleQuery
QueryHandler->>CostStrategy: SelectWithCost
CostStrategy-->>QueryHandler: SelectedIDs and EvidencePages
QueryHandler->>QueryHandler: evidencePageSections
QueryHandler->>Document: FindByID for remaining sections
Document-->>QueryHandler: Section content
QueryHandler-->>Client: Evidence pages followed by sections
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 47 minutes. View limit details
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
Closes HAL-3071
Why
cmd/server(self-host and production) read onlySelectedIDsfrom a page-based strategy./v1/querytherefore returned the overlapping sections in document order and dropped the evidence pages that HAL-1390 added to the standalone engine (internal/api). Withmax_sections: 5the gold evidence was often cut: on the rig, the section with 3M's FY2018 capex came 7th of 35.What
page_<n>units titled"<section> · p.<n>"with the page text. This is the same contract asinternal/api.max_sectionscaps the combined list, so a small cap keeps the evidence.Verified
TestQueryLeadsWithEvidencePagesandTestMaxSectionsKeepsTheEvidence.go build,go vetand theinternal/handlertests pass on the rig's engine VM.For comparison, vector RAG with Gemini embeddings scored hit@5 0.70.
Summary by Sourcery
Preserve page-level evidence in server query results and prioritize it when limiting returned sections.
New Features:
Bug Fixes:
Tests:
Summary by CodeRabbit