···11# Repository Testing Summary
2233+## Lexicon Schema Validation
44+55+We use Indigo's lexicon validator to ensure all AT Protocol schemas are valid and properly structured.
66+77+### Validation Components:
88+1. **Schema Validation** (`cmd/validate-lexicon/main.go`)
99+ - Validates all 57 lexicon schema files are valid JSON
1010+ - Checks cross-references between schemas
1111+ - Validates test data files against their schemas
1212+1313+2. **Test Data** (`tests/lexicon-test-data/`)
1414+ - Contains example records for validation testing
1515+ - Files use naming convention:
1616+ - `*-valid*.json` - Should pass validation
1717+ - `*-invalid-*.json` - Should fail validation (tests error detection)
1818+ - Currently covers 5 record types:
1919+ - social.coves.actor.profile
2020+ - social.coves.community.profile
2121+ - social.coves.post.record
2222+ - social.coves.interaction.vote
2323+ - social.coves.moderation.ban
2424+2525+3. **Validation Library** (`internal/validation/lexicon.go`)
2626+ - Wrapper around Indigo's ValidateRecord
2727+ - Provides type-specific validation methods
2828+ - Supports multiple input formats
2929+3030+### Running Lexicon Validation
3131+```bash
3232+# Full validation (schemas + test data) - DEFAULT
3333+go run cmd/validate-lexicon/main.go
3434+3535+# Schemas only (skip test data validation)
3636+go run cmd/validate-lexicon/main.go --schemas-only
3737+3838+# Verbose output
3939+go run cmd/validate-lexicon/main.go -v
4040+4141+# Strict validation mode
4242+go run cmd/validate-lexicon/main.go --strict
4343+```
4444+4545+### Test Coverage Warning
4646+The validator explicitly outputs which record types have test data and which don't. This prevents false confidence from passing tests when schemas lack test coverage.
4747+4848+Example output:
4949+```
5050+📋 Validation Summary:
5151+ Valid test files: 5/5 passed
5252+ Invalid test files: 2/2 correctly rejected
5353+5454+ ✅ All test files behaved as expected!
5555+5656+📊 Test Data Coverage Summary:
5757+ - Records with test data: 5 types
5858+ - Valid test files: 5
5959+ - Invalid test files: 2 (for error validation)
6060+6161+ Tested record types:
6262+ ✓ social.coves.actor.profile
6363+ ✓ social.coves.community.profile
6464+ ✓ social.coves.post.record
6565+ ✓ social.coves.interaction.vote
6666+ ✓ social.coves.moderation.ban
6767+6868+ ⚠️ Record types without test data:
6969+ - social.coves.actor.membership
7070+ - social.coves.actor.subscription
7171+ - social.coves.community.rules
7272+ ... (8 more)
7373+7474+ Coverage: 5/16 record types have test data (31.2%)
7575+```
7676+7777+### Running Tests
7878+```bash
7979+# Run lexicon validation tests
8080+go test -v ./tests/lexicon_validation_test.go
8181+8282+# Run validation library tests
8383+go test -v ./internal/validation/...
8484+```
8585+386## Test Infrastructure Setup
487- Created Docker Compose configuration for isolated test database on port 5434
588- Test database is completely separate from development (5433) and production (5432)