Thank you for your interest in contributing to AgenticContract! This document provides guidelines for contributing to the project.
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/agentic-contract.git - Create a feature branch:
git checkout -b my-feature - Make your changes
- Run the tests (see below)
- Commit and push
- Open a pull request
This is a Cargo workspace monorepo. All Rust crates are under crates/.
# Build everything (core + MCP server + CLI + FFI)
cargo build --workspace
# Run all tests (core + MCP + CLI + stress)
cargo test --workspace
# Core library only
cargo test -p agentic-contract
# MCP server only
cargo test -p agentic-contract-mcp
# CLI integration tests
cargo test -p agentic-contract-cli --test cli_integration
# Run the CLI
cargo run -p agentic-contract-cli -- stats
# Run the MCP server
cargo run -p agentic-contract-mcp -- servecd python/
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
pytest tests/ -vBefore pushing, always run the canonical guardrails:
cargo fmt --all -- --check
cargo clippy --workspace --all-targets -- -D warnings
cargo test --workspace
bash scripts/check-canonical-sister.shFile an issue with:
- Steps to reproduce
- Expected behavior
- Actual behavior
- System info (OS, Rust version)
- Add the tool definition in
crates/agentic-contract-mcp/src/tools.rs - Add the handler in the
handle_tool_callmatch block - Add tests in
crates/agentic-contract-mcp/tests/ - Update
docs/public/command-surface.md
- Create a new module in
crates/agentic-contract-cli/src/commands/ - Register it in
crates/agentic-contract-cli/src/main.rs - Add integration tests in
crates/agentic-contract-cli/tests/ - Update
docs/public/cli-reference.md
All docs are in docs/. Fix typos, add examples, clarify explanations -- all welcome.
- Rust: Follow standard Rust conventions. Run
cargo clippyandcargo fmt. - Python: Follow PEP 8. Use type hints.
- Tests: Every feature needs tests. We maintain 288 tests across the stack (33 core, 55 engine inventions, 80 MCP stress, 30 server stress, 41 CLI integration, 29 edge cases, 14 stress/edge, 6 lib unit).
- Documentation: Update docs when changing public APIs.
- MCP Quality Standard: Tool descriptions must be verb-first imperative, no trailing periods. Tool errors use
isError: true, protocol errors use JSON-RPC error codes. Unknown tool returns-32803.
Use conventional commit prefixes:
feat: add obligation deadline notificationsfix: risk limit check off-by-onechore: update dependenciesdocs: add approval workflow guide
- Keep PRs focused -- one feature or fix per PR
- Include tests for new functionality
- Update documentation if needed
- Ensure all tests pass before submitting
- Ensure guardrails pass:
bash scripts/check-canonical-sister.sh - Write a clear PR description
By contributing, you agree that your contributions will be licensed under the MIT License.