|
1 | | -# Contributing |
| 1 | +# Contributing to TradingChassis Core |
2 | 2 |
|
3 | | -Thank you for your interest in contributing! |
| 3 | +Contributions should preserve TradingChassis Core as a deterministic, |
| 4 | +Runtime-agnostic library. |
4 | 5 |
|
5 | | -This repository focuses on deterministic, event-driven trading architecture. |
6 | | -Contributions should preserve clarity, explicitness and reproducibility. |
| 6 | +> Terminology: Definitions and related terms match the [canonical |
| 7 | +> terminology](https://tradingchassis.github.io/docs/latest/00-guides/terminology/). |
7 | 8 |
|
8 | | ---- |
| 9 | +## Package Scope |
9 | 10 |
|
10 | | -## Design Principles |
| 11 | +- Core owns canonical Events, State reduction, Strategy evaluation boundary, |
| 12 | + candidate reconciliation, Risk Engine (policy), Execution Control plan/apply, |
| 13 | + and `CoreStepResult`. |
| 14 | +- Core does not own Runtime orchestration, Venue Adapters, dispatch lifecycle, |
| 15 | + or deployment/config wiring. |
11 | 16 |
|
12 | | -All contributions must respect the core design philosophy: |
| 17 | +## Development Setup |
13 | 18 |
|
14 | | -- Determinism over convenience |
15 | | -- Explicit state modeling |
16 | | -- No hidden side effects |
17 | | -- Risk-first architecture |
18 | | -- Clear domain boundaries |
| 19 | +From `core`: |
19 | 20 |
|
20 | | -Avoid introducing implicit behavior or non-deterministic execution paths. |
| 21 | +```bash |
| 22 | +python -m pip install -e ".[dev]" |
| 23 | +``` |
21 | 24 |
|
22 | | ---- |
| 25 | +## Validation Commands |
23 | 26 |
|
24 | | -## Workflow |
| 27 | +Run before opening a PR: |
25 | 28 |
|
26 | | -1. Fork the repository |
27 | | -2. Create a feature branch |
28 | | -3. Commit small, logical changes |
29 | | -4. Open a Pull Request with clear description |
| 29 | +```bash |
| 30 | +python examples/core_step_quickstart.py |
| 31 | +python -m pytest -q |
| 32 | +python -m build |
| 33 | +``` |
30 | 34 |
|
31 | | ---- |
| 35 | +## Architecture Rules |
32 | 36 |
|
33 | | -## Commit Style |
| 37 | +- Core accepts canonical Events through `EventStreamEntry` and |
| 38 | + `process_event_entry` / `process_canonical_event`. |
| 39 | +- Core returns deterministic `CoreStepResult`; Runtime dispatches. |
| 40 | +- Do not introduce Runtime imports. |
| 41 | +- Pydantic models are the source of truth for contract structure. |
34 | 42 |
|
35 | | -Use clear messages: |
| 43 | +## Changing Core Behavior |
36 | 44 |
|
37 | | -feat: add monitoring overlay |
38 | | -fix: correct SecretProviderClass parameters |
39 | | -docs: update bootstrap instructions |
| 45 | +### Canonical Events |
40 | 46 |
|
41 | | ---- |
| 47 | +- Add Event models in `tradingchassis_core/core/domain/types.py`. |
| 48 | +- Register canonical category handling in `core/domain/event_model.py`. |
| 49 | +- Update canonical reduction behavior in `core/domain/processing.py`. |
42 | 50 |
|
43 | | -## Development Environment |
| 51 | +### CoreStep/CoreWakeupStep pipeline |
44 | 52 |
|
45 | | -Recommended: |
| 53 | +- Update `core/domain/processing_step.py` for deterministic flow changes. |
| 54 | +- Keep reconciliation/policy/apply transitions explicit and side-effect-safe. |
46 | 55 |
|
47 | | -- Python 3.11.x |
48 | | -- Dev Container (provided in this repository) |
| 56 | +### Risk Engine (policy) behavior |
49 | 57 |
|
50 | | -Alternatively: |
| 58 | +- Implement policy checks in `core/risk/` and wire through |
| 59 | + `evaluate_policy_intent`. |
| 60 | +- Keep Risk Engine admission as policy-only; no dispatch/Runtime side effects. |
51 | 61 |
|
52 | | -```bash |
53 | | -pip install -e . |
54 | | -``` |
| 62 | +### Execution Control behavior |
| 63 | + |
| 64 | +- Update plan/apply stages in `core/domain/execution_control_plan.py` and |
| 65 | + `core/domain/execution_control_apply.py`. |
| 66 | +- Preserve `ControlSchedulingObligation` as non-canonical output. |
55 | 67 |
|
56 | | ---- |
| 68 | +### Public API exports and docs |
57 | 69 |
|
58 | | -## Testing |
| 70 | +- Update `tradingchassis_core/__init__.py` for intentional public exports only. |
| 71 | +- Sync docs in `README.md` and `docs/reference/public-api.md`. |
59 | 72 |
|
60 | | -Before submitting: |
| 73 | +## Pull Request Checklist |
61 | 74 |
|
62 | | -- The `./scripts/check.sh` script must pass |
63 | | -- All backtests must complete successfully and produce result artifacts |
| 75 | +- [ ] Package remains Core-only and deterministic. |
| 76 | +- [ ] Public API changes are intentional and tested. |
| 77 | +- [ ] Quickstart still runs via public imports. |
| 78 | +- [ ] `python -m pytest -q` passes. |
| 79 | +- [ ] `python -m build` succeeds. |
| 80 | +- [ ] README/docs/changelog updated to match behavior. |
0 commit comments