Thank you for your interest in contributing! This document provides guidelines for contributing to the project.
- Be respectful and inclusive
- Focus on constructive feedback
- Respect differing viewpoints
- Prioritize safety in all discussions
- Check existing issues first
- Use the bug template when creating a new issue
- Include:
- Steps to reproduce
- Expected vs actual behavior
- Environment details (OS, version, etc.)
- Logs or error messages
- Open a discussion first for major features
- Describe the use case
- Explain the benefit to users
- Consider safety implications (especially for robotics)
- Fork the repository
- Create a feature branch:
git checkout -b feature/my-feature - Write tests (TDD required)
- Run the test suite:
pytest tests/ - Ensure coverage stays above 65%
- Update documentation
- Follow code style (black + ruff)
- Tests pass (
pytest tests/) - Coverage maintained (
pytest --cov) - Code formatted (
black .) - Linting passes (
ruff check .) - Type hints added
- Documentation updated
- Changelog updated
- Security implications considered
## Description
Brief description of changes
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation update
## Testing
- [ ] Unit tests added/updated
- [ ] E2E tests pass
- [ ] Manual testing performed
## Safety Check
- [ ] No unsafe robot operations
- [ ] Human-in-the-loop preserved
- [ ] Shadow mode unaffected
## Checklist
- [ ] Code follows style guide
- [ ] Self-review completed
- [ ] Comments added for complex logic
- [ ] Documentation updated# Python 3.11+
python --version
# Git
git --version
# Docker (optional)
docker --version# Clone repository
git clone https://github.com/webthree549-bot/agent-ros-bridge.git
cd agent-ros-bridge
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -e ".[dev]"
# Install pre-commit hooks
pre-commit install
# Verify setup
pytest tests/unit/ -v# All tests
pytest tests/ -v
# Specific test file
pytest tests/unit/test_gateway.py -v
# With coverage
pytest tests/ --cov=agent_ros_bridge --cov-report=html
# E2E tests (requires Docker)
pytest tests/e2e/ -v
# Safety tests only
pytest tests/unit/safety/ -vWe use:
- black for formatting
- ruff for linting
- mypy for type checking
# Format code
black .
# Check linting
ruff check .
# Fix auto-fixable issues
ruff check . --fix
# Type checking
mypy agent_ros_bridge/agent_ros_bridge/
├── agent_ros_bridge/ # Main package
│ ├── gateway_v2/ # Core gateway
│ ├── integrations/ # Protocol adapters
│ ├── safety/ # Safety systems
│ ├── shadow/ # Shadow mode
│ └── web/ # Dashboard
├── tests/ # Test suite
│ ├── unit/ # Unit tests
│ ├── e2e/ # End-to-end tests
│ └── security/ # Security tests
├── docs/ # Documentation
├── config/ # Configuration files
└── scripts/ # Utility scripts
import pytest
from agent_ros_bridge.safety.validator import SafetyValidator
class TestSafetyValidator:
"""Test safety validation logic."""
def test_dangerous_action_detection(self):
validator = SafetyValidator()
result = validator.validate(
action="emergency_stop",
parameters={}
)
assert result.is_dangerous == True
assert result.requires_approval == True
def test_safe_action_approval(self):
validator = SafetyValidator()
result = validator.validate(
action="get_status",
parameters={}
)
assert result.is_dangerous == FalseAll new features must follow Test-Driven Development:
- Write test first (red)
- Implement feature (green)
- Refactor (while keeping tests green)
- Minimum: 65% overall
- Safety-critical code: 90%+
- New features: 80%+
def validate_command(action: str, parameters: dict) -> ValidationResult:
"""
Validate a robot command for safety.
Args:
action: Command action (e.g., 'move', 'rotate')
parameters: Command parameters
Returns:
ValidationResult with safety status
Raises:
SafetyError: If command violates safety constraints
Example:
>>> result = validate_command('move', {'distance': 2.0})
>>> result.is_safe
True
"""
# ImplementationUpdate relevant docs when adding features:
README.md- User-facing overviewdocs/API_REFERENCE.md- API changesdocs/DEPLOYMENT_GUIDE.md- Deployment changesCHANGELOG.md- Release notes
CRITICAL: All contributions must consider safety implications.
- Could this change allow unsafe robot operations?
- Does it bypass human-in-the-loop?
- Could it affect shadow mode data integrity?
- Are there edge cases that could cause harm?
Require additional review:
- Safety configuration changes
- Human approval logic
- Shadow mode logging
- Emergency stop functionality
Tag PRs with safety-critical label.
DO NOT open public issues for security bugs.
Instead:
- Email: security@agent-ros-bridge.ai
- Encrypt with PGP if sensitive
- Allow 30 days for response
- Coordinate disclosure
- Never commit secrets
- Use parameterized queries
- Validate all inputs
- Follow OWASP guidelines
- Run security scans:
bandit -r agent_ros_bridge/
Add benchmarks for performance-critical code:
# tests/benchmarks/test_performance.py
import pytest
import time
def test_command_latency(benchmark):
def send_command():
# Command sending logic
pass
result = benchmark(send_command)
assert result.stats.mean < 0.050 # 50ms max# CPU profiling
python -m cProfile -o profile.stats script.py
# Memory profiling
python -m memory_profiler script.py- Update version in
__init__.py - Update
CHANGELOG.md - Create git tag:
git tag v0.7.0 - Push tag:
git push origin v0.7.0 - GitHub Actions builds and publishes
- GitHub Issues: Bug reports, feature requests
- GitHub Discussions: General questions, ideas
- Slack: Real-time chat (invite-only)
- Email: contact@agent-ros-bridge.ai
Contributors will be:
- Listed in CONTRIBUTORS.md
- Mentioned in release notes
- Invited to Slack community
- Read FAQ
- Open a Discussion
- Email: contact@agent-ros-bridge.ai
By contributing, you agree that your contributions will be licensed under the MIT License.
Thank you for making AI robotics safer! 🤖🛡️