Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
50b9dcb
chore(skills): scaffold agent skills config
aliceisjustplaying May 23, 2026
d896310
fix(hooks): treat pre-write workdir as a fallback, not an extra gate
aliceisjustplaying May 23, 2026
b642a8e
docs: capture data-layer rebuild design (CONTEXT.md, ADRs 0001-0015, …
aliceisjustplaying May 23, 2026
c587c69
docs: grilling round 2 — identity, prefs, shortcut bar, tests, teleme…
aliceisjustplaying May 23, 2026
72c0ab2
docs: round-3 review-pass must-fix deltas (ADRs 0004/0009/0016/0017/0…
aliceisjustplaying May 23, 2026
27e0b99
docs: round-3 grill outcomes — M1–M11 milestones, single-tier e2e, co…
aliceisjustplaying May 23, 2026
b056cb8
docs: pre-AFK polish — OS-conditional social-app path, cleared open i…
aliceisjustplaying May 23, 2026
b5b947e
chore(scripts): add concat-context-and-adrs.sh for architecture-layer…
aliceisjustplaying May 23, 2026
d2c6a86
docs: round-4 architecture-critique must-fix deltas
aliceisjustplaying May 23, 2026
340789f
docs: add AFK rebuild prompt for Cursor Composer 2.5
aliceisjustplaying May 23, 2026
ce936d7
docs: sync runbook secrets list with source.env reality
aliceisjustplaying May 23, 2026
035c375
tests: capture + sanitize ATProto fixtures from main account
aliceisjustplaying May 23, 2026
202561c
tests: capture + sanitize moderation fixtures (6 of 8 causes + MISSIN…
aliceisjustplaying May 23, 2026
769e01d
docs(rebuild-prompt): set -a around source.env + OAuth localhost note
aliceisjustplaying May 23, 2026
085beaa
hooks(bluepy-guard): narrow env/printenv regex to actual commands
aliceisjustplaying May 23, 2026
c50f31f
soften language
aliceisjustplaying May 23, 2026
87ddce7
fix
aliceisjustplaying May 23, 2026
a2320c2
phase-b/M1-scaffolding: Phase 0 substrate (Query, Zustand, providers)
aliceisjustplaying May 23, 2026
30670e0
phase-b/M2-pure-internals: keys, primers, patchers, render helpers
aliceisjustplaying May 23, 2026
065e48f
phase-b/M3-session-clients: 5-mode dispatch and OAuth wiring
aliceisjustplaying May 23, 2026
bc300e1
phase-b/M4-read-hooks: read-only data layer hooks
aliceisjustplaying May 23, 2026
97f3068
phase-b/M5-preferences-shortcuts-moderation: prefs, shortcut bar, mod…
aliceisjustplaying May 23, 2026
828479a
phase-b/M1-M5-review-r1: address codex findings
aliceisjustplaying May 23, 2026
7193b21
phase-b/M1-M5-review-r2: address codex findings
aliceisjustplaying May 23, 2026
9ea5ada
phase-b/M1-M5-review-r3: address codex findings
aliceisjustplaying May 23, 2026
3a1cd99
phase-b/M1-M5-review-r4: address codex findings
aliceisjustplaying May 23, 2026
b449421
phase-b/M1-M5-review-r5: address codex findings
aliceisjustplaying May 23, 2026
19edfbc
phase-b/M1-M5-claude-review: address medium and low findings
aliceisjustplaying May 23, 2026
04e73d2
phase-b/M6-ui-state: add Zustand modals, reveals, ui-preferences
aliceisjustplaying May 23, 2026
900ba14
phase-b/M7: complete migrated read surfaces
aliceisjustplaying May 24, 2026
0d332fd
Fix migrated feed UI regressions
aliceisjustplaying May 24, 2026
4f7279e
Fix post detail navigation and sharing
aliceisjustplaying May 24, 2026
b3247c9
Move mobile search bar to bottom
aliceisjustplaying May 24, 2026
dc9810a
Fix boot performance and search scroll
aliceisjustplaying May 24, 2026
f1c2b57
docs: define push gateway plan
aliceisjustplaying May 24, 2026
1819aaa
Fix mobile search account rendering
aliceisjustplaying May 24, 2026
951fe92
Hydrate profile counts from search results
aliceisjustplaying May 24, 2026
4867eaa
Fix account sheet stats loading
aliceisjustplaying May 24, 2026
2b7cc8c
Restore search page header
aliceisjustplaying May 24, 2026
3b76f47
Improve moderation badge layout
aliceisjustplaying May 24, 2026
310e439
Stretch moderation badge width
aliceisjustplaying May 24, 2026
97da5d6
Speed up thread route rendering
aliceisjustplaying May 24, 2026
c4ceadb
Fix repost header clipping
aliceisjustplaying May 24, 2026
1bec0ed
Fix nested post deck navigation
aliceisjustplaying May 24, 2026
a2bd406
Remove language detection debug logs
aliceisjustplaying May 24, 2026
2f2db39
Fix post thread target scroll
aliceisjustplaying May 24, 2026
49abfd3
Fix notification mentions affordance
aliceisjustplaying May 24, 2026
92c1b39
Prevent thread scroll flash
aliceisjustplaying May 24, 2026
774ba9a
Fix nested thread bottom padding
aliceisjustplaying May 24, 2026
16e4e2d
Fix notification badge positioning
aliceisjustplaying May 24, 2026
6e0e7aa
Flatten post thread reply markup
aliceisjustplaying May 24, 2026
5ff45d2
Ignore no unauthenticated labels
aliceisjustplaying May 24, 2026
13f897f
Update thread markup regression
aliceisjustplaying May 24, 2026
e989ab8
Finish M7 profile graph reads
aliceisjustplaying May 24, 2026
37e1c91
Migrate mini profile graph reads
aliceisjustplaying May 24, 2026
38dd0c9
Fix feed media close navigation
aliceisjustplaying May 24, 2026
152b063
Migrate M8 mutation paths
aliceisjustplaying May 24, 2026
c2ae49c
Validate active DID on record-URI deletes
aliceisjustplaying May 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .claude/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,27 @@
"hooks": [
{
"type": "command",
"command": "${CLAUDE_PROJECT_DIR}/scripts/hooks/bluepy-guard.sh pre-bash"
"command": "${CLAUDE_PROJECT_DIR}/scripts/hooks/bluepy-hook-entry.sh pre-bash"
}
]
},
{
"matcher": "Edit|Write|MultiEdit|apply_patch|ApplyPatch",
"matcher": "Edit|Write|StrReplace|Delete|EditNotebook|MultiEdit|apply_patch|ApplyPatch",
"hooks": [
{
"type": "command",
"command": "${CLAUDE_PROJECT_DIR}/scripts/hooks/bluepy-guard.sh pre-write"
"command": "${CLAUDE_PROJECT_DIR}/scripts/hooks/bluepy-hook-entry.sh pre-write"
}
]
}
],
"PostToolUse": [
{
"matcher": "Edit|Write|MultiEdit",
"matcher": "Edit|Write|StrReplace|Delete|EditNotebook|MultiEdit|apply_patch|ApplyPatch",
"hooks": [
{
"type": "command",
"command": "${CLAUDE_PROJECT_DIR}/scripts/hooks/bluepy-guard.sh post-edit"
"command": "${CLAUDE_PROJECT_DIR}/scripts/hooks/bluepy-hook-entry.sh post-edit"
}
]
}
Expand All @@ -36,7 +36,7 @@
"hooks": [
{
"type": "command",
"command": "${CLAUDE_PROJECT_DIR}/scripts/hooks/bluepy-guard.sh stop"
"command": "${CLAUDE_PROJECT_DIR}/scripts/hooks/bluepy-hook-entry.sh stop"
}
]
}
Expand Down
12 changes: 6 additions & 6 deletions .codex/hooks.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,27 @@
"hooks": [
{
"type": "command",
"command": "bash -lc 'cd \"${CODEX_PROJECT_DIR:-$PWD}\" && scripts/hooks/bluepy-guard.sh pre-bash'"
"command": "bash -lc 'cd \"${CODEX_PROJECT_DIR:-$PWD}\" && scripts/hooks/bluepy-hook-entry.sh pre-bash'"
}
]
},
{
"matcher": "Edit|Write|MultiEdit|apply_patch|ApplyPatch",
"matcher": "Edit|Write|StrReplace|Delete|EditNotebook|MultiEdit|apply_patch|ApplyPatch",
"hooks": [
{
"type": "command",
"command": "bash -lc 'cd \"${CODEX_PROJECT_DIR:-$PWD}\" && scripts/hooks/bluepy-guard.sh pre-write'"
"command": "bash -lc 'cd \"${CODEX_PROJECT_DIR:-$PWD}\" && scripts/hooks/bluepy-hook-entry.sh pre-write'"
}
]
}
],
"PostToolUse": [
{
"matcher": "Edit|Write|MultiEdit",
"matcher": "Edit|Write|StrReplace|Delete|EditNotebook|MultiEdit|apply_patch|ApplyPatch",
"hooks": [
{
"type": "command",
"command": "bash -lc 'cd \"${CODEX_PROJECT_DIR:-$PWD}\" && scripts/hooks/bluepy-guard.sh post-edit'"
"command": "bash -lc 'cd \"${CODEX_PROJECT_DIR:-$PWD}\" && scripts/hooks/bluepy-hook-entry.sh post-edit'"
}
]
}
Expand All @@ -36,7 +36,7 @@
"hooks": [
{
"type": "command",
"command": "bash -lc 'cd \"${CODEX_PROJECT_DIR:-$PWD}\" && scripts/hooks/bluepy-guard.sh stop'"
"command": "bash -lc 'cd \"${CODEX_PROJECT_DIR:-$PWD}\" && scripts/hooks/bluepy-hook-entry.sh stop'"
}
]
}
Expand Down
20 changes: 17 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ The Path above is yours to run autonomously. These few actions are the exception
- Verify external review findings against current code before editing. CodeRabbit and GitHub summaries can be stale; compare the latest PR head SHA and review timestamp before declaring a PR clean.
- Keep fixes minimal for review comments and merge conflicts. Resolve toward current `bluesky` behavior; put broader cleanup in a follow-up PR.
- Treat post/profile/media/poll/spoiler/emoji fields as untrusted HTML input. Escape interpolated values before sanitizing and add XSS regression vectors when touching HTML preview/sanitizer code.
- Do not guess ATProto behavior. Trace through `src/utils/atproto-adapter.ts` and `~/social-app`; logged-out public reads use AppView, PDS-facing writes/uploads need PDS audience/auth.
- Do not guess ATProto behavior. Trace through `src/utils/atproto-adapter.ts` and the social-app reference clone (see Secrets & Paths for the host-conditional path); logged-out public reads use AppView, PDS-facing writes/uploads need PDS audience/auth.
- For compose changes, verify the final `com.atproto.repo.createRecord` payload directly. UI text, facets, embed state, and reply refs are separate concerns.
- Overlay links, icon buttons, comboboxes, and visually labeled inputs need keyboard reachability and accessible names. A browser snapshot with unnamed controls is not clean.
- Behavioral changes to timeline, post, compose, notification, auth, routing, or settings need a focused regression test plus the relevant logged-in browser check.
Expand Down Expand Up @@ -75,8 +75,8 @@ claude -p \

