code
Clone this repository
https://tangled.org/bretton.dev/coves
git@knot.bretton.dev:bretton.dev/coves
For self-hosted knots, clone URLs may differ based on your setup.
New Tests:
- TestGetCommunityFeed_BasicRetrieval: Verifies feed endpoint works
- TestGetCommunityFeed_SortOrders: Tests hot/new/top algorithms
- TestGetCommunityFeed_Pagination: Validates cursor-based paging
- TestGetCommunityFeed_EmptyFeed: Handles communities with no posts
- TestGetCommunityFeed_LimitValidation: Ensures limit clamping works
Test Fix:
- community_consumer_test.go: Changed collection from app.bsky.feed.post
to app.bsky.communityFeed.post to better demonstrate non-Coves namespace
filtering (the test verifies we ignore non-social.coves.community.* events)
Test Coverage:
- Feed retrieval with real post data
- Sort algorithm behavior
- Pagination edge cases
- Input validation
- Error handling
All tests use the shared test infrastructure (SetupTestDB, test user helpers)
and follow integration test patterns.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Comprehensive documentation for feed systems and future aggregator features:
New Documentation:
- COMMUNITY_FEEDS.md: Complete guide to feed architecture and implementation
- aggregators/PRD_AGGREGATORS.md: Product spec for RSS/aggregator features
- aggregators/PRD_KAGI_NEWS_RSS.md: Kagi News integration design
Updated:
- PRD_POSTS.md: Refined post creation flow and security model
Feed Documentation Coverage:
- Architecture overview (service → repo → postgres)
- Sort algorithms (hot, new, top)
- Query optimization and indexing strategy
- Security considerations
- API examples and usage
Aggregator PRDs:
- RSS feed generation per community
- External content aggregation
- Kagi News integration patterns
- Federation considerations
These docs provide context for current feed implementation and roadmap
for future aggregator features.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Extends post types to support feed views and updates lexicon definitions:
Post Types Added:
- PostView: Full post representation with all metadata for feeds
- AuthorView: Author info (DID, handle, displayName, avatar, reputation)
- CommunityRef: Minimal community reference in posts
- PostStats: Aggregated statistics (votes, comments, shares)
- ViewerState: User's relationship with post (votes, saves, tags)
Lexicon Updates:
- social.coves.post.get: Restructured postView definition
- social.coves.feed.getCommunity: Updated query parameters and response
These types align with atProto patterns:
- Follows app.bsky.feed.defs#feedViewPost structure
- Supports viewer-specific state
- Enables efficient feed rendering
- Provides all data clients need in single request
The PostView types are used by feed endpoints to return rich post data.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Integrates community feed functionality into the main server:
- Initialize CommunityFeedRepository with database connection
- Initialize CommunityFeedService with dependencies
- Register feed XRPC routes (public endpoints)
- Add startup logging for feed service
Dependency injection flow:
feedRepo ← db
feedService ← feedRepo + communityService
feedHandler ← feedService
Routes registered:
- GET /xrpc/social.coves.feed.getCommunity (public)
The feed service is now live and ready to serve community feeds.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Implements the HTTP handler layer for social.coves.feed.getCommunity:
- GetCommunityHandler: XRPC endpoint handler with proper validation
- Query parameter parsing: community, sort, limit, cursor
- Error handling: Proper XRPC error responses (InvalidRequest, NotFound)
- Route registration: Public endpoint (no auth required for reading)
Security:
- Input validation for all query parameters
- Limit clamping (max 100 posts per request)
- Community existence verification
- No sensitive data exposure in error messages
Handler flow:
1. Parse and validate query parameters
2. Call feed service
3. Transform to XRPC response format
4. Return JSON with proper headers
This implements the read path for community feeds per atProto patterns.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Implements the core service layer and database repository for community feeds:
- CommunityFeedService: Orchestrates feed retrieval with sorting and pagination
- FeedRepository: PostgreSQL queries for post aggregation and filtering
- Feed types: FeedOptions, FeedResponse, SortOrder enums
- Error types: Proper error handling for feed operations
Architecture:
- Service layer handles business logic and coordinates with community service
- Repository performs efficient SQL queries with proper indexing
- Supports multiple sort algorithms (hot, new, top)
- Pagination via cursor-based approach
Security:
- All queries use parameterized statements
- Input validation in service layer
- Proper error wrapping for debugging
This is the foundation for social.coves.feed.getCommunity XRPC endpoint.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>