Thank you for your interest in contributing to the Agent Control Plane! This document provides guidelines and instructions for contributing to this project.
- Code of Conduct
- Getting Started
- Development Setup
- Project Structure
- Making Changes
- Testing
- Code Style
- Submitting Changes
This project is committed to providing a welcoming and inclusive environment. Please be respectful and considerate in all interactions.
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR-USERNAME/agent-control-plane.git - Create a new branch:
git checkout -b feature/your-feature-name
- Python 3.8 or higher
- pip
- Install the package in development mode:
pip install -e .- Install development dependencies:
pip install -e ".[dev]"agent-control-plane/
├── src/
│ └── agent_control_plane/ # Main package source code
│ ├── __init__.py
│ ├── agent_kernel.py
│ ├── control_plane.py
│ ├── policy_engine.py
│ ├── execution_engine.py
│ ├── constraint_graphs.py
│ ├── shadow_mode.py
│ ├── mute_agent.py
│ ├── supervisor_agents.py
│ └── example_executors.py
├── tests/ # Test files
│ ├── test_control_plane.py
│ └── test_advanced_features.py
├── examples/ # Example scripts
│ ├── basic_usage.py
│ ├── advanced_features.py
│ └── configuration.py
├── docs/ # Documentation
│ ├── guides/
│ ├── api/
│ └── architecture/
├── setup.py # Package setup
├── pyproject.toml # Project configuration
└── README.md # Main documentation
- Keep changes focused: One feature or bug fix per pull request
- Write clear commit messages: Use descriptive commit messages that explain what and why
- Add tests: All new features should include tests
- Update documentation: Update relevant documentation for new features or changes
- Follow existing patterns: Maintain consistency with existing code
- Core modules: Place core functionality in
src/agent_control_plane/ - Tests: Place tests in
tests/directory - Examples: Place examples in
examples/directory - Documentation: Place documentation in
docs/directory
Run all tests:
python -m pytest tests/Run tests with coverage:
python -m pytest --cov=agent_control_plane tests/Run specific test file:
python -m pytest tests/test_control_plane.pyRun specific test:
python -m pytest tests/test_control_plane.py::TestAgentKernel::test_create_agent_session- Use unittest framework (consistent with existing tests)
- Place tests in the
tests/directory - Name test files with
test_prefix - Write descriptive test names that explain what is being tested
- Include both positive and negative test cases
- Test edge cases and error conditions
Example:
import unittest
from agent_control_plane import AgentControlPlane, create_standard_agent
class TestMyFeature(unittest.TestCase):
def setUp(self):
self.control_plane = AgentControlPlane()
def test_feature_success_case(self):
"""Test that feature works in normal conditions"""
# Test implementation
pass
def test_feature_error_case(self):
"""Test that feature handles errors properly"""
# Test implementation
pass- Follow PEP 8 style guide
- Use 4 spaces for indentation (no tabs)
- Maximum line length: 100 characters
- Use descriptive variable names
- Add docstrings to all public classes and functions
- Add type hints where appropriate
Use Black for code formatting:
black src/ tests/ examples/Use flake8 for linting:
flake8 src/ tests/ examples/Use mypy for type checking:
mypy src/-
Update your branch: Ensure your branch is up to date with the main branch
git checkout main git pull upstream main git checkout your-feature-branch git rebase main
-
Run tests: Ensure all tests pass
python -m pytest tests/
-
Update documentation: Update relevant documentation
-
Commit your changes: Use clear, descriptive commit messages
git add . git commit -m "Add feature: description of your feature"
-
Push to your fork:
git push origin your-feature-branch
-
Create a Pull Request:
- Go to the original repository on GitHub
- Click "New Pull Request"
- Select your branch
- Provide a clear description of your changes
- Reference any related issues
- Title: Use a clear, descriptive title
- Description: Explain what changes you made and why
- Tests: Ensure all tests pass
- Documentation: Include documentation updates if needed
- Review: Be responsive to feedback and questions
<type>: <subject>
<body>
<footer>
Types:
feat: New featurefix: Bug fixdocs: Documentation changestest: Adding or updating testsrefactor: Code refactoringstyle: Code style changes (formatting, etc.)chore: Maintenance tasks
Example:
feat: add conditional permission capability
Implement conditional permissions that allow agents to have
fine-grained access control based on context attributes.
Closes #123
If you have questions or need help, please:
- Check GitHub Discussions
- Open an issue on GitHub
- Check existing documentation in the
docs/directory - Review SUPPORT.md for detailed support options
- Look at existing code and tests for examples
The release process is mostly automated through GitHub Actions. Here's how to create a new release:
-
Update Version Numbers
- Update version in
pyproject.toml(line 7) - Update version in
setup.py(line 16) - Follow Semantic Versioning: MAJOR.MINOR.PATCH
- Update version in
-
Update CHANGELOG.md
- Add a new section at the top with the version and date
- List all changes under appropriate categories (Added, Changed, Fixed, etc.)
- Follow Keep a Changelog format
-
Run Pre-release Checks
# Run full test suite python -m pytest tests/ -v # Run linting flake8 src/ --count --select=E9,F63,F7,F82 --show-source # Test package build python -m build twine check dist/*
-
Create and Push Git Tag
git tag -a v1.2.0 -m "Release version 1.2.0" git push origin v1.2.0 -
Automated Workflows
- GitHub Actions automatically creates a GitHub Release from the tag
- Release notes are extracted from CHANGELOG.md
- Package is automatically published to PyPI
-
Post-Release Tasks
- Verify release appears on GitHub: https://github.com/microsoft/agent-governance-toolkit/releases
- Verify package on PyPI: https://pypi.org/project/agent-control-plane/
- Test installation:
pip install agent-control-plane==X.Y.Z - Announce in GitHub Discussions
For detailed PyPI publishing instructions, see docs/PYPI_PUBLISHING.md.
Thank you for contributing to Agent Control Plane!