Repository navigation
Conversation
Closes #676. Saving a whole Bluesky account is long work that gets interrupted: the app quits, the network goes, Bluesky rate limits, the disk fills, someone changes their mind. So durability is the shape of the collection loop rather than something layered on top of it. Every page is committed together with the checkpoint that describes it, so a checkpoint can never claim more than is saved. Every identifier — a captured profile, an expected asset, a bookmark's minted AT URI — is derived from what it names, so committing the same page twice leaves the same data and resuming never duplicates. The media still to fetch is derived from the saved data rather than queued beside it, so a restart finds exactly the work that is left and a failed asset stays explicit and retryable until a success upgrades the backup's completeness. A rate limit is a wait with a time on it. Stopping keeps everything committed and leaves only staging behind. What a category supplies is its AT Protocol surface and its mapping, and nothing else: posts, reposts, likes, and bookmarks all inherit durability from an engine that never knows which one it is running. Storage preflight is honest about what it cannot know. Bluesky publishes a post count and nothing else, so the report separates the part Cyd is certain about from the part it is estimating, and refuses a run only when even the certain part does not fit. Browse views read this computer alone — no connection, no network. Media that was never fetched is shown as absent rather than omitted, because a gap in a backup is something to see. Controller tests drive the whole engine against a fake AT Protocol client with real temporary storage, restarting, retrying, rate limiting, cancelling, and filling the disk for every category. UI tests mock only the controller boundary. Progress and error reports carry operational metadata only, per docs/adr/0029-minimize-bluesky-diagnostics.md. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Match Cyd Mobile on bookmarks. Bluesky keeps bookmarks in a private stash and gives the bookmark itself no AT URI, only a strong ref to the post. Desktop was minting `at://<did>/app.cyd.bookmark/<rkey>` to give it the stable identifier a saved record needs; Mobile instead points the bookmarks selection straight at the bookmarked post and carries the bookmark time on the selection. A Cyd Bluesky archive is a cross-client contract, so an identifier that means one thing on desktop and another on mobile breaks the merge the format promises. Desktop now writes what Mobile writes, and mints nothing. Keep the author a record was captured with. The archive contract's own fixture has a record pointing at a captured profile while the identity points at the renamed one, which is the whole substance of "profile refresh does not rewrite captured historical author labels". Re-collecting was repointing every record at the new profile, and the test asserted that as if it were correct. Records now keep their captured author; only a record Cyd could not read at first — whose author is a bare DID — takes its real author once Bluesky answers for it. Fetch a blob from the repository that holds it. `com.atproto.sync.getBlob` through this account's session only answers for this account's own repository, so a liked video — which belongs to whoever posted it — could never have been saved whole. The owning server is now resolved from its DID document; blobs are public, so that needs no authorization, and the authenticated session remains the fallback for an unresolvable document. Resume interrupted saves. A job only says "running" while a process is running it, so one found in that state on open was interrupted. It now returns to the pending queue and the dashboard offers to carry on, which is what the engine's checkpoint was already able to do and an IPC comment already claimed. A full disk can also defeat the one-row write that records where a run stopped, so that write no longer turns a reported outcome into a thrown one. One definition each, and no dead code. The category graph, the asset address codec, the save-job type name, the AT Protocol collection constants, and the saved-totals list were each written twice; the two copies of the category graph already disagreed, so a Browse view could report a completeness the engine did not mean. Deleted six unused store readers, an unused rate-limit type, and a controller getter only its own tests called. Narrowed a glossary entry whose _Avoid_ list contradicted the code shipped beside it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #676.
The engine
Saving a whole Bluesky account is long work that gets interrupted: the app quits, the network goes, Bluesky rate limits, the disk fills, someone changes their mind. So durability is the shape of the collection loop rather than something layered on top of it.
rateLimitedUntil, not a failure.What a category supplies is its AT Protocol surface and its mapping, and nothing else. Posts read raw repository records, so an own post's images and video are saved at original quality; reposts and likes hydrate their subjects; bookmarks arrive already hydrated. The engine never knows which category it is running.
Storage preflight
Bluesky publishes a post count and nothing else. So the report separates the part Cyd is certain about from the part it is estimating, and refuses a run only when even the certain part does not fit. An uncertain estimate is reported as uncertain, never as a refusal — refusing on a guess would block runs that would have fitted.
Browse
Per-category chronological paging read from this computer alone: no connection, no network. Embeds, subjects, bounded context, deletion state, and source links where they exist. Media that was never fetched is shown as absent rather than omitted, because a gap in a backup is something to see.
Decisions worth a reviewer's attention
Bookmarks match Cyd Mobile, and mint nothing. Bluesky keeps bookmarks in a private stash and gives the bookmark itself no AT URI — only a strong ref to the post. The first commit minted
at://<did>/app.cyd.bookmark/<rkey>to give it the stable identifier a saved record needs. Mobile instead points the bookmarks selection straight at the post and carries the bookmark time on the selection (cyd-mobile/services/archive-export/interchange.ts: "There is no bookmark record URI in Mobile's storage, so the selection names the bookmarked post directly"). A Cyd Bluesky archive is a cross-client contract, so an identifier meaning one thing on desktop and another on mobile breaks the idempotent merge the format promises. Desktop now writes what Mobile writes.Worth noting separately: the canonical fixture under
docs/archive/bluesky/v2/fixtures/does carry anapp.cyd.bookmarkrecord with arecord_subjectsrow, which is what the minting was based on. Mobile's reader handles both shapes, so nothing is broken — but the fixture shows a shape Mobile never writes, and that's probably worth its own issue against the archive contract.A liked video's blob comes from the repository that holds it.
com.atproto.sync.getBlobthrough this account's session only answers for this account's own repository, so a liked video — which belongs to whoever posted it — could never have been saved whole. The owning server is resolved from its DID document; blobs are public, so that needs no authorization, and the authenticated session stays the fallback for an unresolvable document. The fake client sits above this seam, so no test would have caught it.Captured authors survive a rename. The archive contract's own fixture has a record pointing at a captured profile (
alice.test) while the identity points at the renamed one (alice.example) — that is the whole substance of "profile refresh does not rewrite captured historical author labels". Records keep their captured author; only a record Cyd could not read at first, whose author is a bare DID, takes its real author once Bluesky answers for it.Tests
Controller tests drive the whole engine against a fake AT Protocol client with real temporary storage, and they interrupt it: restart, retry, rate limit, cancellation, and disk pressure, each parametrised over all four categories. UI tests mock only the controller boundary. Progress and error reports carry operational metadata only, per
docs/adr/0029-minimize-bluesky-diagnostics.md, and a test asserts the serialized progress contains no DID, handle, record text, AT URI, or local path.npm run lintclean; 1530 tests passing.Known limitation
For reposts, likes, and bookmarks,
estimatedByteson a first run is only the headroom constant, because Bluesky publishes no count for them and the estimate falls back to what is already saved. It is reported asuncertainand the UI names each unsized category, so it is honest — but the number is weak on a first run. Left as-is rather than papered over.🤖 Generated with Claude Code