Repository navigation
test(todos): align thin exact-read contract - #5920
huangruiteng merged 2 commits into
Conversation
|
CI comparison on exact PR head |
Signed-off-by: mika <211269698+mikamikasuki@users.noreply.github.com>
Signed-off-by: mika <211269698+mikamikasuki@users.noreply.github.com>
d8fc48d to
029ca8c
Compare
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent | gpt-6.1-sol | OpenAI | runtime_reported | reasoning_effort=xhigh
Exact head: 029ca8c; base: 44931b6.
未发现阻塞问题 / No blocking finding.
动机
读取完整任务要求的 CLI 用户,以及维护 CLI 与聊天详情集成测试的开发者。 用户按旧协议给精确任务读取加上摘要选项时会被拒绝,开发者运行集成测试也会因相反的旧预期失败;本次把测试和双语协议改为现有的完整读取与明确拒绝规则。 独立验证表明,正常精确读取仍保留完整任务及末尾要求,摘要与精确身份同用时返回拒绝;现有集成测试继续验证聊天详情、来源恢复和读取不写状态。 本次只修正测试与协议表述,不修改运行时、存储格式、权限、用户入口或默认行为,也不承诺解决其他 PR 或整套远程 CI 的失败。
改动思路
修正已有断言和误导性协议,复用原有集成测试;不把完整需求保护改成截断。只删断言会让测试变绿却失去保护,改变运行时又会违背已接受契约。这份完整 diff 的边界合适。
规格依据:docs/reference/required-work-context.md,不可变版本 44931b6d22a50b949d43354e6ea498fb6b68d231。它在本 PR 之前已明确完整精确读取、库存概览与 --thin 拒绝规则;被修改的协议不能作为自身正确性的依据。该文档没有编号,以下是本次映射标识:
- EXACT-FULL:精确读取完整正文;当前和归档记录、末尾要求均保留。
- INVENTORY-THIN:概览可截短,精确身份与
--thin同用必须拒绝。 - SOURCE-AUTHORITY:使用真实权威源,缺失展示和来源故障不能回退旧摘要。
- READ-ONLY:读取不提供执行授权、不写 provider 或重建缺失展示。
具体改动
tests/test_chat_todo_detail.py:43-47 的局部 CLI helper 增加 expected_exit=0;正向命令仍必须成功,负向调用明确要求 exit1。:57-58 不再期望最多500字的成功结果,而是验证拒绝及 remove --thin remedy。完整正文、末尾、真实 HTTP、归档身份、跨来源/异常来源恢复以及最终 provider revision/records 不变的断言均保留。
docs/reference/protocols/active-state-structured-projection-v0.md:229-239,253-258 同步修正英文和中文,区分概览与精确读,不引入开关或新权限。真实链是 CLI main → list_goal_todos → 既有 todo.context.page;Chat detail 使用原入口。完整生产代码与 base 相同。
重复覆盖检查已读取 exact-detail、projection-recovery 和 thin-list 既有测试;本 PR 没有新建同形 smoke。最新20个同作者 PR 及当前完整队列已检查,相关 #5911/#5882 改动投影其他路径,#5925/#5927/#5930 分属其他测试边界;本次不存在已确认的重复警告违规。
对主干的风险
最值得防的是“为了绿灯接受截断或去掉负例”。独立执行同一命令 uv run --extra test python -m pytest -q tests/test_chat_todo_detail.py tests/control_plane/test_todo_exact_detail.py tests/control_plane/test_todo_projection_recovery.py:不可变 base 25 passed、2 failed,两个失败均是旧 exit0 预期与实际拒绝冲突;exact head 27 passed,真实 File/SQLite、CLI subprocess、loopback HTTP 及既有 legacy/source 恢复覆盖通过。
另以私有隔离 mutation 让错误的精确 --thin 返回500字成功摘要,两个修改后 provider 用例均因 0 != 1 失败。它证明负例能捕获错误,不被计作产品失败;正常运行和原断言完整保留。没有用 mock 提供待证明的 HTTP/provider 成功。
原生 premerge 按完整两文件 diff 选出的12项(3个 Todo/投影、8个 docs/content、1个公开边界)及4个直接检查全部通过;Ruff、diff check、compile 通过。语义 advisory 无支持的新词汇载体,完整 diff 也未新增状态规则;空 advisory 本身不是语义证明。未查询、轮询或等待 CI;作者旧 head 的 CI 叙述未作为本次证据。未跑 packaged App、PostgreSQL、全树测试或持续负载;没有改这些边界,也不宣称它们验收通过。
typed-state、domain-neutrality、behavior-disclosure、guidance/obligation、default-off 和 authority lenses:无生产状态/命名/权限/默认/自动加载提示变更,文档如实描述现有拒绝,未把强制规则叫作建议。回滚两份文件即可,没有状态迁移。
我的整体评价
APPROVE 此 exact head。long_horizon preserved:恢复现有集成覆盖,不缩短原请求或增加重复写。user_experience improved:协议给出符合实际的使用方法,没有额外导航、确认或设置。future-facing pass 在原 helper 与测试边界复用后无需增加运行时重构;既有 reader、typed projection 和 effect authority 不动。+14/-10 不是完成证明,真实 base/head、拒绝 mutation 和来源读回才是依据。
English verdict: APPROVE — 029ca8c. This is a coherent repair of an existing stale test and bilingual protocol, based on the accepted pre-change full exact-read contract. Independent base/head reproduction, real File/SQLite CLI/HTTP checks, a decisive wrong-success mutation and native premerge pass. No runtime change, remote CI claim, unrelated PR completion or merge authority is inferred.
Goal And Delivered Outcome
docs/reference/required-work-context.md,loopx/control_plane/todos/list_readback.py, andtests/control_plane/test_todo_exact_detail.pyspecify that--thinis for bounded inventory lists and is rejected with--todo-id; the older integration test and active-state projection protocol had not been updated.159f00fc8ababa088e8f6cde3ef06653bc4c0511, the File and SQLite cases both fail because they expecttodo list --todo-id ID --thinto return a truncated record. The integration test now checks the documented rejection, and the protocol text no longer claims exact IDs support--thin. Runtime behavior is unchanged.mainat159f00fc8ababa088e8f6cde3ef06653bc4c0511.Author Declaration
Implemented against
docs/reference/required-work-context.mdandtests/control_plane/test_todo_exact_detail.pyat159f00fc8ababa088e8f6cde3ef06653bc4c0511; exact-read validation inloopx/control_plane/todos/list_readback.py.--thintests/test_chat_todo_detail.pytests/test_chat_todo_detail.pydocs/reference/protocols/active-state-structured-projection-v0.mdloopx checkpublic-boundary scanScope And Continuation
Validation
d8fc48d50758bc54d3a08b0cb6f7c99a19767d06(head), based on159f00fc8ababa088e8f6cde3ef06653bc4c0511.regression_parity0cd547b, on current main159f00fc, and on PR #5911 head. After the correction, all three focused test modules pass.unitd8fc48d,pytest -q tests/test_chat_todo_detail.py tests/control_plane/test_todo_exact_detail.py tests/control_plane/test_todo_projection_recovery.py: 27 passed.statictests/test_chat_todo_detail.py, Python compile, andgit diff --checkpassed.integration157d39a, pre-merge canary selected 12 checks, all passed, including Todo contract/read-model/projection smokes and public-boundary scan.final-headd8fc48d, the three focused test modules passed (27 tests) andgit diff --checkpassed.Frontend / Visual Evidence
Type of Change
LoopX Area
Technical Direction
Shared-authority RFC fixture impact
Boundary Checklist
none.Signed-off-bytrailer.