fix(knowledge): apply the source and date filters inside a resolved scope's ranking - #8059
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
There was a problem hiding this comment.
All reported issues were addressed across 10 files
Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.
Fix all with cubic | Re-trigger cubic
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
No issues found across 10 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.
Re-trigger cubic
…cope's ranking - a source filter confines the access plan itself, so every on-row predicate, the reach, and the sources the legs walk or rank are that kind of source alone; `upload` keeps only source-less documents - a date filter enumerates the documents it admits off a new `(knowledge_base_id, source_modified_at)` index and ranks them exactly while the planner estimates the window within the probe's limit; a wider window is walked with the date tested through the document, on the row and on the ranked keyword row - a date-bounded set is ranked exactly even when a member source has its own index, since a walk cannot see the date - the reach is keyed and counted by the plan's sources - a keyword leg whose deadline passes before its ranking is resolved is short rather than failed
318f2eb to
1b59f04
Compare
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
All reported issues were addressed across 10 files
Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.
Fix all with cubic | Re-trigger cubic
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
All reported issues were addressed across 10 files
Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.
Fix all with cubic | Re-trigger cubic
Summary
sourceandupdatedfilters were not applied inside the ranking on the resolved-scope path — only at hydration — so a filtered search ranked candidates the filter then refused. On a production-shaped copy,updated: past weekreturned 0 rows although thousands of documents qualified, a small-source filter returned 4, and every filtered search's keyword leg ran to its deadline (this predates improvement(knowledge): resolve connector and member state once per search #8040)uploadkeeps only source-less documents(knowledge_base_id, source_modified_at)partial index and ranks them exactly while the planner estimates the window within the probe's limit; a wider window is walked with the date tested through the document, on the row and on the ranked keyword rowMeasurements
Same copy, same reader (reaches ~63% of the index), complete results; wall time over a ~80 ms round trip:
Server side the new paths are hundreds of milliseconds: past week probes off the date index (~300 ms) then ranks the bounded set exactly (~200 ms); past month is one on-row walk at 340–450 ms. Without the index the date probe was a 320–640 ms sequential scan.
Type of Change
Testing
bun run check:migrations origin/stagingpasses; lint, block registry,check:audits, docs manifest passChecklist