Skip to documentation
KonclaveDocumentationSource snapshot · Apache 2.0
Browse documentation

Rust engineering conventions

Generated Rust repositories use path-scoped instructions for CLI design, workspaces, libraries, async services, unsafe code, dependencies, testing, data...

GuideSource revision 8d0d3676e9fcView authoritative source

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.

On this page

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:

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.