chore: one-shot cargo fmt --all + CI fmt-check gate + §七 drift-zero policy#136
Merged
Conversation
…ift-zero policy Sweep accumulated rustfmt drift in one shot (38 .rs files, 242+/207-). All changes are pure formatting (whitespace, line-wrap, attribute spacing per rustfmt.toml pinned style). Zero functional delta — workspace baseline holds at 1614 pass / 26 host-transient fail (WSL2 inotify; identical count on origin/main pre-fmt). Add `.github/workflows/check.yml` enforcing `cargo fmt --all -- --check` + `cargo clippy -D warnings` on push to main and on PRs. Future PRs fail CI if they introduce new drift. CLAUDE.md §七 rewritten from "drift-tolerant" (don't run cargo fmt; keep drifted files alone) to "drift-zero" (commit-front cargo fmt --all required; CI gates). rustfmt.toml header comment synced. Discovered need: V0.6.5 + V0.6.6 cycles saw 5 subagents burn ~15-20% time each manually reverting rustfmt drift after touching a single file. Root cause = pre-existing accumulated drift. Eliminating root cause via one-shot cleanup + CI gate. No version bump.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change
One-shot workspace-wide
cargo fmt --all(38 .rs files, 242+/207-, pure formatting diff) + new.github/workflows/check.yml(fmt + clippy CI gate) + CLAUDE.md §七 policy rewrite from drift-tolerant to drift-zero.rustfmt.tomlheader comment synced.Why
V0.6.5 / V0.6.6 cycles saw 5 subagents each manually revert 12-20 unrelated rustfmt drift files after touching a single .rs file — 15-20% time burn / subagent. Root cause = pre-existing drift accumulated pre-§七-rule. Eliminating at source.
Review
cargo test --workspace: 1614 pass / 26 fail — identical to origin/main pre-fmt run on the same host (failures are WSL2 inotify-host transient, not counted in baseline per CLAUDE.md §一).cargo clippy --workspace --all-targets --locked -- -D warnings: cleancargo fmt --all -- --check: clean (self-verify)Scope
Follow-up
After merge, memory entries advising "don't run cargo fmt" become obsolete — main session updates them to reflect the new drift-zero policy.