Rules for every contributor
Read docs/ARCHITECTURE.md first. Then:
Scope and files
- Keep a change focused: touch only the files the change needs. If you must change a shared file (root
Cargo.toml, another crate), keep the edit minimal and say so in the description of the change. - New external dependencies go into
[workspace.dependencies]of the rootCargo.toml(alphabetical order) and are referenced withdep.workspace = true. Prefer few, well-known crates. Nounsafe. - The standard’s prose is licensed: never paste it into code, comments, docs or tests. Cite clause numbers.
Rust
- Library crates:
#![warn(missing_docs)], English rustdoc on public items,thiserrorfor errors, nounwrap/expect/panic!on input that comes from a federate or from the network. - Edition 2024. Formatting is
cargo fmt --allwith the repositoryrustfmt.toml. - State that must survive federation save/restore derives
serde::Serializeandserde::Deserialize(noskip_serializing_if, nountagged: snapshots use postcard). - Never let
HashMapiteration order influence behaviour visible to federates: useBTreeMap/BTreeSetor sort. The RTI must be deterministic. - The dev profile has no debug info and no incremental compilation on purpose (disk space). Do not change the profiles. Do not create extra target directories.
- macOS has no
timeoutcommand. Tests must terminate on their own (use bounded waits in code).
Tests
- Test real behaviour through public APIs. Each service: normal case plus every exception it can raise.
- Tests must be deterministic and fast (no sleeps longer than needed, no fixed ports: bind port 0).
- Before you report, run for your crate(s):
cargo fmt --all,cargo clippy -p <crate> --all-targets -- -D warnings,cargo test -p <crate>. Report the realtest result:lines. Never claim a test passes without having run it.
Describing a change
- What is implemented (with clause numbers where relevant).
- What is NOT implemented or deviates from the standard, with the reason. Be exhaustive and honest here.
- Exact gate results (
test result:lines, clippy status). - Open questions or ambiguities you found in the standard.