You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bashkit's command dispatch ends with "command not found" for several common coreutils that aren't builtins yet. The list below is small enough to share one issue and an opportunistic batch-PR or two. Each util is a straightforward application of the existing args-codegen pipeline (cargo run -p bashkit-coreutils-port -- /tmp/uutils <util> <REV>) plus a VFS-backed body.
Acceptance criteria
For each util below:
crates/bashkit/src/builtins/generated/<util>_args.rs generated and committed.
pub mod <util>_args; added to crates/bashkit/src/builtins/generated/mod.rs.
New crates/bashkit/src/builtins/<util>.rs (or extension of an existing topical module — e.g. tee is fine in fileops.rs).
Registered in interpreter/mod.rs dispatch table and crates/bashkit/src/builtins/compgen.rs allowlist.
Spec tests in tests/spec_cases/bash/<util>.test.sh covering happy path, at least one negative case, and unknown-flag rejection (with ### bash_diff for the clap-vs-GNU exit-code difference).
every_builtin_handles_bogus_flag_cleanly in builtins/mod.rs includes the util.
specs/implementation-status.md table updated.
TM-INF-022: stderr remains Display-only; no {:?} in the new module (the existing static check enforces this).
coreutils-args-drift.yml picks up the new generated file automatically.
Per-util scope
tee — write stdin to one or more VFS paths and stdout; flags -a/--append, -i/--ignore-interrupts (no-op in virtual mode, document).
mktemp — VFS-backed temp-file creation returning the path; flags -d/--directory, -p DIR/--tmpdir, suffix/prefix template (XXXXXX); randomness via the existing rand workspace dep. -u/--dry-run returns the would-be path without creating; document any sandbox-bound divergence.
realpath — VFS canonicalization; flags -e/--canonicalize-existing, -m/--canonicalize-missing, --relative-to=, --relative-base=. Symlink-following stays disabled per the existing "Intentionally Unimplemented" entry in specs/implementation-status.md; surface the divergence in spec tests using ### bash_diff.
readlink — VFS read of symlink target; flags -f/--canonicalize, -e, -m. Same symlink stance as realpath.
truncate — VFS file truncation; flag -s SIZE with K/M/G suffixes. -r REF (size of reference file) supported.
stat — VFS file inspection; default GNU-style output; -c FORMAT token expansion at minimum for %n %s %a %y %F. Host-only fields (%u/%U/%g/%G) read from bashkit's username/hostname env per the existing convention. Document any unsupported tokens.
od — byte/char dump; modes -c, -x, -An, -w, -N. Reuse byte-rendering helpers from hextools.rs where alignment lets us.
shuf — random shuffle of stdin lines; flags -n NUM, -i LO-HI, -r/--repeat, -e (echo args). Use the rand workspace dep already present for bot-auth.
Out of scope
Permission ops (chmod, chown, chgrp) — semantics need the threat model first; separate issue.
df/du — disk.rs already covers the common surface; verify before duplicating.
shred — destructive semantics not VFS-shaped.
PR strategy
Suggested grouping (no obligation):
PR A: tee + mktemp + truncate (all small, all fileops-shaped).
PR B: realpath + readlink + stat (path/inspection cluster).
PR C: od + shuf.
Each PR runs the full pre-PR checklist and updates coreutils-args-drift.yml's implicit util list (no edit required — the workflow grep auto-discovers).
Background
bashkit's command dispatch ends with "command not found" for several common coreutils that aren't builtins yet. The list below is small enough to share one issue and an opportunistic batch-PR or two. Each util is a straightforward application of the existing args-codegen pipeline (
cargo run -p bashkit-coreutils-port -- /tmp/uutils <util> <REV>) plus a VFS-backed body.Acceptance criteria
For each util below:
crates/bashkit/src/builtins/generated/<util>_args.rsgenerated and committed.pub mod <util>_args;added tocrates/bashkit/src/builtins/generated/mod.rs.crates/bashkit/src/builtins/<util>.rs(or extension of an existing topical module — e.g.teeis fine infileops.rs).interpreter/mod.rsdispatch table andcrates/bashkit/src/builtins/compgen.rsallowlist.tests/spec_cases/bash/<util>.test.shcovering happy path, at least one negative case, and unknown-flag rejection (with### bash_difffor the clap-vs-GNU exit-code difference).every_builtin_handles_bogus_flag_cleanlyinbuiltins/mod.rsincludes the util.specs/implementation-status.mdtable updated.{:?}in the new module (the existing static check enforces this).coreutils-args-drift.ymlpicks up the new generated file automatically.Per-util scope
-a/--append,-i/--ignore-interrupts(no-op in virtual mode, document).-d/--directory,-p DIR/--tmpdir, suffix/prefix template (XXXXXX); randomness via the existingrandworkspace dep.-u/--dry-runreturns the would-be path without creating; document any sandbox-bound divergence.-e/--canonicalize-existing,-m/--canonicalize-missing,--relative-to=,--relative-base=. Symlink-following stays disabled per the existing "Intentionally Unimplemented" entry inspecs/implementation-status.md; surface the divergence in spec tests using### bash_diff.-f/--canonicalize,-e,-m. Same symlink stance as realpath.-s SIZEwith K/M/G suffixes.-r REF(size of reference file) supported.-c FORMATtoken expansion at minimum for%n %s %a %y %F. Host-only fields (%u/%U/%g/%G) read from bashkit's username/hostname env per the existing convention. Document any unsupported tokens.-c,-x,-An,-w,-N. Reuse byte-rendering helpers fromhextools.rswhere alignment lets us.-n NUM,-i LO-HI,-r/--repeat,-e(echo args). Use therandworkspace dep already present for bot-auth.Out of scope
chmod,chown,chgrp) — semantics need the threat model first; separate issue.df/du—disk.rsalready covers the common surface; verify before duplicating.shred— destructive semantics not VFS-shaped.PR strategy
Suggested grouping (no obligation):
tee+mktemp+truncate(all small, all fileops-shaped).realpath+readlink+stat(path/inspection cluster).od+shuf.Each PR runs the full pre-PR checklist and updates
coreutils-args-drift.yml's implicit util list (no edit required — the workflow grep auto-discovers).Related
specs/coreutils-args-port.mdspecs/implementation-status.md(intentionally-unimplemented list — symlinks)crates/bashkit/src/builtins/compgen.rs(registration list)