Repository navigation
test(cli): isolate machine transport and local telemetry fixtures - #8195
Conversation
…fixtures Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
loopx-agent
left a comment
There was a problem hiding this comment.
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
Reviewer: model_agent | gpt-6.1-sol | OpenAI | runtime_reported | reasoning_effort=max
当前提交的代码审查结论为通过。
动机 / Motivation
运行源码入口回归测试的维护者需要看到控制器真实的准入结果和用量提示,才能区分产品回归与测试环境干扰。
测试继承开启的模型上下文传输后,把导航对象当成内联机器结果。临时用量目录缺少显式本机资格,首次提示测试也拿不到预期文案。 新提交下,同一命令的 42 项源码入口测试通过,包括两个入口的拒绝、其他 Goal 的准入、回执恢复及本机首次用量提示。
本次修改集中在现有源码入口测试的子进程环境及本机用量 fixture。
独立验证覆盖当前源码和相邻契约。安装发行包与其他操作系统的回归由既有发行验证覆盖。
改动思路 / Approach
现有子进程 helper 在测试请求机器 JSON 时设置子进程传输开关,显式覆盖仍按原优先级生效。用量用例复用产品允许的数字 loopback 资格,并拦住发送器。 两种入口各跑一次父进程开和关的场景,让测试直接证明机器调用和模型传输之间的边界。
具体改动 / Changes
改动一处测试文件,增加 10 行、删除 2 行。基线 546c08c0d3f22358ef09b13e69f7edaa806121b8 的 docs/reference/required-work-context.md 要求机器调用方显式选择内联结果,临时用量目录须显式使用数字 loopback。 上下文交付规范 用量资格规范
- MACHINE_JSON 的
run_entry只在子进程里设置LOOPX_CONTEXT_DELIVERY=off。调用方传入的env最后合入,可显式覆盖。 子进程环境 - CONTROLLER_SCOPE 的 module 和 console 都验证受保护 Goal 的写入拒绝、其他 Goal 的准入、原回执恢复及父进程环境。 控制器用例
- TEMP_USAGE 的首次用量提示用例在临时目录内显式启用数字 loopback。它检查 stderr 和披露版本,stub 记录的 detached sender 次数为零。 提示用例
对主干的风险 / Risks
同一命令将父进程传输设为 on。基线为 37 项通过、3 项失败,分别是两个错误读取决策的 KeyError 和首次提示缺失。当前提交 42 项通过。用量、上下文捕获及委派相邻测试共 122 项通过。改动文件 Ruff 和配置的 Mypy 通过。签名和公开边界检查通过。quick premerge 的 5 个直接检查和 0 个选中检查通过。
全量必需 Ruff 在两版都仅报同一处 F841,位于未改动的 tests/control_plane/test_goal_create_completion.py:184。严格质量回执 cqr_325df56af1fde4caae24 为 fail。 两侧完整诊断、Ruff 版本及出错文件内容相同。按当前策略未查询托管 CI。
我的整体评价 / Verdict
当前提交 d6429ce9daec2f2c82d21f4a7f9d404658da6800 以原测试 helper 修复了可复现的隔离错误,保留真实控制器及首次提示断言。实际检查了两个源码 CLI 路径的返回码、JSON、stderr 及隔离状态。此测试改动无渲染页面,视觉审阅不适用。 独立执行环境为本机源码。Windows、安装发行包和真实远程用量发送未验证。
English verdict: APPROVE — The source-entrypoint fixture repair preserves controller and notice coverage. The unchanged required Ruff failure still holds strict qualification.
Source-entrypoint regression tests currently mistake model-facing context navigation for an inline quota decision, and the first-use telemetry fixture expects disclosure from a temporary runtime without the existing explicit local qualification. The three selected cases fail on main before this change.
The existing Python test helper now requests machine JSON only for its child process, while retaining explicit environment overrides. The real outer-controller test runs with parent context both on and off for module and console entrypoints, preserving protected-goal rejection, independent-goal acceptance and receipt-bound recovery. The disclosure fixture opts into the existing numeric-loopback qualification and still asserts that no detached sender starts.
Scope
Only
tests/control_plane/test_source_cli_entrypoint.pychanges. Production TypeScript policy and transport owners, default model context, telemetry eligibility and authorization remain unchanged. This is an existing Python subprocess-fixture repair, with no parallel decision owner or new vocabulary. The shared helper avoids repeated capture parsing at each assertion.Target:
main; tested immutable merge base:546c08c0d3f22358ef09b13e69f7edaa806121b8. Later target commits were inspected and do not change this test file. Tested head:d6429ce9daec2f2c82d21f4a7f9d404658da6800. One DCO-signed commit.Validation
tests/control_plane/test_goal_create_completion.py:184from upstream Retain approved Goal completion criteria before first dispatch #8178. It remains a required validation hold; no baseline exemption or unrelated fix is included.cqr_325df56af1fde4caae24: recorded fail; verification isinvalid_receiptbecause of that required Ruff failure. Native premerge passed its five direct checks and selected no extra canaries; the overall gate remainsquality_invalid_receipt.Author work is complete and reviewable; CI and independent review remain to be assessed. No merge-ready or full-repository test-pass claim.
UI impact: none; no frontend, Lark or installed-app behavior changes. Visual evidence is not applicable. Fixtures are synthetic/local, and no real user message, model call or remote telemetry is used. Written by model_agent — OpenAI Codex (GPT-6).