Skip to content

test(audit): #713 probe stdin EOF + refresh last-run line - #904

Merged
caomengxuan666 merged 1 commit into
masterfrom
arookieofc/docs-713-probe-refresh
Oct 19, 2026
Merged

caomengxuan666 merged 1 commit into
masterfrom
arookieofc/docs-713-probe-refresh

Conversation

@arookieofc

Copy link
Copy Markdown
Member

Reran scripts/audit/nested-context-probes.py (45 cases) on master c9e1421 against WSL GNU bash 5.3.0: 0 engine divergences. The #825/#826 probes pass (both closed); the only residual byte diffs are 3 D1-brand path spellings (/d vs /mnt/d in the $0 prefix). Includes a 1-line harness fix: stdin=DEVNULL in _run (fd9-in-subshell hung forever under a held-open inherited stdin). Docs-only + harness-robustness; no engine bytes touched. Doc run line updated.

@github-actions

Copy link
Copy Markdown
Contributor

欢迎!这是你的第一个 PR 🎉 请确认已跑过本地测试套件;CI 通过后维护者会 review。

@caomengxuan666

Copy link
Copy Markdown
Member

评审结论:APPROVE-WITH-NITS

独立评审(自建 worktree @ 39df8a8,实做验证:本机实跑 harness 45 例 + hang A/B 复现)。stdin EOF 修复正确、last-run 行刷新实质成立、#713 基建无回退。两条 nit 建议随下次触及顺手改,不阻塞合并。

实做验证(全部本机复现)

  • hang bug 复现:master 版 nested-context-probes.py 在 held-open 空管道 stdin 下,case 1 fd9-in-subshell(exec 9<&0 后 read -r -u9)20 秒零输出挂死——与 PR 描述的故障机制一致。
  • 修复实证:PR 版同条件 27 秒跑完、rc=1。stdin=subprocess.DEVNULL 加在共享 _run 里,两腿(rubash/GNU)同 stdin,差分公平性保持;45 例中仅 fd9-in-subshell 依赖 runner stdin,DEVNULL 使其确定性 EOF,与 GNU 行为一致。
  • 45 例实跑(按文档 runner 行:RUBASH_BIN=<exe> GNU_CMD='wsl /usr/local/bin/bash',oracle 实证 5.3.0(1)-release,空 scratch cwd):cases=45 divergences=3,3 条全部是 D1 品牌差异——rubash 打 /c/...、GNU 打 /mnt/c/...,仅 $0: line N: 前缀不同;status=1、单次发射、err.txt/err2.txt 捕获全部一致。即 set -T (functrace) DEBUG trap is not inherited into $( ) command substitution — GNU keeps it in the comsub child (trap.c:1469-1471) #825(已关)/compound's own redirection-failure diagnostic bypasses the ordered fd table: printed twice, 2>file capture dropped, leaks across a subshell's 2>err.txt #826(已关)的修复在 master c9e14214 上验证成立,“0 engine divergences” 实质成立。
  • 基建不回退:45 例(24+21)完整;逐文件脚本法、wsl bash -lc 禁令、wslpath 翻译、非零退出契约、D1–D3 记录全部保留;diff 仅 _run 6 行 + 文档一节。
  • 越界审计:文件集 2 个与票面一致;无 GPL 物料;CI 全绿。

Nit 1:last-run 行引用的数字与 harness 字面输出不一致

文档写 `cases=45 divergences=0`,但 harness 原始打印是 divergences=3(3 条 D1 路径拼写被人工归类为“0 engine-side”)。同一句里点明了 3 条残差、诚实无疑,但上一版 2026-10-13 的行是字面记录(divergences=4)。建议改成可复现的字面口径,如 `cases=45 divergences=3 (all D1-brand `$0` path spelling; 0 engine-side)`,否则下次复跑者看到 3 会以为文档过期。

Nit 2:“case artefacts land there”只对了一半

空 scratch cwd 只承接 c1.log/c2.log/c3.log/c4.txt/c5.txt/err.txt/err2.txt;case.sh 由 _case_file 写在 scripts/audit/ 下,且是 #770 提交的 tracked 文件(每次运行覆写)。跑完恰好回到末例内容所以 status 干净,但中途中断的运行会用中间 case 弄脏 checkout。建议本句措辞修正,或后续把 case.sh 改为 tempfile/入 .gitignore(后者可另行立票)。

观察(非本 PR 引入,仅记录)

该 .py blob 在 master 上本就全文 CRLF(108 行 \r,PR 后 113 行 = 净增 5 行沿用既有风格),.gitattributes 只钉了 *.sh/*.rs 没钉 *.py——与 CONTRIBUTING.md §3 的 CRLF 教义相悖,可另行立票补 *.py eol=lf。

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.

2 participants