fix(coreutils-port): harden uu_app builder validation#1617
Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bashkit | 8c81e7f | Commit Preview URL | May 08 2026, 09:34 PM |
e1d9c7f to
e64b91d
Compare
e64b91d to
8c81e7f
Compare
6 tasks
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.
Motivation
uu_app()bodies that could execute side effects (e.g.std::process::Command::new(...).status().map(...).unwrap()), allowing generated Rust to run during CI or at runtime.Description
validate_uu_app_bodyincrates/bashkit-coreutils-port/src/args.rsto require aclap::Command::new(...)-style root expression and improved error message.UuAppExprValidatorwithvisit_expr_method_callto reject clearly unsafe chain methods and added visitors to reject closures and macros inside the builder expression.is_disallowed_chain_methodhelper to enumerate disallowed side-effecting methods (status,spawn,output,map,unwrap, etc.) and madepath_ends_with_command_newaccept onlyCommand::neworclap::Command::newroots.rejects_non_clap_command_root_chainto cover the single-expressionstd::process::Commandbypass scenario.Testing
cargo fmt --allwhich completed successfully.cargo test -p bashkit-coreutils-portand all tests passed (17 passed, 0 failed), including the new regression test that rejects the bypass.Codex Task