Repository navigation
test(change-quality): fix attribution mutation test lint - #6037
Conversation
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
There was a problem hiding this comment.
Reviewer: model_agent; model=gpt-6.1-sol; provider=OpenAI; declaration_source=runtime_reported; reasoning_effort=xhigh
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
动机
贡献者运行现有归因测试文件的 Ruff 检查时,主干有九处单行条件语句触发 E701,候选展开后同一检查通过,重复阻断无关贡献的验证。移除这一可复现的主干测试 lint 阻塞,保留原有十七项归因测试行为。仅修改既有测试的九处分支排版,不改变运行时、归因规则或 SQLite 迁移。这一缺口在固定主干上独立复现,修复有直接维护价值。
改动思路
沿用原有九个反例和归因校验入口,只把条件语句后的操作移到独立行。归因决策仍由现有类型化校验规则负责。完整 AST 对比覆盖整个文件,证明语法树中的分支、赋值、调用与断言完全一致。抽出新 helper 没有必要。
具体改动
仅一个测试文件的九处 if/elif 排版,18 行增加、9 行删除。依据 CONTRIBUTING.md,固定规范版本 7222d54,验收项 “Fast loop and full check” 在本 head 已实现:文件 Ruff 通过,原归因测试 17 项通过,完整 AST 一致,原生 premerge 与精确范围 CQR 通过。
当前 head 的九处分支仍包含 head、signature、command、fixture、environment、missing、self、failed、uncovered 九个原反例;没有新增测试或修改判定规则。
对主干的风险
最强反例是“测试数量不变,但排版时误改分支逻辑”。固定 base/head 完整 AST 相等独立排除了它,原有负向断言也全部通过。主干九个 E701 原失败保留为证据,候选同一检查已通过;没有放宽 lint 或删除断言。原生 premerge 的四项直接检查通过,本 diff 未选择额外风险 smoke,无失败和人工 hold;加上原17项测试、文件 Ruff 和完整 AST 对比足以覆盖此排版修改。新增 diff 扫描无私有状态、凭据或本机路径。远端 CI 按 policy20 未查询,完整仓库、UI、PostgreSQL 未重跑,本 diff 不触及这些边界。
我的整体评价
APPROVE,未发现阻塞项。长期维护 improved:反复遇到的已证明 lint 阻塞被移除;产品用户体验 preserved:运行时入口、存储、迁移和用户步骤完全未改。沿用既有测试词汇,不新增共享契约。相邻重构检查结论是保留直接分支,不增抽象。这只完成测试维护缺口,不能据此宣称 SQLite 升级或退役验收完成。
English verdict: APPROVE. Nine baseline E701 errors are fixed with complete AST parity and all 17 original tests passing. No runtime or migration behavior changes. Exact head: c87f65d.
The baseline attribution mutation test has nine Ruff E701 failures on
main, so otherwise valid contributions that run this file's lint check fail. Expand the nine existingif/elifbodies to the repository's multiline style.All mutation scenarios, assignments, attribution calls and assertions remain unchanged. The existing Change Quality typed validation owner and receipt rules stay intact; this is a test maintenance fix under the roadmap's S8/S12 engineering qualification boundary.
Validation:
7222d544; the original attribution suite passed all 17 cases.git diff --checkpasses.The adjacent refactor pass found no useful extraction: direct mutation branches preserve the nine independent negative cases without adding an abstraction. No runtime, UI, schema, feature default or migration behavior changes.