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 root Cargo.toml (alphabetical order) and are referenced with dep.workspace = true. Prefer few, well-known crates. No unsafe.
  • 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, thiserror for errors, no unwrap/expect/panic! on input that comes from a federate or from the network.
  • Edition 2024. Formatting is cargo fmt --all with the repository rustfmt.toml.
  • State that must survive federation save/restore derives serde::Serialize and serde::Deserialize (no skip_serializing_if, no untagged: snapshots use postcard).
  • Never let HashMap iteration order influence behaviour visible to federates: use BTreeMap/BTreeSet or 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 timeout command. 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 real test result: lines. Never claim a test passes without having run it.

Describing a change

  1. What is implemented (with clause numbers where relevant).
  2. What is NOT implemented or deviates from the standard, with the reason. Be exhaustive and honest here.
  3. Exact gate results (test result: lines, clippy status).
  4. Open questions or ambiguities you found in the standard.

This page is docs/CONTRIBUTING.md of microrti/microrti, at v0.5.1.