A community based topic aggregation platform built on atproto

docs(prds): reorganize alpha priorities and lexicon gap analysis

Major updates to community PRDs based on lexicon vs implementation
gap analysis:

PRD_COMMUNITIES.md:
- Add "Alpha Blockers" section with clear must-haves
- Mark 6 XRPC endpoints as E2E tested (create, get, list, update,
subscribe, unsubscribe)
- Reorganize into Alpha vs Beta priorities
- Defer posts, wiki, moderation, membership to Beta
- Add note to remove unused categories field

PRD_BACKLOG.md:
- Add P1: Subscription visibility level (1-5 scale feed slider)
- Add P1: Community blocking implementation
- Add P2: Remove categories cleanup task
- Mark OAuth and token refresh as ALPHA BLOCKERS

PRD_GOVERNANCE.md:
- Update status: basic authorization exists (creator-only updates)
- Clarify moderator management is post-alpha (Beta Phase 1)

Key Findings from Analysis:
- Lexicon has many features not yet implemented (wiki, blocking,
advanced rules)
- Current alpha scope: basic CRUD + OAuth + token refresh
- Categories field exists but adds no value - marked for removal
- Membership design decisions deferred to Beta

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

+59 -4
docs/PRD_BACKLOG.md
···
---
-
## 🟡 P1: Important
+
## 🟡 P1: Important (Alpha Blockers)
### Token Refresh Logic for Community Credentials
-
**Added:** 2025-10-11 | **Effort:** 1-2 days
+
**Added:** 2025-10-11 | **Effort:** 1-2 days | **Priority:** ALPHA BLOCKER
**Problem:** Community PDS access tokens expire (~2hrs). Updates fail until manual intervention.
···
---
### OAuth Authentication for Community Actions
-
**Added:** 2025-10-11 | **Effort:** 2-3 days
+
**Added:** 2025-10-11 | **Effort:** 2-3 days | **Priority:** ALPHA BLOCKER
**Problem:** Subscribe/unsubscribe and community creation need authenticated user DID. Currently using placeholder.
**Solution:** Extract authenticated DID from OAuth session context. Requires OAuth middleware integration.
-
**Code:** Multiple TODOs in [community/subscribe.go](../internal/api/handlers/community/subscribe.go#L46), [community/create.go](../internal/api/handlers/community/create.go#L38)
+
**Code:** Multiple TODOs in [community/subscribe.go](../internal/api/handlers/community/subscribe.go#L46), [community/create.go](../internal/api/handlers/community/create.go#L38), [community/update.go](../internal/api/handlers/community/update.go#L47)
+
+
---
+
+
### Subscription Visibility Level (Feed Slider 1-5 Scale)
+
**Added:** 2025-10-15 | **Effort:** 4-6 hours | **Priority:** ALPHA BLOCKER
+
+
**Problem:** Users can't control how much content they see from each community. Lexicon has `contentVisibility` (1-5 scale) but code doesn't use it.
+
+
**Solution:**
+
- Update subscribe handler to accept `contentVisibility` parameter (1-5, default 3)
+
- Store in subscription record on PDS
+
- Update feed generation to respect visibility level (beta work, but data structure needed now)
+
+
**Code:**
+
- Lexicon: [subscription.json:28-34](../internal/atproto/lexicon/social/coves/actor/subscription.json#L28-L34) ✅ Ready
+
- Handler: [community/subscribe.go](../internal/api/handlers/community/subscribe.go) - Add parameter
+
- Service: [communities/service.go:373-376](../internal/core/communities/service.go#L373-L376) - Add to record
+
+
**Impact:** Without this, users have no way to adjust feed volume per community (key feature from DOMAIN_KNOWLEDGE.md)
+
+
---
+
+
### Community Blocking
+
**Added:** 2025-10-15 | **Effort:** 1 day | **Priority:** ALPHA BLOCKER
+
+
**Problem:** Users have no way to block unwanted communities from their feeds.
+
+
**Solution:**
+
1. **Lexicon:** Extend `social.coves.actor.block` to support community DIDs (currently user-only)
+
2. **Service:** Implement `BlockCommunity(userDID, communityDID)` and `UnblockCommunity()`
+
3. **Handlers:** Add XRPC endpoints `social.coves.community.block` and `unblock`
+
4. **Repository:** Add methods to track blocked communities
+
5. **Feed:** Filter blocked communities from feed queries (beta work)
+
+
**Code:**
+
- Lexicon: [actor/block.json](../internal/atproto/lexicon/social/coves/actor/block.json) - Currently only supports user DIDs
+
- Service: New methods needed
+
- Handlers: New files needed
+
+
**Impact:** Users can't avoid unwanted content without blocking
---
## 🟢 P2: Nice-to-Have
+
+
### Remove Categories from Community Lexicon
+
**Added:** 2025-10-15 | **Effort:** 30 minutes | **Priority:** Cleanup
+
+
**Problem:** Categories field exists in create/update lexicon but not in profile record. Adds complexity without clear value.
+
+
**Solution:**
+
- Remove `categories` from [create.json](../internal/atproto/lexicon/social/coves/community/create.json#L46-L54)
+
- Remove `categories` from [update.json](../internal/atproto/lexicon/social/coves/community/update.json#L51-L59)
+
- Remove from [community.go:91](../internal/core/communities/community.go#L91)
+
- Remove from service layer ([service.go:109-110](../internal/core/communities/service.go#L109-L110))
+
+
**Impact:** Simplifies lexicon, removes unused feature
+
+
---
### Improve .local TLD Error Messages
**Added:** 2025-10-11 | **Effort:** 1 hour
+82 -41
docs/PRD_COMMUNITIES.md
···
## 🚧 In Progress / Needs Testing
### XRPC API Endpoints
-
**Status:** Handlers exist, need comprehensive E2E testing
+
**Status:** All core endpoints E2E tested! ✅
+
+
**✅ E2E Tested (via community_e2e_test.go):**
+
- [x] `social.coves.community.create` - Full E2E test with real PDS
+
- [x] `social.coves.community.get` - E2E test validates HTTP endpoint
+
- [x] `social.coves.community.list` - E2E test with pagination/filtering
+
- [x] `social.coves.community.update` - E2E test verifies write-forward + PDS update
+
- [x] `social.coves.community.subscribe` - E2E test verifies subscription in user's repo
+
- [x] `social.coves.community.unsubscribe` - E2E test verifies PDS deletion
+
+
**📍 Post-Alpha:**
+
- [ ] `social.coves.community.search` - Handler exists, defer E2E testing to post-alpha
+
+
**⚠️ Remaining Alpha Blocker:**
+
- Replace placeholder auth (X-User-DID header) with OAuth context extraction across all endpoints
-
- [ ] `social.coves.community.create` - **Handler exists**, needs E2E test with real PDS
-
- [ ] `social.coves.community.get` - **Handler exists**, needs E2E test
-
- [ ] `social.coves.community.update` - **Handler exists**, needs E2E test with community credentials
-
- [ ] `social.coves.community.list` - **Handler exists**, needs E2E test with pagination
-
- [ ] `social.coves.community.search` - **Handler exists**, needs E2E test with queries
-
- [ ] `social.coves.community.subscribe` - **Handler exists**, needs E2E test
-
- [ ] `social.coves.community.unsubscribe` - **Handler exists**, needs E2E test
+
---
-
**What's needed:**
-
- E2E tests that verify complete flow: HTTP → Service → PDS → Firehose → Consumer → DB → HTTP response
-
- Test with real PDS instance (not mocked)
-
- Verify Jetstream consumer picks up events in real-time
+
## ⚠️ Alpha Blockers (Must Complete Before Alpha Launch)
+
+
### Critical Missing Features
+
- [ ] **Subscription Visibility Level (1-5 Scale):** Implement feed slider from DOMAIN_KNOWLEDGE.md
+
- Lexicon: ✅ Ready ([subscription.json:28-34](internal/atproto/lexicon/social/coves/actor/subscription.json))
+
- Service: ❌ Not using `contentVisibility` field
+
- Handler: ❌ Subscribe endpoint doesn't accept/store visibility level
+
- **Impact:** Users can't control how much content they see from each community
+
+
- [ ] **Community Blocking:** Users can block communities from their feeds
+
- Lexicon: ❌ Need new record type (extend `social.coves.actor.block` or create new)
+
- Service: ❌ No implementation (`BlockCommunity()` / `UnblockCommunity()`)
+
- Handler: ❌ No endpoints
+
- Repository: ❌ No methods
+
- **Impact:** Users have no way to hide unwanted communities
+
+
### Critical Security (High Priority)
+
- [ ] **OAuth Authentication:** Replace placeholder `X-User-DID` header with OAuth context
+
- **Currently affected endpoints:** create, update, subscribe, unsubscribe
+
- **See:** [PRD_BACKLOG.md P1 Priority](docs/PRD_BACKLOG.md#L42-L50)
+
+
- [ ] **Token Refresh Logic:** Auto-refresh expired PDS access tokens
+
- **Impact:** Communities break after ~2 hours when tokens expire
+
- **See:** [PRD_BACKLOG.md P1 Priority](docs/PRD_BACKLOG.md#L31-L38)
+
+
---
+
+
## 📍 Beta Features (High Priority - Post Alpha)
### Posts in Communities
**Status:** Lexicon designed, implementation TODO
+
**Priority:** HIGHEST for Beta 1
-
- [ ] Extend `social.coves.post` lexicon with `community` field
-
- [ ] Create post endpoint (with community membership validation?)
+
- [ ] `social.coves.post` already has `community` field ✅
+
- [ ] Create post endpoint (decide: membership validation?)
- [ ] Feed generation for community posts
- [ ] Post consumer (index community posts from firehose)
- [ ] Community post count tracking
+
- [ ] Decide membership requirements for posting
-
**What's needed:**
-
- Decide membership requirements for posting
-
- Design feed generation algorithm
-
- Implement post indexing in consumer
-
- Add tests for post creation/listing
+
**Without posts, communities exist but can't be used!**
---
-
## ⏳ TODO Before V1 Production Launch
+
## 📍 Beta Features (Lower Priority)
-
### Critical Security & Authorization
-
- [ ] **OAuth Middleware:** Protect create/update/delete endpoints
-
- [ ] **Authorization Checks:** Verify user is community creator/moderator
-
- [ ] **Rate Limiting:** Prevent community creation spam (e.g., 5 per user per hour)
-
- [ ] **Handle Collision Detection:** Prevent duplicate community handles
-
- [ ] **DID Validation:** Verify DIDs before accepting create requests
-
- [ ] **Token Refresh Logic:** Handle expired PDS access tokens
+
### Membership System
+
**Status:** Lexicon exists, design decisions needed
+
**Deferred:** Answer design questions before implementing
+
+
- [ ] Decide: Auto-join on first post vs explicit join?
+
- [ ] Decide: Reputation tracking in lexicon vs AppView only?
+
- [ ] Implement membership record creation (if explicit join)
+
- [ ] Member lists endpoint
+
- [ ] Reputation tracking (if in lexicon)
-
### Community Discovery & Visibility
-
- [ ] **Visibility Enforcement:** Respect public/unlisted/private settings in listings
-
- [ ] **Federation Config:** Honor `allowExternalDiscovery` flag
-
- [ ] **Search Relevance:** Implement ranking algorithm (members, activity, etc.)
-
- [ ] **Directory Endpoint:** Public community directory with filters
+
### Community Management
+
- [ ] **Community Deletion:** Soft delete / permanent delete
+
- [ ] **Wiki System:** Lexicon exists, no implementation
+
- [ ] **Advanced Rules:** Separate rules records, moderation config
+
- [ ] **Moderator Management:** Assign/remove moderators (governance work)
+
- [ ] **Categories:** REMOVE from lexicon and code (not needed)
-
### Membership & Participation
-
- [ ] **Membership Tracking:** Auto-create membership on first post
-
- [ ] **Reputation System:** Track user participation per community
-
- [ ] **Subscription → Membership Flow:** Define conversion logic
-
- [ ] **Member Lists:** Endpoint to list community members
-
- [ ] **Moderator Assignment:** Allow creators to add moderators
+
### User Features
+
- [ ] **Saved Items:** Save posts/comments for later
+
- [ ] **User Flairs:** Per-community user flair (design TBD)
-
### Moderation (Basic)
+
### Instance Moderation
- [ ] **Delist Community:** Remove from search/directory
- [ ] **Quarantine Community:** Show warning label
- [ ] **Remove Community:** Hide from instance AppView
- [ ] **Moderation Audit Log:** Track all moderation actions
-
- [ ] **Admin Endpoints:** Instance operator tools
+
+
---
+
+
## ⏳ TODO Before V1 Production Launch
+
+
### Community Discovery & Visibility
+
- [ ] **Visibility Enforcement:** Respect public/unlisted/private settings in listings
+
- [ ] **Federation Config:** Honor `allowExternalDiscovery` flag
+
- [ ] **Search Relevance:** Implement ranking algorithm (members, activity, etc.)
+
- [ ] **Directory Endpoint:** Public community directory with filters
+
- [ ] **Rate Limiting:** Prevent community creation spam (e.g., 5 per user per hour)
+
- [ ] **Handle Collision Detection:** Prevent duplicate community handles
+
- [ ] **DID Validation:** Verify DIDs before accepting create requests
### Token Refresh & Resilience
-
- [ ] **Refresh Token Logic:** Auto-refresh expired PDS access tokens
- [ ] **Retry Mechanism:** Retry failed PDS calls with backoff
- [ ] **Credential Rotation:** Periodic password rotation for security
- [ ] **Error Recovery:** Graceful degradation if PDS is unavailable
+5 -3
docs/PRD_GOVERNANCE.md
···
## Problem Statement
-
**Current State (2025-10-10):**
+
**Current State (2025-10-15):**
- Communities own their own atProto repositories (V2 architecture)
- Instance holds PDS credentials for infrastructure management
-
- No authorization model exists for who can update/manage communities
-
- Only implicit "owner" is the instance itself
+
- Basic authorization exists: only `createdBy` user can update communities
+
- No moderator management system exists yet
+
+
**Note:** Moderator management and advanced governance are **post-alpha** (Beta Phase 1) work. Alpha focuses on basic community CRUD operations.
**Key Issues:**
1. **Self-hosted instances:** Instance operator can't delegate community management to trusted users