---
name: no-cargo-fmt-in-spt-core
description: "Never run cargo fmt in spt-core — no rustfmt gate exists, the tree is not rustfmt-clean, and --all churns 251 files"
metadata: 
  node_type: memory
  type: feedback
  originSessionId: 671139b2-3bfb-4160-85e3-15e5e68fbe4a
  modified: 2026-07-27T08:02:43.714Z
---

Do NOT run `cargo fmt` (especially `--all`) in the spt-core / spt-bs-core worktrees.
Verified 2026-07-27: no `cargo fmt` or `rustfmt` step exists in `.github/workflows/`,
and there is no `rustfmt.toml` or `rust-toolchain.toml` — so nothing pins a formatter
version and nothing gates formatting. The tree is genuinely not rustfmt-clean.

**Why:** one reflexive `cargo fmt --all` rewrote 251 files (`crates/spt/src/cli.rs`
alone: ~601 lines of unrelated reformat, on top of ~50 lines of real change). It also
rewrote CRLF → LF, so `git diff --stat` overstates the damage and `diff` shows every
line changed — measure real churn with `diff -u --strip-trailing-cr`, not the stat.

**How to apply:** write new code in the surrounding style by hand; that is already the
project convention ("match surrounding code style"). If a formatting mistake lands
anyway, do NOT try to un-format selectively: save copies, `git checkout -- .` (never
`reset --hard` — see [[no-reset-hard-with-uncommitted-work]]), then re-apply the real
edits by anchored replacement. A python `sub(old, new)` helper that asserts
`count == 1` and preserves CRLF (`newline=""`, replace `\r\n`→`\n` before matching and
back after) restores an exact diff with zero formatting noise.

Related: [[gate-rig-mechanisms-not-remembered-steps]], [[field-truth-w1-progress]].
