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
+20
View File
@@ -31,3 +31,23 @@ When leading a team (workshop, batch, or any multi-agent session):
- If an agent has not sent a message in ~20 minutes, ping them for a status update.
- **Bottleneck detection:** if other agents are idle and waiting on one agent's output, that agent's silence is a red flag — check on them immediately, do not wait for the next natural message.
- When checking on a stuck agent, offer to reassign the task or pull in another agent to help.
## Agent verification — don't duplicate the push gate
The pre-push hook (`.config/hooks/pre-push`) is the source of truth for Rust
verification and **runs on every push the lead makes** when `server/` changed:
`cargo fmt --check`, `cargo clippy --all-targets -- -D warnings`, and `cargo test`
(plus `cargo deny`, ruff, JSON validation, systems.db stamp). There is no CI (no
`.gitea`/`.github`/`.forgejo` workflows) — the push gate is the only automatic
verification, so it is deliberately comprehensive.
Therefore, when spawning implementation agents, do **not** tell them to run
`cargo fmt`, `cargo clippy`, or `cargo test` pre-emptively — the push gate enforces
all three, so it is pure duplication. Worse, an agent running a *weaker* check (e.g.
plain `cargo clippy` without `-D warnings`) reports a false "clean". Let agents write
code; the gate is authoritative.
On a gate failure at push: fmt auto-fixes (`cargo fmt`); clippy is a quick lead patch;
a `cargo test` failure is a real regression — fix it, or SendMessage the still-alive
agent to fix it in-context. Net: agents verify nothing the gate already covers, and the
lead lets the gate catch fallout on push.
+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 ---