Thank you for your interest in contributing to Synapsis!
This document provides guidelines and instructions for contributing.
- Code of Conduct
- Getting Started
- Development Setup
- How to Contribute
- Pull Request Guidelines
- Coding Standards
- Testing
- Documentation
- Security
- Recognition
We are committed to providing a welcoming and inspiring community for all. Please be respectful and constructive in your interactions.
Expected Behavior:
- β Be respectful and inclusive
- β Accept constructive criticism
- β Focus on what's best for the community
- β Show empathy towards others
Unacceptable Behavior:
- β Harassment or discrimination
- β Trolling or insulting comments
- β Publishing others' private information
- β Promoting illegal activities
Report unacceptable behavior to: methodwhite@proton.me
- Rust: 1.88+
- Git: For version control
- Cargo: Rust package manager
- Text Editor: VS Code, Neovim, etc.
# Fork the repository on GitHub
# Clone your fork
git clone https://github.com/YOUR_USERNAME/synapsis.git
cd synapsis
# Add upstream remote
git remote add upstream https://github.com/MethodWhite/synapsis.git
# Verify remotes
git remote -v# Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# Install dependencies
rustup install 1.88
rustup default 1.88
# Install development tools
cargo install cargo-watch
cargo install cargo-audit
cargo install cargo-tarpaulin
# Build the project
cargo build --release
# Run tests
cargo test
# Run with hot-reload
cargo watch -x "test"# Start development environment
docker-compose up -d
# Access container
docker-compose exec synapsis-dev bash
# Run tests in container
cargo test- Report Bugs - Open an issue
- Fix Bugs - Submit a PR
- Add Features - Discuss first, then implement
- Improve Docs - Always welcome
- Write Tests - Help improve coverage
- Review Code - Help maintain quality
- Answer Questions - Help the community
Look for issues labeled:
- π
good first issue- Perfect for beginners - π§
help wanted- Need community help - π
documentation- Improve docs - π§ͺ
testing- Write tests
- Fork the repo and create your branch
- Discuss major changes in an issue first
- Write tests for new functionality
- Update docs if needed
- Run tests and ensure they pass
- Check formatting with
cargo fmt - Run clippy with
cargo clippy
type: short description
Examples:
feat: Add new PQC algorithm support
fix: Resolve memory leak in session manager
docs: Update README with installation steps
test: Add tests for Kyber768
refactor: Improve error handling in MCP server
## Description
Brief description of changes
## Type of Change
- [ ] π Bug fix
- [ ] β¨ New feature
- [ ] π Documentation
- [ ] π§ͺ Tests
- [ ] π§ Refactor
- [ ] β‘ Performance
## Testing
- [ ] Tests pass
- [ ] New tests added
- [ ] Manually tested
## Checklist
- [ ] Code follows style guidelines
- [ ] Self-review completed
- [ ] Documentation updated
- [ ] No new warnings
- [ ] Tests added/updated- Automated Checks - CI must pass
- Code Review - Maintainer reviews
- Testing - Verify functionality
- Approval - At least 1 approval required
- Merge - Squash and merge
Follow Rust API Guidelines
Example:
// β
Good: Clear naming
pub struct SessionManager {
sessions: HashMap<String, Session>,
}
impl SessionManager {
pub fn new() -> Self {
Self {
sessions: HashMap::new(),
}
}
pub fn create_session(&mut self, agent: &str) -> Result<String> {
// Implementation
}
}
// β Bad: Unclear naming
pub struct SM {
s: HashMap<String, S>,
}// β
Good: Descriptive errors
#[derive(Debug, thiserror::Error)]
pub enum SynapsisError {
#[error("Failed to create session: {0}")]
SessionCreationFailed(String),
#[error("Invalid agent type: {0}")]
InvalidAgentType(String),
}
// β
Good: Proper error propagation
pub fn create_session(&self, agent: &str) -> Result<Session> {
let session = self.validate_agent(agent)
.map_err(|e| SynapsisError::SessionCreationFailed(e.to_string()))?;
Ok(session)
}/// Create a new session for the specified agent
///
/// # Arguments
///
/// * `agent` - The agent type identifier
/// * `project` - Optional project name
///
/// # Returns
///
/// * `Ok(Session)` - Created session
/// * `Err(SynapsisError)` - Error creating session
///
/// # Example
///
/// ```
/// let manager = SessionManager::new();
/// let session = manager.create_session("qwen", Some("my-project"))?;
/// ```
pub fn create_session(&self, agent: &str, project: Option<&str>) -> Result<Session> {
// Implementation
}# All tests
cargo test
# Specific test
cargo test test_kyber512
# With output
cargo test -- --nocapture
# Coverage (requires cargo-tarpaulin)
cargo tarpaulin --out Html#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_session_creation() {
let manager = SessionManager::new();
let result = manager.create_session("test-agent", None);
assert!(result.is_ok());
let session = result.unwrap();
assert_eq!(session.agent_type, "test-agent");
}
#[test]
fn test_invalid_agent() {
let manager = SessionManager::new();
let result = manager.create_session("", None);
assert!(result.is_err());
}
}| Component | Target | Current |
|---|---|---|
| Core | 90% | π― |
| PQC | 100% | β |
| API | 80% | π― |
| Utils | 70% | π― |
- Public APIs - Must have doc comments
- Complex Logic - Add explanatory comments
- Examples - Include usage examples
- Errors - Document possible errors
# Generate documentation
cargo doc --no-deps
# Open in browser
cargo doc --no-deps --open
# Build with private items
cargo doc --document-private-itemsDO NOT open public issues for security vulnerabilities.
DO email: methodwhite@proton.me
Include:
- Description of vulnerability
- Steps to reproduce
- Potential impact
- Suggested fix (if any)
- Never commit secrets or API keys
- Use environment variables for sensitive data
- Review dependencies regularly
- Run cargo-audit before submitting
- Follow secure coding guidelines
We recognize all contributors in:
- README.md contributors section
- Release notes
- Annual contributor report
Active contributors may be invited to become maintainers:
- Consistent contributions
- Code review participation
- Community engagement
- Project alignment
- GitHub Issues: For bugs and feature requests
- GitHub Discussions: For questions and ideas
- Email: methodwhite@proton.me
By contributing, you agree that your contributions will be licensed under the BUSL-1.1 license.
Thank you for contributing to Synapsis! π
Every contribution, no matter how small, makes a difference.