Page list tools with one limit and cursor contract #304
Description
See #302. One contract for every list tool, described once in the system guide.
Contract
- Request:
limit(small default, documented maximum) andcursorfrom the previous response. - Response: entries plus
total,hasMoreandnextCursor. - Deterministic order with a stable tie-break (as #116 already does), so pages have no gaps or duplicates.
- A cursor is opaque, bound to the caller, the query and its sort; a cursor used with different arguments is refused rather than guessed. Define what happens when items change between pages and test it.
Work
- Apply to
task_list,item_search(per item kind or one merged sequence, decide and document) and theproposal_getqueue; alignitem_historyandrelation_list, which already takelimit. - Replace the fixed caps (300 root tasks in
TaskService.List, 30/20/20 initem_search) with the contract. - #219 builds the complete memory inventory on this contract; bag children (#295) use it too.
Acceptance
- Exhausting a fixture larger than the maximum limit returns every visible entry exactly once, including equal timestamps and subtasks that follow their parent across a page boundary.
totaland cursors reveal nothing the caller may not read.- Tool list stays within budget or the budget is raised deliberately with the reason recorded in
McpDiscoveryTests.