Repository navigation
test: repair canonical attention and cleanup-clock CI fixtures - #7049
Conversation
Signed-off-by: huangruiteng <huangrt01@163.com>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: actor_kind=model_agent; model=gpt-6.1-sol; provider=OpenAI; declaration_source=runtime_reported; reasoning_effort=max
详细中文评审
动机
维护 Goal 工作区和进程清理代码的开发者,需要这些既有验证能继续发现真实回归。
旧浏览器夹具仍只写 Markdown,读取权威状态时缺少待办数据;两项进程测试又把浮点时钟舍入当作清理超时。当前夹具先完成真实导入,测试使用固定时钟。
相同基线的六种夹具均在读取时失败,当前六种均保留全部 21 项与三项摘要;打包浏览器路径通过,原清理拒绝断言仍能杀死两种错误实现。
本次只修复三个既有验证文件,不改产品运行时、权限、调度、provider 限额或用户界面,也不宣称 Windows 实机和全仓库测试已通过。
不改动会使原生浏览器回归停在夹具准备阶段,并把舍入误差当成需要排查的产品故障。恢复隐式 Markdown 权威或放宽超时断言都比修正测试输入更偏离原合同。这个完整增量是恢复原有验证的可执行性;不需要增加产品设置或用户确认轮次。
改动思路
权威待办仍归原 canonical owner,夹具复用已有 import_fixture_authority:先备份完整合成源,按保存的导入计划 prepare/apply,再通过真实 Todo reader 读回。只在临时目录建立 File provider;没有迁移或修改活跃 Goal,也没有用手造前端列表代替生产状态读取。
collect_status 的完整原始待办集合保留21项,project_asset 摘要仍只显示三项。--full 明确执行冷读取后才标注完整。原 goal-masthead 再把这些包交给已交付 parser/adapter 和打包页面,继续区分完整、部分、混合和未知状态。这里更正的是测试对当前 owner 的输入,不是改变产品读取策略。
两项 Windows 清理测试只把时钟设为0、deadline设为0.1。原来“不确认子进程退出就拒绝成功”和“原 receiver 未回收必须抛错”的检查、等待次数及上限断言逐项保持相同。生产清理函数及六个相关状态/导入/测试文件与不可变基线逐字节一致。
具体改动
完整评审 e13eb13dabedf001cb49a5eddb5d1b19136476e2 的三个文件、+10/-5:既有 Python 状态夹具、浏览器场景注释和两个既有清理测试。没有产品源码、生成物、新 smoke 或新共享 vocabulary。
规范为 spec_ref=docs/development/good-smokes.md,不可变 spec_revision=b285c7c1b38bb1d426fca2ef6bd8ddfce177959a,按变更前的原章节核验:
| criterion_id | 当前处置与证据 |
|---|---|
| Start With The Contract | implemented:完整源经真实导入、状态读取和打包消费者,不用 helper 成功冒充整条路径。 |
| Is the result deterministic? | implemented:临时合成状态与显式时钟;独立选择256.0时钟原点,复现基线的0.10000000000002274舍入。 |
| Prefer Semantic Pressure | implemented:原两条拒绝断言不变;把“leader退出即清理成功”或“吞掉未回收异常”注入原函数边界,两种错误实现都被现有测试拒绝。 |
| Consolidate Without Losing Coverage | implemented:复用既有导入 helper,保留浏览器与进程两个不同合同;没有新增重复脚本。 |
| Public-Safe Fixtures | implemented:临时目录、公共合成记录及模拟 native IO;不使用活跃 Goal、真实用户消息或凭证。 |
关键代码讲解
goal-attention-fixture.main在真实状态读取前调用既有导入 helper。完整源断言由旧12项修正为21项,摘要三项及原总数断言仍保留;适用的完整读取继续来自原 cold API。goalMastheadScenario只有说明性注释改变,实际生产 parser/adapter、摘要完整性、零动作和中英窄屏断言没有弱化。test_windows_exited_leader_does_not_certify_descendant_cleanup与下一项 unreaped-receiver 测试使用确定时钟;没有扩大 timeout、删除异常或降低回收要求。
对主干的风险
最强风险是修复夹具时制造完整性,或固定时钟后掩盖错误成功。独立运行六种 gate/mixed/optional × 摘要/完整模式:基线六例都报 KeyError: user_todos;当前六例都保留21条原文、分类和唯一 canonical id,默认摘要仍三条。完整/混合/未知的打包页面验证通过,观察不会启动 Turn 或更改 owner 状态。
在同一256.0时钟原点,基线两个断言因浮点舍入失败,当前两个通过;两种危险生产函数变体仍分别触发原 raises 断言失败。这证明当前绿灯依赖语义拒绝,而非只把测试环境改到总能成功。
较广本地四模块测试在两臂均为 73通过、2失败、1跳过。两个失败均在未迁移 None provider 夹具调用 canonical reader 时发生,完整失败栈仅规范化临时路径/内存地址后逐字节相同;这两个测试及所有相关生产文件都未变化,故归为 pre_existing_unrelated,保留红灯,不宣称全仓库健康。跳过的是既有 Windows junction regression;本机只验证了模拟 Windows 清理,未执行 Windows 实机。
当前标准diff原生预检通过:五项direct、两项catalog及一项public-boundary检查;Ruff、Chat构建与实际打包 goal-masthead 场景通过。没有查询、轮询或等待远端CI。浏览器里实际检查中文桌面21项/部分未知和英文390宽混合/未知截图;这只证明现有页面的状态语义,没有把占位夹具当成新布局质量或安装采用的资格。
扫描相同作者最近12个PR的完整改动路径,其他PR没有改这三个文件;相关 #7044 是七文件的 benchmark source 选择改动,引用了这些故障但没有重复修复它们。现有独立进程测试与真实source到浏览器场景具有不同长期价值,保留而无需合并成新框架。
我的整体评价
APPROVE,无阻断发现。 problem_context=goal_achieved 仅指这次完整测试修复;long_horizon=preserved、user_experience=preserved,产品行为和用户步骤不变,原有真实消费者验证恢复可用。不以测试数量、评审或收据证明长期净收益。
规模与问题相称,已有导入 helper 是本次实际复用与简化;没有需要另建模块、兼容分支或迁移的理由。保留两项无关基线失败及Windows实机边界,批准不授予合并或安装权限。
英文简短结论
English verdict: APPROVE — e13eb13. This three-file test repair restores the real canonical-source-to-packaged-browser journey and deterministic cleanup checks without changing production code or assertions. All six current fixture modes pass while the identical base fails; two unsafe cleanup mutations are still rejected. Standard local premerge, build, Ruff and packaged browser pass. The broader suite retains two identical pre-existing canonical-fixture failures and one Windows-junction skip; native Windows, installed adoption and repository-wide health remain unqualified.
The Goal attention browser fixture failed with
KeyError: user_todosafter unmigrated Markdown reads were retired. The fixture now imports its disposable state through the existing canonical-authority helper; it retains all 21 decisions in the source while preserving the three-item overview. All six bounded/full and gate/action variants pass.Two Windows cleanup tests also failed when floating-point subtraction produced
0.10000000000002274instead of0.1. Use a deterministic clock for these mocked process tests, preserving the existing cleanup and deadline assertions. Production behavior is unchanged.Validation: 62 related tests passed, one platform-specific test skipped on Linux; all six real-provider fixture modes and the compiled
goal-mastheadbrowser scenario passed. Ruff, diff, bilingual and public-boundary checks passed. Actual Windows validation remains with CI.These failures were observed in #7044. The attention failure also reproduces on current main
b285c7c1b; this independent repair keeps benchmark source-selection changes separate.