Catch stale Rust compile drift before push

Add a repository-local pre-push gate that runs the locked Rust workspace build from the repo root, plus concise install and verification docs for maintainers.

Constraint: ROADMAP #694 requires a local installable hook artifact only; branch protection remains external.
Rejected: CI or branch-protection changes | outside the requested local pre-push gate scope.
Confidence: high
Scope-risk: narrow
Directive: Keep .github/hooks/pre-push and contributor docs synchronized if the Rust workspace build command changes.
Tested: bash -n .github/hooks/pre-push; SKIP_CLAW_PRE_PUSH_BUILD=1 .github/hooks/pre-push; git diff --check; python3 .github/scripts/check_doc_source_of_truth.py; cargo fmt --manifest-path rust/Cargo.toml --all -- --check; cargo build --manifest-path rust/Cargo.toml --workspace --locked; .github/hooks/pre-push
Not-tested: shellcheck and markdownlint unavailable in environment.
This commit is contained in:
Yeachan-Heo
2026-05-25 20:06:13 +00:00
parent 76c8d4801e
commit 920d5c6c3a
3 changed files with 25 additions and 4 deletions

View File

@@ -17,7 +17,8 @@ covered by the Claw Code 2.0 board.
- Hook: `.github/hooks/pre-push`
- Install command: `git config core.hooksPath .github/hooks`
- Gate: `cargo build --manifest-path rust/Cargo.toml --workspace`
- Gate: `cargo build --manifest-path rust/Cargo.toml --workspace --locked`
- Escape hatch: `SKIP_CLAW_PRE_PUSH_BUILD=1` prints an explicit skip message.
- Purpose: mirror the CI build job locally so stale field/variant references are
caught before push.
@@ -43,5 +44,5 @@ bash -n .github/hooks/pre-push
cargo fmt --manifest-path rust/Cargo.toml --all -- --check
cargo test --manifest-path rust/Cargo.toml -p claw-analog rag_response_ -- --nocapture
cargo test --manifest-path rust/Cargo.toml -p runtime startup_preflight -- --nocapture
cargo build --manifest-path rust/Cargo.toml --workspace
cargo build --manifest-path rust/Cargo.toml --workspace --locked
```