diff --git a/bin/pre-commit b/bin/pre-commit index 457d0b1..20c672d 100755 --- a/bin/pre-commit +++ b/bin/pre-commit @@ -27,10 +27,10 @@ done # 3. Rust checks if git diff --cached --name-only | grep -q '\.rs$'; then echo "→ Rust: cargo fmt check..." - cargo fmt -- --check || { echo "❌ Run 'cargo fmt' first"; exit 1; } + ( cd rust && cargo fmt --all -- --check ) || { echo "❌ Run 'cargo fmt --all' in rust/ first"; exit 1; } echo "→ Rust: cargo clippy..." - cargo clippy --workspace -- -D warnings || exit 1 + ( cd rust && cargo clippy --workspace -- -D warnings ) || exit 1 fi # 4. Python checks diff --git a/rust/crates/agentforge-long-horizon/src/lib.rs b/rust/crates/agentforge-long-horizon/src/lib.rs index 9ca3dfc..7bf54c1 100644 --- a/rust/crates/agentforge-long-horizon/src/lib.rs +++ b/rust/crates/agentforge-long-horizon/src/lib.rs @@ -6,7 +6,7 @@ //! ## Deep audit (2026-06-13): bottlenecks, logical errors, data races //! //! ### Data races / consistency -//! - Safe Rust + &mut self + [lints] forbid(unsafe_code) eliminates intra-process data races. +//! - Safe Rust + &mut self + `lints` forbid(unsafe_code) eliminates intra-process data races. //! - Cross-process races on shared ~/.agentforge/long_horizon/*.json remain possible (no flock). //! Mitigation (existing): atomic write via tmp+rename in checkpoints (reader never sees torn JSON). //! Added: force_persist_task + import_task use same atomic path.