docs(agents): "Before You Push (Rust)" guidance + REQ-202 (minimal build) — issues #438, #456#475
Merged
Merged
Conversation
… REQ-202 (minimal build) Addresses issue #438 (AI commits pass locally, fail CI Format/Clippy) via its own second suggestion: surface the exact CI gates where agents look. The git pre-commit hook (scripts/install-hooks.sh) already runs `cargo fmt --all -- check` on staged .rs since #438 was filed, but it requires manual install and does not cover clippy. The new AGENTS.md "Before You Push (Rust)" section gives the verbatim `cargo fmt --all -- --check` + `cargo clippy --all-targets -- -D warnings` one-liners and documents the three traps that bite agents (grep '^error' misses -D warnings; -p <crate> skips --all-targets test lints; the commit-msg hook rejects `Word:` body lines). Also files REQ-202 (draft) from issue #456: rivet-cli has no minimal build — `default = []` and axum/rmcp/lsp-server are unconditional deps, so every from-source build compiles the full serve+MCP+LSP stack even for the validate/list hot path. Proposed additive fix keeps features in `default` so the published binary is byte-for-byte unchanged; the feature set is a maintainer call, hence draft. Note: a stronger fix for #438 — a .claude/settings.json PostToolUse hook that auto-runs `cargo fmt --all` on every .rs edit — was attempted but is gated as self-modification of agent config and needs explicit maintainer authorization. Confirmed with: rivet validate PASS (257 warnings, 0 errors). Refs: REQ-202, REQ-007
📐 Rivet artifact delta
Graphgraph LR
REQ_202["REQ-202"]:::added
classDef added fill:#d4edda,stroke:#28a745,color:#155724
classDef removed fill:#f8d7da,stroke:#dc3545,color:#721c24
classDef modified fill:#fff3cd,stroke:#ffc107,color:#856404
classDef overflow fill:#e2e3e5,stroke:#6c757d,color:#495057,stroke-dasharray: 3 3
Added
Posted by |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…GENTS.md keep-both Mechanical conflict resolution (EOF REQ-202 append + both AGENTS.md sections). Refs: REQ-202
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.
From the hourly dogfooding + issue-triage loop. Two AI-agent friction reports, triaged and acted on.
#438 — fmt/clippy not guarded in the default agent workflow
Assessment: valid, with one nuance. The report names the
.claude/settings.jsonhook (provenance stamp only) and thepre-commitframework (.pre-commit-config.yaml, not active in fresh clones). What it missed:scripts/install-hooks.shnow installs a gitpre-committhat runscargo fmt --all -- --checkon staged.rs— so the fmt gap is closed if you install hooks. The residual, real gap: the default Claude Code workflow has no fast fmt/clippy guard unless hooks are manually installed, and clippy is never checked per-commit.Fix (this PR): #438's own second suggestion — surface the exact CI gates in
AGENTS.mdunder a "Before You Push (Rust)" heading, with the verbatim one-liners and the three traps that actually bite agents (thegrep '^error'blind spot vs-D warnings;-p <crate>skipping--all-targetstest lints; the commit-msg hook rejectingWord:body lines).#456 — no minimal
--no-default-featuresbuildAssessment: valid (verified against
rivet-cli/Cargo.toml).[features]isdefault = [];axum/tower-http/notify(serve),lsp-server/lsp-types(LSP) andrmcp(full MCP server) are unconditional deps, so every from-source build compiles the entire web/MCP/LSP tree even for the validate/list hot path. rivet-core already gates its heavy deps; the coupling is rivet-cli-specific.Action (this PR): filed REQ-202 (draft) capturing the additive fix —
serve/mcp/lspcargo features kept indefaultso the published binary is byte-for-byte unchanged, enablingcargo build -p rivet-cli --no-default-featuresfor hooks/CI/dogfooding. The#[cfg]gating across the command dispatch is the real work and the default-feature set is a maintainer call, so it's filed draft rather than implemented here.Verification
rivet validatePASS (257 warnings, 0 errors). Docs + draft-artifact only; norivet-core/srcorrivet-cli/srccode change.🤖 Generated with Claude Code