Thank you for your interest in contributing to Ansib-eL. This guide explains how to set up a development environment, follow project conventions, and submit changes.
Please read and follow our Code of Conduct in all interactions.
- Python 3.10 or later
- Git 2.30 or later
- A virtual environment manager (venv, virtualenv, or conda)
# Clone the repository
git clone <repo-url>
cd ansib-el
# Create and activate a virtual environment
python -m venv .venv
source .venv/bin/activate # macOS/Linux
# .venv\Scripts\activate # Windows
# Install in editable mode with dev dependencies
pip install -e ".[dev]"
# Verify the installation
ai-git --version
python -c "from ansibel import GitWrapper; print('OK')"# Full test suite
make test
# With coverage report
make test-cov
# Single test
pytest tests/test_git_wrapper.py::TestGitWrapper::test_init_repo -v
# Async tests (tournament, trust lineage)
pytest tests/ -k "tournament or trust" -vThe project uses pytest-asyncio with asyncio_mode = "auto", so async test functions are detected automatically.
dogfood.py runs Ansib-eL against its own repository as a self-hosted integration test:
python dogfood.pydemo.py provides a guided walkthrough of the full feature set:
python demo.pysrc/ansibel/
__init__.py # Public exports
ansib_el.py # AnsibElSystem unified API
orchestrator.py # Task breakdown, delegation, approval
git_wrapper.py # Git operations with AI metadata
agent_system.py # Agent lifecycle and isolation
tournament.py # Parallel execution, evaluation
trust_lineage.py # Trust scoring, decision lineage
cli.py # Click-based CLI (ai-git)
exceptions.py # Exception hierarchy
tests/
test_git_wrapper.py # Unit tests
docs/ # Documentation
demo.py # Feature walkthrough
dogfood.py # Self-hosted integration test
- Fork the repository and clone your fork.
- Create a branch from
mainwith a descriptive name:git checkout -b feat/evaluation-strategy git checkout -b fix/trust-decay-overflow
- Make your changes. Keep commits focused on a single logical change.
- Run checks before committing:
ruff format src/ tests/ # Auto-format ruff check src/ tests/ # Lint mypy src/ # Type check make test # Tests
- Push and open a pull request against
main.
- Formatter:
ruff format(line length 100) - Linter:
ruff check - Type checker:
mypy(Python 3.10 target)
- Data models: Use
dataclassesfor internal structures, Pydantic for validation at boundaries. - Async: Tournament and trust modules use
asynciowithaiosqlite. Test withpytest-asyncio. - Branch naming: Agent branches follow
agent/{agent_id}/{purpose-slug}. - Frozen dataclasses: Immutable records (
DecisionRecord,ReasoningRecord,TrustScore) use@dataclass(frozen=True). - Protocols: Interface contracts in
orchestrator.pyusetyping.Protocolfor structural subtyping. - Error handling: Raise from the
ansibel.exceptionshierarchy. Never use bareexcept:.
Write clear, imperative-mood commit messages:
Add composite evaluation strategy for tournaments
Combines complexity, test pass rate, and requirement match
scores with configurable weights.
- CI must pass. All checks (lint, type check, tests) run automatically.
- One logical change per PR. Split large changes into reviewable pieces.
- Include tests for new functionality or bug fixes.
- Update documentation if you change public APIs or CLI commands.
- Fill out the PR template with a summary, test plan, and related issues.
- Bugs: Use the bug report template.
- Features: Use the feature request template.
Search existing issues before filing a new one.
Looking for something to work on? These areas are particularly welcome:
- Evaluation strategies: New tournament scoring algorithms beyond the built-in set.
- Trust algorithms: Alternative scoring models (Bayesian, multi-factor).
- IDE integrations: VS Code or JetBrains plugins for
ai-git. - CI/CD pipelines: GitHub Actions, GitLab CI, or Jenkins integration recipes.
- Agent templates: Pre-configured agent profiles for common tasks.
- Documentation: Tutorials, examples, translations.