Thanks for your interest in contributing. This guide covers how to get set up, run tests, and where to look when adding new functionality.
git clone https://github.com/antoinezambelli/forge.git
cd forge
python -m venv .venv
pip install -e ".[dev]"Unit tests are fully deterministic — no LLM backend required.
# Full suite (865 tests)
python -m pytest tests/unit/ -v --tb=short
# With coverage
python -m pytest tests/unit/ --cov=forge --cov-report=term-missing
# Single file
python -m pytest tests/unit/test_runner.py -vIntegration tests (@pytest.mark.integration) require a running backend. Skip them with:
python -m pytest tests/ -m "not integration"src/forge/ # Library source
clients/ # LLM backend adapters (one per backend)
core/ # Workflow, runner, messages, steps
context/ # Context management and compaction
prompts/ # Prompt templates and nudges
tests/
unit/ # Deterministic tests
eval/ # Eval harness (requires live backends)
scenarios/ # Eval scenario definitions
dashboard/ # React-based HTML dashboard (separate npm build)
docs/ # User-facing documentation
decisions/ # Architecture Decision Records (ADRs)
results/ # Eval results and raw data tables
- Create
src/forge/clients/yourbackend.py - Implement the
LLMClientprotocol defined insrc/forge/clients/base.py— it requiressend()andsend_stream()methods - Add unit tests in
tests/unit/test_yourbackend_client.py - Export from
src/forge/__init__.py - Add backend setup instructions to
docs/BACKEND_SETUP.md
- Pick the right file in
tests/eval/scenarios/:_plumbing.py— basic tool-calling mechanics_model_quality.py— model reasoning and argument fidelity_compaction.py/_compaction_chain.py— context window pressure_stateful_*.py— stateful variants of the above
- Define an
EvalScenariowith aWorkflow, validation function, and tags - Register it in
ALL_SCENARIOS(see existing patterns in each file) - Run it:
python -m tests.eval.eval_runner --scenarios your_scenario --runs 5
Guardrails live in the runner (src/forge/core/runner.py) and nudge templates (src/forge/prompts/nudges.py). Each guardrail can be independently toggled via ablation presets in tests/eval/ablation.py. If you add a new guardrail:
- Add the toggle to
AblationConfig - Create a new ablation preset that isolates it
- Run eval with and without to measure impact
The interactive HTML dashboard is a React app at tests/eval/dashboard/. It's a separate build:
cd tests/eval/dashboard
npm install
npm run buildThe built output is embedded into docs/results/dashboard.html via report.py --html.
Design decisions are documented in docs/decisions/. If you're proposing a significant change, consider writing an ADR first. See existing ones for the format.
- Python 3.12+ — use modern syntax (type unions with
|, etc.) asynciothroughout — all client methods and the runner are async- Pydantic for tool parameter schemas
- No external formatting/linting tools enforced yet — match the style of surrounding code
Open an issue on GitHub if something is unclear.