Research project for analysing atproto promotion as a social movement
README.md

socio_atproto: the atproto movement as an online social movement #

This research project studies the promotion of the AT Protocol ("atproto") and of the atmosphere of applications built on it (Bluesky, but also Tangled, standard.site blogs, Smoke Signal, Leaflet...), in opposition to specific view of internet embodied in the concept of "digital capitalism". We treat this promotion as an online social movement and ask three questions:

  • Who is part of it? We look at developers, companies, community organisations, commentators and users, and at their structure: a core, its circles and its audience.
  • Which ideas does it defend? Examples are decentralisation, data portability, "credible exit" and the open social web.
  • How does it defend them? Through discourse, but also through practices: self-hosting one's data, building apps, using atmosphere apps, organising events.

Lines of analysis #

  1. Mapping the actors. We identify a validated core, then a second circle (accounts the core follows) and an audience (accounts that follow the core). The core is not the movement's leadership: it gathers the actors who promote or build atproto in public (developers, apps, organisations, and individuals who claim to endorse it and write or relay posts about it). Accounts excluded from the core because they do not post about atproto often reappear in the second circle or the audience: the frontiers between layers are porous, and each layer rests on a different relation (promotion, recognition by the core, attention to the core).

  2. Network analysis. We study the follow network of the core and the second circle, using several centrality measures that do not mean the same thing:

    • global popularity on Bluesky;
    • recognition inside the movement (in-degree, PageRank, i.e. "followers of followers");
    • reach through one's followers;
    • brokerage;
    • communities.

    Because follow records are dated, we can also date when the network formed.

  3. Practices as markers of commitment. These include hosting one's account outside Bluesky's servers (self-hosted or community PDS), using other atmosphere apps (repository collections), and building feeds or labelers.

  4. Content of the messages. Posts of the core, the second circle and the audience since January 2024 (themes, arguments, framing of the movement), and the networks of reposts (actors relaying the same posts).

  5. Long-form writing. Texts published by the actors on standard.site, Leaflet, WhiteWind and GreenGale.

  6. Positioning against platform capitalism. What the movement criticises (targets, diagnoses) and what it proposes (remedies), measured first with a dictionary evaluated term by term. Research design, hypotheses and literature: documentation/07_research_design_platform_capitalism.qmd; first results: documentation/08_platform_critique.qmd; what remains to do: to_do.qmd.

Pipeline #

Run the scripts from the project root, in this order. Every script sources scripts/paths_and_packages.R itself.

