Contributing

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

Development Setup

  1. Clone the repository and build

    Clone the repository and ensure you have the required toolchain:

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

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

  2. Format before every commit

    Run cargo fmt --all with the default stable rustfmt configuration (see Code Formatting).

  3. Audit dependencies

    Run cargo deny check (see Security Auditing with cargo-deny).

  4. Run the tests

    Run the full test suite and the conformance profile (see Running Tests).

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.

Warning

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

Before you open a PRHow
Ensure all tests passcargo test --all
Ensure code is formattedcargo fmt --all
Ensure no clippy warningscargo clippy --all -- -D warnings
Ensure dependencies pass auditcargo deny check
Write clear commit messagesDescribe the change
Reference any related issuesIn 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.