Repository navigation
docs(2.0): applet inventory scan for library-form command set (#1488 step 1) - #1545
Merged
Merged
Conversation
Scan-only inventory of all 176 REGISTER_COMMAND applets for the 2.0 library-form command set (Refs #1488): per-applet loc, io_idiom, global_state, exit_usage, oracle_status (#1462 audit reports), test_coverage (tests/unit + differential corpus), replace_wave. Findings: output converged on the Win32 console layer for all 176 (79 pure-safePrint, 94 mixed, 3 no-IO); 172/176 have no exit/abort direct calls; wave1 = 15 lowest-risk replacements (true, false, test, [, basename, dirname, printenv, pwd, mkdir, rmdir, readlink, realpath, chmod, chown, df). Spot-check 7 commands, 1 scanner regex gap fixed (safeErrorPrint without Ln suffix), 7/7 consistent post-fix.
caomengxuan666
added a commit
that referenced
this pull request
Nov 9, 2026
…f/who) (#1547) # gap-fill: w 测试补齐 + 6 命令 #1462 式 oracle 审计(arch/locale/pinky/pwd/stdbuf/who) 独立 worktree 分支。方法按 #1462:oracle 源码/活 oracle 先行,再裁决,再修复。全部对照 WSL GNU oracle(coreutils 9.4、procps-ng 4.0.4、glibc 2.39),脚本文件形态,stdout/stderr/exit 三向对照。 ## Task 1 — w(唯一无测试的已审计命令) - 新增 `tests/unit/w`(13 枚 session-count-independent pin):header 存在/-h 抑制、-s tail、-f toggle、-i force-FROM、-p/-o 接受、无匹配 user 过滤恰留 2 行 header 且 exit 0、非法选项诊断 + exit 1、--help/--version。 - WSL procps-ng 4.0.4 差分门:可比面 exit code 与首行诊断逐字节一致。 - 记录残余(不改):header 与上游 procps-ng v4.0.4 git 源码一致(src/w.c:799-806,67/45 列);Ubuntu 构建的 4.0.4 oracle 印 68/46——发行版补丁 vs git tag;上游源码仍为合同。 - 附带:修 C4477(time_ival7 中 `%02d` 配 `long long` 参数的错误转换)。 ## Task 2 — 6 份审计(`tests/differential/audit-<cmd>.md`) | 命令 | 结论 | 一句话 | | --- | --- | --- | | arch | **clean** | 全部面逐字节一致(除仓库级 quotearg/help 约定) | | pwd | **clean** | -L/-P last-wins、POSIXLY_CORRECT 存在性测试、PWD 校验回退全部一致 | | stdbuf | **clean** | 全矩阵,含 optstring-'+' 操作数边界、bare-K xstrtol 规则、125/127 退出码 | | locale | **notes**(4 处修复) | bare -c/-k 改静默(并删一段破损字面量拼接块)、未知名白名单 `locale: unknown name "X"`、编造名(codeset/month/…)被拒 + `mon` 加入、-k print_item 引号 | | pinky | **notes**(3 处修复) | -l 补 try-help 行、`--lookup` 被拒(9.4 无此长选项)、When 列 `%b %e`;heading 在 LC_ALL=C 下逐字节一致 | | who | **notes**(3 处修复) | 缺 FILE 操作数静默 exit 0(旧 pin 与 oracle 矛盾,已翻转)、双 `who: who:` 前缀修复、时间面切 C-locale 12 列分支(who.c:803-811) | 平台面按 W4 协调裁决维持(mesg、utmp 视图、WTS 行、locale 仿真模型),各在审计文件内引用。locale 值模型重做(C-locale 空表/-a/-m 清单/分类转储)需 locale-database 仿真层(niu #758 依赖),已在审计文件内记录为后续跟进。 ## 验证 - Debug 构建绿(scripts/build-with-vs.ps1,pcre2 preset)。 - 触及命令单测 89/89 绿(`w.* locale.* pinky.* who.* pwd.* stdbuf.* arch.*`)。 - CI 全套:3830/3830 通过(x64 default,`[ctest-gate] all tests passed`);队长复核确认:baseline 红腿为主干既有 WSL 侧进程杀死基建红(与 #1540 同族,main 同签名复现);i18n-drift 红腿为本 PR 孤儿 key(删 --lookup 选项 + locale 值表提取口径)——合入前须先在 winuxcmd-i18n 仓同步 PR 清掉并 bump VERSION(或本 PR 内 `--update-baseline` 记录),见文末复核注。 - 净行:+886/−159,15 文件(4 src + 7 audit md + 4 单测),零 arch/pwd/stdbuf 产品改动。 ## 本 PR 删除了什么 - `pinky --lookup` 长选项一个(GNU 9.4 无此选项,属编造项;删后 `--lookup` 按 GNU 措辞被拒,exit 1)。 - locale 旧 `-k` 无参分支整段破损输出(含字面量拼接块 `LC_CTYPE= + get_system_locale() + ` 等 6 行)与旧 `month`/`codeset`/`collate`/`ctype`/`monetary`/`numeric`/`time`/`default_language` 编造名应答。 - who 对缺失 FILE 操作数的 `No such file or directory` 报错(旧 pin 一并翻转)。 - locale 旧报错措辞 `locale: unknown keyword 'X'`(改为 GNU 的 `locale: unknown name "X"`)。 - 其余皆为新增(测试、审计记录、白名单表),无产品功能删除。 Refs #1488, #1462, #1545 --- 复核注(队长复核员):i18n 同步提交落地前本稿不适用;同步落地后重核 C2 门脚本 rc=0 与正文删除节即可合入。 复核记录:~/workspace/review-1547/CAPTAIN-VERIFY.md
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.
Refs #1488 (第一步:清点扫描). Scan-only change — no source code touched.
What
DOCS/2.0-inventory.tsv: all 176REGISTER_COMMANDapplets (authoritative macro scan; [2.0 长线] 命令库化:显式 IO 的库形态命令集(Rust 重写候选)与机械替换路线 #1488/逐命令对照 Oracle 源码审计:全命令面行为契约核验与修复(用户 2026-10-31 令) #1462 said 178 — delta noted in summary), columns: applet | loc | io_idiom | global_state | exit_usage | oracle_status | test_coverage | replace_wave.DOCS/2.0-inventory-summary.md: method/column semantics, idiom counts, top-5 hardest commands, wave-1 shortlist, spot-check report.Headline numbers
Verification
Spot-checked 7 scanned commands against source (df, hostname, tr, cat, kill, sync, mkfifo): 1 scanner regex gap (
safeErrorPrintwithoutLnsuffix) found and fixed; 7/7 consistent post-fix.