Detect repeated cursors, duplicate-only pages and no progress in a pagination scan

$0.005 USDC per call · Agent infrastructure · POST /api/v1/pagination-loop · Id pagination-loop

Takes the pages an agent has fetched so far (cursor used, next cursor returned, item ids) and finds the failures that make a scan loop or lie: a next cursor already used, a page whose items were all seen before, a page that returned nothing new yet offers another cursor, a scan that has not ended. Optionally takes declared ordering and cursor assumptions and lists the omission risks they imply (offset cursors under mutation, non-unique sort keys, unstable order). Each page's cursor must be the previous page's next cursor, otherwise pages are missing and the result is unknown. pass only when the scan ended (no next cursor), nothing repeated and no declared risk applies. Does not call the API and cannot prove completeness; unknown means that.

What you get

Stops an endless paging loop and catches silent duplicates or skips before the agent reports 'all items'.

Call it

Send the JSON body below to https://agents.writerslogic.com/api/v1/pagination-loop. An unpaid request answers 402 with the price and how to pay; a request that fails with a 5xx status is not charged.

curl -i -X POST https://agents.writerslogic.com/api/v1/pagination-loop \
  -H 'content-type: application/json' \
  -d '{"pages":[{"items":["a","b"],"nextCursor":"c1"},{"cursor":"c1","items":["c","d"],"nextCursor":"c2"},{"cursor":"c2","items":["e"]}],"declared":{"ordering":"stable-unique-key","cursorKind":"opaque"}}'

Input

FieldTypeRequiredDescription
pagesarray<object>; max 500 itemsyes
declaredobjectno

Example request body

{
  "pages": [
    {
      "items": [
        "a",
        "b"
      ],
      "nextCursor": "c1"
    },
    {
      "cursor": "c1",
      "items": [
        "c",
        "d"
      ],
      "nextCursor": "c2"
    },
    {
      "cursor": "c2",
      "items": [
        "e"
      ]
    }
  ],
  "declared": {
    "ordering": "stable-unique-key",
    "cursorKind": "opaque"
  }
}

Result

The response is { "data": ..., "_provenance": ... }. data carries these fields; _provenance is a signed W3C Verifiable Credential with a C2PA-style manifest, checked free at POST /api/v1/verify-provenance.

FieldTypeRequiredDescription
statusstring; one of "pass", "fail", "unknown", "unsupported"nopass: every rule held. fail: a rule was violated (see witnesses). unknown: the input lacks the evidence to decide. unsupported: outside what this engine covers. Missing evidence is never a pass.
pagesCheckedintegerno
itemsSeenintegerno
uniqueItemsintegerno
duplicateItemsintegerno
endedbooleannoThe last page offered no next cursor.
loopAtPageintegernoIndex of the first page that repeats a cursor, when any.
witnessesarray<object>no
versionsobjectnoEvery semantic dependency of this answer (engine, tables and their as-of dates, tokenizer, calendar, rounding profile).
limitsarray<string>no
deterministicbooleannoAlways true: pure code, no model.

Pay and connect

Available through: x402 (USDC on Base), MCP. MCP clients reach it through the execution-safety-kit package.

Machine-readable