Thank you for your interest in contributing to the Hushh Consent Protocol. This document explains how to contribute code, agents, operons, and documentation.
- Python 3.13+
- A virtual environment (
python -m venv .venv) - Dependencies installed:
pip install -r requirements.txt -r requirements-dev.txt
git clone https://github.com/<your-username>/consent-protocol.git
cd consent-protocolgit checkout -b feat/my-new-operonFollow the architecture and coding standards below.
Every PR must pass these before merge:
make ci-local # Runs all checks (lint, format, typecheck, test, security)Or run individually:
make lint # Lint
make format-check # Format check
make typecheck # Type check
make test # Tests
make security # Security scan- Target:
main - Fill out the PR template (tests, ruff, mypy, consent validation, docs)
- One approval required
- Formatter: ruff format (double quotes, 100 char line length)
- Linter: ruff check (E, F, B, I, S rules)
- Type checker: mypy (gradual adoption; new code should be typed)
- Security: bandit scans
hushh_mcp/andapi/
- API routes never access the database directly. All DB operations go through service classes in
hushh_mcp/services/. - Agents never call services directly. The stack is: Agent > Tool > Operon > Service.
- Consent is validated at every layer. Use
HushhAgentfor agents,@hushh_toolfor tools. - No
sessionStorageorlocalStoragepatterns. The backend is stateless; state management is the frontend's concern.
Operons are the business logic building blocks. See docs/reference/agent-development.md for the full guide.
Quick steps:
- Choose the right module in
hushh_mcp/operons/kai/:calculators.py-- pure math, no side effectsfetchers.py-- external API calls (SEC, yfinance, news)analysis.py-- orchestration of calculators + fetchersllm.py-- Gemini LLM integrationstorage.py-- encrypted vault operations
- Add your function with full type annotations
- Add tests in
tests/ - Update the operon catalog in
docs/reference/agent-development.md
| Type | Side Effects | DB Access | Example |
|---|---|---|---|
| PURE | None | No | calculators.py -- math, ratios |
| IMPURE | Yes | Via service | fetchers.py -- API calls, DB reads |
Pure operons are preferred. Impure operons must validate consent if they access user data.
- Create a directory:
hushh_mcp/agents/<agent_name>/ - Create
agent.pyextendingHushhAgent:
from hushh_mcp.hushh_adk.core import HushhAgent
class MyAgent(HushhAgent):
REQUIRED_SCOPES = ["attr.domain.*"]
async def run(self, context, request):
self._validate_consent(context) # Mandatory
# Agent logic here- Create
agent.yamlmanifest:
name: my-agent
version: "1.0.0"
description: "What this agent does"
required_scopes:
- attr.domain.*
tools:
- name: my_tool
function: hushh_mcp.agents.my_agent.tools.my_tool- Create
tools.pywith@hushh_tooldecorated functions - Wire tools to operons (never directly to services)
- Add tests
- Register in
hushh_mcp/agents/__init__.py
- Create or extend a router in
api/routes/ - Use service classes for all DB operations
- Add the route to
server.pyrouter registration - Update
docs/reference/consent-protocol.mdif it involves consent - Update route documentation in
docs/
- All documentation lives in
docs/within this repository - Every new agent or operon must be documented
- Use relative paths for all internal links
Before submitting, verify:
-
make ci-localpasses (or run checks individually) - Consent validation is present at agent entry AND tool invocation
- Tests cover the new code
- Documentation is updated
See CODE_OF_CONDUCT.md.
Open an issue or check docs/README.md for the full documentation index.