Skip to content

Directory: serve every bundle binding by default and page by content-hash cursor - #260

Merged
randomblocker merged 3 commits into
phase0-completionfrom
contrib/community-155-bundle-listing-pages
Nov 6, 2026
Merged

randomblocker merged 3 commits into
phase0-completionfrom
contrib/community-155-bundle-listing-pages

Conversation

@randomblocker

@randomblocker randomblocker commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

GET /api/dacs/bundles/{jobId} returned at most 50 bindings unless the client paged, which differs from the DACS-1 §6.3.6 contract of serving every BB-4-valid binding. Its offset paging could also skip a record when a reindex happened between pages.

With neither limit nor cursor, the route now returns the plain { bindings } response with every binding. Paging is an optional extension:

  • cursor is the content hash of the last binding read. Paged order is by binding content hash, not by signer.
  • A cursor whose key no longer exists continues from the next key.
  • A cursor without limit returns everything after it.
  • Old numeric cursors are now rejected with 400.

The store write path is unchanged. README, OpenAPI and SPEC_PIN describe the new behaviour.

Tests: a default request returns more than 50 bindings; paging across a reindex between pages omits nothing; cursor-only returns the rest; a vanished cursor key continues from the next key. Each failed on the old code. Full directory suite: 1667 pass, 0 fail, 1 skipped; typecheck clean.

Closes #155

🤖 Generated with Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

randomblocker and others added 3 commits November 6, 2026 14:59
…t-hash keyset

GET /api/dacs/bundles/{jobId} capped a plain request at 50 bindings and
paged by offset, so a reindex between pages could make a page skip a
record. With neither limit nor cursor it now returns every BB-4-valid
binding as { bindings }. limit and cursor are an optional extension: the
cursor is the content hash of the last binding read, paged results are
ordered by that hash (not grouped by signer), a cursor whose key is gone
continues from the next key, and a cursor without limit returns the rest.

Closes #155

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…hashing on the default path

The bundles route re-verified every stored binding on each GET and hashed
and sorted the whole set even for a plain request, which blocks the event
loop on a large job. Every writer into the job's binding set (registration
route, reindex, chain scan, well-known crawl) already verifies BB-4 before
storing, so the route now serves the stored bindings as they are. A request
with neither limit nor cursor is served unhashed and unsorted, in unspecified
order; only paged replies are ordered by content hash. OpenAPI, README and
SPEC_PIN say so.

Tests: a default GET calls neither the signature verifier nor the hash
function; each write path refuses a binding with a bad signature, a wrong
job or a missing member and does not store it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…n read; legacy envelopes served as stored

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@randomblocker
randomblocker marked this pull request as ready for review November 6, 2026 19:16
@randomblocker
randomblocker merged commit a90cf71 into phase0-completion Nov 6, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant