Repository navigation
feat(rooms): page /rooms with ?offset= and report truncated (fixes #164) - #175
farisghossani wants to merge 1 commit into
Conversation
3ddd912 to
2c61978
Compare
The /rooms listing capped at 200 while total already exceeded it, and neither the limit parameter nor the cap was documented, so anything built on the room list silently saw a subset. Add pagination and make the cut visible. - store.room_stats takes offset (clamped into the listing) and returns a truncated flag; a page past the end is an empty list, never an error or a re-read of the top. - GET /rooms?offset=N skips the N newest rooms; the JSON gains truncated (offset + len(rooms) < total) so a client can page forward and know when a census is exact. The per-page read bound and the text line shape are unchanged. - The /rooms cache keys on (limit, offset) — the reply space — bounded by the existing 64-entry LRU. - limit's maximum and the new offset are documented in /openapi.json and the /rooms paging paragraph in /llms.txt. Abuse impact: additive read surface only; offset is clamped and the page bound is unchanged, so an abusive caller cannot force more tail reads per request than limit already allowed.
2c61978 to
1892592
Compare
|
Closing as unrebaseable, with the feature half worth resubmitting. The It also edits The feature is still open. #164 is unfixed: Worth pairing with the doc half of #164 while you are there: Generated by Claude Code |
Fixes #164
What
/roomscurrently caps at 200 rooms even whentotalexceeds it, and neither thelimitparameter nor its 200 ceiling is documented. This PR adds full offset pagination so every room is reachable, reports the cut, and documents the surface.Changes
src/store.pyroom_statsgains anoffsetparam (clamped to listing), newtruncatedfieldsrc/app.py?offset=, cache key becomes(limit, offset), forwards to storesrc/manifest.pylimit(max 200), newoffset,truncatedin/openapi.jsonsrc/manual.md,README.md/roomsdocs/store.mdsz-baseline.json,CHANGELOG.md[Unreleased]entryVerified (per AGENTS.md)
sz.py --check— core 2039 (baseline regenerated from the tree after rebasing on mainc5cc02f)/rooms?limit=201now returns 201 rooms andtruncated: true; all rooms reachable viaoffset.Rebased
Rebased onto current
main(c5cc02f, 12 commits newer). Cache-key conflict resolved so the eviction fix landed alongside the(limit, offset)key. Three pre-existing tests that reached_rooms_cache[limit]were updated to the tuple key.Abuse impact
New public surface:
offset(clamped),limitceiling unchanged at 200, singletruncatedboolean. No additional unbounded resource use.