Implement DDD recommendations: domain errors, events, and services (v0.56.5)
- Add docs/GLOSSARY.md with 50+ ubiquitous language definitions
- Add pkg/domain/errors/ with structured domain error types (validation,
authorization, processing, policy, storage) and helper functions
- Add pkg/domain/events/ with domain event dispatcher supporting sync/async
publishing and 16 event types for system-wide notifications
- Add pkg/event/specialkinds/ registry for handling special event kinds
- Add pkg/event/ingestion/ service for orchestrating event processing pipeline
- Strengthen aggregate boundaries with accessor methods and deprecation comments
for ACL Registry, Server, and Listener
- Update DDD_ANALYSIS.md to reflect current architecture (v0.56.4)
Files modified:
- docs/GLOSSARY.md: NEW - ubiquitous language glossary
- pkg/domain/errors/errors.go: NEW - domain error types with 16 tests
- pkg/domain/events/events.go: NEW - 16 domain event types
- pkg/domain/events/dispatcher.go: NEW - event dispatcher with 10 tests
- pkg/event/specialkinds/registry.go: NEW - special kind handler registry
- pkg/event/ingestion/service.go: NEW - event processing orchestration
- pkg/acl/acl.go: Add accessor methods (GetMode, GetACLByType, etc.)
- pkg/acl/follows.go, managed.go, curating.go: Add Context() accessor
- app/server.go: Add accessor methods (GetConfig, Database, IsAdmin, IsOwner)
- app/listener.go: Add ServerContext, ServerConfig, ServerDatabase accessors
- DDD_ANALYSIS.md: Update analysis for current architecture
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>