Repository navigation
Conversation
`POST /memories/search` returned one page and had no way to ask for the next one, while `GET /memories` had just gained `offset`. This closes the gap and removes the second hard-coded page ceiling that made closing it unsafe. - `SearchRequest` gained `offset`, and both adapters window the ranked result by it. The window is applied *after* the access filter, the same measure the listing endpoints use, so a page is a page of what the caller may read wherever it comes from - and the adapter contract suite proves both backends window identically. - `MAX_PAGE_SIZE` moved beside the request models. It is part of the request contract: `SearchRequest` bounded `limit` with a literal `100` while the listing routes used their own constant, so the same client could be told one ceiling by one endpoint and refused by the next. One number, one home, and the paging module imports it rather than defining a second copy. - The response gained `has_more` and echoes `offset` / `limit`. `has_more` is what `returned` cannot say: a short page and the final page are indistinguishable without it. The route asks the adapter for one cell past the page to answer it - the adapter has already ranked the whole candidate set before slicing, so that costs one comparison and no extra query. Also fixed: a stray `"total": 1` left in the search example in `docs/api-reference.md` by this chain's earlier rename. It was still documenting the count the server has never computed, in the one place a client is most likely to copy from. Verified against a live server: 38/38 conformance vectors, and the Node SDK's full 19 tests run against a real server rather than skipping for lack of one. Plus 241 server tests, 25 SDK tests, ruff/mypy clean, `mkdocs build --strict` clean.
Owner
Author
|
Landed on master in the v0.1.0 chain: the branch was fast-forward merged as part of |
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.
feat(server): page search results, with one ceiling for both endpoints
POST /memories/searchreturned one page and had no way to ask for the next one,while
GET /memorieshad just gainedoffset. This closes the gap and removes thesecond hard-coded page ceiling that made closing it unsafe.
SearchRequestgainedoffset, and both adapters window the ranked result byit. The window is applied after the access filter, the same measure the
listing endpoints use, so a page is a page of what the caller may read
wherever it comes from - and the adapter contract suite proves both backends
window identically.
MAX_PAGE_SIZEmoved beside the request models. It is part of the requestcontract:
SearchRequestboundedlimitwith a literal100while the listingroutes used their own constant, so the same client could be told one ceiling by
one endpoint and refused by the next. One number, one home, and the paging
module imports it rather than defining a second copy.
has_moreand echoesoffset/limit.has_moreis whatreturnedcannot say: a short page and the final page are indistinguishablewithout it. The route asks the adapter for one cell past the page to answer it -
the adapter has already ranked the whole candidate set before slicing, so that
costs one comparison and no extra query.
Also fixed: a stray
"total": 1left in the search example indocs/api-reference.mdby this chain's earlier rename. It was still documentingthe count the server has never computed, in the one place a client is most likely
to copy from.
Verified against a live server: 38/38 conformance vectors, and the Node SDK's full
19 tests run against a real server rather than skipping for lack of one. Plus 241
server tests, 25 SDK tests, ruff/mypy clean,
mkdocs build --strictclean.