# Contributing to plexus

Thanks for your interest. plexus aims to be a clean-room, distribution-friendly
Rust implementation of the Reticulum protocol. A few rules keep it that way.

## Before you start

- Read [ARCHITECTURE.md](ARCHITECTURE.md). It is the source of truth for the
  design, the crate boundaries, and the roadmap. In particular, §1 (the
  gateway/extension seam) and §10 (licensing) are non-negotiable invariants.
- Check [`docs/adr/`](docs/adr/) for the Architecture Decision Records. New
  significant decisions need an ADR.

## Licensing of contributions

By submitting a contribution you agree it is licensed under **MIT OR
Apache-2.0**, matching the project. Do **not** submit code that is:

- derived from `markqvist/Reticulum` source dated **after April 2025** (the
  Reticulum License is incompatible);
- derived from any **AGPL/GPL/LGPL/SSPL/BSL** source (including RetiNet);
- a transliteration of the Python reference. We implement from the protocol
  specification and observed wire behavior, not by porting code.

Wire-format knowledge from the public-domain spec and the Reticulum manual is
fine to use freely. When in doubt, ask in an issue first.

## The gateway/extension seam

The single most important rule (ARCHITECTURE.md §1): **extensions must never
leak into Reticulum-compatible wire output** unless explicitly negotiated. The
crate boundaries enforce this; the conformance suite verifies it. PRs that blur
this boundary will be sent back.

## Development workflow

```sh
cargo xtask test-all     # fmt, clippy (all/pedantic/cargo), build, test, vectors
cargo xtask audit        # cargo-deny + cargo-audit
```

Requirements for a mergeable PR:

- `cargo fmt --all` clean.
- `cargo clippy --all-targets --workspace` clean (warnings in first-party code
  are treated as defects).
- Tests pass, including conformance vectors where the area is covered.
- `cargo deny check` passes (licenses, advisories, sources).
- New public items are documented (`missing_docs` is a warning we honor).
- No `unsafe` without an ADR and a per-block justification comment.

## Commit / PR hygiene

- One logical change per PR. Reference the relevant ARCHITECTURE.md section or
  roadmap item.
- Conformance-affecting changes must include or update test vectors.
