mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-10 16:33:27 +00:00
Audit follow-ups before merge: - amy fetch default limit is now the same on both paths: absent --limit → 100 for plain AND --paginate (previously --paginate silently meant "unbounded"). `--limit 0` is the explicit opt-in to drain everything (unbounded); negative is rejected. The effective limit is carried on the filter so both paths agree. - drainAllPages sizes its SeenIds for CLI-scale fetches (initialSlotsPow2 = 12, ~64 KB) instead of the large-walk default (~16 MB eagerly allocated per fetch); it grows if an unbounded drain needs it. - fetchAllPages clamps the inclusive advance to `min(pageMinTs, boundary)` so a misbehaving relay that answers with an event past the requested `until` can't push the cursor upward — the boundary dedup and termination rely on `until` never increasing. No-op for honest relays (they only return events ≤ until). Verified live: default and --paginate both cap at 100; --limit 50 → 50; --limit 0 --paginate drains the full window (>100); paging tests + SeenIds tests still pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015YEbdqCRPkszkGCoi89RMt