Thank you for your interest in contributing to Project AEGIS! This document provides guidelines for contributing to the project.
- Code of Conduct
- Development Setup
- Architecture Overview
- Contribution Workflow
- Coding Standards
- Testing
- Documentation
We are committed to providing a welcoming and inclusive environment. By participating in this project, you agree to abide by our principles:
- Respect: Treat all contributors with respect and professionalism
- Collaboration: Work together constructively and value diverse perspectives
- Security First: Prioritize security in all contributions
- Quality: Maintain high standards for code quality and documentation
- Rust: 1.75+ (Edition 2021)
- Docker: 24.0+
- Node.js: 20+
- Python: 3.11+
- Git: 2.40+
-
Clone the repository
git clone https://github.com/100monkeys-ai/aegis-orchestrator.git cd aegis-orchestrator -
Build the Rust workspace
cargo build
-
Run tests
cargo test -
Install pre-commit hooks
./scripts/setup-hooks.sh
-
Create a feature branch
git checkout -b feature/your-feature-name
-
Make your changes
- Write code following our standards (see below)
- Add tests for new functionality
- Update documentation as needed
-
Run checks locally
cargo fmt --check # Format check cargo clippy # Linting cargo test # Run tests
-
Commit your changes
git add . git commit -m "feat: add new feature"
-
Push and create PR
git push origin feature/your-feature-name
AEGIS follows Domain-Driven Design (DDD) principles with clear separation of concerns.
orchestrator/
├── core/ # Pure domain logic (no IO)
│ ├── agent.rs # Agent entities and value objects
│ ├── runtime.rs # Runtime trait and types
│ ├── security.rs # Security policies
│ └── swarm.rs # Swarm coordination
├── api/ # HTTP/gRPC server (adapter)
├── runtime-docker/ # Docker implementation (adapter)
├── runtime-firecracker/ # Firecracker implementation
└── security/ # Policy enforcement- Bounded Contexts: Clear separation between Execution, Orchestration, Billing, and Identity
- Hexagonal Architecture: Domain core is pure Rust, infrastructure acts as adapters
- Ubiquitous Language: Consistent terminology throughout code, docs, and UI
- Rich Domain Models: Behavior lives in entities, not service scripts
- Bug Fixes: Fix existing issues
- Features: Add new functionality
- Documentation: Improve docs and examples
- Performance: Optimize code for speed or memory
- Security: Address security vulnerabilities
We follow Conventional Commits:
<type>(<scope>): <subject>
<body>
<footer>Types:
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code refactoringtest: Adding or updating testschore: Build process or tooling changes
Example:
feat(runtime): add Firecracker cold-start optimization
Optimize the VM boot sequence to reduce cold-start time from 150ms to 125ms
by pre-loading kernel modules and using minimal init system.
Closes #123- Ensure all checks pass: Tests, linting, formatting
- Update documentation: If you change APIs or add features
- Add tests: All new code must have tests
- Request review: Tag relevant maintainers
- Address feedback: Make requested changes promptly
- Squash commits: Before merging, squash into logical commits
- Edition: 2021
- Formatting: Use
cargo fmt(rustfmt) - Linting: Use
cargo clippywith strict settings - Error Handling: Use
Resultand?operator, avoidpanic! - Documentation: All public APIs must have doc comments
- Async: Use
async-traitfor traits, prefertokioruntime
Example:
/// Execute a task on a running agent instance.
///
/// # Arguments
/// * `id` - The instance identifier
/// * `input` - Task input containing prompt and context
///
/// # Errors
/// Returns `RuntimeError::ExecutionFailed` if the task fails.
///
/// # Example
/// ```
/// let output = runtime.execute(&id, input).await?;
/// ```
pub async fn execute(&self, id: &InstanceId, input: TaskInput) -> Result<TaskOutput, RuntimeError>;- Version: 3.11+
- Formatting: Use
black(line length: 100) - Linting: Use
ruff - Type Hints: All functions must have type annotations
- Documentation: Docstrings for all public APIs
Example:
async def execute_task(self, agent_id: str, task_input: TaskInput) -> TaskOutput:
"""Execute a task on a deployed agent.
Args:
agent_id: ID of the deployed agent
task_input: Task input with prompt and context
Returns:
Task output with result and logs
Raises:
HTTPError: If the API request fails
"""- Version: 5.3+
- Formatting: Use Prettier
- Linting: Use ESLint with strict rules
- Type Safety: Enable
strictmode, avoidany - Documentation: JSDoc for all public APIs
- Unit Tests: Test individual functions and modules
- Integration Tests: Test component interactions
- End-to-End Tests: Test full workflows
- Security Tests: Test policy enforcement
# Rust tests
cargo test
# Python tests
cd sdks/python
pytest
# TypeScript tests
cd sdks/typescript
npm test
# All tests
./scripts/test-all.sh- Coverage: Aim for >80% code coverage
- Clarity: Tests should be self-documenting
- Isolation: Tests should not depend on external state
- Fast: Unit tests should run in milliseconds
Example:
#[tokio::test]
async fn test_docker_runtime_spawn() {
let runtime = DockerRuntime::new("assets/bootstrap.py".to_string(), None, None, "http://localhost:8088".to_string(), None, 2049, 2049).unwrap();
let config = AgentConfig {
name: "test-agent".to_string(),
runtime: "python:3.11".to_string(),
// ...
};
let instance_id = runtime.spawn(config).await.unwrap();
assert!(!instance_id.as_str().is_empty());
}- API Docs: Generated from code comments
- Architecture Docs: High-level design (in
docs/) - Examples: Working code samples (in
examples/) - Guides: Step-by-step tutorials
- Clarity: Write for developers unfamiliar with the codebase
- Completeness: Cover all public APIs and features
- Examples: Include code examples for complex concepts
- Updates: Keep docs in sync with code changes
# Rust API docs
cargo doc --open
# Python API docs
cd sdks/python
pdoc aegis --html
# TypeScript API docs
cd sdks/typescript
npm run docsDo not open public issues for security vulnerabilities.
Instead, email: security@100monkeys.ai
Include:
- Description of the vulnerability
- Steps to reproduce
- Potential impact
- Suggested fix (if any)
All security-related changes require:
- Threat model analysis
- Security team review
- Penetration testing (for major features)
- General Questions: Open a discussion on GitHub
- Bug Reports: Open an issue with the
buglabel - Feature Requests: Open an issue with the
enhancementlabel
Thank you for contributing to AEGIS!