Contributing

Guidelines for contributing to the MIND compiler, runtime, and toolchain.

Development Setup

Clone the repository and ensure you have the required toolchain:

git clone https://github.com/cputer/mind.git
cd mind
rustup update stable
cargo build --all

The project requires stable Rust. Nightly features are not used.

Code Formatting

All code must be formatted using the default stable rustfmt configuration. Run formatting before committing:

cargo fmt --all

The project uses only stable rustfmt options. Deprecated or nightly-only options like wrap_comments are not used. The default rustfmt.toml configuration (if present) contains only stable options compatible with the current Rust stable toolchain.

CI will fail if code is not properly formatted. Always run cargo fmt --all before pushing.

Security Auditing with cargo-deny

The project uses cargo-deny to audit dependencies for security vulnerabilities and license compliance:

cargo deny check

Handling CVSS v4 Advisories

Some security advisories use CVSS v4 scoring, which older versions of cargo-deny do not fully support. If you encounter errors like:

error: advisory uses unsupported CVSS v4 format

There are two approaches to resolve this:

  • Update cargo-deny to a version that supports CVSS v4 (0.14.3 or later)
  • Use the sanitize script if available in the repository, which preprocesses the advisory database to remove unsupported CVSS v4 entries

Check the repository's scripts/ directory or CI configuration for the current recommended approach.

Running Tests

Run the full test suite before submitting changes:

cargo test --all

For conformance testing against the specification:

cargo run --bin mindc -- conformance --profile cpu

Pull Request Guidelines

  • Ensure all tests pass: cargo test --all
  • Ensure code is formatted: cargo fmt --all
  • Ensure no clippy warnings: cargo clippy --all -- -D warnings
  • Ensure dependencies pass audit: cargo deny check
  • Write clear commit messages describing the change
  • Reference any related issues in the PR description

Project Structure

The MIND ecosystem spans multiple repositories:

Getting Help

If you have questions about contributing, open a discussion on the GitHub Discussions page or check existing issues for guidance.