chadtmiller.com/monolith
An atproto PDS
0
0
pds-server: a space's listRecords cursor is a record's URI, as the reference's is
Merged Approved
The pull makes a space's listRecords answer the last record's URI as its cursor. It also takes a URI of the same space and repo as a position, whether or not the record exists.
- Server: I read
list_recordsin full. The prefix strip, the/check and the upper-bound logic are correct. A cursor below the collection's lower bound gives an empty page, which is right. - Spec: the change is in
spec/SPACES-REPO.md, in both "Each read" and "Cursors". - Harness: the new checks are stricter. The built-cursor read compares both sides against what the harness wrote.
- Changeset: it is present and written for clients.
One nit: the doc comment on list_records still says the cursor is "the last path of the page before". It should say the last record's URI.
All checks have passed
4 passed, 1 skipped
1 skipped check
releaseSkippedMerged as f722cb1
knotless reads a private repository's refs with a space
listRecordspage started below a key it chooses, a cursor it builds as a record URI, as the reference's cursors are. Monolith answered{collection}/{rkey}cursors and read a URI as a byte position below every key, so knotless saw no refs and every push to a private repository on Monolith failed. Now Monolith's cursor is the reference's: the last record's URI, taken as a position whether or not the record exists.Claude Opus 5.5 · high
What changes
Spec.
spec/SPACES-REPO.md, "Each read": a fulllistRecordspage answers the URI of its last record,{space}/{repo}/{collection}/{rkey}, asgetRecordanswers it; a cursor of that form, of thespaceandrepoasked, is a position whether or not such a record is or was there, so{space}/{repo}/{collection}/{prefix}.~starts below every key beginning{prefix}.. "Cursors": alistRecordscursor is no longer the server's to choose, since clients build them; one with a/that is not a record URI of the space and repo asked is400 InvalidCursor.listRepoOpsandlistSpacescursors are as they were.Harness.
harness/spaces/repo.mjs,listRecords: each cursor answered must be the URI of the page's last record; and one more read, on both sides, from a cursor built for a key (a written record's path with~after it, which need not exist), against the records the harness wrote below it. The reference passes both, which confirms its cursors are the last record's URI and that it takes a built one as a position.Server.
crates/pds-server/src/space_repo.rs,list_records: the cursor answered is{space}/{repo}/{path}; one taken must start with{space}/{repo}/of the request, and the rest is the position. Its unit tests use URI cursors, and assert a bare path and another repo's URI areInvalidCursor.A
.changeset(patch): clients see the cursor's form change.Why
The owner's account moved to Monolith; knotless's spaces-alpha cutover builds cursors as the reference has them (
crates/knotless/src/remote.rs,Remote::cursor,keys::scan_cursor), soknotless repo refsandgit pushon private repositories saw an empty repository and tried to create refs that exist (RecordAlreadyExists). Taking the reference's cursor form is the change that lets every alpha client page Monolith as it pages the reference; knotless building its own would leave the next client hitting the same.How it was checked
node spaces/compare.mjs --seed 1against the pinned reference: passes with the fix.space_repo.rsas on main, the same run fails at "listRecords from a built cursor" (seed 1: com.atproto.space.listRecords differs).cargo test -p pds-server --lib space_repo: 14 pass.just quick: run before queueing; the gates are thegatesworkflow's.Shortcomings
Cursors of the old form that a client holds mid-listing across the deploy are refused
InvalidCursor; it starts the listing again.