fix(trades): limit reaches byItem, not only the trades array #275

Closed
coilyco-ops wants to merge 1 commit from coilyco-ops/trades-limit-reaches-byitem into main AGit
Member

refs #267 - limit bounded the small array and left the large one; byItem is the bulk of the payload

refs #267 - limit bounded the small array and left the large one; byItem is the bulk of the payload
get_trades bounded the small array and left the large one whole. At
limit=2 the trades list correctly reported "showing 2 of 528 rows" while
byItem returned roughly 250 rows, and byItem is the bulk of the payload.

A caller passing limit to keep a response small got the parameter's
acknowledgement and not its effect.

byItem is a ranked per-item array that grows with the item catalogue, so
rule 1 of #267 applies to it. The scalar summaries are what rule 5
protects and they are untouched: counts, totalCurrencyVolume, and the
counts_note stay whole regardless of limit, and the test asserts
totalCurrencyVolume survives.

Checked before changing it, because bounding a genuine aggregate would
break rule 5 rather than satisfy rule 1: items.py joins the ledger's
by_item with the atlas's, and it takes the dataclass field as typed
tuples. _bound_rows mutates the serialized payload after to_dict, so that
join cannot see this and is unaffected.

Mutation: naming only "trades" again fails the new test.

Slice of #267, which stays open. byCurrency in this same payload also
grows with world size and is not named in the issue, so I left it rather
than widening the claim. get_currency's shadowed 15-row cap, the four
tools with no limit parameter, and the 25-tool audit are untouched.

Refs #267

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: Kai Siren <coilysiren@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
coilyco-ops closed this pull request 2026-08-13 22:12:28 +00:00

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
coilyco-gaming/eco-app!275
No description provided.