getVerbsWithPagination was offset-only: it re-scanned from shard 0 on every page and early-terminated at offset+limit, so a full edge walk was O(N²) (a consumer measured ~19k edges → 27s paging at 900/page). It now accepts an opaque resume token (cv1:<shard>:<verbId>) that resumes the shard walk immediately AFTER the last returned verb — O(N) total at any page size, no scale cliff. - Stable within-shard order (sort by verb id); ids come from the path so verbs skipped by the cursor are never read. - Cursor supersedes offset when present; offset path preserved for back-compat, and offset callers now get a usable nextCursor so they can switch to cursor paging. Foreign/malformed tokens decode to null → offset fallback (no throw). - The relationships stream generator now uses cursor (was offset → O(N²)). - Parity with the noun side (getNounsWithPagination already cursored). Test: tests/unit/storage/verb-cursor-pagination.test.ts — a full cursored walk visits every edge exactly once (no dup, no skip), matches the offset walk's set, and a foreign cursor falls back gracefully. |
||
|---|---|---|
| .. | ||
| blobStorage.compression-policy.test.ts | ||
| blobStorage.test.ts | ||
| getNouns-totalCount.test.ts | ||
| getVerbs-totalCount.test.ts | ||
| sharding.test.ts | ||
| stats-count-accuracy.test.ts | ||
| storage-path-resolution.test.ts | ||
| verb-cursor-pagination.test.ts | ||
| vfs-mkdir-bug.test.ts | ||