Repository navigation
Fix Windows CLI output probe reader invocation - #8817
Conversation
Port the probe fixture and native Windows regression coverage from e6eb92d and 8d200aa. Decode the generated PowerShell literals into argv before launching the pinned reader. Signed-off-by: LoopX Agent <[email protected]>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent / gpt-6.1-sol / OpenAI / runtime_reported / reasoning effort max
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
动机 / Motivation
在 Windows 上维护或验证 LoopX 的人需要 CLI 输出预算探针完整读取已保存的上下文,才能比较两个版本。 旧探针把 PowerShell 调用符当成可执行文件,比较在基线收据生成阶段中断。候选解开路径的引号并通过原启动器补读全部页面,输出比较可以继续。
同一组用例在基线重现了两种启动失败。在候选上,两条路径读回原始 UTF‑8 字节,冻结探针完成了 98 对输出的比较。 核验范围包括 macOS 上的真实 PowerShell 7、CLI 恢复与冻结输出对照。此提交的原生 Windows CreateProcess 和托管任务未独立执行。
改动思路 / Approach
本次交付是回归探针的进程启动与原有 Windows 工作流的测试选择。 探针用现有渲染器和启动器,只在测试夹具中还原生成的字面参数。 普通 POSIX 形态继续用原解析。对 PowerShell 形态,引用路径需要解开调用运算符和重复转义的引号。相对脚本交给既有启动辅助函数。随后分页器继续核对原命令范围和游标,每页由实际 CLI 读取。 生成命令 · 启动助手
具体改动 / Changes
关键代码讲解
_reader_argv还原已知的字面命令形态,扫描范围覆盖 & 后引用的可执行文件和直接的安全相对词。ASCII 单引号和四种 PowerShell 单引号字符按 renderer 的重复规则解开。两条测试用真实命令读取保有引号、中文和 emoji 的捕获。解码与其边界 · 两条回归用例read_pinned_cli_body将 .ps1 交给command_argv,其他路径仍通过 argv 启动。每次续读仍应使用同一程序、选项和原文件。结束时核对内容长度和 JSON 类型,原诊断测试继续验证 UTF‑8 进程错误。读回循环pinned_reader_follows纳入当前 Windows fixture 测试项。工作流测试确认选择器存在,同时保留长路径、稳定夹具和进程诊断的原有选择。测试入口
按 docs/reference/contracts/interface-budget-contract.md 核对。frozen-pinned-comparison 已实现,两端使用同一份冻结探针。complete-digest-bound-utf8 已实现,原读回身份和导航与每页字节均保留。native-launcher-coverage 已实现,两条真实启动回归都被选入已有原生 Windows 测试步骤。基线 Canonical CLI fixture qualification
对主干的风险 / Risks
路径需要调用运算符时基线试图执行 & 并报 FileNotFoundError。直接执行相对 .ps1 则报 PermissionError。 候选上 743 项定向和工作流测试通过。额外的启动器与预算选集为 9 项通过、2 项跳过。冻结探针比较了 98 对结果,未触发输出回归或新增可见结果。测试用输入限定为现有 renderer,生成语法变化时同一组路径回归会暴露差异。独立执行在 macOS 与真实 PowerShell 7.5.4。Windows 工作流选择经过本地断言,确切提交的原生 CreateProcess、环境编码和托管任务结果仍未核验。
语义与 CI 对齐
行为复用已有捕获与启动器协议。工作流扩大已有测试选择。原 CLI 的分页、费用观测与只读约束由本地冻结对照和实际读取覆盖。
我的整体评价 / Verdict
本次交付是回归探针的进程启动与原有 Windows 工作流的测试选择。 对需要比较输出的维护者,这使已经生成的原始内容能进入同一相对预算比较。现有预算和补读义务保留,净长期收益未量化。检查了测试夹具和工作流差异。这个边界没有渲染面。 未执行原生 Windows 创建进程和托管任务。 本地证据支持在 b330832f3e1d 给出通过结论。
English verdict: APPROVE at b330832. Both historical invocation failures reproduce, and the fixed probe reads the original UTF-8 and compares all 98 frozen outputs. Native Windows at this exact head remains unverified.
Problem
The native Windows CLI budget smoke fails while it builds the frozen base receipt. The probe passes a generated PowerShell command through POSIX
shlexand hands the resulting&token to CreateProcess as the executable. The failure is reported asWinError 2before later portability checks run. Windows failureChange
Port the test-fixture correction already exercised by #8266. Decode the renderer's literal PowerShell argv, preserve quoted paths and run pinned
.ps1launchers through the existing command helper. Run both path regressions in the native Windows lifecycle job.Validation
&onmainwith a generated Windows command. The same CLI test on this head reads the complete UTF-8 body across multiple pages.