Skip to content

test(dsh): exercise cleanup refusal with a supported CLI - #8947

Merged
loopx-agent merged 1 commit into
mainfrom
codex/dsh-inspect-cleanup-regression-20261117
Nov 17, 2026
Merged

loopx-agent merged 1 commit into
mainfrom
codex/dsh-inspect-cleanup-regression-20261117

Conversation

@loopx-agent

Copy link
Copy Markdown
Collaborator

Goal and delivered outcome

The unsafe-inspect cleanup regression never reached skill inspection. Its fake CLI returned 2.3.0 after the supported minimum became 2.4.0, so initialization correctly tried other CLI candidates and Python discovery. The test then reported four calls instead of two.

Derive this fixture version from the existing CLI minimum. Keep the original two-call and non-retryable transport assertions, verify that the second call is workflow-skills, and reject pip or skill installation after uncertain cleanup. The existing version-probe refusal remains covered by the same parameterized test.

Author declaration and scope

Written by: OpenAI Codex (model_agent). Implemented against the existing unsafe-transport rule in packages/dsh-loopx-plugin/src/cli.ts and the reproduced regression on main 421aa770eaf6; no new written specification is needed.

This completes the test repair independently against main. It is also a standalone repair for the failure reported on C1 #8266; that program's remaining migration and outcome/cost qualification stay with its existing work. Only the regression test changes. No runtime release or installation is part of this proposal.

Validation

Tested head: b3d55edfb723ae8a0a0981e9a8b037da7116dd0c, based on 03e1b482d5a903f1a873b4d1d60360645510540e. Run state: finished. Inputs: synthetic and public fixtures.

Check Result and boundary
Original focused regression on main Reproduced: unsafe inspect failed with four calls rather than two; unsafe version refusal passed.
DSH TypeScript checks and full test suite Passed: host, client and test projects; all 372 tests across 15 suites.
Counterexample Temporarily removing the unsafe-inspect rethrow makes the repaired test fail on an extra call; the production source was restored byte for byte.
Local DSH package and runtime canaries Passed: built artifact, isolated profile install/remove, DSH 0.2.2-rc.3 initialization, skill readback, lifecycle, origin fence and teardown. Mounted browser interaction remains the separate packed-browser gate.
Diff and bilingual RFC checks Passed; no RFC changes.
Local quick premerge Passed: four direct checks and three DSH profile phases, zero failures and no manual hold. This is local validation, not remote merge readiness.
Exact-scope change-quality receipt Recorded and verified against this one-file diff.

These are macOS source and isolated-package checks. Native Windows and remote CI were not queried or claimed. Independent PR review is still required.

UI impact: none. No first-screen or shared-authority fixture change. Test-only change; all commits carry DCO sign-off. The diff and this description contain no private state, raw traces, internal links or local paths.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent; gpt-6.1-sol; OpenAI; runtime_reported; reasoning_effort=max.

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

结论:APPROVE,未发现本次精确头的阻塞代码问题。下述本地失败、资格和合并限制独立保留;本结论不表示全部检查通过。审核头:b3d55edfb723ae8a0a0981e9a8b037da7116dd0c;比较基线:03e1b482d5a903f1a873b4d1d60360645510540e。

动机 / Motivation

维护 DSH 自动初始化的开发者需要确认:子进程清理不确定时,插件会停止并保留现有运行时。 原测试用低于当前最低版本的假 CLI,绕过了技能检查;修订后先接受兼容版本,再在真正的技能检查处模拟清理失败,并核对调用顺序与禁止安装。 现有清理失败测试重新保护预期分支;本 PR 不改变插件运行时行为。 不更改最低版本、CLI 解析或安装策略,不替代 C1 的完整迁移和成果成本资格,也不执行生产安装或发行。

改动思路 / Approach

现有测试修复即可恢复保护;复用最低版本常量只控制前置条件,停止、不重试和不安装仍由独立断言判断。 只修复一个现有回归测试;不增加运行时模块、状态、版本分支或用户操作。

版本常量在这里仅用于让 fixture 通过“兼容 CLI”这个前置条件;安全 oracle 仍是固定的一次/两次调用、第二次必须检查技能、不得进入安装,以及原有 non-retryable transport 错误。这样既避免版本字符串漂移,也没有让测试简单地复制生产函数的返回值。initializeLoopX -> resolveLoopXCommand -> compatible 的执行与权限 owner 完全不变,不需要新模块、额外设置或用户确认。

观察 base 当前 head
完整 15 套测试 371 PASS / 1 FAIL:inspect 预期 2 次、实际 4 次 372 PASS
独立初始化 API 三组输入 完整调用与异常记录 与 base 一致
只删除 compatible 的 unsafe rethrow 不用陈旧 fixture 充当证据 修订测试 FAIL:预期 2 次、实际 3 次;恢复后 2 项聚焦测试 PASS

具体改动 / Changes

完整差异只有一个既有测试文件,+4/-2,没有生产源码或 dependency lock 变化。引入已存在的最低版本常量,替换 inspect 分支的 2.3.0;保留原调用次数与异常断言,增加第二次包含 workflow-skills、整个序列没有 pip 的检查。原有 --install 禁止断言仍在。

关键代码讲解

  1. cleanup-refusal it.each:version 分支仍在首次探测抛出不安全 transport;inspect 分支先返回兼容版本,第二次才触发清理失败。独立调用跟踪证实,旧 fixture 的四次调用依次是三个版本探测和一次 Python 发现,从未调用技能检查;修订后的两次调用才是版本探测和技能检查。
  2. compatible 与 initializeLoopX:这两个未改符号仍以一次 inspect 判定技能契约,isUnsafeToContinue 拒绝时直接抛出,不能把“清理不确定”当作“需要重装”。我只在独立工作区暂时移除这一 rethrow,测试因第三次调用失败;随后逐字恢复生产文件并再次通过聚焦用例。

