Guidance for AI coding agents working in this repository (FuelLabs/fuel-core).
Before claiming done, committing, or pushing a PR that touches Rust sources, agents must:
- Format with the same nightly rustfmt CI uses (not the pin in
rust-toolchain.toml). - Confirm the check is clean.
# Install once if missing
rustup toolchain install nightly-2025-09-28 --component rustfmt
# Apply + verify (matches `.github/workflows/ci.yml` `rustfmt` job)
cargo +nightly-2025-09-28 fmt --all
cargo +nightly-2025-09-28 fmt --all -- --checkKeep RUST_VERSION_FMT in sync with .github/workflows/ci.yml (env.RUST_VERSION_FMT, currently nightly-2025-09-28).
- Never run
cargo fmt/cargo fmt --allon the stable / 1.94.1 toolchain fromrust-toolchain.toml..rustfmt.tomluses nightly-only options (imports_layout,imports_granularity,normalize_comments,trailing_semicolon). Stable ignores them and can rewrite hundreds of files with compact import layout. - Prefer formatting the whole workspace with the CI nightly (
cargo +nightly-2025-09-28 fmt --all) so the PR matches CI. If you must format a subset, still use that nightly + this repo's.rustfmt.toml. - Also run
cargo clippy(stable pin) with-D warningson touched crates when practical; CI enforces warnings as errors.
| Step | Command |
|---|---|
| Setup | cargo fetch |
| Build | cargo build |
| Test | cargo test |
| Format (required) | cargo +nightly-2025-09-28 fmt --all then -- --check |
| Lint | cargo clippy -- -D warnings (scoped to changed crates is OK) |
| Local CI-ish | source ci_checks.sh |
See CONTEXT.md for Ready vs Health, Height Gap, and Max Sync Height Diff.