Contributing to ASAP Protocol
July 19, 2026 ยท View on GitHub
Thanks for helping out! Here's how to get started quickly.
Quick Start
-
Setup: You need
uvinstalled. Use--devso that dev dependencies (pytest-xdist, ruff, mypy, etc.) are installed and local test runs match CI (includingpytest -n auto).git clone https://github.com/asap-protocol/asap-protocol.git cd asap-protocol uv sync --all-extras --dev -
Verify (CI has two jobs: fast test with
-n auto, and coverage with--cov):uv run pytest -n auto --tb=shortFor coverage locally:
uv run pytest --tb=short --cov=asap --cov-report=xml --cov-fail-under=85
Development Workflow
- Linting & Formatting:
uv run ruff check .anduv run ruff format . - Type Checking:
uv run mypy src/ scripts/ tests/ - Testing:
uv run pytest -n auto --tb=short(same as CI test job, fast). For coverage:uv run pytest --tb=short --cov=asap --cov-report=xml --cov-fail-under=85(same as CI coverage job; do not combine-nwith--covdue to known xdist+cov bug).
Pull Requests
- Branch: Create a feature branch (
git checkout -b feature/my-cool-feature). - Commit: Use Conventional Commits (e.g.,
feat: add awesome feature,fix: resolve crash). - Test: Ensure
uv run pytest -n auto --tb=shortpasses (same as CI test job). - Push: Open a PR on GitHub.
Testing
Test Structure
Tests are organized into three categories:
- Unit tests (
tests/transport/unit/): Test isolated components without HTTP or rate limiting dependencies - Integration tests (
tests/transport/integration/): Test component interactions within the transport layer - E2E tests (
tests/transport/e2e/): Test complete agent workflows
Rate Limiting in Tests
IMPORTANT: To prevent rate limiting interference between tests:
-
For non-rate-limiting tests: Inherit from
NoRateLimitTestBase:from tests.transport.conftest import NoRateLimitTestBase class TestMyFeature(NoRateLimitTestBase): """Rate limiting is automatically disabled.""" pass -
For rate limiting tests: Use aggressive monkeypatch fixtures (see Testing Guide)
-
Run with parallel execution: Use
pytest -n autofor process-level isolation (CI test job uses this; coverage is collected in a separate CI job without -n to avoid xdist+cov INTERNALERROR).
Test Isolation Strategy
We use a three-pronged approach to ensure test isolation:
- Process isolation (pytest-xdist): Tests run in separate processes
- Aggressive monkeypatch: Module-level limiters are replaced for complete isolation
- Strategic organization: Rate limiting tests are isolated in separate files
See the Testing Guide for complete details on:
- Test organization and structure
- Writing new tests
- Using fixtures
- Troubleshooting test interference
Troubleshooting: If you see unrecognized arguments: -n, run uv sync --all-extras --dev so pytest-xdist is installed. CI uses two jobs: test (pytest -n auto --tb=short) for fast feedback and coverage (pytest --tb=short --cov=asap --cov-report=xml --cov-fail-under=85) for Codecov; do not combine -n with --cov locally (known xdist+cov bug).
Guidelines
- Code Style: Follow PEP 8 (handled by Ruff).
- Tests: New features need tests. Bug fixes need regression tests.
- Use
NoRateLimitTestBasefor tests that don't test rate limiting - See Testing Guide for detailed guidelines
- Use
- Docs: Update docstrings and README if you change behavior.
Reviewing Dependabot PRs
Dependabot automatically creates pull requests for dependency updates. Here's how to review and handle them:
Types of Updates
-
Security Updates: Automatically created when vulnerabilities are detected
- These are high priority and should be reviewed promptly
- Security: See SECURITY.md for reporting vulnerabilities.
-
Version Updates: Created monthly for non-security dependency updates
- These can be reviewed during regular maintenance windows
- Focus on patch and minor updates first
Review Workflow
- Check CI Status: Ensure all CI checks pass (tests, linting, type checking)
- Review Changelog: Check the dependency's changelog for breaking changes
- Test Locally (if needed):
git checkout <dependabot-branch> uv sync --all-extras uv run pytest - Verify Compatibility: Ensure the update doesn't break existing functionality
- Merge: If everything looks good, merge the PR
Target Review Times
These are target times for review, not strict commitments. As a solo maintainer, we aim to review updates within these windows:
- Critical Security: Aim for 3-5 business days
- High Security: Aim for 1-2 weeks
- Medium Security: Aim for 2-3 weeks
- Low Security: Aim for 1 month
- Version Updates: Review within the next monthly batch (or within 1 month)
When to Defer
- If the update introduces breaking changes that require code modifications
- If CI tests fail and the failure is not related to the dependency update
- If the update conflicts with other ongoing work (coordinate with maintainers)
Auto-merge
Currently, auto-merge is disabled. All Dependabot PRs require manual review to ensure compatibility and maintain code quality.
Project Structure
src/asap/models: Core Pydantic models.src/asap/transport: HTTP/JSON-RPC layer.src/asap/state: State machine logic.tests/: Where the magic is verified.
Architecture & Design
Understanding the "why" behind our code is crucial. Please review:
- Tech Stack Decisions: engineering/architecture/tech-stack-decisions.md
- ADRs: docs/adr
Need Help?
Check Discussions or open an Issue.
For general, non-security inquiries (coordination, integrations, press), you can reach maintainers at info@asap-protocol.com. Do not use this address for vulnerability reports โ follow SECURITY.md instead.
Using AI coding tools? See AGENTS.md for project-specific instructions optimized for Cursor, Copilot, Codex and other AI assistants.
By contributing, you agree to the Code of Conduct and license your code under Apache 2.0.