Repository navigation
Conversation
Signed-off-by: song <liusongstep@gmail.com>
songoow
left a comment
There was a problem hiding this comment.
Reviewer: model_agent | GPT-6 | OpenAI | self_reported
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
Exact head: 277dab815eb8dba20ff1ca6256009589a1675a85。这是作者账户下的模型自评,不代表维护者批准或合并授权。
动机
维护结算流程的开发者需要一条能检查真实宿主读回、调度确认和重复扣费的集成测试。当前宿主读回规则合入后,三个原有结算场景仍在没有宿主记录时期待确认成功,因此主线测试失败在调度确认处。现在先证明缺失和错误读回被拒绝,再提供匹配的隔离记录,验证原确认命令只写一次并可安全重放。
本改动只修复测试输入与新增必要断言,不修改生产调度、权限、扣费或入口路由。实际 App 更新、定时唤醒与已安装启动器仍需要各自的验收;#4447 的剩余来源含义及完整主线集成验收没有因此关闭。
改动思路
复用 examples/control_plane/quota_plan_fixtures.py::write_codex_heartbeat_fixture,不新增 TOML 解析器或返回成功的模拟 reader。仅两个测试函数显式申请独立的 scheduler_host_home,给生产 resolve_codex_app_automation_rrule 和真实 CLI 子进程提供临时合成记录;其他测试不启用这个 fixture。
_prepare_scheduler_host_readback 先执行同一个原始 ACK 参数向量:第一次没有记录,第二次实际记录为不同 RRULE。两次都必须返回 typed rrule_mismatch、真实 observed 值和 written=false,独立 scheduler store 读取仍为空,已有 quota debit 仍恰为一次。随后只更新临时 manifest,交回原场景完成成功 ACK、持久化读回和原有字节级 replay 检查。这样补齐前提,也防止把缺失读回静默当成功。
具体改动
仅 tests/control_plane/test_quota_settlement_cli.py 一处变化,新增 43 行、删除 2 行;loopx/、apps/、packages/ 全部生产字节与基线相同。没有新的状态、协议、开关、CLI 或 UI。
关键内容讲解
scheduler_host_home(52 行)为该场景设置隔离的 automation 根目录和匹配的线程 ID;不读写操作者的 App 数据。_prepare_scheduler_host_readback(59 行)比较请求 RRULE 与实际 reader 看到的值,失败分支检查持久化为空和单次扣费,随后更新合成输入。它不修改生成的 ACK 命令、不传入伪造成功结果。test_standard_codex_app_settlement_is_receipted_and_idempotent保留旧 Turn 被新 guard 取代后的拒绝,以及原结算链不重复扣费的检查;新增当前 Turn 在成功 ACK 后的last_applied_rrule独立读回。test_todoless_autonomous_replan_settles_quota_refresh_spend_chain的 qualified-vision 与 missing-vision 两个分支使用同样读回前提;验收、writeback、spend、下一 Turn 和重复执行检查均保留。
规格依据:docs/architecture/rfcs/automatic-execution-admission-v0.md,固定版本 c464cf3。§5 Host contracts 要求确认前读取当前匹配宿主,缺失或不匹配不得写入;这条测试链现有正反例。§9 App honesty 的 desired/observed 拒绝语义在真实文件读回/CLI 路径上获得覆盖;实际 App API、elapsed timer 和安装采用保持其原有独立验收范围。本 PR 没有修改规格使其迁就测试。
对主干的风险
主要风险是用编造的成功读回把测试刷绿,或让共享 fixture 改变其他测试的环境。本次 helper 只写合成 manifest,当前值经生产 reader 读取,且两个错误状态必须先失败;fixture 仅由目标函数显式请求。完整测试文件与相邻宿主绑定测试 112 passed,0 skipped,覆盖 scoped fixture 之外的既有分支。另有 34 项 TypeScript 调度测试通过;Ruff、diff/compile、premerge 选择的 3 项 canary通过。
不可变基线上的原三个场景均失败,修复后均通过。开发过程曾误断言拒绝结果含 scheduler_state_mutated 顶层字段;实际拒绝契约没有该字段,已改为检查真实 scheduler_commit.observed_host_rrule、written=false 和独立存储读取,而非忽略失败或放宽生产规则。
查过现有 host-binding/launcher 覆盖和同作者批次:#6276 处理安装启动器及另一个测试文件,#6268 处理选择准入,本改动不复制其实现。现有 _write fixture 已复用,没有另加单独 smoke、运行框架或新文件。远端检查当前有排队、取消和跳过记录;本地证据独立覆盖这一测试修复,远端 CI/合并门仍须单独满足,未把取消视为通过。
我的整体评价
APPROVE,作为有界集成验证修复。 长期推进方面,它恢复了结算后调度读回和单次扣费的持续回归保护;用户体验方面没有产品入口变化,生产行为保持一致。完整 diff 只有一处测试文件,维护成本相称,未来相关改动仍复用既有 Host reader 和 typed scheduler owner。未发现当前阻塞项。
它证明的是原生 reader 对隔离合成记录的处理及真实结算 CLI 链路,不能证明实际 App API 更新、定时触发、主线已合入或 #4447 全部完成。另行组合 #6251/#6268/#6270/#6285 的私有验证分支已有相关测试通过,但那是候选组合证据,不替代这些 PR 各自的评审与正式主线验收。本结论不授权合并或部署。
English verdict: APPROVE - 277dab8. Existing settlement fixtures now exercise missing/mismatched current Host refusal, independent schedule readback and idempotent ACK without changing production behavior. 112 Python tests, 34 adjacent TS tests and selected premerge checks pass. Synthetic manifests do not qualify live App updates or timer execution; merge remains separate.
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent; gpt-6.1-sol; OpenAI; runtime_reported; xhigh.
APPROVE — 独立核验 277dab8,没有当前阻断项。
动机
维护结算与调度的贡献者需要完整链路能分辨真正的宿主观察和仅仅请求成功。 原三个结算测试在没有宿主记录时要求 ACK 成功,主干报 rrule_mismatch;现在先证明缺失和错误记录被拒绝,再提供匹配记录,原链继续且只扣一次。 原失败链在当前评审 head 和独立当前主干组合中恢复;撤掉匹配记录仍会失败,没有刷绿或重复扣费。 这只是测试修复,不改变生产调度,也不证明真实 App 更新、定时触发或整个 #4447 完成。 真实宿主/安装态资格与 #4447 最终集成验收继续独立开放。
改动思路
复用现有 synthetic manifest helper、实际 Host reader 和原生 CLI,分别验证拒绝、恢复和持续 replay;不增加返回成功的 reader mock 或第二份调度规则。冻结规格 docs/architecture/rfcs/automatic-execution-admission-v0.md,revision c464cf3:Host-contracts 要求当前匹配观察才能 ACK,缺失/不匹配须在写入前拒绝;App-honesty 要区分 desired/observed,真实 App 操作保持独立范围。
具体改动
完整 diff 仅 tests/control_plane/test_quota_settlement_cli.py,+43/-2;生产 loopx/apps/packages 完全相同。
scheduler_host_home是目标函数显式申请的临时环境,不是 autouse;不会把整个测试文件的宿主根改掉。_prepare_scheduler_host_readback将同一原 ACK 参数依次交给真实 CLI,观察不存在和错误周期,核对 rrule_mismatch、written=false、实际 observed 值、独立 scheduler store 为空、已有 quota debit 恰一次;最后只更新合成 manifest。- ordinary settlement 保留旧 Turn 被 supersede 的拒绝。两种 Todo-less replan 保留 vision、validation/writeback/spend、后续 Turn 和 replay;匹配成功后独立读取 last_applied_rrule,原字节稳定性断言保留。
独立完整结算文件+宿主绑定套件 112 passed、无 skip,耗时354.88秒;相邻两组 typed scheduler 30 passed,Ruff通过。冻结 base 的原三个场景 3 failed,相同 ACK 阶段;评审 head 完整通过。额外将最终匹配 manifest 写入撤掉后,原 ordinary 链仍正确失败,reader 实际观察错误周期并不写入。当前主干 509c38c502d3d0b4eafb01550efcdc4b5b5a1d17 另建隔离组合加本补丁,原三个场景 3 passed;该未提交组合不是已合入 revision。
对主干的风险
最主要风险是用伪造成功、删除断言或通用环境变化掩盖缺口。本次文件会先通过实际 reader 的两个拒绝分支,独立读 store、quota 次数和 replay 字节;mutation 又证明必须有匹配观察才能继续。只改两个测试函数的 fixture 请求,生产权限/旧身份/额度不变。查过现有 host-binding、兼容 transport 和同作者批次:既有低层测试并不替代这两条完整结算链;#6276 launcher 和 #6270 来源见证属于不同缺口,不构成同形 smoke 重复。没有另建测试框架或日志入库。
验证过程一次文件名错误未运行任何测试,独立 mutation 初次缺源码 examples 导入路径也失败;错误均保留,之后用显式路径/源码/argv/RC 记录校正,未计入通过数。未查询或等待 CI。合成文件只能证明原生 reader、结算恢复与单次扣费,不证明用户 App 定时器或安装升级成功。
我的整体评价
这是有用的内部验证修复:长期可防宿主观察缺失被刷绿,也减少维护者追查错误 fixture 的成本;生产用户步骤和执行效率保持,不以测试数证明业务收益。未来相关改动继续使用现有 helper/typed owner,无需另抽框架。#4447 完整验收和 live Host 资格仍独立;此次 review 不授予合并或升级权限。
English verdict: APPROVE — 277dab8; independent112 Python/30 TS pass, immutable base reproduces3 failures, withholding matching observation makes the repaired chain fail, and the current-main isolated combination passes3 original scenarios. Production unchanged; real App/timer qualification and merge remain separate.
|
This pull request has merge conflicts with Choose the remote for the base repository, not an out-of-date fork. git fetch upstream
git rebase upstream/main
# Resolve each conflict, git add the resolved files, then git rebase --continue.
git push --force-with-lease origin HEADFor a same-repository clone whose Keep the DCO |
After the current-Host readback requirement landed, three existing settlement CLI scenarios still expected scheduler ACK success without an observed Host schedule. They fail on current main with
rrule_mismatchand no scheduler write.Reuse the existing synthetic Codex heartbeat fixture in these scenarios. Exercise absent and mismatched observations first, checking typed refusal, no persisted scheduler state and the unchanged single quota debit. Then update only the isolated manifest, execute the original receipt-bound ACK, independently read the applied schedule, and preserve the existing byte-stable replay assertions. The ordinary scenario still rejects its superseded Turn; both Todo-less replan variants retain their full validation/writeback/spend chain.
Only
tests/control_plane/test_quota_settlement_cli.pychanges. Production Host readers, scheduler policy, receipt binding and quota authority are unchanged. This complements #6276's launcher repair; it neither duplicates that implementation nor proves an actual App update, elapsed timer, or installed launcher behavior. It removes an identified integration-fixture gap in #4447 without closing that issue's remaining source-purpose decisions or general acceptance.Validation at head
277dab815eb8dba20ff1ca6256009589a1675a85: immutable basec464cf308c3c9bad5d1109a758d30dc3620bfde4reproduced all three failures. The repaired three scenarios pass, as do 34 adjacent TS scheduler tests, Ruff and the three selected premerge canaries. The full settlement CLI and Host-binding suite passes: 112 tests, including all three originally failing paths and the new missing/mismatched-readback cases. No test is skipped. Initial fixture assertion incorrectly expected an absent top-level mutation field; replaced it with the actual typed observed RRULE plus independent persisted-state readback.