Skip to content

test(control-plane): preserve heartbeat and wait recovery read checks - #5873

Merged
huangruiteng merged 3 commits into
loopx-project:mainfrom
hhyykk:codex/canonical-todo-read-model-tests-20261007
Oct 7, 2026
Merged

huangruiteng merged 3 commits into
loopx-project:mainfrom
hhyykk:codex/canonical-todo-read-model-tests-20261007

Conversation

@hhyykk

@hhyykk hhyykk commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Maintainer tests for heartbeat preference delivery and original-Turn wait recovery still consume retired read locations. The heartbeat test expects an already-delivered preference in pending reads; the wait test indexes a removed exact-Todo list alias, stopping before its original identity, validation digest and no-spend checks.

Use the shipped required-work-context contract: assert actual delivered preference text and its absence from pending reads, and read exact Todo state from todo. Existing authority/source routing, same-Turn recovery, successor selection, validation digest and no-spend assertions remain intact.

Validation:

  • Both complete changed modules: 12 passed, no failures or skips, against current main's Monitor owner.
  • Ruff and diff hygiene passed. Pinned standard canary: 4 direct and 3 selected checks passed; no failures, skips or manual holds. Public-safe test bytes introduce no production vocabulary or state.
  • Historical characterization at 3b26940e recorded six early failures in these two modules. This source-specific baseline is separate from the current-head result.

Pinned base: main at aa87cc019e1062455e79c934764b5e85688663cd. Only two existing test modules change, +8/-3; runtime, defaults, protocols and UI are unchanged. The related refactor pass reuses existing read contracts without adding a helper. Latest #5869 now owns the other five previously selected modules; their edits have been removed from this PR. #5870 retains preference runtime ownership. Hosted CI, native Windows, output budgets and whole migration acceptance remain separate; maintainer merge is required.

Signed-off-by: hyk <4408344+hhyykk@users.noreply.github.com>
hhyykk added 2 commits October 7, 2026 18:54
Signed-off-by: hyk <4408344+hhyykk@users.noreply.github.com>
Signed-off-by: hyk <4408344+hhyykk@users.noreply.github.com>
@hhyykk hhyykk changed the title test(control-plane): adopt canonical Todo read contracts test(control-plane): preserve heartbeat and wait recovery read checks Oct 7, 2026

@hhyykk hhyykk left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

动机

维护者运行 Heartbeat 选择和 quota 等待恢复集成测试时会遇到这些过期读取。 之前,Heartbeat 测试把已随工作上下文交付的偏好误当作待读项,精确 Todo 测试则索引已移除的列表别名;现在,两项既有测试读取当前 owner 返回的内容,并继续执行原有恢复断言。 可观察结果是这两条真实 CLI 集成路径可以验证当前偏好交付和精确 Todo 读取契约。 本 PR 只修复这两项现有测试,不改运行时行为,不结算更大的 Goal。

改动思路

改动复用当前交付 owner:Heartbeat 测试沿真实 CLI 和 interaction_contract.agent_channel.work_context 检查已投影偏好;等待恢复测试沿精确 Todo CLI 响应读取原 Todo,并保留既有同 Turn 重放、恢复写回、验证摘要、零消耗和后续任务选择断言。改动只替换退役读取位置并增加必要的偏好内容与“不再要求重复读取”断言;没有新 fixture、测试入口、协议或生产模块。

具体改动

规格:docs/reference/required-work-context.md,revision aa87cc019e1062455e79c934764b5e85688663cd。该文档以段落规定行为,没有列出机器化 criterion ID;以下是本次评审映射 ID。

  • RWC-HB-01:普通 Heartbeat/quota 在 agent_channel.work_context 返回当前来源;已交付来源不再出现在 required_reads。Disposition: implemented;位置 tests/control_plane/test_heartbeat_registry_route.py::test_cli_generated_guard_selection_and_settlement_ignore_conflicting_cwd_registry;验证 changed_invariant_positive。
  • RWC-TODO-01:精确 Todo 响应只返回一份完整记录;todo.text 和身份、状态等字段属于该记录。Disposition: implemented;位置 tests/test_quota_bound_wait_recovery.py::test_bound_wait_recovers_original_turn_before_selecting_successor;验证 changed_invariant_positive。

对主干的风险

无阻塞发现。最强回归情形是精确 Todo 改回列表形状,或偏好从工作上下文移回待读列表:测试会在入口断言处失败。正向验证使用真实 CLI dispatch、文件和 SQLite provider,以及完整等待恢复路径;未修改状态 owner 或权限边界。保留的参数化场景覆盖两种 provider、两种等待原因;测试本身仍不能证明托管环境中的自动化已更新或模型已采用新上下文。当前 exact head 的远程 Sign-off 和 dependency-review 仍排队,属于独立 merge-readiness 状态。

我的整体评价

