# WinuxCmd 2.0 Migration Guide (1.x → 2.0.0) > **Draft at the 2.0 freeze (2026-11-14, `origin/main` = f0cf6b17).** Every > claim below is tied to a gate record or an issue. Re-verify the numbers at > the release commit; the tag may include wiring waves that landed after this > snapshot. > > **中文摘要**:2.0 把命令实现从 C++ 主体机械替换为 **rust2 库形态** > (显式注入 IO、无进程全局状态、返回状态码),命令集、命令名、 > `--help` 品牌文案、multicall/edition 机制、WPM 都**不变**。变化分三类: > ① 1.x 的私有扩展(`echo -u/-r`、`fmt -m/-P/-x/-X/-T`、`fold -c`、 > `numfmt --unit-separator/-M/-l` 等)按 GNU 退役;② 1.x 与 GNU 不一致 > 的行为被修正(详见逐命令表);③ 尚未接线的命令在 2.0.0 里**行为不变**, > 它们的 GNU 差异是 1.x 遗留 bug,按 issue 跟踪。遇到新差异请按 §8 报告。 ## 0. How to read this guide - **1.x** means WinuxCmd 1.2.1 (the last 1.x release) as recorded by the three-way gate (`r=c` column: new-vs-old exe rc + stdout). - **2.0.0** means the release this guide ships with. The per-command table distinguishes three states: - **wired** — the product path is rust2; differences below are verified. - **ready** — the Rust library is on main and the differential gate is green, but the product still dispatches to the 1.x C++ body; there is no user-visible 2.0 change *yet*. - **1.x** — still the 1.x implementation; 2.0.0 does not change it. - Evidence abbreviations: **GR** = `rust2/GATE-REPORT.md` (the wave section that measured the rows), **INV** = `DOCS/2.0-inventory.tsv`, **GH** = a GitHub issue number. **Data sources and one gap.** The gate ledger (`target/gate/ledger.tsv`, gitignored) is the primary `r=c` record; the committed narrative is GR. The oracle-audit board (`DOCS/oracle-audit/`) is **not on `origin/main`** — it is held in the `wc-oracle` lane's local worktree — so this guide uses the 19 `compat-gap` issues **#1639–#1657** (plus #1670/#1672/#1675) as the audited-difference source. At release, cross-check the board and replace the issue anchors with its line anchors where they differ. ## 1. The short version 1. **Command set, names, options surface, help text, editions, WPM: unchanged.** 2.0 replaces *implementations*, not the interface. `winuxcmd ` and a multicall entry link resolve exactly as in 1.x. 2. **2.0 is GNU-truer where 1.x had invented behavior.** Private options retire (§3); recorded 1.x deviations are corrected (§4, §5). 3. **A wired command never falls back to C++.** There is no dual track: if the Rust library is not built, the command is absent from that build (the CMake `WINUXCMD_ENABLE_RUST2` contract). Official builds ship Rust. 4. **Windows platform subsets remain.** NTFS has no POSIX mode bits or numeric uid/gid; ownership changes need OS rights; symlink creation needs Developer Mode or elevation; SELinux does not exist. These are documented subsets, not 2.0 regressions (§6). 5. **Scripts that depended on a retired 1.x extension must change**; scripts that used GNU syntax get more GNU-faithful output, not less. ## 2. What a 2.0 binary is ``` winuxcmd.exe (one image, one CRT) ├── C++ front end registration metadata, dispatcher, option policy, │ help/version interception, wpm, retained faces ├── rust2_bridge the only C++ that touches the ABI ├── winuxcmd_ffi C ABI v2: winuxcmd_run / winuxcmd_run_stream └── winux-cmds library-form commands (Io, Ctx, CmdResult) └── winux-core Ctx/EnvSource/HostServices/path/regex seam ``` - **Library form**: `pub fn _cmd(args: &[OsString], io: &mut Io, ctx: &Ctx) -> CmdResult`. No command calls `exit()`, touches process stdio, reads the process env, or keeps process-global mutable state. - **Injected IO**: the host passes bytes in and receives byte buffers out; a pull callback (`winuxcmd_run_stream`) provides streaming stdin. Rust never opens a CRT fd or a console handle. - **Multicall**: dispatch is by `argv[0]`; entry links are real hardlinks to `winuxcmd.exe` (never launchers). Editions only decide which entry links are materialized. - **Editions**: `default` and `full` are the same source; `full` adds entry links for the shell-builtin shadow names (`[`, `env`, `false`, `kill`, `test`, `time`, `true`) and carries the `-full` asset suffix. The default edition is the wpm-indexed one. - **I18N**: runtime messages carry stable keys and English fallbacks in source; translations arrive through the host (`WINUX_LANG`) from the separately published catalog. Untranslated builds are English-only. - **Retained C++ faces**: `grep -P` (PCRE2; decision doc `DOCS/2.0-regex-engine-decision.md` §6), the dispatcher/registration shell, WPM, and the `!` named-pipe bridge. A split-engine command routes its non-retained face to Rust and the retained face to C++ (grep does this per invocation; `egrep`/`fgrep` always route to Rust). ## 3. Retired 1.x extensions All of these were WinuxCmd-only spellings. GNU rejects them (usually `invalid option`, exit 1) or treats them as data. The 2.0 rule is: **follow GNU, and do not let the dispatcher reject what GNU would accept as data.** | 1.x extension | GNU basis | 2.0 behavior | Anchors | |---|---|---|---| | `echo -u`, `echo --upper` | coreutils `echo.c` scans only `-n`, `-e`, `-E` as leading options; `echo -u hello` prints `-u hello` | prints `-u hello` as data (rc 0). Help/man still mentions the spelling for continuity; as a flag it can never reject argv | GR wave6; `src/commands/echo.cpp` | | `echo -r N`, `echo --repeat N` | `echo.c` has no repeat concept | `-r`/`--repeat` are data; the dispatcher no longer int-validates the following token (`echo -r x` → `-r x`, rc 0) | #1621; GR wave6 | | `fold -c`, `fold --characters` | POSIX/GNU fold options are `-b/--bytes`, `-s/--spaces`, `-w/--width` only | `invalid option -- 'c'`, rc 1 | GR wave3a | | `fmt -m`, `fmt --preserve-headers` | GNU fmt has no mail-header mode | `invalid option`, rc 1 | GR wave3a | | `fmt -P`, `fmt --skip-prefix` | not a GNU fmt option | `invalid option`, rc 1 | GR wave3a | | `fmt -x`, `fmt --exact-prefix` | not a GNU fmt option | `invalid option`, rc 1 | GR wave3a | | `fmt -X`, `fmt --exact-skip-prefix` (the "awk-like `-X`" approximation) | not a GNU fmt option; GNU only has `-c/-p/-s/-t/-u/-w/-g` | `invalid option`, rc 1 | GR wave3a | | `fmt -T`, `fmt --tab-width` | GNU fmt's tab width is a compile-time 8; no option | `invalid option`, rc 1 | GR wave3a | | `numfmt --unit-separator` | coreutils 9.4 `numfmt.c` option table has no such long option | `unrecognized option`, rc 1 | GR wave3b; `numfmt.rs` module doc | | `numfmt -M`, `numfmt -l` | no such shorts in GNU numfmt 9.4 | `invalid option`, rc 1 | GR wave3b | | `numfmt` input suffixes `Z/Y/R/Q` | GNU 9.4 rejects these suffix letters (the 1.x parser accepted them) | rejected like GNU 9.4; `K/M/G/T/P/E` and `KiB`-family stay | GR wave3b | | `cp` operand wildcard expansion (`cp '*.txt' dest`) | coreutils `cp.c` receives shell-expanded operands; the program itself treats every operand literally | literal operand: `cp: cannot stat '*.txt': No such file or directory`, rc 1 (probed WSL 9.4). The 1.x body glob-expanded inside the applet | cp wire; `rust2/crates/winux-cmds/src/cp.rs` module doc | | `cp --update=none-fail` | not a `--update` argmatch value in coreutils 9.4 (`none`, `none-fail` arrives in 9.7) | `invalid argument 'none-fail' for '--update'` + valid-argument list, rc 1 | cp wire; `cp/opts.rs` | | `cp --strip-trailing-slashes /` copying | GNU 9.4 stats the operand as spelled: a trailing separator on a regular file is ENOTDIR even with the option | `cp: cannot stat 'file/': Not a directory`, rc 1 | cp wire; `tests/unit/cp` re-pin | | `od -w N` separated form (`od -w 4`) | coreutils `od.c` declares `w::` — an OPTIONAL argument that only counts when ATTACHED; `od -w 4` means width 32 plus the FILE operand `4` | `od -w 4` reports `od: 4: No such file or directory`, rc 1; use `-w4` / `--width=4` | GR wave-W2; `tests/unit/od/od_unit_test.cpp` | **Retained on purpose (not GNU, but kept for compatibility):** | spelling | why it stays | |---|---| | `realpath -E` | WinuxCmd extension (`all components but the last must exist`); a documented superset. GNU has no `-E`. | | `rev -0` | Matches the oracle: util-linux 2.39.3 accepts `-0` (undocumented). | | `hostname -i/-I/-s` | Matches the Debian hostname 3.23 oracle (net-tools spellings), not coreutils. | **Do not port forward:** a retirement applies to the *option*, not to the data. Rewrite scripts as: ```diff - echo -r 3 "---" + for i in 1 2 3; do echo "---"; done - echo --upper ok + echo ok # uppercase with tr if you actually need it - fmt -X -w 72 file + fmt -w 72 file ``` ## 4. Per-command 1.x → 2.0 differences Every one of the 176 applets appears below. "wired" rows are verified by the three-way gate (`rust2/GATE-REPORT.md`); `GR` means the wave section named in the inventory anchor. "ready" means the Rust library is green but the product path is still 1.x at this snapshot. "1.x" means unchanged in 2.0.0. | command | 1.x | 2.0.0 | evidence | |---|---|---|---| | `arch` | 1.x value model | 2.0 target: same value model, GNU rc errors; **not wired** | GR wave6 | | `b2sum` | `-t`/`-b` handling differed | `-t`/`-b` last-wins; GNU missing-file wording; streaming stdin | GR wave2b | | `base32` | — | GNU-exact; same rows as base64 | GR wave2b | | `base64` | 1.x C++ base64 | GNU-exact encode/decode; streaming ABI (v2) validated | GR wave2b | | `basename` | — | no recorded change; GNU-exact `-s` (any value implies multiple operands) | GR wave1 | | `basenc` | 1.x C++ implementation | unchanged in 2.0.0 (wave 2) | INV | | `cal` | 1.x C++ implementation | unchanged in 2.0.0 (wave 2) | INV | | `cat` | 1.x C++ implementation | unchanged in 2.0.0 (wave 3) | INV | | `chattr` | 1.x C++ implementation | unchanged in 2.0.0 (wave 2) | INV | | `chcon` | 1.x SELinux stub | 2.0 target: capability probe, GNU non-SELinux shapes; **not wired** | GR wave5 | | `chgrp` | 1.x C++ chgrp | 2.0 target: `--preserve-root` failsafe, numeric-group no-op; **not wired** | GR wave5 | | `chmod` | 1.x C++ chmod | 2.0 target: full GNU modechange grammar, GNU `-v/-c`, `-R` fts preorder + root refusal; **not wired at this snapshot** | GR wave1 deepening; #1488 | | `chown` | 1.x C++ chown | 2.0 target: real ownership via `SetNamedSecurityInfoW`, `--from`/`--reference`, GNU wording; **not wired** | GR wave1 deepening | | `chroot` | 1.x C++ implementation | unchanged in 2.0.0 (wave 3) | INV | | `cksum` | 1.x cksum | 2.0 target: GNU byte-exact (46 rows); **not wired** | GR wave5 | | `clear` | 1.x C++ implementation | unchanged in 2.0.0 (wave 2) | INV | | `cmp` | 1.x C++ implementation | unchanged in 2.0.0 (wave 3) | INV | | `col` | 1.x C++ implementation | unchanged in 2.0.0 (wave 3) | INV | | `column` | 1.x C++ implementation | unchanged in 2.0.0 (wave 3) | INV | | `comm` | 1.x C++ implementation | unchanged in 2.0.0 (wave 3) | INV | | `cp` | 1.x C++ cp | **wired on rust2** (2.0.0); #1647 symlink/LX sources, #1648 `-i` decline rc, #1693 `-r -H`, #1700 dangling/self-through-link; wildcard operands and `--update=none-fail` retire to the GNU contract | GH; `cp.rs` | | `cpio` | 1.x C++ implementation | unchanged in 2.0.0 (wave 4) | INV | | `csplit` | 1.x csplit | 2.0 target: GNU segment flush rules; **not wired** | GR wave4b | | `cut` | 1.x cut | GNU strtol list + diagnostics, unconditional record terminator, one-list rule, byte-mode `--output-delimiter` at each range start, `-z -d ''` one-record shape; streaming stdin | GR wave-W2 | | `cygpath` | 1.x C++ implementation | unchanged in 2.0.0 (wave 4) | INV | | `d2u` | 1.x C++ implementation | unchanged in 2.0.0 (wave 4) | INV | | `date` | 1.x date | 2.0 target: GNU 9.4 help/version text, `-s` refusal on Windows; **not wired** | GR wave5 | | `dd` | 1.x C++ implementation | unchanged in 2.0.0 (wave 3) | INV | | `df` | 1.x df; `--output` subset | 2.0 target: 12-column `--output`, `-t/-x`, `--total`, `-i`, `-B`; inode 0 on NTFS; **not wired**; #1657 open | GR wave1; GH | | `diff` | 1.x C++ implementation | unchanged in 2.0.0 (wave 3) | INV | | `diff3` | 1.x C++ implementation | unchanged in 2.0.0 (wave 3) | INV | | `dir` | 1.x C++ implementation | unchanged in 2.0.0 (wave 2) | INV | | `dircolors` | 1.x C++ implementation | unchanged in 2.0.0 (wave 3) | INV | | `dirname` | — | no recorded change | GR wave1 | | `dos2unix` | 1.x C++ implementation | unchanged in 2.0.0 (wave 4) | INV | | `du` | 1.x du; `--time` ignored `TZ`; `-lb ` printed the tree once; `--block-size=bogus` said "invalid -B argument" | 2.0: Rust `du.rs` wired (wave-W3). `--time` honors `TZ` (GNU, fixes a 1.x deviation); `-l` re-counts repeated operands like GNU; the diagnostic names `--block-size`; `-L/-H` operand liveness kept from #1656 (dangling link reports without errno text); followed-directory identity dedupe from #1670/PR #1730 (`-L dirlink dir` prints once under the first spelling, LX links resolve to their target, `-P` keeps the link and the directory distinct, `-l` bypasses the dedupe) | GR wave-W3; #1656; #1670 | | `echo` | `-u/--upper`, `-r/--repeat` extensions | both are data (§3); GNU `echo.c` scan | GR wave6; #1621 | | `env` | 1.x C++ implementation | unchanged in 2.0.0 (wave 3) | INV | | `envsubst` | 1.x C++ implementation | unchanged in 2.0.0 (wave 4) | INV | | `expand` | rejected `-4,8` lists | accepted like GNU | GR wave3b follow-up | | `expr` | 1.x C++ implementation | unchanged in 2.0.0 (wave 2) | INV | | `factor` | 1.x factor | 2.0 target: exact 0..u64::MAX; rho perf boundary documented; **not wired** | GR wave4b/wave6 | | `false` | pilot returned 0 for `false --help` | sole-argument rule; `false --help` keeps rc 1 | GR wave1 refresh | | `file` | 1.x C++ implementation | unchanged in 2.0.0 (wave 2) | INV | | `find` | 1.x C++ implementation | unchanged at this snapshot; library/wire in flight | #1634 | | `fmt` | accepted `-m/-P/-x/-X/-T` | retired (§3); cost-DP formatter | GR wave3a | | `fold` | accepted `-c` | `-c` retired (§3); byte/column algorithm | GR wave3a | | `free` | 1.x C++ implementation | unchanged in 2.0.0 (wave 2) | INV | | `getconf` | Windows table | GNU-shaped errors + Windows value table; glibc help text | GR wave2a | | `getfacl` | 1.x C++ implementation | unchanged in 2.0.0 (wave 2) | INV | | `getopt` | 1.x C++ implementation | unchanged in 2.0.0 (wave 2) | INV | | `grep` | 1.x C++ implementation | unchanged at this snapshot; library/wire in flight | #1660 | | `groups` | 1.x value model | 2.0 target: `NetUserGetGroups` model; **not wired** | GR wave4b/wave6 | | `head` | 1.x head | 2.0 target: GNU count grammar (`+K/-K`, `-n -0`, suffixes); **not wired** | GR wave4a | | `hexdump` | 1.x C++ implementation | unchanged in 2.0.0 (wave 3) | INV | | `hmac256` | 1.x C++ implementation | unchanged in 2.0.0 (wave 4) | INV | | `hostid` | rejected `-h` | `-h` accepted; value model | GR wave3b | | `hostname` | `-F` advertised but rejected by the parser; net-tools spellings | `-F` reads the file (1.x bug #1526); net-tools operand/value model retained | GR wave2a; #1526 | | `id` | Windows value model | uid `0x30000+RID` model; GNU rc errors | GR wave2a | | `infocmp` | 1.x C++ implementation | unchanged in 2.0.0 (wave 2) | INV | | `install` | 1.x C++ implementation | unchanged in 2.0.0 (wave 4) | INV | | `join` | — | GNU byte-exact (51 rows) | GR wave3b | | `kill` | 1.x C++ implementation | unchanged in 2.0.0 (wave 3) | INV | | `killall` | 1.x C++ implementation | unchanged in 2.0.0 (wave 4) | INV | | `ldd` | 1.x C++ implementation | unchanged in 2.0.0 (wave 2) | INV | | `less` | 1.x C++ implementation | unchanged in 2.0.0 (wave 4) | INV | | `ln` | `-s` refused without privilege; target absolutized; `-i` decline rc 0 | `ALLOW_UNPRIVILEGED_CREATE`; literal target; `-i` decline rc 1. Open: #1651, #1675 | GR wave3a; GH | | `locale` | 1.x C++ implementation | unchanged in 2.0.0 (wave 3) | INV | | `locate` | 1.x C++ implementation | unchanged in 2.0.0 (wave 4) | INV | | `logger` | 1.x C++ implementation | unchanged in 2.0.0 (wave 4) | INV | | `logname` | 1.x C++ implementation | unchanged in 2.0.0 (wave 2) | INV | | `look` | 1.x C++ implementation | unchanged in 2.0.0 (wave 4) | INV | | `ls` | 1.x C++ ls | unchanged in 2.0.0; GNU gaps #1639-#1646 tracked for the Rust rewrite | GH | | `lsattr` | 1.x C++ implementation | unchanged in 2.0.0 (wave 2) | INV | | `lsof` | 1.x C++ implementation | unchanged in 2.0.0 (wave 2) | INV | | `man` | 1.x C++ implementation | unchanged in 2.0.0 (wave 2) | INV | | `md5sum` | glob-expanded operands; empty-operand quoting differed | literal operands; GNU quoting | GR wave6 | | `mkdir` | `-Z` rejected; `-m` applied to every `-p` component | `-Z` accepted no-op; `-m` leaf-only with `-p`; symbolic modes vs `a=rwx` | GR wave1 | | `mkfifo` | 1.x mkfifo; `-Zctx` accepted silently; `--context=` warned nothing; empty NAME answered `File exists` | wired: GNU `--context[=CTX]` optarg rules (only a PRESENT value warns), bundled `-Zctx2` → `invalid option -- 'c'` rc 1, empty NAME → ENOENT; `!` marker contract unchanged | GR wave-W4 | | `mkgroup` | 1.x C++ implementation | unchanged in 2.0.0 (wave 2) | INV | | `mknod` | 1.x mknod; device/file-create diagnostics always quoted the name; empty MAJOR/MINOR read `missing` | wired: quotef diagnostics (plain names unquoted, empty name `''`), `invalid major device number ''`, `--context=` warns; marker unchanged; block/char nodes still EPERM (no Windows device-node type) | GR wave-W4 | | `mkpasswd` | 1.x C++ implementation | unchanged in 2.0.0 (wave 2) | INV | | `mktemp` | 1.x mktemp; bare `--tmpdir` consumed the template as DIR; an absolute/template-directory path printed a bare name | 2.0: Rust `mktemp.rs` wired (wave-W3). Bare `--tmpdir` is the GNU optional argument; a template carrying a directory prints that directory (GNU verbatim spelling); the default directory prints the environment value as given, so `TEMP` with backslashes yields `C:\...\Temp/name` instead of 1.x's normalized `C:/...` | GR wave-W3 | | `more` | 1.x C++ implementation | unchanged in 2.0.0 (wave 4) | INV | | `mpicalc` | 1.x C++ implementation | unchanged in 2.0.0 (wave 3) | INV | | `mv` | 1.x C++ mv | unchanged; #1649 (dir over file) tracked | GH | | `namei` | 1.x C++ implementation | unchanged in 2.0.0 (wave 2) | INV | | `nice` | 1.x nice | 2.0: Rust `nice.rs` wired (wave-W3); rc 125 without try-tail, legacy `-N` rewrite unchanged, child inherits the live stdio handle | GR wave-W3 | | `nl` | 1.x C++ implementation | unchanged in 2.0.0 (wave 3) | INV | | `nohup` | 1.x nohup | library ready (leading-options-only `+` optstring) but **not wired**: the terminal faces (stdin -> NUL, stdout -> `nohup.out`, stderr -> stdout) need console-class facts that the ABI cannot inject yet, so wiring now would drop 1.x's interactive redirection. Blocked on the host stdio-metadata channel (recipe §8 / §5.M) | GR wave4b; REPLACEMENT-RECIPE §8 | | `nproc` | affinity counts differed | affinity counts follow the 1.x value model; GNU rc errors | GR wave2a | | `numfmt` | accepted `--unit-separator/-M/-l`, ZYRQ; field padding collapsed | retired (§3); field width preserved | GR wave3b; borrow-algo | | `od` | 1.x od | shortest-round-trip floats, `-tx1z` column, absolute `-j`/`-N` addresses, `-S/--strings`, the old-style `[FILE] [[+]OFFSET] [[+]LABEL]` form, obsolescent `D e F H I L O B h X` letters, multi-spec pad distribution; the separated `-w N` spelling retires (§3) | GR wave-W2 | | `paste` | — | serial/parallel delbuf algorithm; directory EISDIR mapping | GR wave3a | | `patch` | 1.x C++ implementation | unchanged in 2.0.0 (wave 3) | INV | | `pathchk` | 1.x pathchk | 2.0 target: POSIX checks + Windows value model; **not wired** | GR wave4b | | `pgrep` | 1.x C++ implementation | unchanged in 2.0.0 (wave 2) | INV | | `pidof` | 1.x C++ implementation | unchanged in 2.0.0 (wave 2) | INV | | `pinky` | 1.x pinky | 2.0 target: GNU pinky.c port over WTS sessions; **not wired** | GR wave5 | | `pkill` | 1.x C++ implementation | unchanged in 2.0.0 (wave 2) | INV | | `pldd` | 1.x C++ implementation | unchanged in 2.0.0 (wave 2) | INV | | `pr` | 1.x C++ implementation | unchanged in 2.0.0 (wave 4) | INV | | `printenv` | no `--null`; operand scan diverged | `-0`/`--null`, `getopt("+")` operand stop, NAME=VALUE full dump | GR wave1 | | `printf` | 1.x C++ implementation | unchanged in 2.0.0 (wave 2) | INV | | `ps` | 1.x C++ implementation | unchanged in 2.0.0 (wave 4) | INV | | `ptx` | 1.x ptx | 2.0 target: C++ subset data flow; circular-context layout stays a documented divergence; **not wired** | GR wave4b | | `pwd` | any `$PWD` accepted | `$PWD` honored only when it names the cwd (dot/dotdot rejected) | GR wave1 | | `readlink` | `-q`/`-s` spellings off; verbosity not last-wins | `-q`/`-s`, last-wins verbosity, `-n` over `-z`, `/` canonical output | GR wave1; #1491 | | `realpath` | mode words / `-E` handling differed | `-E` retained (extension), mode-word last-wins, trailing separators, `--relative-base` | GR wave1 | | `regtool` | 1.x C++ implementation | unchanged in 2.0.0 (wave 2) | INV | | `renice` | 1.x C++ implementation | unchanged in 2.0.0 (wave 2) | INV | | `reset` | 1.x C++ implementation | unchanged in 2.0.0 (wave 2) | INV | | `rev` | `-h`/`-V` parse error or version block | util-linux text; C-locale byte reversal (ctest re-pinned) | GR wave6 | | `rm` | 1.x C++ rm | unchanged; #1650 (empty operand), #1672 (native_path) tracked | GH | | `rmdir` | `-p` printed a trailing slash | GNU `-p` output; `--path` alias | GR wave1 | | `runcon` | 1.x SELinux stub | 2.0 target: capability probe; **not wired** | GR wave5 | | `sdiff` | 1.x C++ implementation | unchanged in 2.0.0 (wave 3) | INV | | `sed` | 1.x C++ implementation | unchanged at this snapshot; library/wire in flight | #1635 | | `seq` | spurious `Try 'seq --help'`; f64 drift past 17 digits | GNU diagnostic; exact decimal path; sub-ulp steps no longer hang | GR wave3a; borrow-algo | | `sha1sum` | glob-expanded operands | literal operands; GNU quoting | GR wave6 | | `sha224sum` | — | streaming stdin; GNU byte-exact | GR wave2b | | `sha256sum` | glob-expanded operands | literal operands; GNU quoting | GR wave6 | | `sha384sum` | — | streaming stdin; GNU byte-exact | GR wave2b | | `sha512sum` | glob-expanded operands | literal operands; GNU quoting | GR wave6 | | `shred` | 1.x C++ implementation | unchanged in 2.0.0 (wave 4) | INV | | `shuf` | 1.x shuf | 2.0 target: deterministic `--random-source` port; **not wired** | GR wave4b | | `sleep` | — | no recorded change | GR wave2a | | `sort` | 1.x sort (12x slower; rejected `+POS1`, `-S100k`, `-y100`) | 2.0 target: GNU sort.c port; accepts those; `-R` deterministic; **not wired** | GR wave4b sort | | `split` | 1.x C++ implementation | unchanged in 2.0.0 (wave 3) | INV | | `stat` | `-c %C` rc 1; format-slot/escape differences | `-c %C` rc 0; `-c`/`--printf`/`--format` last-wins. Open: #1652 `-L`, #1653 `-`, #1654 `%N`/size, #1655 `TZ` | GR wave3a; GH | | `stdbuf` | 1.x C++ implementation | unchanged in 2.0.0 (wave 3) | INV | | `strings` | 1.x C++ implementation | unchanged in 2.0.0 (wave 3) | INV | | `stty` | 1.x C++ implementation | unchanged in 2.0.0 (wave 4) | INV | | `sum` | 1.x sum | SysV 16-bit fold, block counts, last-of-`-r/-s` in any spelling | GR wave-W2 | | `sync` | operand globbing | no globbing; `FlushFileBuffers` semantics | GR wave1 wiring remainder | | `tac` | directory-open wording differed | GNU wording; streaming stdin; `-r` via winux-regex BRE | GR wave2b; rust2/README | | `tail` | 1.x tail | 2.0 target: GNU follow semantics with injected `StdinMeta`; **not wired** | rust2/README; #1626 | | `tee` | open-failure name always quoted | GNU unquoted `quotef`; EPIPE-silent model | GR wave3a | | `test` | same as `[` | GNU precedence / wording; `test_ts43` help row stays `note` (branded text) | GR wave1 | | `[` | same test implementation | GNU precedence for `-a`/`-o`/`==`, GNU two-arg wording; sole-arg help stays branded | GR wave1 | | `tic` | 1.x C++ implementation | unchanged in 2.0.0 (wave 2) | INV | | `time` | 1.x C++ implementation | unchanged in 2.0.0 (wave 4) | INV | | `timeout` | exit status only; child set platform-specific | childproc execvp chain; signal mapping; rc 124/125 | GR wave3b | | `toe` | 1.x C++ implementation | unchanged in 2.0.0 (wave 2) | INV | | `top` | 1.x C++ implementation | unchanged in 2.0.0 (wave 4) | INV | | `touch` | `-d 'YYYY-MM-DD HH:MM:SS'` rejected; `-t .99` accepted | GNU parse-datetime subset; `SetFileTime` DST-aware | GR wave3a | | `tput` | 1.x C++ implementation | unchanged in 2.0.0 (wave 4) | INV | | `tr` | 1.x tr | GNU byte-set grammar, C-locale tables, `-A` no-op, escaped range endpoints, reverse-range wording, unquote warnings, `[=c=]`-in-string2 fatal | GR wave-W2 | | `tree` | 1.x C++ implementation | unchanged in 2.0.0 (wave 2) | INV | | `true` | pilot accepted `--help`/`--version` anywhere | only as the sole argument; branded text | GR wave1 refresh | | `truncate` | `-s 1kB` grammar rejected | GNU suffix grammar accepted | GR wave2b | | `tsort` | accepted `-w` | `-w` rejected (GNU 9.4 has none) | GR wave3b | | `tty` | 1.x tty | 2.0 target: GNU byte-exact (22 rows); **not wired** | GR wave5 | | `tzset` | 1.x C++ implementation | unchanged in 2.0.0 (wave 2) | INV | | `u2d` | 1.x C++ implementation | unchanged in 2.0.0 (wave 4) | INV | | `uname` | Windows value model | unchanged value model; GNU rc errors | GR wave2a | | `unexpand` | rejected `-4,8` lists | accepted like GNU | GR wave3b follow-up | | `uniq` | 1.x C++ implementation | unchanged in 2.0.0 (wave 3) | INV | | `unix2dos` | 1.x C++ implementation | unchanged in 2.0.0 (wave 4) | INV | | `unlink` | generic failure text | 1.x Windows failure chain (invalid name → missing), trailing separators stripped | GR wave2a | | `updatedb` | 1.x C++ implementation | unchanged in 2.0.0 (wave 4) | INV | | `uptime` | 1.x C++ implementation | unchanged in 2.0.0 (wave 2) | INV | | `users` | rejected `-h` | `-h` accepted; value model | GR wave3b | | `vdir` | 1.x C++ implementation | unchanged in 2.0.0 (wave 2) | INV | | `vmstat` | 1.x C++ implementation | unchanged in 2.0.0 (wave 3) | INV | | `w` | 1.x C++ implementation | unchanged in 2.0.0 (wave 2) | INV | | `watch` | 1.x C++ implementation | unchanged in 2.0.0 (wave 4) | INV | | `wc` | 1.x C++ implementation | unchanged in 2.0.0 (wave 3) | INV | | `whereis` | 1.x C++ implementation | unchanged in 2.0.0 (wave 2) | INV | | `which` | 1.x C++ implementation | unchanged in 2.0.0 (wave 3) | INV | | `who` | 1.x value model | 2.0 target: WTS session model; **not wired** | GR wave4b | | `whoami` | Windows value model | same value model; GNU-shaped rc errors | GR wave2a | | `wpm` | 1.x C++ implementation | unchanged in 2.0.0 (wave 4) | INV | | `xargs` | 1.x xargs (26 recorded divergences) | 2.0 target: findutils 4.9 port, 26 rows GNU-exact; **not wired** | GR xargs; #1625 | | `xxd` | 1.x C++ implementation | unchanged in 2.0.0 (wave 3) | INV | | `yes` | 1.x C++ implementation | unchanged in 2.0.0 (wave 3) | INV | ## 5. Behavior changes that are 1.x bug fixes These are not interface changes; scripts that already expected GNU behavior start working. Each is recorded in the gate ledger (`r=c:no` row) or in a closed issue. | area | 1.x behavior | 2.0 | Anchor | |---|---|---|---| | `echo` option scan | int-validated `-r`'s value ahead of the handler, so `echo -r x` was rc 1 | data, rc 0 | #1621 | | `fold`/`fmt` option validation | accepted 1.x-only options | GNU invalid-option path | GR wave3a | | digest operands | glob-expanded file operands internally | literal operands (the shell expands; GNU `digest.c` receives them expanded) | GR wave6 | | digest empty operand | unquoted/empty-name diagnostics differed | `md5sum: '': No such file or directory` | GR wave6 | | `expand`/`unexpand` obsolescent lists | dispatcher rejected `-4,8` / `-4,8,12` with `invalid option -- ','` | accepted like GNU (`expand.c` digit options take optional args; `unexpand.c` treats digits/commas as option chars) | GR wave3b wiring follow-up | | `seq` error tail | printed a spurious `Try 'seq --help'` after an unknown-format diagnostic | no tail, rc matches GNU | GR wave3a | | `seq` decimals | f64 drift past 17 significant digits; sub-ulp steps could loop forever | exact decimal path; boundary shapes documented | GR borrow-algo §seq | | `numfmt --field` | converted field collapsed to single spaces | original field width preserved | GR borrow-algo §numfmt | | `tee` open-failure name | always quoted | GNU's unquoted `quotef` spelling | GR wave3a | | `ln -i` decline | rc 0 (observed no-op) | rc 1 like GNU (subject to the open ordering bugs below) | GR wave3a | | `ln -s` target | 1.x absolutized the link target | target stored as given | #1609 | | `ln -s` privilege | silent copy downgrade | real symlink via `ALLOW_UNPRIVILEGED_CREATE`; copy downgrade is opt-in | GR wave3a | | `stat -c %C` | rc 1 | rc 0 | GR wave3a | | `rmdir -p` | trailing slash in output | GNU stripping | GR wave1 | | `touch -d "YYYY-MM-DD HH:MM:SS"` | rejected | accepted (GNU parse-datetime subset) | GR wave3a | | `touch -t .99` | accepted | rejected like GNU | GR wave3a | | `readlink -f/-e/-m` | drive-dialect spellings / backslashes in output | `/`-separated canonical names, resolver-consistent drive | #1491 (1.2.1, kept in 2.0) | | `sort` | rejected `+POS1`, `-S100k`, `-y100`; `-R` random per run | GNU accepts all three; `-R` is deterministic FNV order (documented deviation) | GR wave4b sort | | `tsort -w` | accepted | rejected (GNU 9.4 has no `-w`) | GR wave3b | | `hostid -h`, `users -h` | rejected | accepted | GR wave3b | | `xargs` quoting/EOF/`-L`/`-s` family | 26 recorded `r=c` divergences (slurp-then-run input, lone quote at EOF, NUL passthrough, leading `\f\v\r`, EOF-string per item, `-d` hex, `-L` under `-d`, `-I{}` echo, `-s0`, `+1`/`-n`, `-P` bound, `-a -`/`-a DIR`, shebang child) | GNU byte-for-byte on those 26 rows (`xargs.rs` module doc). `-P` output order and the 40000-item batching are exit-status-gated only (scheduler / Windows command-line budget) | GR xargs; #1625 | ## 6. Platform subsets that are NOT 2.0 regressions | area | what Windows cannot do | what 2.0 does | Anchor | |---|---|---|---| | POSIX mode bits | NTFS has no `rwx`/setuid/setgid/sticky storage | parses the full GNU mode grammar; persists owner-write as the read-only attribute; other bits live in the in-memory model; `-R` uses GNU fts preorder and refuses filesystem roots | GR wave1 deepening | | Ownership | no POSIX uid/gid; group changes need `SeRestorePrivilege` | real owner change where the OS grants `WRITE_OWNER`; OS denial maps to GNU's `Operation not permitted` rc 1; numeric ids are validated no-ops | GR wave1 deepening | | Symlinks | creation needs Developer Mode/admin | `ALLOW_UNPRIVILEGED_CREATE` attempted; otherwise documented refusal (no silent copy unless opted in) | GR wave3a | | `df` inodes | NTFS reports no inode counts | inode columns 0 / `IUse% -` (documented deviation); 12-column `--output` model implemented | GR wave1; #1657 open for column widths | | SELinux (`chcon`, `runcon`, `ls -Z`) | no SELinux | capability probe; GNU non-SELinux shapes (`?`, rc 0) where the oracle has them | #1643; GR wave5 | | FIFO / device nodes | no POSIX FIFOs; named-pipe bridge | `!` marker contract through the C++ `file_io` layer | #1038; GR wave5/wave6 | | Terminal metadata | library cannot see console-ness through injected IO | input class is injected (`tail::StdinMeta`); registry defaults to pipe; driver composes the real class | GR tail follow; `rust2/README.md` | | Time zone | no `TZ` handling in some paths | `touch` uses `SetFileTime` + DST-aware conversion; `stat` TZ is an open gap | #1655 | | Broken pipe | no POSIX SIGPIPE | output write error surfaces as the host status (141 by policy); wired per-command overrides keep the GNU status (grep 2, xargs 125, `tty 3` with `tty: write error: `); the default-policy ruling is #1487 | #1487; GR xargs; GR wave1 tty | | Locale | no full locale database | `LC_ALL=C` byte model is the gate domain; `#1549` locale-database simulation is the 2.0 item | `DOCS/2.0-MASTER-PLAN.md` §0 item 6 | | `sort --batch-size` bound | Windows has no `RLIMIT_NOFILE` | GNU's `rlimit-3` shape is kept with the 1.x OPEN_MAX analogue (3200), so values above 3197 are "too large" | #1488 sort WP-I | ## 7. What is deliberately unchanged - **176 commands** (the multicall set), their names, and their option registration surface. - **`--help` / `--version` text** remains the WinuxCmd-branded dispatcher output for the wired commands (the pilot's GNU-driver help text is not the product surface). Sole-argument interception rules match 1.x. - **Editions and entry links**: default vs full, the `-full` suffix, and the wpm-indexed default artifact. - **WPM** (package manager, `wpm` command) and the package contracts in `AGENTS.md`. - **Cygwin/MSYS bridging commands** (`cygpath`, `d2u`, `u2d`, `dos2unix`, `unix2dos`, `regtool`) — these are Windows-specific by design and have no GNU oracle. - **`link` does not exist and will not be added** (MSVC `link.exe` collision; `WINUXCMD_BANNED_COMMANDS`). ## 8. Reporting a difference 1. Pin the oracle: WSL GNU coreutils 9.4 (or the command's upstream: findutils 4.9.0, util-linux 2.39.3, Debian hostname 3.23), `LC_ALL=C`, `TZ=UTC`. 2. Give the exact argv, stdin bytes, cwd shape, and the three outputs (GNU / WinuxCmd 1.2.1 / WinuxCmd 2.0) with exit codes. 3. File it with the `compat-gap` label. If the difference is a deliberate platform subset, cite the row in §6; if it is a retired extension, cite §3. 4. A 2.0 release blocker is an **unclassified** `r=c:no` row: the gate must either match GNU or carry a documented reason. "It differs" is not a classification. ## 9. Open compatibility gaps at this snapshot The 19 audited `compat-gap` issues (2026-11-14) are all in the file-operation family that is not yet wired. They are 1.x bugs that 2.0's Rust rewrites are expected to fix, not 2.0 regressions: | family | issues | |---|---| | `ls` | #1639 symlink target/size, #1640 `-L`, #1641 column padding, #1642 group-directories-first, #1643 `-Z`, #1644 `--si`, #1645 invalid `--sort` rc, #1646 quoting styles | | `cp` | #1647 symlink sources, #1648 `-i` decline rc — **fixed by the cp wire** (LX reparse links, dangling stat, `-r -H`; ctest 83/83) | | `mv` | #1649 dir-over-file | | `rm` | #1650 empty operand | | `ln` | #1651 `-i`/`-f` order (wired), #1675 `-b` with `-i` | | `stat` | #1652 `-L`, #1653 `-` operand, #1654 `%N`/size, #1655 `TZ` (wired) | | `du` | #1656 `-L` dir links, #1670 `-L` dedup | | `df` | #1657 `--output` widths (ready) | Shared-layer hazard: **#1672** (`native_path` empty operand absolutized to cwd) affects the whole filesystem family and is the root cause class behind #1650. --- *Sources: `DOCS/2.0-HANDOVER.md`, `DOCS/2.0-MASTER-PLAN.md`, `rust2/GATE-REPORT.md`, `DOCS/2.0-inventory.tsv`, issues #1639–#1657 and #1670/#1672/#1675. This guide is a draft; the release commit is the authority.*