All secrets live in `~/.secrets/bluepy/` with private permissions. Never log, print, or commit them.

- `source ~/.secrets/bluepy/source.env` sets `CLOUDFLARE_EMAIL`, `CLOUDFLARE_API_KEY`, `CLOUDFLARE_ACCOUNT_ID`, `ATPROTO_TEST_IDENTIFIER`, `ATPROTO_TEST_PASSWORD`.
- Reference clients are read-only: `~/social-app` first, optionally `github.com/mozzius/graysky`.
- `source ~/.secrets/bluepy/source.env` sets `ATPROTO_TEST_IDENTIFIER`, `ATPROTO_TEST_PASSWORD`, `ATPROTO_TEST_IDENTIFIER_2`, `ATPROTO_TEST_PASSWORD_2`, `CLOUDFLARE_EMAIL`, `CLOUDFLARE_KEY`, `CLOUDFLARE_ACCOUNT_ID`, `SENTRY_DSN`, `PLAUSIBLE_HOST`, `PLAUSIBLE_DOMAIN`, `CLIENT_METADATA_PROD`, `ATPROTO_PROD_IDENTIFIER`, `ATPROTO_PROD_PASSWORD`.
- Reference clients are read-only: `~/social-app` (Linux/VPS) / `~/src/a/social-app` (macOS dev). The runbook writes `~/social-app`; if the path doesn't exist on the host, try `~/src/a/social-app` before failing — both are the same `bluesky-social/social-app` clone. Optionally `github.com/mozzius/graysky`.

