v2 provisional: clear integration 9 failures (whitelist tr+exit, B4 viewport draft, CHANGELOG pointer, workers audit via audit_on_conn, verify-multiuser gate evidence)
9 failures from v1 baseline 02835f6 cleared with provisional resolutions only; each option pair is annotated provisional in verification/code-to10-v2-failures-summary.md and awaits user confirmation. No check deleted, no skip added, no bare-phrase stuffing, default hard merge gate untouched. Known remainder: one pre-existing date-dependent test_arch_converge failure (Oct-dated fixture vs Nov current month), failing on pristine v1 too, left for the quota track.
This commit is contained in:
1 parent
cdb481092d
commit
c900a0f78d
4 files changed
+187
-30
No files matched your search
@@ -1407,6 +1407,10 @@ VERIFY_COMMAND_ALLOWLIST = frozenset({
|
||||
# 验测里常见的最小谓词/输出工具(只读或只写 stdout)
|
||||
"test", "[", "true", "false", "echo", "grep", "cat", "ls", "diff",
|
||||
"wc", "head", "tail", "sleep",
|
||||
# tr:与 grep/wc/head/tail 同类的 stdin->stdout 纯过滤器,
|
||||
# 无写文件、无联网、无 -i 原地模式(与 sed 不同,sed 因 -i
|
||||
# 写文件、awk 因 system() 可执行命令,本轮刻意不补入)。
|
||||
"tr",
|
||||
# sleep 是惰性的(只等待,不读写、不执行),且受 verify_timeout
|
||||
# 上限约束;验测里“等一会儿再查文件”(sleep N && test -f)
|
||||
# 是常见写法,旧测试 test_goal_verify_timeout_is_a_verify_failure
|
||||
@@ -1417,7 +1421,20 @@ VERIFY_COMMAND_ALLOWLIST = frozenset({
|
||||
# pip/pip3(装包取码;python3 -m pip 同理不在首词层拦截,见上文
|
||||
# “白名单不是沙箱”)、cd/export/time(shell 内建,改 cwd/环境,
|
||||
# 请用 VAR=val cmd 形态或 host 自身的 cwd)。
|
||||
#
|
||||
# 临时消解(v2 provisional,待用户确认后才算定):#256 白名单 ×
|
||||
# #263 旧 shell 语义碰撞——本轮临时选“白名单扩围”一边,见下
|
||||
# _VERIFY_SHELL_BUILTINS。另一边(旧测试按新语义更新:管道改
|
||||
# grep、exit 3 改 python3 -c sys.exit)的代价是丢掉“任意退出码
|
||||
# + 管道过滤器”这组旧 shell 语义的直接证据,且改的是 #263 已
|
||||
# 定测试的期望;若用户最终选旧测试更新一边,本处扩围须 revert。
|
||||
_VERIFY_DENIED_RC = 126
|
||||
# 仅有的白名单内建命令:exit。它不是外部程序(simple 路走
|
||||
# shell=False 会因找不到可执行文件而抛错),只能走 shell 路;
|
||||
# 它除终止本条 shell 并返回码外无任何副作用(不读写文件、
|
||||
# 不联网、后续段不会执行),故可作段首词,但 classify 须给它
|
||||
# 打上 builtin 形态、强制走 shell,绝不能落入 simple/simple-env。
|
||||
_VERIFY_SHELL_BUILTINS = frozenset({"exit"})
|
||||
|
||||
|
||||
def _scan_shell_command(command):
|
||||
@@ -1761,6 +1778,11 @@ def classify_verify_command(command, cwd=None):
|
||||
"features": features, "notes": notes}
|
||||
else:
|
||||
notes.append(f"脚本路径未校验(无 cwd):{cmd_word}")
|
||||
elif cmd_word in _VERIFY_SHELL_BUILTINS:
|
||||
# 内建命令无 argv 可执行体:打上 builtin 形态,迫使
|
||||
# 本函数末尾落入 shell(shell=True 下由 shell 解释),
|
||||
# 绝不能走 simple/simple-env 的 shell=False 路径。
|
||||
features = features | {"builtin"}
|
||||
elif cmd_word not in VERIFY_COMMAND_ALLOWLIST:
|
||||
return {"kind": "denied", "argv": None, "env": None,
|
||||
"reason": f"首词不在验测白名单内:{cmd_word}",
|
||||
|
||||
Reference in new issue
Block a user