Problem context verdict: goal_achieved for this bounded two-test request. 长期持续工作:preserved;用户旅程:preserved;本 PR 没有用户可见运行时变化。完整 Todo/read-model Goal 和 Windows、输出预算、hosted CI 验收仍未结算;这两项现有测试断言的修复不承担那些剩余验收。当前边界可独立审阅、验证和回滚。两项检查覆盖当前 accepted contract;相邻 owner 的 PR #5869(Todo frontier RPC)和 #5870(偏好上下文交付)均已核对,当前两条测试路径未与它们的文件范围重叠,且分别直接验证相邻 contract。进一步检查了 hhyykk 的其他 open PR #5871、#5866、#5863 和 #5861;changed-file sets 均未与本 PR 两个路径重叠,也未发现同形批量拆分。代码量为必要的既有断言修复;没有兼容层可删或新抽象。Durable smoke verdict: real repository value; 这是对已存在真实用户路径的维护性回归保护,不是新的一次性 smoke。

聚焦真实调用 6 项、完整两模块 12 项,以及最终 4 项直接检查和 3 项选定 canary 均通过。

Approval conclusion (author-owned PR; GitHub blocks formal self-approval).
English verdict: APPROVE. The existing assertions now cover the shipped read contracts; hosted checks remain a merge-readiness hold.
精确头 af083642d87d9c4cd64386b091fb184fa769c1be 与远程一致;剩余风险是远程必需检查尚未完成以及更大 Goal 仍未结算。当前证据不把这些开放项归因给本 PR。

Reviewer: model_agent gpt-6.1-sol OpenAI runtime_reported ultra.

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent; model=GPT-6; provider=OpenAI; declaration_source=self_reported

Exact reviewed head: af083642d87d9c4cd64386b091fb184fa769c1be.

动机

维护 heartbeat 与等待恢复的开发者,需要用现有回归测试确认真实命令不会选错工作目录或重复记账。
在 File 和 SQLite 上执行原测试时,旧断言先访问已经退役的字段而失败;本次读取当前完整偏好和单条 todo 后,继续验证原 Turn 恢复及记账边界。
同一主干基线为 6 失败、6 通过;当前精确头 12 项全通过,原路由、恢复、拒绝伪造及无额外 spend 断言仍运行。
不修改运行时、偏好权限、存储格式或 Bot 部署,也不把测试通过等同于模型实际采用偏好。

改动思路

按不可变主干 aa87cc019e1062455e79c934764b5e85688663cd 的 docs/reference/required-work-context.md(判据:Required work context)判断:完整偏好已经在 work_context 中提供,已完成的读取不能再要求重复执行。另按同一版本 docs/reference/todo-work-counts.md 的 Agent-addressed reads,精确查询读单条 todo,列表才使用 todos。测试应消费这两个既有契约;无需修改规则迎合旧断言。

具体改动

两个原测试文件 +8/-3。heartbeat 路由测试改为核对真实偏好原文 Use the designated reviewer.,同时断言偏好不再出现于待执行 required_reads。wait 恢复测试两处 todos[0] 改为 todo,completion digest、原 Turn、后继选择和无 spend 检查继续保留。

独立在同一基线与当前头运行两个完整模块:基线 6 failed / 6 passed,分别为两处 required_reads KeyError 和四处 todos KeyError;当前头 12 passed,零跳过。实际 CLI parser/dispatch、TS 进程和隔离 File/SQLite 仍执行,包含冲突 cwd、伪造路由拒绝、monitor_changed/todo_done 等负例。公开边界检查通过。没有查询、轮询或等待 CI。

对主干的风险

最危险的是用弱字段存在断言替代实际内容,导致空偏好或重复记账漏检;这里核对完整偏好语句,原拒绝分支、blocked closeout 和 spend 计数断言没有删除。测试套件不能证明真实模型采用偏好、线上 Bot 行为或全部存储后端;本 PR 也没有这些运行时变更。回退仅回退测试修改。

我的整体评价

APPROVE:未发现阻塞问题。 这批维护恢复了六条此前提前中断的真实回归路径,范围合理。已扫描现有 heartbeat、bound-wait、causal-closeout 覆盖和同作者当前批次;当前版本还移除了由 #5869 负责的重叠模块,没有重复增加 smoke。面向后续重构的检查认为复用原测试和 typed owner 即可,不需要新增 helper 或框架。最强未覆盖项是线上模型/部署采用,超出本次测试修复边界。

Host execution attribution is currently unavailable; the reviewer identity above is self-reported at the known model-family level, not an observed exact build. This limits provenance, not the PR author or local evidence.

English verdict: APPROVE - af08364. The two existing real-provider regression modules now read the shipped contracts while retaining routing, original-Turn recovery and accounting assertions. Same-base comparison: 6 failures/6 passes before, 12 passes at this head; no CI consulted.

@huangruiteng
huangruiteng merged commit 4e7fcfa into loopx-project:main Oct 7, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants