Skip to content

docs(agents): "Before You Push (Rust)" guidance + REQ-202 (minimal build) — issues #438, #456#475

Merged
avrabe merged 2 commits into
mainfrom
chore/req-202-minimal-build-and-push-docs
Jun 5, 2026
Merged

docs(agents): "Before You Push (Rust)" guidance + REQ-202 (minimal build) — issues #438, #456#475
avrabe merged 2 commits into
mainfrom
chore/req-202-minimal-build-and-push-docs

Conversation

@avrabe
Copy link
Copy Markdown
Contributor

@avrabe avrabe commented Jun 5, 2026

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.json hook (provenance stamp only) and the pre-commit framework (.pre-commit-config.yaml, not active in fresh clones). What it missed: scripts/install-hooks.sh now installs a git pre-commit that runs cargo fmt --all -- --check on 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.md under a "Before You Push (Rust)" heading, with the verbatim one-liners and the three traps that actually bite agents (the grep '^error' blind spot vs -D warnings; -p <crate> skipping --all-targets test lints; the commit-msg hook rejecting Word: body lines).

A stronger fix — a .claude/settings.json PostToolUse hook that auto-runs cargo fmt --all on every .rs edit (making fmt drift impossible, not just documented) — was attempted but is gated as self-modification of agent config and needs maintainer authorization. Flagged on the issue.

#456 — no minimal --no-default-features build

Assessment: valid (verified against rivet-cli/Cargo.toml). [features] is default = []; axum/tower-http/notify (serve), lsp-server/lsp-types (LSP) and rmcp (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/lsp cargo features kept in default so the published binary is byte-for-byte unchanged, enabling cargo build -p rivet-cli --no-default-features for 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 validate PASS (257 warnings, 0 errors). Docs + draft-artifact only; no rivet-core/src or rivet-cli/src code change.

🤖 Generated with Claude Code

… 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
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 5, 2026

📐 Rivet artifact delta

Change Count
Added 1
Removed 0
Modified 0
Downstream impacted (depth ≤ 5) 0

Graph

graph 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
Loading
Added
  • REQ-202

📎 Full HTML dashboard attached as workflow artifact rivet-delta-pr-475download from the workflow run.

Posted by rivet-delta workflow. The graph shows only changed artifacts; open the HTML dashboard (above) for full context.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 5, 2026

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
@avrabe avrabe merged commit 531f4f3 into main Jun 5, 2026
18 of 19 checks passed
@avrabe avrabe deleted the chore/req-202-minimal-build-and-push-docs branch June 5, 2026 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant