agents: add Rust positional arg count and local execution rules (#4412) Fixed-arity Rust CLI parsers used match guards and fixed-size array `try_from` conversions for positional argument counts, and per-mnemonic `--strategy=Rustc=local` overrides caused host `glibc` version mismatches on remote test runners. Require explicit length checks for fixed positional argument counts and `--spawn_strategy=local` when overriding remote execution locally.
diff --git a/.agents/rules/rust.md b/.agents/rules/rust.md index e105a6c..939086b 100644 --- a/.agents/rules/rust.md +++ b/.agents/rules/rust.md
@@ -46,6 +46,9 @@ (`bool`, enums, validated `PathBuf`, pre-compiled `Regex`) in `parse_args` rather than storing stringly-typed `String` fields or deferring validation to execution. +* **Positional argument counts**: Validate fixed positional argument counts with + an explicit length check (e.g., `if positional.len() != 3`) rather than + collection-length match guards or fixed-size array `try_from` conversions. * **`OsString` & `ExitCode`**: Keep CLI arguments and file paths as `OsString` and `PathBuf`; never round-trip `OsString -> String -> PathBuf` via `to_string_lossy()`. Return `std::process::ExitCode` from `main()` and
diff --git a/.agents/rules/testing.md b/.agents/rules/testing.md index a7fdba2..c141507 100644 --- a/.agents/rules/testing.md +++ b/.agents/rules/testing.md
@@ -35,6 +35,12 @@ * When building `//docs:docs` fails with exit code 2, treat it as a known Sphinx/Bazel flake and retry the build. +## Local vs. Remote Execution Consistency +* Do not pass `--strategy=Rustc=local` (or per-mnemonic local overrides for + compiled binaries) while leaving test runners or downstream build actions on + remote execution; host `glibc` mismatches cause `GLIBC_2.xx not found` on RBE + containers. Use `--spawn_strategy=local` when running locally. + ## Test Organization * **Domain Placement**: Place tests by the feature tested (e.g., `tests/bootstrap_impls/`), not by the fixture helper used (e.g.,