refactor(builtins): port tee/mktemp/realpath/stat/od to codegen args#1594
Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bashkit | 8a2348e | Commit Preview URL Branch Preview URL |
May 07 2026, 08:41 PM |
…1532) Generates *_args.rs from uutils/coreutils' uu_app() definitions for the five remaining gap-fill utilities, replacing handwritten flag parsers with the generated clap surface. Each builtin still implements the body locally against the bashkit VFS. Codegen extensions: bashkit-coreutils-port now resolves `fn uu_app` from sibling .rs files (tee splits it into cli.rs) and inlines newtype value-parser structs together with their impl blocks (mktemp's OptionalPathBufParser, realpath's NonEmptyOsStringParser). Spec coverage: new mktemp.test.sh and od.test.sh; tee/stat/path tests gain unknown-flag and `### bash_diff` clap-vs-GNU exit-code cases. The bogus-flag sweep adds tee/mktemp/readlink, and specs/implementation-status.md records the new test counts.
b143af9 to
8a2348e
Compare
chaliy
added a commit
that referenced
this pull request
May 17, 2026
## Release v0.6.0 Bumps workspace version `0.5.0 → 0.6.0`, regenerates `Cargo.lock`, syncs `bashkit-cli` path-dep pin, `crates/bashkit-js/package.json` + `package-lock.json`, and adds the v0.6.0 entry to `CHANGELOG.md`. ### Highlights - **Continue coreutils adoption experiment** — Extends codegen beyond `uu_app()` args to vendor whole upstream uutils modules with a manifest and drift-detection CI. `tee`, `mktemp`, `realpath`, `stat`, and `od` now flow through codegen; `printf` runs on a vendored copy of uucore's format implementation; and `env` is ported through a virtual-env shim (TM-INF-024) (#1592, #1593, #1594). - **MCP server mode removed from CLI** — `bashkit mcp` and its CLI transport are gone; embed bashkit via the library bindings instead (breaking — see below). - **Security hardening across the sandbox** — Fail-closed fixes across realfs, snapshot/restore, sqlite (`VACUUM` rejected, row caps, engine cache invalidation), network (SSRF precheck fails closed, IPv4-mapped IPv6 normalization), jq (`halt` replaced; fancy-regex + file-binding caps), and ssh (sftp `ls` escaping, try `none`-auth first). The final 6 OPEN threat-model entries are now mitigated (#1568). ### Breaking Changes - **CLI MCP server mode removed**: the `bashkit mcp` subcommand and bundled MCP server transport are gone. Migrate by embedding bashkit via the library bindings (`bashkit` crate, `@everruns/bashkit` on npm, `bashkit` on PyPI) and exposing tools through your own MCP server. ### Publish-readiness report - **Manifest version sync** — `Cargo.toml`, `crates/bashkit-cli/Cargo.toml` (path-dep pin), `crates/bashkit-js/package.json`, `crates/bashkit-js/package-lock.json` (top-level + `packages.""`), and `Cargo.lock` all read `0.6.0`. - **Registry freshness** — `cargo search bashkit` / `cargo search bashkit-cli` / `npm view @everruns/bashkit version` / `pip index versions bashkit` all return `0.5.0`; `0.6.0` is the next version on every registry. - **`cargo fmt --check`** — clean. - **`cargo clippy --all-targets --all-features -- -D warnings`** — clean. - **`cargo test --workspace`** — passes (workspace + doctests; `CARGO_PROFILE_*_DEBUG=0` set locally so test binaries fit in the runner's disk). - **`cargo publish --dry-run -p bashkit --allow-dirty`** — passes after the same `monty`/python-feature strip that `.github/workflows/publish.yml` performs at publish time (matches the existing CI flow). - **`cargo publish --dry-run -p bashkit-cli --allow-dirty`** — fails locally with `failed to select a version for the requirement bashkit = "^0.6.0"` because `bashkit 0.6.0` isn't on crates.io yet. This is the expected order — `publish-bashkit` runs first in `publish.yml`, then `publish-bashkit-cli` resolves the new version. No action needed. - **PyPI / npm packaging** — no packaging-touching changes in this release, so the `maturin build` / `napi build` smoke tests were skipped per `specs/release-process.md` step 5. ### Post-merge Once merged, `release.yml` will tag `v0.6.0`, publish a GitHub Release from the changelog entry, and dispatch `publish.yml`, `publish-python.yml`, `publish-js.yml`, and `cli-binaries.yml`. I'll watch the workflows and verify all four targets (crates.io, PyPI, npm, Homebrew) report `0.6.0` before declaring the release shipped. **Full Changelog**: v0.5.0...v0.6.0
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.
Summary
<util>_args.rsfrom uutils'uu_app()for the five remaining gap-fill utilities (tee,mktemp,realpath,stat,od), replacing handwritten flag parsers with the codegen-produced clap surface. Each builtin still implements the body locally against the bashkit VFS.bashkit-coreutils-portto (a) resolvefn uu_appfrom sibling.rsfiles (needed for tee, which splits intocli.rs) and (b) inline newtype value-parser structs along with theirimplblocks (mktemp'sOptionalPathBufParser, realpath'sNonEmptyOsStringParser).### bash_diffannotations for the clap-vs-GNU exit-code differences: newmktemp.test.shandod.test.sh;tee/stat/pathtests gain unknown-flag and missing-value cases; bogus-flag sweep addstee/mktemp/readlink;specs/implementation-status.mdrecords the new test counts.Why
Closes the codegen-modernization ask in #1532. All eight gap-fill utilities (
tee,mktemp,realpath,readlink,truncate,stat,od,shuf) are now driven by the uutils-derived clap surface, so flag-signature drift is auto-detected bycoreutils-args-drift.ymlrather than rotting in handwritten parsers.Test plan
cargo build -p bashkitcargo fmt --checkcargo clippy --all-targets --all-features -- -D warningscargo test -p bashkit --lib— 2230 passedbash_spec_tests) — 2052+ pass; new### bash_diffcases cover unknown-flag rejection and-cmissing-valueevery_builtin_handles_bogus_flag_cleanlyincludes the new portsgenerated_args_headers_match_pinned_uutils_revisionclean (all generated files atuutils@39364b6)every_generated_parser_emits_env_defaults_tableclean (regenerated against TM-INF-024 surface)The pre-existing
threat_jq_moderate_nesting_worksfailure onorigin/mainis unrelated to this change.Closes #1532
Generated by Claude Code