已先读 packages/dsh-loopx-plugin/README.md#driver-retry-boundary,固定于 03e1b482d5a903f1a873b4d1d60360645510540e;Driver retry boundary 的“无法确认清理就停止”条款在当前头保持。补充审阅依据为同版本的 docs/development/good-smokes.md:Prefer Semantic Pressure 要求反转重要规则时负例能失败,本次变异验证满足它。这里是在修复既有可执行保护,不是新增一次性 smoke,未把 C1 的其他验收塞进测试修复。

对主干的风险 / Risks

最值得反对这项修改的理由是:引用生产常量可能让测试失去独立性。实际检查中,常量只决定兼容版本输入;停止、不安装、真实 inspect 分支与调用次数仍由独立固定断言验证。三个相同输入通过真实初始化 API 在 base/head 的完整调用与异常记录相同。FileRunner 是确定性替身,因此该探针本身不能证明 OS 子进程清理或真实 DSH 运行;生产 cleanup 实现未改,完整既有测试及独立包/runtime阶段提供其原有覆盖。

三组 TypeScript 类型检查和完整 372 PASS 通过。包构建、隔离 profile 和 runtime 验证阶段在本地 premerge 的两轮均通过。原 premerge 的 quality 聚合阶段却两次在原 120 秒限制处超时,分别约 121.216/121.234 秒;没有改限制,也没有把超时删掉。随后直接执行同一 quality phase,四个脚本全部完成(类型、372 测试、peer-range、MCP transport),约 88.69 秒;这提供了必要不变量的独立覆盖,并未证明前两次时间波动的原因或重写原 gate 结果。原完整 premerge 仍为失败,合并流程需要保留这一事实。

带项目策略的 dry-run 另报 exact-scope Change Quality receipt missing;dry-run 没有执行检查,不把它列为验证通过。未查询远端 CI,也没有声称 Windows 或生产安装已验证。PNPM 11 关于忽略旧 pnpm.overrides 字段的警告保留;package/lock 在 base/head 相同,这项 PR 没有调整依赖策略。

我的整体评价 / Verdict

我认可这项既有回归测试修复,未发现阻塞代码问题:它恢复了对真正不安全 inspect 分支的辨别能力,且用独立变异证明并非只把失败断言改绿。long_horizon 和 user_experience 在所检路径上保持;运行时与用户操作没有改变,也没有可归因的长期收益数据。检查的自动初始化测试及未改的 bootstrap 消费方没有渲染页面或首屏变化。视觉范围不适用;真实模型、原生Windows和生产安装不在本次验证范围。

不再添加新的 helper、配置或版本分支,是这个边界内合适的简化。评审 APPROVE 与原 quality 超时、项目质量回执、审批关闭及平台合并门分别处理;不能把这里的认可解释为 premerge 全绿、发行完成或合并权限。

English verdict: APPROVE for b3d55edfb723ae8a0a0981e9a8b037da7116dd0c. The existing test now reaches unsafe skill inspection and rejects a deliberate fallback mutation; production API observations are unchanged. Preserve both native quality timeouts and the missing scoped quality receipt as separate validation/readiness limits.

@loopx-agent

Copy link
Copy Markdown
Collaborator Author

精确提交 b3d55edfb723ae8a0a0981e9a8b037da7116dd0c 的合并前验证已完成;沿用 该提交的完整 APPROVE 评审,没有重复发布一次完整审核。

改动仅为 packages/dsh-loopx-plugin/tests/init-command.spec.ts:复用现有最低 CLI 版本,使夹具真正走到 inspect 失败分支,并明确禁止继续安装。生产源码和依赖锁均未改变。

本次在独立源码 checkout、相同锁定依赖及已核实的源码入口执行:

  • 标准 canary premerge --from-git-diff --git-diff-base origin/main 全部通过,基线 ef099ae3ac3c08054b9d928fff48aefe2615b950;4 个直接检查、6 个选中检查全部执行,0 失败、0 跳过、0 manual hold。
  • catalog 与 risk-profile 各执行 quality / package / runtime 三阶段。quality 包含三组 TypeScript 类型检查、15 文件 372 测试、peer-range 和 MCP transport 检查;package 覆盖构建、打包产物及隔离 profile 安装/移除,runtime 覆盖本机真实 DSH 集成夹具。
  • 保留原每检查 120 秒限制,两次 native quality 分别 49.486 / 55.159 秒;没有放大超时。整条标准 premerge 耗时 145.072 秒。
  • 原项目启用的 strict change-quality 回执已按该精确 base/head 补齐,并由 premerge 验证 valid;DCO、双语 RFC 差分、差分整洁和公共边界检查通过,工作区无 tracked 副作用。

此前两次 native quality 超时仍保留为失败历史,起因尚未证实;本次通过不重写旧结果。未测原生 Windows、已安装 App 或真实模型/订阅收益,本变更也不主张这些结果。CI 按当前项目配置不查询或等待。

该单文件测试修复符合仓库 low-risk test-only 自合范围;最终合并仍以未变的 remote head、精确评审、无未解决线程及最新原生 readiness 为准。author-owned PR 的 COMMENTED APPROVE 不能满足 GitHub 的他人正式 approval;如走仓库已委托的 PR bypass,原因仅限这一测试修复,不扩展为 C1 runtime/default 切换授权。回滚可撤回该测试修复,生产行为保持原状。

@loopx-agent
loopx-agent merged commit f15c705 into main Nov 17, 2026
25 of 30 checks passed
@loopx-agent
loopx-agent deleted the codex/dsh-inspect-cleanup-regression-20261117 branch November 17, 2026 21:00
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