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.
Add convenient shell script for validating all lexicon schemas and test data.
**Added:**
- scripts/validate-schemas.sh - Wrapper around cmd/validate-lexicon
**Usage:**
```bash
./scripts/validate-schemas.sh
```
**Features:**
- Validates all 58 lexicon schema files
- Validates cross-references between schemas
- Tests all lexicon test data files (15 valid, 11 invalid)
- Reports test coverage per record type
This script makes it easy to verify lexicon changes before committing,
addressing the PR review requirement for lexicon validation.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Remove test data files that are no longer valid after enum → knownValues changes:
**Removed obsolete enum validation tests:**
- post/post-invalid-enum-type.json - knownValues allow unknown types
- community/moderator-invalid-permissions.json - knownValues allow extension
- interaction/share-valid*.json (2 files) - interaction lexicons removed
- interaction/tag-*.json (3 files) - interaction lexicons removed
**Fixed invalid test data:**
- moderation/tribunal-vote-valid.json - corrected invalid AT-URI format
Changed: at://$1/... → at://did:plc:testuser123/...
**Rationale:**
With knownValues (vs strict enums), the lexicon validator accepts unknown
values for extensibility. These test files expected rejection of unknown
enum values, which no longer applies under the knownValues pattern.
**Validation Status:** All 58 lexicons validated successfully
- 15/15 valid test files passing
- 11/11 invalid test files correctly rejected
- 13 record types with test coverage
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Apply comprehensive atProto Lexinomicon best practices to all lexicon schemas:
**Extensibility (16 enum → knownValues changes):**
- Convert all closed enums to knownValues for federation compatibility
- Affected fields: sort, timeframe, postType, vote, blockedBy, embedType
- Allows unknown values from other implementations gracefully
- Enables future additions without breaking existing clients
**Internationalization (11+ maxGraphemes additions):**
- Add maxGraphemes constraints to all string fields with maxLength
- Ensures proper UTF-8 multi-byte character handling
- Affected: community names, descriptions, alt text, edit notes, titles, content
- Follows 10-20 byte-to-grapheme ratio for international text
**Schema Organization (3 reference fixes):**
- Fix feed references: getTimeline#feedViewPost → defs#feedViewPost
- Fix community references: list#communityView → defs#communityView
- Remove unimplemented aspectRatio reference from video.json
- Centralizes definitions in defs.json files per best practices
**Files Modified:**
- embed: external.json, images.json, video.json
- feed: getAll.json, getCommunity.json, getDiscover.json, getTimeline.json
- community: defs.json, profile.json, search.json
- community/post: get.json, search.json, update.json
**Impact:** No breaking changes - existing code uses defensive validation patterns
that work seamlessly with knownValues. All validation tests passing.
References: https://github.com/bluesky-social/atproto/discussions/4245
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Align richtext facet lexicon with atProto Lexinomicon style guide:
- Remove $type from required fields (automatically added by SDK for union discrimination)
- Remove handle field from mention type (use persistent DIDs only per best practices)
- Add maxGraphemes constraint to spoiler reason field for proper internationalization
- Update descriptions to match Bluesky documentation patterns
- Update tests to remove handle field references
References: https://github.com/bluesky-social/atproto/discussions/4245
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Fixes test failures caused by hardcoded community names that created
duplicate handle conflicts across test runs.
Changed:
- update-test → update-test-{timestamp}
- sub-test → sub-test-{timestamp}
- delete-test → delete-test-{timestamp}
All consumer tests now pass consistently.