Friction (hit repeatedly while dogfooding)
AI-agent PRs (e.g. #437) keep failing the Format and Clippy CI jobs on
the first push, even though the change is otherwise correct (Test/Playwright
green). Two compounding reasons:
- The Claude Code pre-commit hook only stamps provenance.
.claude/settings.json's
PreToolUse/pre-commit command is rivet stamp all --created-by ai-assisted
— it does not run cargo fmt --check or clippy. So an agent's commit
passes the local hook and only discovers fmt/clippy drift after pushing and
waiting on CI.
- The
pre-commit framework that does cover this isn't active in fresh
clones. .pre-commit-config.yaml has cargo-fmt (cargo fmt --all -- check) and cargo-clippy (cargo +stable clippy --all-targets -- -D warnings) — exactly the CI gates — but the git hooks are only installed
after pre-commit install, which an agent/contributor may never run.
Net: the cheapest, most common CI failure (rustfmt) has no fast local guard in
the default agent workflow.
Suggested fix
- Add a fast
cargo fmt --check step to the Claude/agent pre-commit hook
(it runs in ~1s, and Format is the single most common first-push failure).
Leave clippy/test out of the per-commit hook (too slow), but a fmt gate alone
would eliminate most red first-pushes.
- Optionally document a one-shot
pre-commit install --install-hooks (or a
cargo fmt --check && cargo clippy --all-targets -- -D warnings one-liner) in
AGENTS.md under a "before you push" heading, since docs/pre-commit.md exists
but isn't surfaced where agents look.
Note for triagers
cargo clippy ... | grep '^error' is a deceptive local check — CI runs clippy
with -D warnings, so a warning (e.g. doc_lazy_continuation) fails CI while
that grep reports clean. Worth calling out in contributor docs.
Found by an AI agent dogfooding rivet.
Friction (hit repeatedly while dogfooding)
AI-agent PRs (e.g. #437) keep failing the Format and Clippy CI jobs on
the first push, even though the change is otherwise correct (Test/Playwright
green). Two compounding reasons:
.claude/settings.json'sPreToolUse/pre-commit command is
rivet stamp all --created-by ai-assisted— it does not run
cargo fmt --checkor clippy. So an agent's commitpasses the local hook and only discovers fmt/clippy drift after pushing and
waiting on CI.
pre-commitframework that does cover this isn't active in freshclones.
.pre-commit-config.yamlhascargo-fmt(cargo fmt --all -- check) andcargo-clippy(cargo +stable clippy --all-targets -- -D warnings) — exactly the CI gates — but the git hooks are only installedafter
pre-commit install, which an agent/contributor may never run.Net: the cheapest, most common CI failure (rustfmt) has no fast local guard in
the default agent workflow.
Suggested fix
cargo fmt --checkstep to the Claude/agent pre-commit hook(it runs in ~1s, and Format is the single most common first-push failure).
Leave clippy/test out of the per-commit hook (too slow), but a fmt gate alone
would eliminate most red first-pushes.
pre-commit install --install-hooks(or acargo fmt --check && cargo clippy --all-targets -- -D warningsone-liner) inAGENTS.md under a "before you push" heading, since
docs/pre-commit.mdexistsbut isn't surfaced where agents look.
Note for triagers
cargo clippy ... | grep '^error'is a deceptive local check — CI runs clippywith
-D warnings, so a warning (e.g.doc_lazy_continuation) fails CI whilethat grep reports clean. Worth calling out in contributor docs.
Found by an AI agent dogfooding rivet.