Rust engineering conventions
Generated Rust repositories use path-scoped instructions for CLI design, workspaces, libraries, async services, unsafe code, dependencies, testing, data...
Repository-relative paths and “this checkout” refer to the Konclave source repository, not this website. The source link above identifies the exact revision used here.
Generated Rust repositories use path-scoped instructions for CLI design, workspaces, libraries, async services, unsafe code, dependencies, testing, data boundaries, and observability. A rule applies only when the matching code or manifest exists; adding Rust guidance does not turn every crate into a service or require every specialized verification tool.
Design boundaries
- Keep workspace policy at the root and crate responsibilities narrow.
- Treat public library APIs, errors, features, and documentation as compatibility commitments.
- Give long-running tasks explicit ownership, cancellation, backpressure, and observed shutdown.
- Prefer safe Rust and isolate every necessary unsafe invariant behind a safe API.
- Validate and bound untrusted data before allocation, persistence, or side effects.
- Keep diagnostics structured and keep secrets and protocol payloads out of logs.
Native cryptographic builds
Non-FIPS Windows builds use the AWS-LC system crate’s lockfile-pinned prebuilt NASM
objects, configured in .cargo/config.toml, so contributors do not need a separate
assembler installation. Linux CI builds AWS-LC from source. Updating the provider,
system crate, or prebuilt-object setting requires supply-chain and cryptographic
review.
Context-specific tools remain evidence-driven:
- Miri is appropriate for unsafe and undefined-behavior-sensitive code.
- Loom is appropriate for small concurrency primitives.
- Fuzzing and property tests are appropriate for parsers and state machines.
- Snapshot tests are useful only when the reviewed snapshot is a meaningful contract.
- MSRV, no-default-feature, and all-feature jobs belong in CI only when the repository supports those compatibility surfaces.
Research basis
The conventions synthesize current public guidance rather than copying one repository’s local policy:
- The Rust project contributor instructions demonstrate test selection, invariant-focused comments, and high-stakes safety boundaries.
- Cargo workspaces, workspace inheritance, and features define the root/member and additive-feature contracts.
- The Rust API guidelines and rustdoc inform public API and documentation expectations.
- Tokio’s contributor documentation provides context for async testing, feature compatibility, Loom, and MSRV.
- The Rustonomicon and
unsafe_op_in_unsafe_fndefine explicit unsafe proof obligations. - Miri, the Rust fuzz book, and Loom define specialized verification boundaries.
- Public instructions from
Ruff,
uv,
OpenMLS,
Windows Drivers Rust,
Cloud Hypervisor,
and Orb Software
reinforce narrow visibility, workspace lint inheritance, public documentation, and
isolated
SAFETYexplanations.
Repository-specific contribution bans, nightly-only formatting, blanket pedantic
lints, mandatory snapshot frameworks, panic = "abort", and universal use of Miri,
Loom, fuzzing, or alternative test runners are intentionally not generalized.
Content: Konclave,Apache-2.0. Revision: 8d0d3676e9fc746749a4fc04ddeb4499023c4104.