--- import Layout from "../layouts/Layout.astro"; // The diagram is inlined rather than loaded, for the same reason the wordmark // is on the homepage: as one element in the document it takes the page's theme // tokens (see `.diagram` in global.css) instead of baking in one palette. // // It is inlined *pre-rendered*, because substandard.blog is served behind a // strict CSP with no `unsafe-inline` and no `unsafe-eval`: a client-side // Mermaid would need a script the CSP blocks. `npm --prefix web run diagram` // renders web/src/diagrams/architecture.mmd in headless Chrome and strips the // CSS the CSP would drop; nothing here ships a script. import diagram from "../diagrams/architecture.svg?raw"; const REPO = "https://tangled.org/permadeath.com/substandard"; const src = (path: string) => `${REPO}/blob/main/${path}`; // Who calls whom. Every row is a request the extension makes itself; links a // person clicks (a reader, a Bluesky profile) are left out, since they are // ordinary navigations and not the extension talking. const calls = [ { from: "background worker", to: "the site you are viewing", what: "GET /.well-known/site.standard.publication", why: "detect a publication, and check that its record points back at the site", }, { from: "background worker, popup", to: "plc.directory, public.api.bsky.app", what: "DID documents, identity.resolveHandle (including whether a site's host is a handle)", why: "turn a DID into a PDS host, and a handle into a DID", }, { from: "background worker, popup", to: "the publication's PDS", what: "repo.getRecord", why: "the publication and document records the page's link tags name", }, { from: "background worker, popup", to: "your PDS", what: "repo.listRecords", why: "your own subscriptions, blocks and follows, to know what to show", }, { from: "popup", to: "the owner's PDS", what: "repo.getRecord, sync.getBlob", why: "the owner's profile, and avatar or publication icon images", }, { from: "popup", to: "constellation.microcosm.blue", what: "GET /links/distinct-dids, GET /links/count", why: "who else has a subscription record pointing at this publication, and how many documents point at it", }, { from: "popup", to: "public.api.bsky.app", what: "app.bsky.feed.getPosts", why: "reply, repost and like counts for the article's Bluesky thread, when its document record names one", }, { from: "popup", to: "api.bsky.app", what: "app.bsky.feed.searchPosts", why: "other people's posts that link to the article's canonical URL", }, { from: "popup", to: "the labelers your account subscribes to", what: "label.queryLabels", why: "moderation labels on the publication and its owner", }, { from: "popup", to: "your PDS", what: "repo.createRecord, repo.deleteRecord", why: "subscribe and unsubscribe; post feedback if you use the feedback form", }, { from: "OAuth host (offscreen document on Chrome, background page on Firefox)", to: "your PDS and its authorization server", what: "OAuth: authorization request, token refresh (daily keepalive), revoke", why: "sign in, refresh, and sign out", }, ]; // Where anything that outlives a single request is kept. All of it is local; // there is no substandard-operated server for it to be kept on. const storage = [ { where: "extension session storage", what: "per-tab detection state, well-known probe results, short-lived lookups", life: "cleared when the browser closes", }, { where: "extension local storage", what: "your follow list, your chosen reader, and a non-secret session mirror (DID, handle, avatar URL)", life: "until you clear it or uninstall", }, { where: "extension-origin IndexedDB and localStorage", what: "OAuth tokens, DPoP keys and PKCE state, written by the OAuth client", life: "until sign-out or uninstall", }, ]; ---

architecture

how it works

The extension runs in your browser and talks to AT Protocol services directly.

This includes the site you're on, both their and your PDS, and ecosystem services (like Bluesky APIs).