chore(config): gate cargo test in pre-push on Rust changes

Add `cargo test --quiet` to the pre-push Rust block (sharing clippy's
target/ guard) so the suite runs automatically on every push touching
server/. Nothing ran the tests before — pre-push did only fmt/clippy/deny
and there is no CI — so a Rust regression could reach main unverified.

Document the resulting agent-spawn rule in team-patterns.md: don't have
implementation agents pre-run fmt/clippy/test pre-emptively, since the push
gate now enforces all three. The gate is authoritative; the lead patches any
fallout at push.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-08 10:39:55 +02:00
co-authored by Claude Opus 4.8
parent 71a0544622
commit c318cea6db
2 changed files with 32 additions and 1 deletions
+12 -1
View File
@@ -97,8 +97,19 @@ elif command -v cargo >/dev/null 2>&1 && [ -d "$REPO_ROOT/server" ]; then
else
echo "pre-push: clippy — OK"
fi
# cargo test — the ONLY automatic correctness gate: nothing else (no CI
# workflows exist) runs the suite, so without this a Rust regression
# reaches main unverified. Gated on server/ changes; shares the target/
# guard with clippy so a cold worktree isn't forced into a full build.
echo "pre-push: checking Rust (cargo test)..."
if ! (cd "$REPO_ROOT/server" && cargo test --quiet 2>&1); then
ERRORS=$((ERRORS + 1))
else
echo "pre-push: cargo test — OK"
fi
else
echo "pre-push: skipping clippy (no target/ — run 'cargo build' once to enable)"
echo "pre-push: skipping clippy + test (no target/ — run 'cargo build' once to enable)"
fi
# --- Rust dependency audit (cargo deny) — requires deny.toml config ---