ADR 0358: A Bluesky announcement is one post record with facets and a link card, under a record key derived from the announcement
- Status: Accepted
- Date: 2026-10-29
- Parent epic: #382
- Story: #391 (task DIST2.1.2)
Context#
ADR 0357 connects a Bluesky account. The delivery worker calls a provider only through the adapter interface of
social-delivery.mjs (ADRs 0316 to 0319): publish resolves only for a success the provider confirmed and named,
everything else is a typed DeliveryError, and an optional reconcile looks an uncertain attempt up. LinkedIn
and Facebook honour no idempotency key, so an uncertain attempt there can only be looked up by content (ADR 0320) or
handed to a person.
What Bluesky's records require, checked on 2026-10-29 against the lexicons and guides:
app.bsky.feed.post:text(at most 3,000 bytes and 300 graphemes) andcreatedAtare required; the record key type istid;embedis one of images, video, external, record;facetsannotate the text.app.bsky.richtext.facet:byteStartinclusive,byteEndexclusive, "counting bytes of the UTF-8 encoded text"; features#link(a full URI),#tag(without the#, at most 64 graphemes) and#mention(a DID).app.bsky.embed.external:uri,titleanddescriptionare required;thumbis an uploaded blob of at most 1,000,000 bytes.com.atproto.repo.createRecord: takesrepo,collection, an optionalrkeyand therecord, and answersuriandcid.getRecordreads one record by repo, collection and key, with the errorRecordNotFound.- The posts guide shows link cards and facets built by the client: the service does not detect links or fetch a card for you.
- XRPC errors are JSON
{ error, message }; an expired access token answersExpiredToken(HTTP 400); a limit answers HTTP 429 (XRPC, rate limits).
Decision#
- One record, written by the adapter.
publishsends onecreateRecordof anapp.bsky.feed.postto the connected account's own repository (repois the account's DID):textis the stored caption,createdAtthe moment of the attempt, andembedanapp.bsky.embed.externalcard whoseuriis the canonical post,titlethe caption's first line (plain, at most 300 characters) anddescriptionempty. No thumbnail is uploaded (images aremanualin the manifest), and the post text does not repeat the link: the card carries it. - Facets for links and hashtags, never mentions. Full
http(s)://links and#hashtagsin the caption become#linkand#tagfacets at UTF-8 byte offsets; sentence punctuation at the end of a link is left out of its facet, a link with credentials is not linked, and an all-digit#2026is not a tag.@handlesstay plain text: a mention needs the handle resolved to a DID, and a wrong one would notify a stranger. - The caption limit is Bluesky's. The announcement model gives Bluesky a caption limit of 300 characters in both
halves (
social_schedule.rs,social-schedule.mjs, held totests/fixtures/social-schedule.json). Characters (code points) are never fewer than graphemes, and 300 of them are at most 1,200 bytes, so a caption Admin accepts is always within Bluesky's limits; the adapter checks graphemes and bytes again before sending. The Rust Admin checks a new or edited caption before it knows the account's provider, so it now accepts one that some destination takes (check_caption_for_any, formerly every destination), and the hosted function, which resolves the account, applies that destination's own limit; the composer counts against the chosen destination's limit as you type. The manifest declaresmaxTextChars: 300and the newapp-passwordlogin method (ADR 0357) in both halves and the fixture. - A record key per announcement. The record key is a TID (atproto's 13-character timestamp identifier) made from
the announcement's scheduled instant (milliseconds, plus three digits of microseconds) and a 10-bit clock id, the
extra bits taken from a SHA-256 of its idempotency key. Every attempt of one announcement names the same record:
if an attempt that looked uncertain did land, a later write of the same key is refused by the repository instead of
posting twice. The worker gives adapters the announcement's
scheduledForfor this. The idempotency key itself is never sent. - The at:// URI is the provider post id. A 200 counts only when the service names exactly
at://<did>/app.bsky.feed.post/<key>with acid; any other 2xx, a 3xx or a 5xx isuncertain. 401, or 400 or 403 withExpiredToken,InvalidToken,AuthenticationRequiredorAuthMissing, isauth(the account is flagged for reconnecting, ADR 0319); 429 orRateLimitExceededisrate-limited, honouringRetry-Afterand otherwiseRateLimit-Reset(an epoch second, or a small number of seconds); other 4xx arerejected. The service's message is never read. - Reconcile reads that one record.
reconcilecallsgetRecordfor the announcement's key. It ispublishedonly when the record is there, is a post, and holds exactly the caption and the canonical link;RecordNotFoundis a conclusiveabsent(the key is this announcement's alone); anything else isunknown, which the worker keeps looking at and then hands to a person (ADR 0318).
Consequences#
- An uncertain Bluesky attempt is settled by a lookup that cannot match another post, and a retry after a wrong "absent" cannot duplicate the post, unlike the content matching LinkedIn and Facebook need.
- Two announcements of one account would need the same scheduled millisecond and the same 20 bits of hash to share a key; the second would then be refused, never written over the first.
- The card has no image and an empty description; Bluesky shows the title and the link's domain. Adding a thumbnail
(an
uploadBlobof the post's social image) is a later, separate change to the manifest'simagesupport. - Mentions, language tags (
langs) and self-labels are not sent.