Apply review feedback to minimal Cortex query (P0-D)#50
Merged
devlux76 merged 5 commits intop0d/cortex-query-minimalfrom Mar 13, 2026
Merged
Apply review feedback to minimal Cortex query (P0-D)#50devlux76 merged 5 commits intop0d/cortex-query-minimalfrom
devlux76 merged 5 commits intop0d/cortex-query-minimalfrom
Conversation
…ting, add missing tests Co-authored-by: devlux76 <86517969+devlux76@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] [issue #21] Implement minimal Cortex query
Apply review feedback to minimal Cortex query (P0-D)
Mar 13, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR applies prior review feedback to the minimal Cortex query path by improving global result ranking, documenting a key precondition in vector concatenation, flagging an IndexedDB scalability concern, and adding missing unit tests for query behavior.
Changes:
- Sort merged hotpath + cold query results by descending score before returning.
- Document
concatVectors’ non-empty/equal-length precondition and add a scalability TODO forgetAllPages(). - Add/adjust unit tests for empty-corpus behavior and descending-score ordering; reformat MetadataStore stubs in an existing test.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
cortex/Query.ts |
Sorts combined results by score and documents concatVectors precondition. |
storage/IndexedDbMetadataStore.ts |
Adds a TODO warning that getAllPages() is a full-table scan unsuitable for large corpora. |
tests/SalienceEngine.test.ts |
Re-formats stubbed methods for readability/consistency. |
tests/cortex/Query.test.ts |
Adds missing query tests and updates the test vector backend kind. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Five issues identified in the P0-D review: unsorted combined results, missing defensive docs on
concatVectors, no pagination warning ongetAllPages, cramped stub formatting, and missing test cases that P0-D3 claimed complete.Changes
cortex/Query.ts– Sortcombinedby descending score before building the return value; add JSDoc toconcatVectorsdocumenting the non-empty-array preconditionstorage/IndexedDbMetadataStore.ts– AddTODOongetAllPages()flagging the full-table-scan as unfit for large corpora; should be replaced with paginated/indexed accesstests/SalienceEngine.test.ts– Reformat three stub methods crammed on one line to separate lines, consistent with the rest of the mocktests/cortex/Query.test.ts– Add the two tests that P0-D3 listed but were absent: empty-corpus (no results) and descending-score-order (relevance); fix pre-existingTestVectorBackend.kindtype error ("test"→"wasm")💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.