## Branches, Remotes & Deploy

Expand Down Expand Up @@ -116,3 +116,17 @@ All secrets live in `~/.secrets/bluepy/` with private permissions. Never log, pr
- AT URIs are native: serialize as `at://…`, never `at:/…`.
- Do not invent types that codify known-broken behavior.
- Bluesky image limits: 2 MB and about 4000 px long edge.

## Agent skills

### Issue tracker

Linear (team `Aliceisjustplaying`, project `Bluepy`) via the official Linear MCP server. See `docs/agents/issue-tracker.md`.

### Triage labels

Triage roles map to Linear workflow states. See `docs/agents/triage-labels.md`.

### Domain docs

Single-context — `CONTEXT.md` + `docs/adr/` at the repo root. See `docs/agents/domain.md`.
20 changes: 17 additions & 3 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ The Path above is yours to run autonomously. These few actions are the exception
- Verify external review findings against current code before editing. CodeRabbit and GitHub summaries can be stale; compare the latest PR head SHA and review timestamp before declaring a PR clean.
- Keep fixes minimal for review comments and merge conflicts. Resolve toward current `bluesky` behavior; put broader cleanup in a follow-up PR.
- Treat post/profile/media/poll/spoiler/emoji fields as untrusted HTML input. Escape interpolated values before sanitizing and add XSS regression vectors when touching HTML preview/sanitizer code.
- Do not guess ATProto behavior. Trace through `src/utils/atproto-adapter.ts` and `~/social-app`; logged-out public reads use AppView, PDS-facing writes/uploads need PDS audience/auth.
- Do not guess ATProto behavior. Trace through `src/utils/atproto-adapter.ts` and the social-app reference clone (see Secrets & Paths for the host-conditional path); logged-out public reads use AppView, PDS-facing writes/uploads need PDS audience/auth.
- For compose changes, verify the final `com.atproto.repo.createRecord` payload directly. UI text, facets, embed state, and reply refs are separate concerns.
- Overlay links, icon buttons, comboboxes, and visually labeled inputs need keyboard reachability and accessible names. A browser snapshot with unnamed controls is not clean.
- Behavioral changes to timeline, post, compose, notification, auth, routing, or settings need a focused regression test plus the relevant logged-in browser check.
Expand Down Expand Up @@ -76,8 +76,8 @@ codex exec \

