| 1 | # Contributing |
| 2 | |
| 3 | Thanks for wanting to help. Braid is at version 0.1, so the most useful |
| 4 | contributions right now are reviews of the [design](docs/design.md) and the |
| 5 | [format](docs/spec/format-v1.md), bug reports, and tests. |
| 6 | |
| 7 | Coding agents: part 2 of [AGENTS.md](AGENTS.md) says the same in short, |
| 8 | with the checks to run before every commit. |
| 9 | |
| 10 | ## Build and test |
| 11 | |
| 12 | You need a stable Rust toolchain, 1.89 or newer. |
| 13 | |
| 14 | ```bash |
| 15 | cargo build |
| 16 | cargo test --workspace |
| 17 | cargo fmt --all --check |
| 18 | cargo clippy --workspace --all-targets -- -D warnings |
| 19 | cargo deny check # needs cargo-deny |
| 20 | ``` |
| 21 | |
| 22 | CI runs the same checks on every platform in its matrix, checks the minimum |
| 23 | Rust version, builds the format crate for WebAssembly, and runs the privacy |
| 24 | check in `scripts/privacy-check.sh`. |
| 25 | |
| 26 | ## Rules |
| 27 | |
| 28 | - **No code from git or any other GPL project.** Git is GPLv2 and braid is |
| 29 | Apache-2.0. Do not port, translate or paste from git's sources. Reading |
| 30 | documentation and observing behaviour is fine. The git bridge uses |
| 31 | [gitoxide](https://github.com/GitoxideLabs/gitoxide), which is MIT or |
| 32 | Apache-2.0. |
| 33 | - **Dependencies must be compatible with Apache-2.0.** `deny.toml` holds the |
| 34 | list of accepted licences. |
| 35 | - **Hashed formats are specified first.** A change to the bytes of an id, a |
| 36 | tree or a changeset needs an update to `docs/spec/format-v1.md` and to its |
| 37 | golden vectors in the same pull request, and `docs/spec/check_vectors.py` |
| 38 | must still pass. Format v1 is frozen, so such a change needs a new format |
| 39 | version. |
| 40 | - **Performance claims come with a reproducible script** and are stated as a |
| 41 | ratio against git on the same machine. Do not publish absolute timings or |
| 42 | describe your hardware. [`bench/run.py`](bench/README.md) is that script |
| 43 | for every number in the README. |
| 44 | - **Tests come with the change.** Bug fixes include a test that fails without |
| 45 | the fix. |
| 46 | |
| 47 | ## Licence of contributions |
| 48 | |
| 49 | Unless you say otherwise, any contribution you submit is licensed under |
| 50 | Apache-2.0, as section 5 of the [licence](LICENSE) describes. |