Thank you for your interest in contributing to Causality! We're excited to have you join our community in building a powerful behavioral analysis system for detecting application modifications.
- 🐛 Bug Reports - Found something broken? Let us know!
- 💡 Feature Requests - Have ideas for new functionality?
- 📖 Documentation - Help improve our docs and examples
- 🔧 Code Contributions - Fix bugs or implement new features
- 🧪 Testing - Add test cases or improve test coverage
- 🎨 UI/UX - Help design and improve the event definition interface
- 📱 Mobile SDKs - Enhance iOS/Android SDK implementations
- 🌐 WebAssembly - Improve the WASM SDK and browser integration
-
Fork and Clone
git clone https://github.com/yourusername/causality.git cd causality -
Install Dependencies
# Install Go 1.24 or higher # https://golang.org/doc/install # Install Go dependencies go mod tidy # Install development tools make install
-
Verify Setup
# Run tests make test # Run linting make lint # Generate proto files make generate
-
Create a Feature Branch
git checkout -b feature/your-feature-name # or git checkout -b fix/issue-description -
Make Your Changes
- Write clean, well-documented code
- Follow existing code patterns and style
- Add tests for new functionality
- Update documentation as needed
-
Test Your Changes
# Run all tests make test # Run tests with coverage make coverage # Run linting make lint # Run linter with auto-fix make lint-fix # Test mobile SDK generation make mobile # Test WASM build make wasm
-
Commit Your Changes
# Use conventional commits format git commit -m "feat: add new event pattern detection" # or git commit -m "fix: resolve HTTP request handling issue"
-
Push and Create PR
git push origin feature/your-feature-name
Then create a Pull Request on GitHub
- Follow standard Go conventions and idioms
- Use
gofmtandgoimportsfor formatting (runmake lint-fixto auto-format) - Use golangci-lint for comprehensive linting (run
make lint) - Write clear, self-documenting code
- Add comments for complex logic
- Keep functions small and focused
- Handle errors explicitly
- Use context for cancellation and timeouts
- Use clear, descriptive message and field names
- Group related fields together
- Add comments for all services and messages
- Follow Buf Style Guide
- Version APIs appropriately (v1, v2, etc.)
- Keep platform-specific code minimal
- Use interfaces for platform abstraction
- Handle network failures gracefully
- Implement proper event batching
- Add comprehensive error handling
- Minimize binary size
- Use efficient data structures
- Handle browser compatibility issues
- Implement proper error boundaries
- Add performance monitoring
We follow Conventional Commits:
feat:New featurefix:Bug fixdocs:Documentation changesstyle:Code style changes (formatting, etc.)refactor:Code refactoringtest:Test additions or changeschore:Maintenance tasksperf:Performance improvements
Examples:
feat: add event collection API to HTTP server
fix: resolve memory leak in analysis engine
docs: update mobile SDK integration guide
test: add unit tests for behavioral pattern matching
perf: optimize event batching for mobile clients
- Maintain minimum 80% code coverage
- Write unit tests for all new functions
- Add integration tests for HTTP API endpoints
- Include edge cases and error scenarios
- Test mobile SDK on both iOS and Android
- Verify WASM builds in multiple browsers
# Run all tests
make test
# Run specific package tests
go test ./internal/analysis
# Run with verbose output
go test -v ./...
# Generate coverage report
make coverage
# Test mobile SDK
make test-mobile
# Test WASM build
make test-wasmfunc TestAnalysisEngine_DetectAnomaly(t *testing.T) {
// Arrange
engine := NewAnalysisEngine()
events := []Event{
{Type: "login", Timestamp: time.Now()},
{Type: "suspicious_action", Timestamp: time.Now()},
}
// Act
anomaly, err := engine.DetectAnomaly(context.Background(), events)
// Assert
assert.NoError(t, err)
assert.NotNil(t, anomaly)
assert.Equal(t, "suspicious_pattern", anomaly.Type)
}- Follow Domain-Driven Design principles
- Keep services loosely coupled
- Use dependency injection
- Implement proper error handling
- Add appropriate logging and metrics
- Use Protocol Buffers for all event definitions
- Implement efficient serialization/deserialization
- Add event validation and sanitization
- Support event batching and compression
- Handle out-of-order events gracefully
- Implement pluggable detection algorithms
- Support real-time and batch processing
- Add configurable thresholds and rules
- Provide detailed anomaly reports
- Include false positive mitigation
- Handle concurrent requests efficiently
- Implement proper connection pooling
- Add rate limiting and throttling
- Support graceful shutdown
- Include API health checks
-
Self-Review Checklist
- Code follows project style guidelines
- Tests pass locally
- Coverage meets requirements (80%)
- Documentation is updated
- No debugging code left
- Commit messages follow conventions
- Mobile SDK builds successfully
- WASM compiles without errors
-
PR Description Template
## Description Brief description of changes ## Type of Change - [ ] Bug fix - [ ] New feature - [ ] Breaking change - [ ] Documentation update ## Testing - [ ] Unit tests pass - [ ] Integration tests pass - [ ] Manual testing completed - [ ] Mobile SDK tested - [ ] WASM build tested ## Checklist - [ ] My code follows style guidelines - [ ] I have performed self-review - [ ] I have added tests - [ ] Documentation is updated
- All PRs require at least one review
- Address all feedback constructively
- Keep PRs focused and small when possible
- Link related issues in PR description
- Ensure CI pipeline passes
When reporting bugs, please include:
-
Environment Details
- OS and version
- Go version
- Causality version/commit
- Mobile platform (if applicable)
- Browser version (for WASM)
-
Steps to Reproduce
- Clear, numbered steps
- Minimal reproduction case
- Expected vs actual behavior
-
Additional Context
- Error messages
- Log outputs
- Network traces
- Screenshots if applicable
For feature requests, please describe:
-
Use Case
- What problem does it solve?
- Who would benefit?
- Real-world scenario
-
Proposed Solution
- How should it work?
- API/UI considerations
- Performance implications
-
Alternatives Considered
- Other approaches
- Workarounds
- Trade-offs
Current focus areas:
-
Core System
- HTTP server scalability
- Analysis engine accuracy
- Event processing performance
- Storage optimization
-
Mobile SDKs
- Battery efficiency
- Offline support
- Cross-platform consistency
- SDK size reduction
-
WebAssembly
- Browser compatibility
- Performance optimization
- Bundle size reduction
- Worker thread support
-
Analysis Algorithms
- Machine learning models
- Pattern recognition
- Anomaly detection accuracy
- Real-time processing
- README - Project overview
- Architecture - System design
- API Docs - API specifications
- Mobile Guide - Mobile SDK integration
- WASM Guide - WebAssembly integration
- GitHub Issues - Bug reports and features
- GitHub Discussions - General discussion
- Pull Requests - Code contributions
We are committed to providing a welcoming and inclusive environment. Please:
- Be respectful and considerate
- Welcome newcomers and help them get started
- Focus on constructive criticism
- Respect differing opinions
- Report inappropriate behavior
By contributing to Causality, you agree that your contributions will be licensed under the MIT License.
Thank you for contributing to Causality! Together, we're building the future of behavioral analysis and application security. 🚀🔒