All secrets live in `~/.secrets/bluepy/` with private permissions. Never log, print, or commit them.

- `source ~/.secrets/bluepy/source.env` sets `CLOUDFLARE_EMAIL`, `CLOUDFLARE_API_KEY`, `CLOUDFLARE_ACCOUNT_ID`, `ATPROTO_TEST_IDENTIFIER`, `ATPROTO_TEST_PASSWORD`.
- Reference clients are read-only: `~/social-app` first, optionally `github.com/mozzius/graysky`.
- `source ~/.secrets/bluepy/source.env` sets `ATPROTO_TEST_IDENTIFIER`, `ATPROTO_TEST_PASSWORD`, `ATPROTO_TEST_IDENTIFIER_2`, `ATPROTO_TEST_PASSWORD_2`, `CLOUDFLARE_EMAIL`, `CLOUDFLARE_KEY`, `CLOUDFLARE_ACCOUNT_ID`, `SENTRY_DSN`, `PLAUSIBLE_HOST`, `PLAUSIBLE_DOMAIN`, `CLIENT_METADATA_PROD`, `ATPROTO_PROD_IDENTIFIER`, `ATPROTO_PROD_PASSWORD`.
- Reference clients are read-only: `~/social-app` (Linux/VPS) / `~/src/a/social-app` (macOS dev). The runbook writes `~/social-app`; if the path doesn't exist on the host, try `~/src/a/social-app` before failing — both are the same `bluesky-social/social-app` clone. Optionally `github.com/mozzius/graysky`.