Step Script What it does
1a scripts/01_collect_core_candidates.R Gathers core candidates from resources/core_seed_sources.csv. Collects their profiles, PDS, repo collections and last activity, then writes a review file sorted by signals of involvement.
(manual) review file → validation/core_validation.csv (data folder) A human decides, for each candidate, include = TRUE/FALSE and account_type (individual, app for applications and services of the atmosphere, or organization for companies, collectives, communities and events), with a reason, a coder and a date. Decisions are typed in the single review file review/core_candidates.csv (description and link to the Bluesky profile for each candidate). 01 and 02 copy them into the validation file (import_review_decisions()). 01 then rewrites the review file with the new candidates, keeping the decisions and the candidates of earlier runs, after saving a copy in review/backups/; it refuses to run while the file is open in LibreOffice. Rerunning 01 adds as candidates the profiles that mention a validated organization (e.g. the developers of an app).
1b scripts/02_collect_core.R For the validated core: profiles, identities, repo collections and status, follows (from each PDS, dated) and all followers (AppView).
2 scripts/03_collect_second_circle.R Defines the second circle (weighted number of core followers ≥ k, each follow weighted by the idf of the followed account's popularity, so that celebrities count less) and the audience (following ≥ k core actors). The audience score weights each followed core account by the inverse of its popularity (idf of its number of followers). Saves the sensitivity of both to k and checks the activity of every candidate. Inactive accounts are left out of the audience. Then collects profiles and repositories, and the follows of the second circle and the audience (both are part of the networks).
3 scripts/04_collect_posts.R Posts written by the core, the second circle and the audience since posts_start (1 January 2024), and their reposts (URI of the reposted post only), read in each actor's repository. Incremental: rerunning fetches only what was published since the last run.
4 scripts/05_collect_blogs.R Long-form publications of the core and the second circle (standard.site, Leaflet, WhiteWind, GreenGale): blogs and documents with their full text when the record holds it. Documents whose text is not in the record (external sites) are flagged.
5 scripts/06_describe_actors.R Descriptive analysis of all layers: popularity, arrival cohorts, activity, hosting, apps, languages, distinctive words and clusters of descriptions (LSA + k-means). Writes it to results/actors/<id>/.
6 scripts/07_build_networks.R Builds four networks of the core and the second circle with tidygraph and networkflow: follows, interactions (replies, quotes, mentions), co-follows and co-reposts (coupling strength of shared follows or reposted posts, as in bibliographic coupling). For each: centralities, Leiden communities described by tf-idf on descriptions, node roles, UMAP layout, and a backbone of ties for the maps. Writes them to results/networks/<id>/<network>/.
7 scripts/08_topic_model.R Structural topic model of the core's posts (English; documents = an author's posts in a thread), with the type of account and time as covariates. Writes it to results/topics/<id>/.
8 scripts/09_bertopic_posts.py BERTopic on the core's posts (one post per document): multilingual sentence embeddings, UMAP, HDBSCAN with a parameter grid minimising unassigned posts, class-based tf-idf labels, topics over time and by type of account. Python environment: ~/.venvs/socio_atproto_bertopic (CPU torch, bertopic, sentence-transformers, duckdb). Writes to results/bertopic/<id>/.
9 scripts/10_topic_model_blogs.R Structural topic model of the long-form publications of the core (one article per document, full text, duplicates and placeholders excluded), with the type of account and the month as covariates. Writes it to results/topics_blogs/<id>/.
10 scripts/11_platform_dictionary.R Applies the dictionary of the critique of platforms (resources/platform_dictionary.csv: one regular expression per term, in categories of three dimensions: targets, diagnoses, remedies) to the English posts of the three layers and to the long-form articles, links removed. Scores per post, actor and week, and overlay with the BERTopic topics. Writes to results/platform_dictionary/<id>/.
11 scripts/12_robustness_benchmark.R Robustness of the topic models (posts, long-form articles) and of the dictionary to the dependence between documents of the same author: cluster bootstrap by author and author-level analysis of the differences between account types and layers, counts restricted to documents with a clear dominant topic, two methods of representative documents, benchmark metrics to compare the next extensions of the data. Writes robust_* files next to each run and results/benchmark/.
(eval) scripts/evaluate_platform_dictionary.R Stage-1 evaluation of the dictionary: draws a seeded sample of hits, probes (excluded homonyms) and posts without hits, in chunks judged by a model with the rubric resources/evaluation/platform_dictionary_prompt.md, then summarises the verdicts (precision per term, misses, share of critiques). Files in evaluation/platform_dictionary/<version>/ (outside the repo: they quote posts).
docs documentation/*.qmd Detailed reports: data collection (01_data_collection.qmd), network analysis (02_network_analysis.qmd), description of the actors (03_actors_description.qmd), topic model (04_topic_model.qmd), BERTopic (05_bertopic.qmd), topic model of blog articles (06_topic_model_blogs.qmd), dictionary measure of the critique of platforms (08_platform_critique.qmd). to_do.qmd (root) lists what is missing or could be improved.
source("scripts/01_collect_core_candidates.R")
# ... validate candidates in ~/data/socio_atproto/validation/core_validation.csv ...
source("scripts/02_collect_core.R")
source("scripts/03_collect_second_circle.R")
source("scripts/04_collect_posts.R")    # rerun later to fetch the new days
source("scripts/05_collect_blogs.R")
source("scripts/06_describe_actors.R")
source("scripts/07_build_networks.R")
source("scripts/08_topic_model.R")
# BERTopic (Python): ~/.venvs/socio_atproto_bertopic/bin/python scripts/09_bertopic_posts.py
source("scripts/10_topic_model_blogs.R")
source("scripts/11_platform_dictionary.R")
source("scripts/12_robustness_benchmark.R")  # after 08, 10 and 11
source("scripts/evaluate_platform_dictionary.R") # draws a diagnostic sample, or summarises its verdicts

or, in the background (survives the end of the terminal session; logs in ~/data/socio_atproto/logs/):

setsid nohup scripts/run_pipeline.sh 01 02 03 04 05 06 07 08 09 10 11 reports > /dev/null 2>&1 &

Reports are rendered with the Quarto binary shipped with Positron (Quarto is not on the PATH):

/usr/share/positron/resources/app/quarto/bin/quarto render documentation/01_data_collection.qmd

Rerunning. Running steps 1b–3 again later adds a new observation to the database: follows added or removed, profile changes, PDS migrations. An interrupted script resumes its unfinished run when rerun.

Testing. Set options(socio_atproto.test_mode = TRUE) before sourcing a script. Test runs use a separate database (socio_atproto_test.duckdb), few sources and small caps, so they never touch the history of the real collection. To discard them, delete that file. To test step 1b without writing made-up decisions into resources/, point to another validation file with options(socio_atproto.core_validation_file = "path/to/test_validation.csv").

Requirements. R ≥ 4.4 and the packages loaded in paths_and_packages.R (installed automatically through pacman), plus igraph, tidygraph, ggraph and the author's networkflow package for step 3 (R CMD INSTALL from a clone of https://github.com/agoutsmedt/networkflow). No Bluesky account or API key is needed: every endpoint used is public.

Data structure #

Data never live in the repository. Everything is in ~/data/socio_atproto/ (data_path in paths_and_packages.R):

~/data/socio_atproto/
  socio_atproto.duckdb        # all collected observations
  socio_atproto_test.duckdb   # test runs (disposable)
  staging/<run_id>/           # compressed chunks of a run in progress (deleted when the run finishes)
  review/core_candidates.csv  # the single file where candidates are coded (backups/ keeps former versions)
  validation/                 # manual decisions on the candidates (core_validation.csv)
  results/layers/             # sensitivity of the layers to the threshold k
  results/networks/<id>/<network>/  # nodes, edges, edges_undirected, edges_backbone, community_terms (.parquet) for follow, interaction, co_follow, co_repost
  results/actors/<id>/        # actors, distinctive_terms, text_clusters (.parquet), metadata.json
  results/benchmark/benchmark_<date>.csv  # metrics of script 12, one file per date
  results/platform_dictionary/<id>/  # post_hits, actor_scores, weekly, blog_documents, blog_hits, topic_overlay (.parquet), dictionary.csv, metadata.json
  evaluation/platform_dictionary/<version>/  # diagnostic samples, chunks and verdicts of the dictionary (quote posts)
  logs/                       # logs of the collection runs

Only the sources used to find core candidates are versioned, in resources/. The manual validation of the candidates contains judgements about identifiable people, so it stays with the data, in validation/. It is hand-made work that cannot be collected again: back it up.

The database #

The data change constantly: people edit their bio, change handle, follow and unfollow, and move to another server. Each execution of a collection script is a run (collection_runs: step, dates, parameters, git commit, summary). Every observation refers to the run that made it. To follow change without storing the same data at every run, the database only records what changed:

Table Content Logic
actors actor_id ↔ did DIDs are the stable identifiers (handles change). Integer ids keep the large tables small.
profile_versions handle, display name, description, labels, verification, number of feeds/lists/starter packs One row per distinct version: a new row only when the content hash changes.
profile_observations followers, follows and posts counts One narrow row per actor and run (a panel). A NULL hash means the profile was not returned (deleted, deactivated, suspended).
identity_versions PDS endpoint, handle claimed in the DID document Stored once, with first and last run seen; a migration creates a new row.
repo_collections record types present in the repository Stored once, with first and last run seen.
posts posts written by the actors since posts_start (posts, replies, quotes): text, languages, reply and quote links, shared link, mentions, hashtags One row per post (URI), stored once; reruns only add new posts.
reposts reposts by the actors: URI of the reposted post (with its author's DID) and date One row per repost record. The content of a reposted post is in posts when its author is collected.
repo_status whether the account is active; date of its last activity (any action recorded in its repository) One narrow row per actor and run.
follows source_id follows target_id, record key, creation date One row per relation, with first_seen_run, last_seen_run and removed_run. Removals are only inferred from complete lists.
core_candidates where each candidate was found One row per (run, actor, source).
actor_layers core / second_circle / audience, with criterion and threshold Rewritten by each run of a step.
collection_progress checkpoints (status, cursor, number of items, complete or capped) Allows resuming; records failures and caps.

The views latest_profiles, latest_identities, latest_repo_status, current_follows and latest_layers give the current state. Views are not stored: they are saved queries on the tables. For example, current_follows is the rows of follows without removed_run, and latest_identities is the latest row of identity_versions per actor. The tables keep the history and the views give the present. The full wiki of the database (tables, columns, relations) is in documentation/01_data_collection.qmd, with descriptions in documentation/data_dictionary.csv.

We chose this design over full snapshots at each run. Snapshots are simpler to query, but their volume grows with every run, while most profiles and follows do not change between two runs.

Analysis results are written as parquet files in results/, never in the database: the database only holds observations.

Collecting respectfully #

The data are public, but they are personal data, and the servers we query are run by a company and, for self-hosted PDSes, by individuals.

  • Polite rates.
    • AppView: half its published limit (5 requests/s).
    • Each PDS: one request at a time, at most 2/s.
    • PLC directory: 4 requests/s.
    • Servers that signal overload are paused for as long as they ask; servers that keep failing are given up.
  • Identification. Every request carries a user agent naming the project and this repository.
  • No useless requests. Runs are resumable, profiles are requested by batches of 25, and only accounts with a large following beyond any reason (above 2 million followers, max_followers_full_collect) are skipped.
  • Minimal data. We collect only what the research questions need. Raw API responses are not archived by default.
  • Opt-outs. Accounts labelled !no-unauthenticated (they asked not to be shown to logged-out visitors) are flagged. They are analysed in aggregate but never named in reports or published outputs.
  • Publication. Published results only name public figures and organisations in their public role. Other actors are pseudonymised.

All this is configured in scripts/paths_and_packages.R ("politeness"). Do not raise the rates.

Code organisation #

  • scripts/paths_and_packages.R: packages, paths, politeness settings and research parameters (thresholds, caps, keyword regex).
  • scripts/functions.R: shared helpers, documented with roxygen2.
    • Database: schema, runs, loaders.
    • Crawler engine run_crawl(): politeness, memory-bounded staging, checkpoints.
    • Response parsers.
    • Collectors: profiles, identities, repo descriptions, follows, followers, searches, starter packs, lists.
  • scripts/0*_*.R: the pipeline steps. Their headers explain the choices made and the alternatives.

Repository #

The main remote is Codeberg (origin). The project is also mirrored on Tangled, a git forge built on atproto: git push pushes to both. git remote -v shows the push URLs, and git push tangled pushes to Tangled only.