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.
- Update cross-reference tests to use new defs locations
- Remove handle field from actor profile test data
- Update invalid test case to check for missing createdAt instead of handle
- Clean up test data for removed lexicons (block, saved, preferences)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Actor changes:
- Remove handle from actor.profile record (resolved from DID, not stored)
- Remove geoLocation from actor.profile (not implemented)
- Remove verification fields from profile (AppView concern, not record data)
- Remove federation fields from profile (AppView concern, not record data)
- Remove moderation fields from profile (AppView concern, not record data)
- Update actor.getProfile to return profileViewDetailed from defs
- Update actor.updateProfile to remove geoLocation reference
Community changes:
- Remove handle from community.profile record (resolved from DID, not stored)
- Remove memberCount, subscriberCount from record (AppView cached stats)
- Remove federatedFrom, federatedId from record (AppView metadata)
- Remove federation and contentRules from record (not implemented)
- Update community.get to return communityViewDetailed from defs
- Update community.list to return communityView array from defs
Key principle: Records contain only user-controlled data. Computed stats,
cached values, and viewer state live in AppView views (defs.json), not records.
Following atProto best practices per:
https://github.com/bluesky-social/atproto/discussions/4245
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add social.coves.actor.defs.json with profileView, profileViewDetailed,
profileStats, viewerState, and geoLocation definitions
- Add social.coves.community.defs.json with communityView, communityViewDetailed,
communityStats, and viewerState definitions
- Remove unimplemented actor lexicons: block, blockUser, unblockUser, saved,
saveItem, unsaveItem, getSaved, preferences
- Remove duplicate actor.subscription (replaced by community.subscription)
Following atProto best practices: reusable definitions in defs.json,
removing unimplemented features from pre-production codebase.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Applied atProto best practices from https://github.com/bluesky-social/atproto/discussions/4245
Changes:
- getMembers.json: Changed 'enum' to 'knownValues' for sort parameter to allow schema evolution
- profile.json: Removed 'visibility' and 'moderationType' from required fields (both have defaults)
These changes improve forward compatibility and follow atProto lexicon design guidelines
while maintaining full backward compatibility with existing code.
Impact: Zero breaking changes - all tests pass, service layer already handles defaults.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit migrates the vote lexicon to align with atProto conventions and
fixes several pre-existing bugs discovered during the migration.
## Main Changes
1. **Namespace Migration**: social.coves.interaction.vote → social.coves.feed.vote
- Follows Bluesky's pattern (app.bsky.feed.like)
- All feed interactions now in consistent namespace
- Updated all code references, tests, and Jetstream consumers
2. **atProto Best Practices** (per https://github.com/bluesky-social/atproto/discussions/4245):
- Changed `enum` to `knownValues` for future extensibility
- Use standard `com.atproto.repo.strongRef` instead of custom definition
- Enhanced description to mention authentication requirement
3. **Added Core atProto Schemas**:
- com.atproto.repo.strongRef.json
- com.atproto.label.defs.json
- Required for lexicon validation, standard practice for Go projects
## Bug Fixes
1. **Foreign Key Constraint Mismatch** (013_create_votes_table.sql):
- REMOVED FK constraint on voter_did → users(did)
- Code comments stated FK was removed, but migration still had it
- Tests expected no FK for out-of-order Jetstream indexing
- Now consistent: votes can be indexed before users
2. **Invalid Test Data** (tests/lexicon-test-data/feed/vote-valid.json):
- Missing required `direction` field
- `subject` was string instead of strongRef object
- Now valid: includes direction, proper strongRef with uri+cid
## Files Changed
**Lexicon & Test Data:**
- Moved: internal/atproto/lexicon/social/coves/{interaction → feed}/vote.json
- Moved: tests/lexicon-test-data/{interaction → feed}/vote-valid.json
- Added: internal/atproto/lexicon/com/atproto/repo/strongRef.json
- Added: internal/atproto/lexicon/com/atproto/label/defs.json
**Code (10 files updated):**
- internal/validation/lexicon.go
- internal/validation/lexicon_test.go
- internal/atproto/jetstream/vote_consumer.go
- cmd/server/main.go (Jetstream URL)
- internal/db/postgres/vote_repo_test.go (12 test URIs)
- internal/db/migrations/013_create_votes_table.sql
## Tests
✅ All vote repository tests passing (11 tests)
✅ Validation tests passing with new lexicon path
✅ TestVoteRepo_Create_VoterNotFound passing (validates FK removal)
✅ Lexicon schema validation passing
✅ No regressions introduced
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>