Repository navigation
test: remove obsolete contract-health display import - #8969
Conversation
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
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)
无阻断发现,APPROVE 当前 exact head d01c512ffc328f69b1e14b551dafaee33075b7ac。
动机 / Motivation
运行仓库本地校验的贡献者会遇到这个问题。同一条 Ruff 命令在 base 因未使用导入报 F401;删除该行后完整声明范围通过。恢复本地 lint 门,同时保留 contract-health 的全部断言与 JSON 身份校验。本补丁只修复测试文件的 lint 缺陷;C1 迁移、运行时、安装及发行资格继续由各自交付负责。
改动思路 / Approach
直接删除测试模块中唯一未被引用的 display_report_text import 是足够的修复。忽略 F401 会放宽仓库校验,删除生产 helper 或测试断言则超出问题范围。loopx.contract 仍导入并调用该 helper;测试继续走 display_report_value → report_json_text。完整净 diff 只有这一行,没有新增 owner、配置、状态或重试。
具体改动 / Changes
规范依据:CONTRIBUTING.md#fast-loop-and-full-check,不可变 revision 684400582063e16d6c460b005598714f03ae380b(原文),在读 diff 前核对。declared-ruff:完整声明 Ruff 范围通过;fast-loop:按该测试清理的风险执行相关测试、配置的 mypy 和 quick premerge。
该测试模块 的完整 AST 对照除这一条 import 外完全相同:16 个测试函数、71 条断言保留。base/head 各 21 项测试通过、零 skip,包含相似 Goal 身份不合并、JSON 身份还原、全局错误 fail-closed 与缺失 state 只阻断受影响 Goal。配置的 mypy 两边各 17 个源文件通过。base 的同命令 Ruff 仅报这一处 F401,head 全声明范围通过。
对主干的风险 / Risks
PASS:精确 head 的托管 quick premerge 执行 5 个直接检查、0 个 catalog 检查,零失败/手动 hold;严格 CQR cqr_61888f437cc964f01e69 与当前 base/diff 匹配且 valid。两边使用各自 checkout 的 Python/LoopX,未借用已安装版本,未查询或等待 CI。
最值得防范的是清理顺带删掉身份断言或必要 helper:完整 diff、AST 对照和现有测试排除了本补丁的这种变化;helper 的独立 canary 仍保留。#8953、#8950、#8949 的同文件 patch 也含该行删除,已读回确认;它们的更广重构另行评审,后续按各自 base 协调,不能把本次窄批准套用过去。没有新增一次性 smoke、复制 fixture 或包装器。
我的整体评价 / Verdict
本次维护目标已完成:声明 lint 缺陷消除,原语义覆盖保留。Long-horizon:preserved,生产接续/权限/持久化路径无 diff;不据此声称 C1 迁移或效率收益。User experience / visual review:not_applicable。仅删除 tests/control_plane/test_contract_health.py 的测试 import,没有渲染表面变化。无本补丁引入的视觉待验范围;未开展 UI 或安装验收。
无当前阻断发现。检查覆盖这一行源码清理;全仓回归、跨平台、安装与发行没有在本次验收。当前边界无需额外 refactor。批准结论与 GitHub closeout、readiness 及实际合并授权分别判断。
English verdict: APPROVE exact head d01c512; removes the independently reproduced F401 only, preserving all assertions with 21/21 base/head tests, declared Ruff, configured mypy and strict managed quick premerge passing.
Goal And Delivered Outcome
mainat684400582063e16d6c460b005598714f03ae380bfails the repository Ruff command with F401 intests/control_plane/test_contract_health.py:display_report_textis imported but never used. Remove that obsolete import; retain the JSON report helpers and every identity/health assertion. This also resolves the baseline lint defect identified in the independent review of #8963.Author Declaration
CONTRIBUTING.md#fast-loop-and-full-checkat that revision.tests/control_plane/test_contract_health.pyScope And Continuation
Complete within this lint repair. #8956 and #8963 retain their separate C1 implementation and review boundaries; this PR does not change runtime contracts or certify the C1 migration.
Validation
d01c512ffc328f69b1e14b551dafaee33075b7ac.uv run --extra test python -m ruff check tests loopx/canary loopx/control_plane loopx/domain_packs loopx/presentationuv run --extra test python -m pytest -q tests/control_plane/test_contract_health.py: 21 passed, including distinct Goal identities, JSON projection and affected/unaffected health behavior.cqr_61888f437cc964f01e69verified valid.Coverage: a test-only unused-import removal; runtime, UI and packaging behavior are untouched. Remote CI was not queried. Broader runtime or model qualification is outside this repair.
Frontend / Visual Evidence
UI impact: none. Screenshots and visual review: N/A; no rendered surface changed. Source data: none.
Type of Change
LoopX Area
Shared-authority RFC fixture impact
N/A: no authority, provider, persisted schema or routing behavior changes.
Boundary Checklist