## Branches, Remotes & Deploy

Expand Down Expand Up @@ -117,3 +117,17 @@ All secrets live in `~/.secrets/bluepy/` with private permissions. Never log, pr
- AT URIs are native: serialize as `at://…`, never `at:/…`.
- Do not invent types that codify known-broken behavior.
- Bluesky image limits: 2 MB and about 4000 px long edge.

## Agent skills

### Issue tracker

Linear (team `Aliceisjustplaying`, project `Bluepy`) via the official Linear MCP server. See `docs/agents/issue-tracker.md`.

### Triage labels

Triage roles map to Linear workflow states. See `docs/agents/triage-labels.md`.

### Domain docs

Single-context — `CONTEXT.md` + `docs/adr/` at the repo root. See `docs/agents/domain.md`.
41 changes: 41 additions & 0 deletions CONTEXT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Bluepy

A Bluesky client whose UI descends from Phanpy (a Mastodon client) but whose data layer is being rebuilt to be ATProto-shaped end to end. This glossary captures the terms that distinguish Bluepy's ATProto-native choices from generic web-app vocabulary and from the Phanpy/Mastodon vocabulary the codebase is moving away from.

## Language

### Identifiers & permalinks

**At-URI** (`at://...`):
The ATProto-native identifier for a record. Always serialized with the `at://` prefix, never `at:/`. Full form is `at://<did-or-handle>/<collection>/<rkey>`. Bluepy uses at-URIs as both record references inside the data layer and as URLs in the browser (see Permalink).
_Avoid_: ATP URI, AT-URI without prefix, Bluesky URI

**Permalink**:
The at-URI of a record (post, profile, list, feed generator) used directly as the navigation URL — e.g. `bluepy.social/at://did:plc:.../app.bsky.feed.post/3kxabc`. Bluepy treats the at-URI as the canonical identifier *and* the canonical URL form; there is no separate web-style permalink. No legacy fallback.
_Avoid_: Bluesky URL, web URL, post URL, share link, public URL

### Services Bluepy talks to

**PDS** (Personal Data Server):
The ATProto server that holds the user's repository and signs writes. Bluepy talks to the PDS for any operation requiring identity: writes, mutes/blocks/follows, authenticated reads, blob uploads. One PDS per logged-in account.
_Avoid_: Bluesky server, home server

**AppView**:
A service that indexes ATProto records and serves Bluesky-shape lexicon queries (`app.bsky.*`) — feeds, threads, profiles, search, notifications. Bluepy treats the AppView as configurable: different users can point Bluepy at different AppView implementations.

**Active AppView**:
The AppView a given user has configured Bluepy to use. Defaults to the official Bluesky AppView, but users can switch to e.g. Blacksky's AppView. Public reads route here. The active-AppView setting is per-account.

