Skip to content

rust2: help surface for the 13 driver-surface commands + df note upgrades (#1488) - #1563

Merged
caomengxuan666 merged 5 commits into
mainfrom
rust2/help-surface
Nov 11, 2026
Merged

caomengxuan666 merged 5 commits into
mainfrom
rust2/help-surface

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

Closes parts of #1488 (help surface) and resolves the two df note findings from the #1555 QC audit.

Task 1 — 13 commands with empty --help/--version (WIN-AUDIT structural black hole)

The Rust driver printed NOTHING for --help/--version on b2sum, base32, base64, sha224sum, sha384sum, getconf, hostname, id, nproc, printenv, tac, uname, whoami. Each now prints the probed WSL-oracle text byte-for-byte (26/26 stdout+rc comparisons against fresh env <cmd> --help|--version captures under WSL):

command oracle surface --help --version gate rows
b2sum / sha224sum / sha384sum coreutils 9.4 per-algo body + shared footer (GNU coreutils) 9.4 + authors b2a19/b2a23, s224a12/a19, s384a12/a19 strict
base32 / base64 coreutils 9.4 RFC 4648 body Simon Josefsson block b32a23/a24, b64a28/a29 strict
id / nproc / tac / uname / whoami coreutils 9.4 body + footer (GNU coreutils) 9.4 id18/22, np10/21, ta24/ta27, un17/18, wa05/06 strict
printenv (wired) coreutils 9.4 body (incl. shell-version note) (GNU coreutils) 9.4 pe19/pe21 stay win (product exe keeps branded dispatcher text — true/false precedent); driver/--abi path carries the oracle bytes
getconf glibc 2.39 (Ubuntu GLIBC 2.39-0ubuntu8.9) glibc help incl. launchpad footer getconf (Ubuntu GLIBC ...) 2.39 gc19 strict, gc23 strict (new)
hostname Debian hostname 3.23 DEBIAN_USAGE on stdout, rc 255 (-h same) hostname 3.23 rc 0 hn19 strict (rc 255), hn20 strict

Shared builders live in the new winux-cmds/src/gnuhelp.rs; the first flag in argv wins (getopt_long order, --version --help probed on all oracle families). Per-command unit tests lock shape + rc.

Also registers the four wave2 modules that shipped unregistered on main (getconf/hostname/id/uname) — their 88 gate rows ran rc 127 (the gap GATE-REPORT deferred to "wiring lane scope").

Task 2 — df note upgrades (NOTE-QC.md)

  • df13 (df C:\Windows): GNU df stats each operand as given (df.c); drive-letter forms are not POSIX paths → quotef'd df: 'X': No such file or directory, empty stdout, rc 1 (probed for C:\, C:\Windows, -h/-k variants). df.rs now takes that branch for drive-letter operands (is_drive_letter_form) instead of resolving the drive; relative/statable operands keep mount-point resolution. df13-drive-path win → strict (rust rc 1 == GNU rc 1, byte-equal stdout; the fresh Debug cpp baseline also errors here — r=c:yes).
  • df12 (audited scenario df --output=source C:\): same operand class, added as df36-output-source-drive strict (the NOTE-QC id df12-output-subset no longer exists in the wave1-deepening table). The same class forced df07/df09/df15 win → strict, where they pass byte-equal against GNU; cpp's drive-root model stays recorded (r=c:no).
  • gen-cases.py df_rows had drifted from the committed df.tsv (15 vs 35 rows) — df_rows is now transcribed from the committed table so df.tsv is generator-backed again. note-registry.tsv: stale df12-output-subset/df13-drive-path rows deleted; the two real df notes documented with probed claims (df24 fstype exact-match, df33 Developer-Mode symlink).

bash gate/run-gate.sh df: 25 GNU-gated + 9 win rows all green. Full gate (39 tables): 932 GNU-gated + 134 win, zero failures; cargo test green; cargo fmt --check clean (fmt drift in 8 untouched files fixed first).

QC artifacts regenerated from this tree: WIN-AUDIT.md (hostname/id/nproc/uname/whoami now fully aligned; digest family left the win class), NOTE-QC.md, COVERAGE.md, GATE-REPORT.md (+ refresh narrative).

cargo fmt --check (the pre-commit hook) fails on main with the current
toolchain: line-join/split drift in argopt, canon, mkdir, pwd, readlink,
realpath, sync, test_cmd. Formatting only, no semantic change.
…#1488)

The QC win audit (WIN-AUDIT.md, PR #1555) found a structural black
hole: b2sum base32 base64 sha224sum sha384sum getconf hostname id nproc
printenv tac uname whoami returned rc 0 with EMPTY stdout for
--help/--version. Each now prints the probed WSL-oracle text
byte-for-byte:

- coreutils 9.4 bodies + gnuhelp::footer / gnuhelp::coreutils_version
  (new shared module) for the ten coreutils commands; the first
  --help/--version flag in argv wins, like getopt_long.
- getconf carries the glibc 2.39 help/version verbatim (Ubuntu GLIBC
  2.39-0ubuntu8.9 oracle, incl. its own bug-report footer).
- hostname carries the Debian 3.23 contract: --help/-h print the
  DEBIAN_USAGE block on stdout and exit 255; --version prints
  'hostname 3.23' rc 0 (probed rc 255/0).
- printenv (wired) keeps the dispatcher contract in the product exe and
  prints the oracle bytes on the driver/FFI surface; the --abi path
  shares dispatch, so it gains the text automatically.

Also registers the four wave2 modules that shipped unregistered on
main (getconf/hostname/id/uname) — their 88 gate rows ran rc 127
(GATE-REPORT 'wiring lane scope' gap).

Unit tests per command lock the shape/rc; the strict gate rows added in
the next commit keep the bytes honest against WSL GNU.

Verification: driver --help/--version for all 13 byte-compared against
fresh 'env <cmd> --help|--version' captures (26/26 equal, rc equal);
cargo test green (279 incl. new surface tests).
…branch (#1488)

GNU df stats each operand as given (df.c main -> df_file); one the
oracle cannot stat is the quotef'd 'df: X: No such file or directory'
diagnostic with rc 1 and empty stdout (probed: df 'C:\\' /
df 'C:\\Windows' / df -h 'C:\\' all rc 1 under WSL — drive-letter
forms are not POSIX paths). The rust2 df instead resolved them through
the Windows drive model (canonicalize -> mount -> volume table rc 0),
inheriting the 1.x C++ applet's model that NOTE-QC.md registered as a
masked divergence.

Now drive-letter operands (is_drive_letter_form: X: / X:\\ / X:\\...)
take the GNU branch; relative and statable operands keep the
mount-point resolution both sides agree on. The diagnostic goes through
digestsum's gnulib quotef approximation (now pub(crate)) so backslash
names are quoted ('C:\\') and plain POSIX paths are not — same
condition GNU uses; stderr wording itself stays recorded-not-gated.

Gate rows flip in the next commit: df07/df09/df13/df15 win -> strict,
df13-drive-path note gone, new df36-output-source-drive (the audited
df12 scenario: df --output=source C:\\).

Verification: bash gate/run-gate.sh df — 25 GNU-gated + 9 win rows all
green; cargo test df:: green (12).
…ed (#1488)

Task 1 rows (13 commands): the sole --help/--version rows promoted
win -> strict for b2sum(base32/base64/sha224sum/sha384sum/tac/uname/id/
hostname/getconf/nproc/whoami — the driver now prints the probed oracle
bytes, so the rows gate the text against GNU instead of comparing only
rc with the branded C++ text; a regression to empty output now FAILS
the gate). New version rows: b2a23, ta27, gc23 (getconf glibc version),
plus printenv pe21-version which stays win like pe19 (printenv is a
wired command — the product exe keeps the branded dispatcher text,
true/false precedent).

df rows: gen-cases.py df_rows had drifted from the wave1-deepening
df.tsv (15 vs 35 rows; the generator was stale on main) — df_rows is
now transcribed from the committed table so df.tsv is generator-backed
again. Mode changes per the df.rs operand fix: df07-c-drive, df09-h-
drive, df13-drive-path, df15-block-size-k win -> strict (rc 1, empty
stdout, byte-equal to GNU on both sides), new df36-output-source-drive
(the NOTE-QC df12 scenario: df --output=source C:\\).

note-registry.tsv: drop the stale df12-output-subset/df13-drive-path
rows (ids that only existed in the pre-deepening table; NOTE-QC audited
them against an older lane driver whose df12 happened to error). The
two remaining df notes are documented with probed claims: df24 (-x
fstype exact match: rc parity, platform-inherent listing) and df33
(symlink operand needs Developer Mode; GNU rc 0 vs Windows rc 1).

Verification: full bash gate/run-gate.sh (39 case tables) — 932
GNU-gated + 134 win cases, zero failures; gen-cases.py --dup-check has
no new intra-command duplicates.
…ve (#1488)

Regenerated from this tree with the worktree-built driver + Debug cpp
baseline (provenance lines updated accordingly):

- WIN-AUDIT.md — the 13 commands' structural help/version entries are
  gone: hostname/id/nproc/uname/whoami win rows classify fully aligned,
  and the digest/base32/base64/tac help/version rows left the win class
  entirely (now strict). Remaining df/printenv structural rows are the
  documented value-model listings and the wired product's branded
  --help/--version text (16 vs 23 lines), recorded not gated.
- NOTE-QC.md — df's audited notes are now df24 (UPGRADE-EXIT candidate:
  rc parity holds, stdout platform-form-bound) and df33
  (MASKED-DIVERGENCE, re-justified in note-registry.tsv: Developer-Mode
  symlink creation). Other commands' notes (ln/stat/test/chown) are
  re-inventoried for their lanes.
- COVERAGE.md / GATE-REPORT.md — per-command counts after the row
  promotions + new rows; GATE-REPORT gains the help-surface refresh
  narrative. Full gate: 932 GNU-gated + 134 win, all green.
@caomengxuan666
caomengxuan666 merged commit b055b48 into main Nov 11, 2026
9 of 10 checks passed
caomengxuan666 added a commit that referenced this pull request Nov 12, 2026
… to exit (#1488 QC round 2)

QC round-2 drift check (#1563 leftover 1): two opposite drift directions
had accumulated since the QC layer landed.

- chmod/chown: the committed TSVs were AHEAD of the generator - the
  wave1-deepening lanes added cm23-cm45 / cw17-cw36+cw25b directly to the
  TSVs, so a regeneration silently DROPPED 45 rows. Those rows are now
  transcribed into gen-cases.py (order byte-identical to the committed
  tables); per-table provenance comments survive regeneration via
  TABLE_NOTES.
- wave2 family (12 tables): the wave2b wiring lane regenerated its TSVs
  from a stale pre-#1563 generator copy, reverting the 24 sole
  --help/--version rows back to win (4a28e23). The generator on main
  already says strict, so regenerating re-restores #1563�s promotion;
  the fresh ledger gates those rows byte-for-byte against GNU
  (b2a19/b2a23/un17/wa05...: r=g:yes, all green).

df24-x-case-sensitive: NOTE-QC round 1 verdict UPGRADE-EXIT is now acted
on -  rc parity 0==0 stable across 3 fresh probes, stdout
is the platform-inherent listing (GNU ext4 mount table vs Windows volume
listing), which is exactly the exit-mode contract. note -> exit; the
registry entry is retired with the promotion recorded in a generator
comment.

Regeneration is a no-op again (verified); full gate after the change:
1197 GNU-gated + 146 win rows, zero failures.
caomengxuan666 added a commit that referenced this pull request Nov 12, 2026
… the help-surface sweep (#1488 QC round 2)

- cpp_bin(): the default resolved into rust2/build-vs/... (build-vs is a
  TREE-root sibling, not under rust2/) — every QC-script cpp side
  degraded to 'missing exe' -> rc None until CPP_BIN was exported. Found
  by the round-2 NOTE-QC sweep; the env override still wins.
- rust_bin_for(): the wave2 lane-driver split is retired - #1566/#1568/
  #1570 wired every wave2/3 command to main, so one driver covers all 47
  tables; RUST_BIN_W2 stays only as an override. provenance() now prints
  a single rust= line (splits only when overridden).
- to_mnt() helper extracted from run_gnu_side's inline path mapping.
- qc_note_audit/qc_win_audit re-run templates no longer require
  RUST_BIN_W2.
- NEW gate/qc_help_surface.py -> HELP-SURFACE.md: standing sweep of
  every implemented command (47 gen-cases tables) x
  --help/--version/-h/--bogus, rust2 driver vs GNU 9.4 (batched
  per-command WSL scratch, /tmp/winuxcmd-gate-qc-help).

Round-2 sweep verdicts (188 probes): 15 commands fully ALIGNED on
--help/--version (the #1563 13 + test/bracket), 61 EMPTY-HELP +
19 RC-ONLY findings - all on the LIBRARY/driver surface; the product
exe's help face is covered by dispatcher metadata (verified basename/
mkdir/seq/join/expand/numfmt/tsort/timeout/stat print usage). RC-ONLY
headliners: hostname --bogus rc 1 vs GNU 255 (Debian hostname
contract), getconf --bogus rc 1 vs GNU 2, and -h treated silently rc 0
vs GNU invalid-option rc 1 on the argopt-era commands (same class as
the hostid ho12 / users us17 notes).
caomengxuan666 added a commit that referenced this pull request Nov 12, 2026
…tool layer (#1488 QC round 2)

- 'all 15 commands, 338 cases' -> 'all 47 commands, 1343 cases'.
- New QC tool layer subsection: coverage/dup-check/note-audit/win-audit/
  help-surface entry points and the note-registry contract.
- Documents that generator-backedness broke twice (df in #1563,
  chmod/chown/wave2 in the round-2 sweep) and why TSVs are generated.
- Wiring status: 44 commands via WINUXCMD_RUST2_COMMANDS (waves
  1/2a/2b/3a/3b); chmod/chown/df still carry 1.x C++ bodies.
caomengxuan666 added a commit that referenced this pull request Nov 13, 2026
… to exit (#1488 QC round 2)

QC round-2 drift check (#1563 leftover 1): two opposite drift directions
had accumulated since the QC layer landed.

- chmod/chown: the committed TSVs were AHEAD of the generator - the
  wave1-deepening lanes added cm23-cm45 / cw17-cw36+cw25b directly to the
  TSVs, so a regeneration silently DROPPED 45 rows. Those rows are now
  transcribed into gen-cases.py (order byte-identical to the committed
  tables); per-table provenance comments survive regeneration via
  TABLE_NOTES.
- wave2 family (12 tables): the wave2b wiring lane regenerated its TSVs
  from a stale pre-#1563 generator copy, reverting the 24 sole
  --help/--version rows back to win (4a28e23). The generator on main
  already says strict, so regenerating re-restores #1563�s promotion;
  the fresh ledger gates those rows byte-for-byte against GNU
  (b2a19/b2a23/un17/wa05...: r=g:yes, all green).

df24-x-case-sensitive: NOTE-QC round 1 verdict UPGRADE-EXIT is now acted
on -  rc parity 0==0 stable across 3 fresh probes, stdout
is the platform-inherent listing (GNU ext4 mount table vs Windows volume
listing), which is exactly the exit-mode contract. note -> exit; the
registry entry is retired with the promotion recorded in a generator
comment.

Regeneration is a no-op again (verified); full gate after the change:
1197 GNU-gated + 146 win rows, zero failures.
caomengxuan666 added a commit that referenced this pull request Nov 13, 2026
… the help-surface sweep (#1488 QC round 2)

- cpp_bin(): the default resolved into rust2/build-vs/... (build-vs is a
  TREE-root sibling, not under rust2/) — every QC-script cpp side
  degraded to 'missing exe' -> rc None until CPP_BIN was exported. Found
  by the round-2 NOTE-QC sweep; the env override still wins.
- rust_bin_for(): the wave2 lane-driver split is retired - #1566/#1568/
  #1570 wired every wave2/3 command to main, so one driver covers all 47
  tables; RUST_BIN_W2 stays only as an override. provenance() now prints
  a single rust= line (splits only when overridden).
- to_mnt() helper extracted from run_gnu_side's inline path mapping.
- qc_note_audit/qc_win_audit re-run templates no longer require
  RUST_BIN_W2.
- NEW gate/qc_help_surface.py -> HELP-SURFACE.md: standing sweep of
  every implemented command (47 gen-cases tables) x
  --help/--version/-h/--bogus, rust2 driver vs GNU 9.4 (batched
  per-command WSL scratch, /tmp/winuxcmd-gate-qc-help).

Round-2 sweep verdicts (188 probes): 15 commands fully ALIGNED on
--help/--version (the #1563 13 + test/bracket), 61 EMPTY-HELP +
19 RC-ONLY findings - all on the LIBRARY/driver surface; the product
exe's help face is covered by dispatcher metadata (verified basename/
mkdir/seq/join/expand/numfmt/tsort/timeout/stat print usage). RC-ONLY
headliners: hostname --bogus rc 1 vs GNU 255 (Debian hostname
contract), getconf --bogus rc 1 vs GNU 2, and -h treated silently rc 0
vs GNU invalid-option rc 1 on the argopt-era commands (same class as
the hostid ho12 / users us17 notes).
caomengxuan666 added a commit that referenced this pull request Nov 13, 2026
…tool layer (#1488 QC round 2)

- 'all 15 commands, 338 cases' -> 'all 47 commands, 1343 cases'.
- New QC tool layer subsection: coverage/dup-check/note-audit/win-audit/
  help-surface entry points and the note-registry contract.
- Documents that generator-backedness broke twice (df in #1563,
  chmod/chown/wave2 in the round-2 sweep) and why TSVs are generated.
- Wiring status: 44 commands via WINUXCMD_RUST2_COMMANDS (waves
  1/2a/2b/3a/3b); chmod/chown/df still carry 1.x C++ bodies.

# Conflicts:
#	rust2/README.md
@caomengxuan666
caomengxuan666 deleted the rust2/help-surface branch November 18, 2026 05:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant