Developer Guide
How to extend and contribute to b1e55ed.Project Structure
Key Modules
| Module | Purpose |
|---|---|
engine/core/db.py | SQLite event store, hash chain |
engine/core/config.py | Config model, env var mapping |
engine/core/contributors.py | Contributor registry, scoring |
engine/core/scoring.py | Attribution scoring logic |
engine/core/webhooks.py | Webhook dispatch |
engine/brain/orchestrator.py | Brain cycle orchestration |
engine/brain/synthesis.py | Multi-domain conviction synthesis |
engine/brain/regime.py | Regime detection |
engine/integrations/oracle.py | Oracle provenance projection |
engine/integrations/eas.py | EAS attestation client |
engine/integrations/forge.py | Identity derivation |
api/routes/signals.py | Signal submit, attribution |
api/routes/mcp.py | MCP JSON-RPC server |
api/routes/oracle.py | Oracle endpoint |
api/routes/events.py | SSE event stream |
Test Setup
Adding a Producer
Producers live inengine/producers/. They emit signal events to the event store.
1. Create the producer module
2. Register via CLI
config/user.yaml for built-in producers.
3. Write tests
Adding a Strategy
Strategies live inengine/strategies/. They consume signals and produce trade intents for the backtest engine.
Extension Registry Pattern
The engine uses a registry pattern for producers and strategies. Built-in components are discovered at import time. External components register via the database or config overlay. For producers:engine/core/producers.py — ProducerRegistry
For strategies: engine/strategies/__init__.py — StrategyRegistry
Contribution Guidelines
- Branch from
develop— all PRs targetdevelop, notmain - Tests required — new code without tests won’t merge
- No broken links — run
bash scripts/validate_doc_deps.shbefore commit - Lint clean —
uv run ruff check . && uv run ruff format --check . - Type-check —
uv run mypy engine/ api/for changed modules
CI Requirements
Every PR must pass:engine/ and api/ packages.
See Also
- Architecture — how the pieces fit together
- API reference — all endpoints
- CLI reference — all commands
- Configuration — all config keys