**Bluesky AppView**:
The official Bluesky-operated AppView (`did:web:api.bsky.app#bsky_appview`, public endpoint `public.api.bsky.app`). Bluepy keeps a separate client pinned to this AppView as a fallback target for operations that the active AppView (e.g. Blacksky's) doesn't implement or implements incorrectly.

**Push Gateway**:
Bluepy-owned delivery infrastructure for Web Push notifications. It may store browser push subscriptions and delivery dedupe state, but it is not Bluepy's canonical notification inbox; canonical notification state remains AppView-shaped Bluepy data.
_Avoid_: notification server, push inbox, notification source of truth

## Example dialogue

> **A**: A user reports that trending topics don't load when they're signed into Blacksky's AppView. What's going on?
> **B**: The user's **Active AppView** is Blacksky, which doesn't implement `app.bsky.unspecced.getTrendingTopics`. That operation has to be force-routed to the **Bluesky AppView** instead. Check `src/data/feeds.ts` — it should be using the Bluesky-pinned client for that call, not the active one.
> **A**: And the share button copies the wrong link format. What should it copy?
> **B**: The **Permalink** — the at-URI form. `bluepy.social/at://did:plc:abc.../app.bsky.feed.post/3kxyz`, not `bsky.app/profile/handle/post/rkey`. No legacy URL shape.
13 changes: 13 additions & 0 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions docs/adr/0001-at-uri-canonical-url-form.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# ADR-0001: At-URIs are the canonical Bluepy URL form

Bluepy uses literal at-URI permalinks in the browser address bar (`bluepy.social/at://<did>/<collection>/<rkey>`) instead of a conventional `/post/<did>/<rkey>` or `/profile/<handle>/post/<rkey>` shape. The trade-off accepted: routing layer must bend to support `:` and `//` as literal path characters (`/:scheme://*`), and SEO-friendly URL shapes are forgone; in return, the URL form *is* the record identifier with no translation layer between address bar and data layer. There is no legacy fallback — `/post/...` shapes are not redirected or supported.
3 changes: 3 additions & 0 deletions docs/adr/0002-data-layer-stays-on-atproto-api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# ADR-0002: Data-layer rebuild stays on `@atproto/api`; library swap to atcute deferred

Phase (b) of the data-layer rebuild deletes the Mastodon-API-shaped adapter (`src/utils/atproto-adapter.ts`, the `v1`/`v2` namespaces, `AdaptedStatus` / `AdaptedAccount` wrappers) and replaces it with a thin Bluepy data layer on top of `@atproto/api`'s `AtpAgent`. atcute (`mary-ext/atcute`) was a serious candidate — stricter lexicon-generated types, ~30-50 KB lighter, first-class Bluesky helpers (`threading`, `richtext-builder`, `moderation`) — but its `FetchHandlerObject` session model is not interoperable with `@atproto/oauth-client-browser`, which we keep, and it has no equivalent of `RichText.detectFacets()`. We accept those costs only after the new Bluepy data-layer interface is in place and the seam is well-defined; at that point the client swap becomes mechanical. Until then, the architectural goal (kill the Masto-shape) is separated from the library choice.
3 changes: 3 additions & 0 deletions docs/adr/0003-data-layer-shape.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# ADR-0003: Data layer surfaces domain verbs + React hooks; lexicon types are the contract

The new Bluepy data layer is organised flat-by-domain (`src/data/posts.ts`, `profiles.ts`, `feeds.ts`, `notifications.ts`, `lists.ts`, `feed-generators.ts`, `search.ts`, `bookmarks.ts`), with each module exporting both imperative functions (`getPostThread(uri)`, `createPost(record)`) and React hooks built on TanStack Query (`usePost(uri)`, `useThread(uri)`). Types flowing through the layer are `@atproto/api`'s generated lexicon types directly (`AppBskyFeedPost.Record`, `AppBskyActorDefs.ProfileViewDetailed`); no Mastodon-shaped wrappers, no `AdaptedXxx` aliases. The lexicon's procedural verb names (`getPostThread`, `listRecords`) are a network detail kept inside the wrapper — the app deals in domain verbs. TanStack Query is the cache. Hooks co-locate with their imperative counterparts so an AFK porting agent never has to decide which file a new operation belongs in.
Loading